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 /sass.c |
initial commit
Diffstat (limited to 'sass.c')
-rw-r--r-- | sass.c | 27 |
1 files changed, 27 insertions, 0 deletions
@@ -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; +} |