|
9 | 9 |
|
10 | 10 | #ifdef _WIN32 |
11 | 11 |
|
12 | | - /* You should define ADD_EXPORTS *only* when building the DLL. */ |
13 | | - #ifdef ADD_EXPORTS |
14 | | - #define ADDAPI __declspec(dllexport) |
15 | | - #define ADDCALL __cdecl |
16 | | - #else |
17 | | - #define ADDAPI |
18 | | - #define ADDCALL |
19 | | - #endif |
| 12 | +/* You should define ADD_EXPORTS *only* when building the DLL. */ |
| 13 | +#ifdef ADD_EXPORTS |
| 14 | +#define ADDAPI __declspec(dllexport) |
| 15 | +#define ADDCALL __cdecl |
| 16 | +#else |
| 17 | +#define ADDAPI |
| 18 | +#define ADDCALL |
| 19 | +#endif |
20 | 20 |
|
21 | 21 | #else /* _WIN32 not defined. */ |
22 | 22 |
|
23 | | - /* Define with no value on non-Windows OSes. */ |
24 | | - #define ADDAPI |
25 | | - #define ADDCALL |
| 23 | +/* Define with no value on non-Windows OSes. */ |
| 24 | +#define ADDAPI |
| 25 | +#define ADDCALL |
26 | 26 |
|
27 | 27 | #endif |
28 | 28 |
|
29 | 29 | #ifdef __cplusplus |
30 | 30 |
|
31 | | -#include <stack> |
32 | | -#include <string> |
33 | 31 | #include <cstring> |
34 | | -#include <sstream> |
35 | 32 | #include <iostream> |
| 33 | +#include <sstream> |
| 34 | +#include <stack> |
| 35 | +#include <string> |
36 | 36 |
|
37 | 37 | #ifndef SASS2SCSS_VERSION |
38 | 38 | // Hardcode once the file is copied from |
|
44 | 44 | namespace Sass |
45 | 45 | { |
46 | 46 |
|
47 | | - // pretty print options |
48 | | - const int SASS2SCSS_PRETTIFY_0 = 0; |
49 | | - const int SASS2SCSS_PRETTIFY_1 = 1; |
50 | | - const int SASS2SCSS_PRETTIFY_2 = 2; |
51 | | - const int SASS2SCSS_PRETTIFY_3 = 3; |
52 | | - |
53 | | - // remove one-line comment |
54 | | - const int SASS2SCSS_KEEP_COMMENT = 32; |
55 | | - // remove multi-line comments |
56 | | - const int SASS2SCSS_STRIP_COMMENT = 64; |
57 | | - // convert one-line to multi-line |
58 | | - const int SASS2SCSS_CONVERT_COMMENT = 128; |
59 | | - |
60 | | - // String for finding something interesting |
61 | | - const std::string SASS2SCSS_FIND_WHITESPACE = " \t\n\v\f\r"; |
62 | | - |
63 | | - // converter struct |
64 | | - // holding all states |
65 | | - struct converter |
66 | | - { |
67 | | - // bit options |
68 | | - int options; |
69 | | - // is selector |
70 | | - bool selector; |
71 | | - // concat lists |
72 | | - bool comma; |
73 | | - // has property |
74 | | - bool property; |
75 | | - // has semicolon |
76 | | - bool semicolon; |
77 | | - // comment context |
78 | | - std::string comment; |
79 | | - // flag end of file |
80 | | - bool end_of_file; |
81 | | - // whitespace buffer |
82 | | - std::string whitespace; |
83 | | - // context/block stack |
84 | | - std::stack<std::string> indents; |
85 | | - }; |
86 | | - |
87 | | - // function only available in c++ code |
88 | | - char* sass2scss (const std::string& sass, const int options); |
89 | | - |
| 47 | + // pretty print options |
| 48 | + const int SASS2SCSS_PRETTIFY_0 = 0; |
| 49 | + const int SASS2SCSS_PRETTIFY_1 = 1; |
| 50 | + const int SASS2SCSS_PRETTIFY_2 = 2; |
| 51 | + const int SASS2SCSS_PRETTIFY_3 = 3; |
| 52 | + |
| 53 | + // remove one-line comment |
| 54 | + const int SASS2SCSS_KEEP_COMMENT = 32; |
| 55 | + // remove multi-line comments |
| 56 | + const int SASS2SCSS_STRIP_COMMENT = 64; |
| 57 | + // convert one-line to multi-line |
| 58 | + const int SASS2SCSS_CONVERT_COMMENT = 128; |
| 59 | + |
| 60 | + // String for finding something interesting |
| 61 | + const std::string SASS2SCSS_FIND_WHITESPACE = " \t\n\v\f\r"; |
| 62 | + |
| 63 | + // converter struct |
| 64 | + // holding all states |
| 65 | + struct converter |
| 66 | + { |
| 67 | + // bit options |
| 68 | + int options; |
| 69 | + // is selector |
| 70 | + bool selector; |
| 71 | + // concat lists |
| 72 | + bool comma; |
| 73 | + // has property |
| 74 | + bool property; |
| 75 | + // has semicolon |
| 76 | + bool semicolon; |
| 77 | + // comment context |
| 78 | + std::string comment; |
| 79 | + // flag end of file |
| 80 | + bool end_of_file; |
| 81 | + // whitespace buffer |
| 82 | + std::string whitespace; |
| 83 | + // context/block stack |
| 84 | + std::stack<std::string> indents; |
| 85 | + }; |
| 86 | + |
| 87 | + // function only available in c++ code |
| 88 | + char* sass2scss(const std::string& sass, const int options); |
90 | 89 | } |
91 | 90 | // EO namespace |
92 | 91 |
|
93 | 92 | // declare for c |
94 | 93 | extern "C" { |
95 | 94 | #endif |
96 | 95 |
|
97 | | - // prettyfy print options |
98 | | - #define SASS2SCSS_PRETTIFY_0 0 |
99 | | - #define SASS2SCSS_PRETTIFY_1 1 |
100 | | - #define SASS2SCSS_PRETTIFY_2 2 |
101 | | - #define SASS2SCSS_PRETTIFY_3 3 |
| 96 | +// prettyfy print options |
| 97 | +#define SASS2SCSS_PRETTIFY_0 0 |
| 98 | +#define SASS2SCSS_PRETTIFY_1 1 |
| 99 | +#define SASS2SCSS_PRETTIFY_2 2 |
| 100 | +#define SASS2SCSS_PRETTIFY_3 3 |
102 | 101 |
|
103 | | - // keep one-line comments |
104 | | - #define SASS2SCSS_KEEP_COMMENT 32 |
105 | | - // remove multi-line comments |
106 | | - #define SASS2SCSS_STRIP_COMMENT 64 |
107 | | - // convert one-line to multi-line |
108 | | - #define SASS2SCSS_CONVERT_COMMENT 128 |
| 102 | +// keep one-line comments |
| 103 | +#define SASS2SCSS_KEEP_COMMENT 32 |
| 104 | +// remove multi-line comments |
| 105 | +#define SASS2SCSS_STRIP_COMMENT 64 |
| 106 | +// convert one-line to multi-line |
| 107 | +#define SASS2SCSS_CONVERT_COMMENT 128 |
109 | 108 |
|
110 | | - // available to c and c++ code |
111 | | - ADDAPI char* ADDCALL sass2scss (const char* sass, const int options); |
| 109 | +// available to c and c++ code |
| 110 | +ADDAPI char* ADDCALL sass2scss(const char* sass, const int options); |
112 | 111 |
|
113 | | - // Get compiled sass2scss version |
114 | | - ADDAPI const char* ADDCALL sass2scss_version(void); |
| 112 | +// Get compiled sass2scss version |
| 113 | +ADDAPI const char* ADDCALL sass2scss_version(void); |
115 | 114 |
|
116 | 115 | #ifdef __cplusplus |
117 | 116 | } // __cplusplus defined. |
|
0 commit comments