aboutsummaryrefslogtreecommitdiff
path: root/sass.c
blob: dde8409acbba0870ffc4cfd32ca76f56ea53bfe7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
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;
}