diff options
Diffstat (limited to 'node_modules/node-sass/src/libsass/include')
8 files changed, 702 insertions, 0 deletions
diff --git a/node_modules/node-sass/src/libsass/include/sass.h b/node_modules/node-sass/src/libsass/include/sass.h new file mode 100644 index 0000000..1dd8b06 --- /dev/null +++ b/node_modules/node-sass/src/libsass/include/sass.h @@ -0,0 +1,15 @@ +#ifndef SASS_H +#define SASS_H + +// #define DEBUG 1 + +// include API headers +#include <sass/base.h> +#include <sass/version.h> +#include <sass/values.h> +#include <sass/functions.h> +#include <sass/context.h> +#include <sass2scss.h> + +#endif + diff --git a/node_modules/node-sass/src/libsass/include/sass/base.h b/node_modules/node-sass/src/libsass/include/sass/base.h new file mode 100644 index 0000000..88dd8d3 --- /dev/null +++ b/node_modules/node-sass/src/libsass/include/sass/base.h @@ -0,0 +1,89 @@ +#ifndef SASS_BASE_H +#define SASS_BASE_H + +// #define DEBUG_SHARED_PTR + +#ifdef _MSC_VER + #pragma warning(disable : 4503) + #ifndef _SCL_SECURE_NO_WARNINGS + #define _SCL_SECURE_NO_WARNINGS + #endif + #ifndef _CRT_SECURE_NO_WARNINGS + #define _CRT_SECURE_NO_WARNINGS + #endif + #ifndef _CRT_NONSTDC_NO_DEPRECATE + #define _CRT_NONSTDC_NO_DEPRECATE + #endif +#endif + +#include <stddef.h> +#include <stdbool.h> + +#ifdef __GNUC__ + #define DEPRECATED(func) func __attribute__ ((deprecated)) +#elif defined(_MSC_VER) + #define DEPRECATED(func) __declspec(deprecated) func +#else + #pragma message("WARNING: You need to implement DEPRECATED for this compiler") + #define DEPRECATED(func) func +#endif + +#ifdef _WIN32 + + /* You should define ADD_EXPORTS *only* when building the DLL. */ + #ifdef ADD_EXPORTS + #define ADDAPI __declspec(dllexport) + #define ADDCALL __cdecl + #else + #define ADDAPI + #define ADDCALL + #endif + +#else /* _WIN32 not defined. */ + + /* Define with no value on non-Windows OSes. */ + #define ADDAPI + #define ADDCALL + +#endif + +/* Make sure functions are exported with C linkage under C++ compilers. */ +#ifdef __cplusplus +extern "C" { +#endif + + +// Different render styles +enum Sass_Output_Style { + SASS_STYLE_NESTED, + SASS_STYLE_EXPANDED, + SASS_STYLE_COMPACT, + SASS_STYLE_COMPRESSED, + // only used internaly + SASS_STYLE_INSPECT, + SASS_STYLE_TO_SASS +}; + +// to allocate buffer to be filled +ADDAPI void* ADDCALL sass_alloc_memory(size_t size); +// to allocate a buffer from existing string +ADDAPI char* ADDCALL sass_copy_c_string(const char* str); +// to free overtaken memory when done +ADDAPI void ADDCALL sass_free_memory(void* ptr); + +// Some convenient string helper function +ADDAPI char* ADDCALL sass_string_quote (const char* str, const char quote_mark); +ADDAPI char* ADDCALL sass_string_unquote (const char* str); + +// Implemented sass language version +// Hardcoded version 3.4 for time being +ADDAPI const char* ADDCALL libsass_version(void); + +// Get compiled libsass language +ADDAPI const char* ADDCALL libsass_language_version(void); + +#ifdef __cplusplus +} // __cplusplus defined. +#endif + +#endif diff --git a/node_modules/node-sass/src/libsass/include/sass/context.h b/node_modules/node-sass/src/libsass/include/sass/context.h new file mode 100644 index 0000000..2f88d68 --- /dev/null +++ b/node_modules/node-sass/src/libsass/include/sass/context.h @@ -0,0 +1,170 @@ +#ifndef SASS_C_CONTEXT_H +#define SASS_C_CONTEXT_H + +#include <stddef.h> +#include <stdbool.h> +#include <sass/base.h> +#include <sass/values.h> +#include <sass/functions.h> + +#ifdef __cplusplus +extern "C" { +#endif + + +// Forward declaration +struct Sass_Compiler; + +// Forward declaration +struct Sass_Options; // base struct +struct Sass_Context; // : Sass_Options +struct Sass_File_Context; // : Sass_Context +struct Sass_Data_Context; // : Sass_Context + +// Compiler states +enum Sass_Compiler_State { + SASS_COMPILER_CREATED, + SASS_COMPILER_PARSED, + SASS_COMPILER_EXECUTED +}; + +// Create and initialize an option struct +ADDAPI struct Sass_Options* ADDCALL sass_make_options (void); +// Create and initialize a specific context +ADDAPI struct Sass_File_Context* ADDCALL sass_make_file_context (const char* input_path); +ADDAPI struct Sass_Data_Context* ADDCALL sass_make_data_context (char* source_string); + +// Call the compilation step for the specific context +ADDAPI int ADDCALL sass_compile_file_context (struct Sass_File_Context* ctx); +ADDAPI int ADDCALL sass_compile_data_context (struct Sass_Data_Context* ctx); + +// Create a sass compiler instance for more control +ADDAPI struct Sass_Compiler* ADDCALL sass_make_file_compiler (struct Sass_File_Context* file_ctx); +ADDAPI struct Sass_Compiler* ADDCALL sass_make_data_compiler (struct Sass_Data_Context* data_ctx); + +// Execute the different compilation steps individually +// Usefull if you only want to query the included files +ADDAPI int ADDCALL sass_compiler_parse(struct Sass_Compiler* compiler); +ADDAPI int ADDCALL sass_compiler_execute(struct Sass_Compiler* compiler); + +// Release all memory allocated with the compiler +// This does _not_ include any contexts or options +ADDAPI void ADDCALL sass_delete_compiler(struct Sass_Compiler* compiler); +ADDAPI void ADDCALL sass_delete_options(struct Sass_Options* options); + +// Release all memory allocated and also ourself +ADDAPI void ADDCALL sass_delete_file_context (struct Sass_File_Context* ctx); +ADDAPI void ADDCALL sass_delete_data_context (struct Sass_Data_Context* ctx); + +// Getters for context from specific implementation +ADDAPI struct Sass_Context* ADDCALL sass_file_context_get_context (struct Sass_File_Context* file_ctx); +ADDAPI struct Sass_Context* ADDCALL sass_data_context_get_context (struct Sass_Data_Context* data_ctx); + +// Getters for Context_Options from Sass_Context +ADDAPI struct Sass_Options* ADDCALL sass_context_get_options (struct Sass_Context* ctx); +ADDAPI struct Sass_Options* ADDCALL sass_file_context_get_options (struct Sass_File_Context* file_ctx); +ADDAPI struct Sass_Options* ADDCALL sass_data_context_get_options (struct Sass_Data_Context* data_ctx); +ADDAPI void ADDCALL sass_file_context_set_options (struct Sass_File_Context* file_ctx, struct Sass_Options* opt); +ADDAPI void ADDCALL sass_data_context_set_options (struct Sass_Data_Context* data_ctx, struct Sass_Options* opt); + + +// Getters for Context_Option values +ADDAPI int ADDCALL sass_option_get_precision (struct Sass_Options* options); +ADDAPI enum Sass_Output_Style ADDCALL sass_option_get_output_style (struct Sass_Options* options); +ADDAPI bool ADDCALL sass_option_get_source_comments (struct Sass_Options* options); +ADDAPI bool ADDCALL sass_option_get_source_map_embed (struct Sass_Options* options); +ADDAPI bool ADDCALL sass_option_get_source_map_contents (struct Sass_Options* options); +ADDAPI bool ADDCALL sass_option_get_source_map_file_urls (struct Sass_Options* options); +ADDAPI bool ADDCALL sass_option_get_omit_source_map_url (struct Sass_Options* options); +ADDAPI bool ADDCALL sass_option_get_is_indented_syntax_src (struct Sass_Options* options); +ADDAPI const char* ADDCALL sass_option_get_indent (struct Sass_Options* options); +ADDAPI const char* ADDCALL sass_option_get_linefeed (struct Sass_Options* options); +ADDAPI const char* ADDCALL sass_option_get_input_path (struct Sass_Options* options); +ADDAPI const char* ADDCALL sass_option_get_output_path (struct Sass_Options* options); +ADDAPI const char* ADDCALL sass_option_get_source_map_file (struct Sass_Options* options); +ADDAPI const char* ADDCALL sass_option_get_source_map_root (struct Sass_Options* options); +ADDAPI Sass_Importer_List ADDCALL sass_option_get_c_headers (struct Sass_Options* options); +ADDAPI Sass_Importer_List ADDCALL sass_option_get_c_importers (struct Sass_Options* options); +ADDAPI Sass_Function_List ADDCALL sass_option_get_c_functions (struct Sass_Options* options); + +// Setters for Context_Option values +ADDAPI void ADDCALL sass_option_set_precision (struct Sass_Options* options, int precision); +ADDAPI void ADDCALL sass_option_set_output_style (struct Sass_Options* options, enum Sass_Output_Style output_style); +ADDAPI void ADDCALL sass_option_set_source_comments (struct Sass_Options* options, bool source_comments); +ADDAPI void ADDCALL sass_option_set_source_map_embed (struct Sass_Options* options, bool source_map_embed); +ADDAPI void ADDCALL sass_option_set_source_map_contents (struct Sass_Options* options, bool source_map_contents); +ADDAPI void ADDCALL sass_option_set_source_map_file_urls (struct Sass_Options* options, bool source_map_file_urls); +ADDAPI void ADDCALL sass_option_set_omit_source_map_url (struct Sass_Options* options, bool omit_source_map_url); +ADDAPI void ADDCALL sass_option_set_is_indented_syntax_src (struct Sass_Options* options, bool is_indented_syntax_src); +ADDAPI void ADDCALL sass_option_set_indent (struct Sass_Options* options, const char* indent); +ADDAPI void ADDCALL sass_option_set_linefeed (struct Sass_Options* options, const char* linefeed); +ADDAPI void ADDCALL sass_option_set_input_path (struct Sass_Options* options, const char* input_path); +ADDAPI void ADDCALL sass_option_set_output_path (struct Sass_Options* options, const char* output_path); +ADDAPI void ADDCALL sass_option_set_plugin_path (struct Sass_Options* options, const char* plugin_path); +ADDAPI void ADDCALL sass_option_set_include_path (struct Sass_Options* options, const char* include_path); +ADDAPI void ADDCALL sass_option_set_source_map_file (struct Sass_Options* options, const char* source_map_file); +ADDAPI void ADDCALL sass_option_set_source_map_root (struct Sass_Options* options, const char* source_map_root); +ADDAPI void ADDCALL sass_option_set_c_headers (struct Sass_Options* options, Sass_Importer_List c_headers); +ADDAPI void ADDCALL sass_option_set_c_importers (struct Sass_Options* options, Sass_Importer_List c_importers); +ADDAPI void ADDCALL sass_option_set_c_functions (struct Sass_Options* options, Sass_Function_List c_functions); + + +// Getters for Sass_Context values +ADDAPI const char* ADDCALL sass_context_get_output_string (struct Sass_Context* ctx); +ADDAPI int ADDCALL sass_context_get_error_status (struct Sass_Context* ctx); +ADDAPI const char* ADDCALL sass_context_get_error_json (struct Sass_Context* ctx); +ADDAPI const char* ADDCALL sass_context_get_error_text (struct Sass_Context* ctx); +ADDAPI const char* ADDCALL sass_context_get_error_message (struct Sass_Context* ctx); +ADDAPI const char* ADDCALL sass_context_get_error_file (struct Sass_Context* ctx); +ADDAPI const char* ADDCALL sass_context_get_error_src (struct Sass_Context* ctx); +ADDAPI size_t ADDCALL sass_context_get_error_line (struct Sass_Context* ctx); +ADDAPI size_t ADDCALL sass_context_get_error_column (struct Sass_Context* ctx); +ADDAPI const char* ADDCALL sass_context_get_source_map_string (struct Sass_Context* ctx); +ADDAPI char** ADDCALL sass_context_get_included_files (struct Sass_Context* ctx); + +// Getters for options include path array +ADDAPI size_t ADDCALL sass_option_get_include_path_size(struct Sass_Options* options); +ADDAPI const char* ADDCALL sass_option_get_include_path(struct Sass_Options* options, size_t i); + +// Calculate the size of the stored null terminated array +ADDAPI size_t ADDCALL sass_context_get_included_files_size (struct Sass_Context* ctx); + +// Take ownership of memory (value on context is set to 0) +ADDAPI char* ADDCALL sass_context_take_error_json (struct Sass_Context* ctx); +ADDAPI char* ADDCALL sass_context_take_error_text (struct Sass_Context* ctx); +ADDAPI char* ADDCALL sass_context_take_error_message (struct Sass_Context* ctx); +ADDAPI char* ADDCALL sass_context_take_error_file (struct Sass_Context* ctx); +ADDAPI char* ADDCALL sass_context_take_output_string (struct Sass_Context* ctx); +ADDAPI char* ADDCALL sass_context_take_source_map_string (struct Sass_Context* ctx); +ADDAPI char** ADDCALL sass_context_take_included_files (struct Sass_Context* ctx); + +// Getters for Sass_Compiler options +ADDAPI enum Sass_Compiler_State ADDCALL sass_compiler_get_state(struct Sass_Compiler* compiler); +ADDAPI struct Sass_Context* ADDCALL sass_compiler_get_context(struct Sass_Compiler* compiler); +ADDAPI struct Sass_Options* ADDCALL sass_compiler_get_options(struct Sass_Compiler* compiler); +ADDAPI size_t ADDCALL sass_compiler_get_import_stack_size(struct Sass_Compiler* compiler); +ADDAPI Sass_Import_Entry ADDCALL sass_compiler_get_last_import(struct Sass_Compiler* compiler); +ADDAPI Sass_Import_Entry ADDCALL sass_compiler_get_import_entry(struct Sass_Compiler* compiler, size_t idx); +ADDAPI size_t ADDCALL sass_compiler_get_callee_stack_size(struct Sass_Compiler* compiler); +ADDAPI Sass_Callee_Entry ADDCALL sass_compiler_get_last_callee(struct Sass_Compiler* compiler); +ADDAPI Sass_Callee_Entry ADDCALL sass_compiler_get_callee_entry(struct Sass_Compiler* compiler, size_t idx); + +// Push function for paths (no manipulation support for now) +ADDAPI void ADDCALL sass_option_push_plugin_path (struct Sass_Options* options, const char* path); +ADDAPI void ADDCALL sass_option_push_include_path (struct Sass_Options* options, const char* path); + +// Resolve a file via the given include paths in the sass option struct +// find_file looks for the exact file name while find_include does a regular sass include +ADDAPI char* ADDCALL sass_find_file (const char* path, struct Sass_Options* opt); +ADDAPI char* ADDCALL sass_find_include (const char* path, struct Sass_Options* opt); + +// Resolve a file relative to last import or include paths in the sass option struct +// find_file looks for the exact file name while find_include does a regular sass include +ADDAPI char* ADDCALL sass_compiler_find_file (const char* path, struct Sass_Compiler* compiler); +ADDAPI char* ADDCALL sass_compiler_find_include (const char* path, struct Sass_Compiler* compiler); + +#ifdef __cplusplus +} // __cplusplus defined. +#endif + +#endif diff --git a/node_modules/node-sass/src/libsass/include/sass/functions.h b/node_modules/node-sass/src/libsass/include/sass/functions.h new file mode 100644 index 0000000..ac47e8e --- /dev/null +++ b/node_modules/node-sass/src/libsass/include/sass/functions.h @@ -0,0 +1,139 @@ +#ifndef SASS_C_FUNCTIONS_H +#define SASS_C_FUNCTIONS_H + +#include <stddef.h> +#include <stdbool.h> +#include <sass/base.h> + +#ifdef __cplusplus +extern "C" { +#endif + + +// Forward declaration +struct Sass_Env; +struct Sass_Callee; +struct Sass_Import; +struct Sass_Options; +struct Sass_Compiler; +struct Sass_Importer; +struct Sass_Function; + +// Typedef helpers for callee lists +typedef struct Sass_Env (*Sass_Env_Frame); +// Typedef helpers for callee lists +typedef struct Sass_Callee (*Sass_Callee_Entry); +// Typedef helpers for import lists +typedef struct Sass_Import (*Sass_Import_Entry); +typedef struct Sass_Import* (*Sass_Import_List); +// Typedef helpers for custom importer lists +typedef struct Sass_Importer (*Sass_Importer_Entry); +typedef struct Sass_Importer* (*Sass_Importer_List); +// Typedef defining importer signature and return type +typedef Sass_Import_List (*Sass_Importer_Fn) + (const char* url, Sass_Importer_Entry cb, struct Sass_Compiler* compiler); + +// Typedef helpers for custom functions lists +typedef struct Sass_Function (*Sass_Function_Entry); +typedef struct Sass_Function* (*Sass_Function_List); +// Typedef defining function signature and return type +typedef union Sass_Value* (*Sass_Function_Fn) + (const union Sass_Value*, Sass_Function_Entry cb, struct Sass_Compiler* compiler); + +// Type of function calls +enum Sass_Callee_Type { + SASS_CALLEE_MIXIN, + SASS_CALLEE_FUNCTION, + SASS_CALLEE_C_FUNCTION, +}; + +// Creator for sass custom importer return argument list +ADDAPI Sass_Importer_List ADDCALL sass_make_importer_list (size_t length); +ADDAPI Sass_Importer_Entry ADDCALL sass_importer_get_list_entry (Sass_Importer_List list, size_t idx); +ADDAPI void ADDCALL sass_importer_set_list_entry (Sass_Importer_List list, size_t idx, Sass_Importer_Entry entry); +ADDAPI void ADDCALL sass_delete_importer_list (Sass_Importer_List list); + + +// Creators for custom importer callback (with some additional pointer) +// The pointer is mostly used to store the callback into the actual binding +ADDAPI Sass_Importer_Entry ADDCALL sass_make_importer (Sass_Importer_Fn importer, double priority, void* cookie); + +// Getters for import function descriptors +ADDAPI Sass_Importer_Fn ADDCALL sass_importer_get_function (Sass_Importer_Entry cb); +ADDAPI double ADDCALL sass_importer_get_priority (Sass_Importer_Entry cb); +ADDAPI void* ADDCALL sass_importer_get_cookie (Sass_Importer_Entry cb); + +// Deallocator for associated memory +ADDAPI void ADDCALL sass_delete_importer (Sass_Importer_Entry cb); + +// Creator for sass custom importer return argument list +ADDAPI Sass_Import_List ADDCALL sass_make_import_list (size_t length); +// Creator for a single import entry returned by the custom importer inside the list +ADDAPI Sass_Import_Entry ADDCALL sass_make_import_entry (const char* path, char* source, char* srcmap); +ADDAPI Sass_Import_Entry ADDCALL sass_make_import (const char* imp_path, const char* abs_base, char* source, char* srcmap); +// set error message to abort import and to print out a message (path from existing object is used in output) +ADDAPI Sass_Import_Entry ADDCALL sass_import_set_error(Sass_Import_Entry import, const char* message, size_t line, size_t col); + +// Setters to insert an entry into the import list (you may also use [] access directly) +// Since we are dealing with pointers they should have a guaranteed and fixed size +ADDAPI void ADDCALL sass_import_set_list_entry (Sass_Import_List list, size_t idx, Sass_Import_Entry entry); +ADDAPI Sass_Import_Entry ADDCALL sass_import_get_list_entry (Sass_Import_List list, size_t idx); + +// Getters for callee entry +ADDAPI const char* ADDCALL sass_callee_get_name (Sass_Callee_Entry); +ADDAPI const char* ADDCALL sass_callee_get_path (Sass_Callee_Entry); +ADDAPI size_t ADDCALL sass_callee_get_line (Sass_Callee_Entry); +ADDAPI size_t ADDCALL sass_callee_get_column (Sass_Callee_Entry); +ADDAPI enum Sass_Callee_Type ADDCALL sass_callee_get_type (Sass_Callee_Entry); +ADDAPI Sass_Env_Frame ADDCALL sass_callee_get_env (Sass_Callee_Entry); + +// Getters and Setters for environments (lexical, local and global) +ADDAPI union Sass_Value* ADDCALL sass_env_get_lexical (Sass_Env_Frame, const char*); +ADDAPI void ADDCALL sass_env_set_lexical (Sass_Env_Frame, const char*, union Sass_Value*); +ADDAPI union Sass_Value* ADDCALL sass_env_get_local (Sass_Env_Frame, const char*); +ADDAPI void ADDCALL sass_env_set_local (Sass_Env_Frame, const char*, union Sass_Value*); +ADDAPI union Sass_Value* ADDCALL sass_env_get_global (Sass_Env_Frame, const char*); +ADDAPI void ADDCALL sass_env_set_global (Sass_Env_Frame, const char*, union Sass_Value*); + +// Getters for import entry +ADDAPI const char* ADDCALL sass_import_get_imp_path (Sass_Import_Entry); +ADDAPI const char* ADDCALL sass_import_get_abs_path (Sass_Import_Entry); +ADDAPI const char* ADDCALL sass_import_get_source (Sass_Import_Entry); +ADDAPI const char* ADDCALL sass_import_get_srcmap (Sass_Import_Entry); +// Explicit functions to take ownership of these items +// The property on our struct will be reset to NULL +ADDAPI char* ADDCALL sass_import_take_source (Sass_Import_Entry); +ADDAPI char* ADDCALL sass_import_take_srcmap (Sass_Import_Entry); +// Getters from import error entry +ADDAPI size_t ADDCALL sass_import_get_error_line (Sass_Import_Entry); +ADDAPI size_t ADDCALL sass_import_get_error_column (Sass_Import_Entry); +ADDAPI const char* ADDCALL sass_import_get_error_message (Sass_Import_Entry); + +// Deallocator for associated memory (incl. entries) +ADDAPI void ADDCALL sass_delete_import_list (Sass_Import_List); +// Just in case we have some stray import structs +ADDAPI void ADDCALL sass_delete_import (Sass_Import_Entry); + + + +// Creators for sass function list and function descriptors +ADDAPI Sass_Function_List ADDCALL sass_make_function_list (size_t length); +ADDAPI Sass_Function_Entry ADDCALL sass_make_function (const char* signature, Sass_Function_Fn cb, void* cookie); +ADDAPI void ADDCALL sass_delete_function (Sass_Function_Entry entry); +ADDAPI void ADDCALL sass_delete_function_list (Sass_Function_List list); + +// Setters and getters for callbacks on function lists +ADDAPI Sass_Function_Entry ADDCALL sass_function_get_list_entry(Sass_Function_List list, size_t pos); +ADDAPI void ADDCALL sass_function_set_list_entry(Sass_Function_List list, size_t pos, Sass_Function_Entry cb); + +// Getters for custom function descriptors +ADDAPI const char* ADDCALL sass_function_get_signature (Sass_Function_Entry cb); +ADDAPI Sass_Function_Fn ADDCALL sass_function_get_function (Sass_Function_Entry cb); +ADDAPI void* ADDCALL sass_function_get_cookie (Sass_Function_Entry cb); + + +#ifdef __cplusplus +} // __cplusplus defined. +#endif + +#endif diff --git a/node_modules/node-sass/src/libsass/include/sass/values.h b/node_modules/node-sass/src/libsass/include/sass/values.h new file mode 100644 index 0000000..9832038 --- /dev/null +++ b/node_modules/node-sass/src/libsass/include/sass/values.h @@ -0,0 +1,145 @@ +#ifndef SASS_C_VALUES_H +#define SASS_C_VALUES_H + +#include <stddef.h> +#include <stdbool.h> +#include <sass/base.h> + +#ifdef __cplusplus +extern "C" { +#endif + + +// Forward declaration +union Sass_Value; + +// Type for Sass values +enum Sass_Tag { + SASS_BOOLEAN, + SASS_NUMBER, + SASS_COLOR, + SASS_STRING, + SASS_LIST, + SASS_MAP, + SASS_NULL, + SASS_ERROR, + SASS_WARNING +}; + +// Tags for denoting Sass list separators +enum Sass_Separator { + SASS_COMMA, + SASS_SPACE, + // only used internally to represent a hash map before evaluation + // otherwise we would be too early to check for duplicate keys + SASS_HASH +}; + +// Value Operators +enum Sass_OP { + AND, OR, // logical connectives + EQ, NEQ, GT, GTE, LT, LTE, // arithmetic relations + ADD, SUB, MUL, DIV, MOD, // arithmetic functions + NUM_OPS // so we know how big to make the op table +}; + +// Creator functions for all value types +ADDAPI union Sass_Value* ADDCALL sass_make_null (void); +ADDAPI union Sass_Value* ADDCALL sass_make_boolean (bool val); +ADDAPI union Sass_Value* ADDCALL sass_make_string (const char* val); +ADDAPI union Sass_Value* ADDCALL sass_make_qstring (const char* val); +ADDAPI union Sass_Value* ADDCALL sass_make_number (double val, const char* unit); +ADDAPI union Sass_Value* ADDCALL sass_make_color (double r, double g, double b, double a); +ADDAPI union Sass_Value* ADDCALL sass_make_list (size_t len, enum Sass_Separator sep, bool is_bracketed); +ADDAPI union Sass_Value* ADDCALL sass_make_map (size_t len); +ADDAPI union Sass_Value* ADDCALL sass_make_error (const char* msg); +ADDAPI union Sass_Value* ADDCALL sass_make_warning (const char* msg); + +// Generic destructor function for all types +// Will release memory of all associated Sass_Values +// Means we will delete recursively for lists and maps +ADDAPI void ADDCALL sass_delete_value (union Sass_Value* val); + +// Make a deep cloned copy of the given sass value +ADDAPI union Sass_Value* ADDCALL sass_clone_value (const union Sass_Value* val); + +// Execute an operation for two Sass_Values and return the result as a Sass_Value too +ADDAPI union Sass_Value* ADDCALL sass_value_op (enum Sass_OP op, const union Sass_Value* a, const union Sass_Value* b); + +// Stringify a Sass_Values and also return the result as a Sass_Value (of type STRING) +ADDAPI union Sass_Value* ADDCALL sass_value_stringify (const union Sass_Value* a, bool compressed, int precision); + +// Return the sass tag for a generic sass value +// Check is needed before accessing specific values! +ADDAPI enum Sass_Tag ADDCALL sass_value_get_tag (const union Sass_Value* v); + +// Check value to be of a specific type +// Can also be used before accessing properties! +ADDAPI bool ADDCALL sass_value_is_null (const union Sass_Value* v); +ADDAPI bool ADDCALL sass_value_is_number (const union Sass_Value* v); +ADDAPI bool ADDCALL sass_value_is_string (const union Sass_Value* v); +ADDAPI bool ADDCALL sass_value_is_boolean (const union Sass_Value* v); +ADDAPI bool ADDCALL sass_value_is_color (const union Sass_Value* v); +ADDAPI bool ADDCALL sass_value_is_list (const union Sass_Value* v); +ADDAPI bool ADDCALL sass_value_is_map (const union Sass_Value* v); +ADDAPI bool ADDCALL sass_value_is_error (const union Sass_Value* v); +ADDAPI bool ADDCALL sass_value_is_warning (const union Sass_Value* v); + +// Getters and setters for Sass_Number +ADDAPI double ADDCALL sass_number_get_value (const union Sass_Value* v); +ADDAPI void ADDCALL sass_number_set_value (union Sass_Value* v, double value); +ADDAPI const char* ADDCALL sass_number_get_unit (const union Sass_Value* v); +ADDAPI void ADDCALL sass_number_set_unit (union Sass_Value* v, char* unit); + +// Getters and setters for Sass_String +ADDAPI const char* ADDCALL sass_string_get_value (const union Sass_Value* v); +ADDAPI void ADDCALL sass_string_set_value (union Sass_Value* v, char* value); +ADDAPI bool ADDCALL sass_string_is_quoted(const union Sass_Value* v); +ADDAPI void ADDCALL sass_string_set_quoted(union Sass_Value* v, bool quoted); + +// Getters and setters for Sass_Boolean +ADDAPI bool ADDCALL sass_boolean_get_value (const union Sass_Value* v); +ADDAPI void ADDCALL sass_boolean_set_value (union Sass_Value* v, bool value); + +// Getters and setters for Sass_Color +ADDAPI double ADDCALL sass_color_get_r (const union Sass_Value* v); +ADDAPI void ADDCALL sass_color_set_r (union Sass_Value* v, double r); +ADDAPI double ADDCALL sass_color_get_g (const union Sass_Value* v); +ADDAPI void ADDCALL sass_color_set_g (union Sass_Value* v, double g); +ADDAPI double ADDCALL sass_color_get_b (const union Sass_Value* v); +ADDAPI void ADDCALL sass_color_set_b (union Sass_Value* v, double b); +ADDAPI double ADDCALL sass_color_get_a (const union Sass_Value* v); +ADDAPI void ADDCALL sass_color_set_a (union Sass_Value* v, double a); + +// Getter for the number of items in list +ADDAPI size_t ADDCALL sass_list_get_length (const union Sass_Value* v); +// Getters and setters for Sass_List +ADDAPI enum Sass_Separator ADDCALL sass_list_get_separator (const union Sass_Value* v); +ADDAPI void ADDCALL sass_list_set_separator (union Sass_Value* v, enum Sass_Separator value); +ADDAPI bool ADDCALL sass_list_get_is_bracketed (const union Sass_Value* v); +ADDAPI void ADDCALL sass_list_set_is_bracketed (union Sass_Value* v, bool value); +// Getters and setters for Sass_List values +ADDAPI union Sass_Value* ADDCALL sass_list_get_value (const union Sass_Value* v, size_t i); +ADDAPI void ADDCALL sass_list_set_value (union Sass_Value* v, size_t i, union Sass_Value* value); + +// Getter for the number of items in map +ADDAPI size_t ADDCALL sass_map_get_length (const union Sass_Value* v); +// Getters and setters for Sass_Map keys and values +ADDAPI union Sass_Value* ADDCALL sass_map_get_key (const union Sass_Value* v, size_t i); +ADDAPI void ADDCALL sass_map_set_key (union Sass_Value* v, size_t i, union Sass_Value*); +ADDAPI union Sass_Value* ADDCALL sass_map_get_value (const union Sass_Value* v, size_t i); +ADDAPI void ADDCALL sass_map_set_value (union Sass_Value* v, size_t i, union Sass_Value*); + +// Getters and setters for Sass_Error +ADDAPI char* ADDCALL sass_error_get_message (const union Sass_Value* v); +ADDAPI void ADDCALL sass_error_set_message (union Sass_Value* v, char* msg); + +// Getters and setters for Sass_Warning +ADDAPI char* ADDCALL sass_warning_get_message (const union Sass_Value* v); +ADDAPI void ADDCALL sass_warning_set_message (union Sass_Value* v, char* msg); + +#ifdef __cplusplus +} // __cplusplus defined. +#endif + +#endif diff --git a/node_modules/node-sass/src/libsass/include/sass/version.h b/node_modules/node-sass/src/libsass/include/sass/version.h new file mode 100644 index 0000000..56ea016 --- /dev/null +++ b/node_modules/node-sass/src/libsass/include/sass/version.h @@ -0,0 +1,12 @@ +#ifndef SASS_VERSION_H +#define SASS_VERSION_H + +#ifndef LIBSASS_VERSION +#define LIBSASS_VERSION "[NA]" +#endif + +#ifndef LIBSASS_LANGUAGE_VERSION +#define LIBSASS_LANGUAGE_VERSION "3.5" +#endif + +#endif diff --git a/node_modules/node-sass/src/libsass/include/sass/version.h.in b/node_modules/node-sass/src/libsass/include/sass/version.h.in new file mode 100644 index 0000000..b8d4072 --- /dev/null +++ b/node_modules/node-sass/src/libsass/include/sass/version.h.in @@ -0,0 +1,12 @@ +#ifndef SASS_VERSION_H +#define SASS_VERSION_H + +#ifndef LIBSASS_VERSION +#define LIBSASS_VERSION "@PACKAGE_VERSION@" +#endif + +#ifndef LIBSASS_LANGUAGE_VERSION +#define LIBSASS_LANGUAGE_VERSION "3.5" +#endif + +#endif diff --git a/node_modules/node-sass/src/libsass/include/sass2scss.h b/node_modules/node-sass/src/libsass/include/sass2scss.h new file mode 100644 index 0000000..8736b2c --- /dev/null +++ b/node_modules/node-sass/src/libsass/include/sass2scss.h @@ -0,0 +1,120 @@ +/** + * sass2scss + * Licensed under the MIT License + * Copyright (c) Marcel Greter + */ + +#ifndef SASS2SCSS_H +#define SASS2SCSS_H + +#ifdef _WIN32 + + /* You should define ADD_EXPORTS *only* when building the DLL. */ + #ifdef ADD_EXPORTS + #define ADDAPI __declspec(dllexport) + #define ADDCALL __cdecl + #else + #define ADDAPI + #define ADDCALL + #endif + +#else /* _WIN32 not defined. */ + + /* Define with no value on non-Windows OSes. */ + #define ADDAPI + #define ADDCALL + +#endif + +#ifdef __cplusplus + +#include <stack> +#include <string> +#include <cstring> +#include <sstream> +#include <iostream> + +#ifndef SASS2SCSS_VERSION +// Hardcode once the file is copied from +// https://github.com/mgreter/sass2scss +#define SASS2SCSS_VERSION "1.1.1" +#endif + +// add namespace for c++ +namespace Sass +{ + + // pretty print options + const int SASS2SCSS_PRETTIFY_0 = 0; + const int SASS2SCSS_PRETTIFY_1 = 1; + const int SASS2SCSS_PRETTIFY_2 = 2; + const int SASS2SCSS_PRETTIFY_3 = 3; + + // remove one-line comment + const int SASS2SCSS_KEEP_COMMENT = 32; + // remove multi-line comments + const int SASS2SCSS_STRIP_COMMENT = 64; + // convert one-line to multi-line + const int SASS2SCSS_CONVERT_COMMENT = 128; + + // String for finding something interesting + const std::string SASS2SCSS_FIND_WHITESPACE = " \t\n\v\f\r"; + + // converter struct + // holding all states + struct converter + { + // bit options + int options; + // is selector + bool selector; + // concat lists + bool comma; + // has property + bool property; + // has semicolon + bool semicolon; + // comment context + std::string comment; + // flag end of file + bool end_of_file; + // whitespace buffer + std::string whitespace; + // context/block stack + std::stack<std::string> indents; + }; + + // function only available in c++ code + char* sass2scss (const std::string& sass, const int options); + +} +// EO namespace + +// declare for c +extern "C" { +#endif + + // prettyfy print options + #define SASS2SCSS_PRETTIFY_0 0 + #define SASS2SCSS_PRETTIFY_1 1 + #define SASS2SCSS_PRETTIFY_2 2 + #define SASS2SCSS_PRETTIFY_3 3 + + // keep one-line comments + #define SASS2SCSS_KEEP_COMMENT 32 + // remove multi-line comments + #define SASS2SCSS_STRIP_COMMENT 64 + // convert one-line to multi-line + #define SASS2SCSS_CONVERT_COMMENT 128 + + // available to c and c++ code + ADDAPI char* ADDCALL sass2scss (const char* sass, const int options); + + // Get compiled sass2scss version + ADDAPI const char* ADDCALL sass2scss_version(void); + +#ifdef __cplusplus +} // __cplusplus defined. +#endif + +#endif
\ No newline at end of file |