Initial commit
[yaffs-website] / node_modules / node-sass / src / sass_context_wrapper.h
1 #ifndef SASS_CONTEXT_WRAPPER
2 #define SASS_CONTEXT_WRAPPER
3
4 #include <vector>
5 #include <memory>
6 #include <nan.h>
7 #include <stdlib.h>
8 #include <sass/context.h>
9 #include "custom_function_bridge.h"
10 #include "custom_importer_bridge.h"
11
12 #ifdef __cplusplus
13 extern "C" {
14 #endif
15
16   void compile_data(struct Sass_Data_Context* dctx);
17   void compile_file(struct Sass_File_Context* fctx);
18   void compile_it(uv_work_t* req);
19
20   struct sass_context_wrapper {
21     // binding related
22     bool is_sync;
23     void* cookie;
24     char* file;
25     char* include_path;
26     char* out_file;
27     char* source_map;
28     char* source_map_root;
29     char* linefeed;
30     char* indent;
31
32     // libsass related
33     Sass_Data_Context* dctx;
34     Sass_File_Context* fctx;
35
36     // libuv related
37     uv_async_t async;
38     uv_work_t request;
39
40     // v8 and nan related
41     Nan::Persistent<v8::Object> result;
42     Nan::Callback* error_callback;
43     Nan::Callback* success_callback;
44
45     std::vector<CustomFunctionBridge *> function_bridges;
46     std::vector<CustomImporterBridge *> importer_bridges;
47   };
48
49   struct sass_context_wrapper*      sass_make_context_wrapper(void);
50   void sass_free_context_wrapper(struct sass_context_wrapper*);
51
52 #ifdef __cplusplus
53 }
54 #endif
55
56 #endif