Initial commit
[yaffs-website] / node_modules / node-sass / src / libsass / src / sass.hpp
1 // must be the first include in all compile units
2 #ifndef SASS_SASS_H
3 #define SASS_SASS_H
4
5 // undefine extensions macro to tell sys includes
6 // that we do not want any macros to be exported
7 // mainly fixes an issue on SmartOS (SEC macro)
8 #undef __EXTENSIONS__
9
10 #ifdef _MSC_VER
11 #pragma warning(disable : 4005)
12 #endif
13
14 // aplies to MSVC and MinGW
15 #ifdef _WIN32
16 // we do not want the ERROR macro
17 # define NOGDI
18 // we do not want the min/max macro
19 # define NOMINMAX
20 // we do not want the IN/OUT macro
21 # define _NO_W32_PSEUDO_MODIFIERS
22 #endif
23
24
25 // should we be case insensitive
26 // when dealing with files or paths
27 #ifndef FS_CASE_SENSITIVE
28 # ifdef _WIN32
29 #  define FS_CASE_SENSITIVE 0
30 # else
31 #  define FS_CASE_SENSITIVE 1
32 # endif
33 #endif
34
35 // path separation char
36 #ifndef PATH_SEP
37 # ifdef _WIN32
38 #  define PATH_SEP ';'
39 # else
40 #  define PATH_SEP ':'
41 # endif
42 #endif
43
44
45 // include C-API header
46 #include "sass/base.h"
47
48 // For C++ helper
49 #include <string>
50
51 // output behaviours
52 namespace Sass {
53
54   // create some C++ aliases for the most used options
55   const static Sass_Output_Style NESTED = SASS_STYLE_NESTED;
56   const static Sass_Output_Style COMPACT = SASS_STYLE_COMPACT;
57   const static Sass_Output_Style EXPANDED = SASS_STYLE_EXPANDED;
58   const static Sass_Output_Style COMPRESSED = SASS_STYLE_COMPRESSED;
59   // only used internal to trigger ruby inspect behavior
60   const static Sass_Output_Style INSPECT = SASS_STYLE_INSPECT;
61   const static Sass_Output_Style TO_SASS = SASS_STYLE_TO_SASS;
62
63   // helper to aid dreaded MSVC debug mode
64   // see implementation for more details
65   char* sass_copy_string(std::string str);
66
67 }
68
69 // input behaviours
70 enum Sass_Input_Style {
71   SASS_CONTEXT_NULL,
72   SASS_CONTEXT_FILE,
73   SASS_CONTEXT_DATA,
74   SASS_CONTEXT_FOLDER
75 };
76
77 // simple linked list
78 struct string_list {
79   string_list* next;
80   char* string;
81 };
82
83 // sass config options structure
84 struct Sass_Inspect_Options {
85
86   // Output style for the generated css code
87   // A value from above SASS_STYLE_* constants
88   enum Sass_Output_Style output_style;
89
90   // Precision for fractional numbers
91   int precision;
92
93   // initialization list (constructor with defaults)
94   Sass_Inspect_Options(Sass_Output_Style style = Sass::NESTED,
95                        int precision = 5)
96   : output_style(style), precision(precision)
97   { }
98
99 };
100
101 // sass config options structure
102 struct Sass_Output_Options : Sass_Inspect_Options {
103
104   // String to be used for indentation
105   const char* indent;
106   // String to be used to for line feeds
107   const char* linefeed;
108
109   // Emit comments in the generated CSS indicating
110   // the corresponding source line.
111   bool source_comments;
112
113   // initialization list (constructor with defaults)
114   Sass_Output_Options(struct Sass_Inspect_Options opt,
115                       const char* indent = "  ",
116                       const char* linefeed = "\n",
117                       bool source_comments = false)
118   : Sass_Inspect_Options(opt),
119     indent(indent), linefeed(linefeed),
120     source_comments(source_comments)
121   { }
122
123   // initialization list (constructor with defaults)
124   Sass_Output_Options(Sass_Output_Style style = Sass::NESTED,
125                       int precision = 5,
126                       const char* indent = "  ",
127                       const char* linefeed = "\n",
128                       bool source_comments = false)
129   : Sass_Inspect_Options(style, precision),
130     indent(indent), linefeed(linefeed),
131     source_comments(source_comments)
132   { }
133
134 };
135
136 #endif