a
doum
昨天 307960b07d8cb122d9de0c8267b8cb7a63cfc605
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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
#ifndef SASS_CONTEXT_WRAPPER
#define SASS_CONTEXT_WRAPPER
 
#include <vector>
#include <memory>
#include <nan.h>
#include <stdlib.h>
#include <sass/context.h>
#include "custom_function_bridge.h"
#include "custom_importer_bridge.h"
 
#ifdef __cplusplus
extern "C" {
#endif
 
  void compile_data(struct Sass_Data_Context* dctx);
  void compile_file(struct Sass_File_Context* fctx);
  void compile_it(uv_work_t* req);
 
  struct sass_context_wrapper {
    // binding related
    bool is_sync;
    void* cookie;
    char* file;
    char* include_path;
    char* out_file;
    char* source_map;
    char* source_map_root;
    char* linefeed;
    char* indent;
 
    // libsass related
    Sass_Data_Context* dctx;
    Sass_File_Context* fctx;
 
    // libuv related
    uv_async_t async;
    uv_work_t request;
 
    // v8 and nan related
    Nan::Persistent<v8::Object> result;
    Nan::AsyncResource* async_resource;
    Nan::Callback* error_callback;
    Nan::Callback* success_callback;
 
    std::vector<CustomFunctionBridge *> function_bridges;
    std::vector<CustomImporterBridge *> importer_bridges;
  };
 
  struct sass_context_wrapper*      sass_make_context_wrapper(void);
  void sass_free_context_wrapper(struct sass_context_wrapper*);
 
#ifdef __cplusplus
}
#endif
 
#endif