diff options
author | root <root@debian> | 2014-09-14 00:29:23 +0000 |
---|---|---|
committer | root <root@debian> | 2014-09-14 00:29:23 +0000 |
commit | a4f8c7af3baba2179f6de2f198be23860f3803bc (patch) | |
tree | f7e47617819aa2414917d1ba7136b2c95a04dada |
initial commit
-rw-r--r-- | Makefile | 3 | ||||
-rw-r--r-- | README | 5 | ||||
-rw-r--r-- | sass.c | 27 |
3 files changed, 35 insertions, 0 deletions
diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..6922f76 --- /dev/null +++ b/Makefile @@ -0,0 +1,3 @@ +all: + gcc sass.c -I ./libsass/ ./libsass/libsass.a -o sass -lstdc++ + @@ -0,0 +1,5 @@ +simple sass wrapper. + +USAGE: + +sass myfile.sass > myfile.css @@ -0,0 +1,27 @@ +#include <sass_interface.h> +#include <stdio.h> +#include <unistd.h> +#include <stdlib.h> + + +int main (int argc, char **argv) { + struct sass_file_context *ctx = sass_new_file_context(); + ctx->input_path = argv[1]; + sass_compile_file(ctx); + if (ctx->error_status) { + if (ctx->error_message) { + fprintf(stderr,"%s\n", ctx->error_message); + } + else { + fprintf(stderr,"An error occured; no error message available\n"); + } + return 1; + } + + else if (ctx->output_string) { + fprintf(stdout, "%s", ctx->output_string); + } + + sass_free_file_context(ctx); + return 0; +} |