aboutsummaryrefslogtreecommitdiff
path: root/sass.c
diff options
context:
space:
mode:
Diffstat (limited to 'sass.c')
-rw-r--r--sass.c27
1 files changed, 27 insertions, 0 deletions
diff --git a/sass.c b/sass.c
new file mode 100644
index 0000000..dde8409
--- /dev/null
+++ b/sass.c
@@ -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;
+}