Blame docs/api-context-internal.md

Packit Service 7770af
```C
Packit Service 7770af
// Input behaviours
Packit Service 7770af
enum Sass_Input_Style {
Packit Service 7770af
  SASS_CONTEXT_NULL,
Packit Service 7770af
  SASS_CONTEXT_FILE,
Packit Service 7770af
  SASS_CONTEXT_DATA,
Packit Service 7770af
  SASS_CONTEXT_FOLDER
Packit Service 7770af
};
Packit Service 7770af
Packit Service 7770af
// sass config options structure
Packit Service 7770af
struct Sass_Inspect_Options {
Packit Service 7770af
Packit Service 7770af
  // Output style for the generated css code
Packit Service 7770af
  // A value from above SASS_STYLE_* constants
Packit Service 7770af
  enum Sass_Output_Style output_style;
Packit Service 7770af
Packit Service 7770af
  // Precision for fractional numbers
Packit Service 7770af
  int precision;
Packit Service 7770af
Packit Service 7770af
};
Packit Service 7770af
Packit Service 7770af
// sass config options structure
Packit Service 7770af
struct Sass_Output_Options : Sass_Inspect_Options {
Packit Service 7770af
Packit Service 7770af
  // String to be used for indentation
Packit Service 7770af
  const char* indent;
Packit Service 7770af
  // String to be used to for line feeds
Packit Service 7770af
  const char* linefeed;
Packit Service 7770af
Packit Service 7770af
  // Emit comments in the generated CSS indicating
Packit Service 7770af
  // the corresponding source line.
Packit Service 7770af
  bool source_comments;
Packit Service 7770af
Packit Service 7770af
};
Packit Service 7770af
Packit Service 7770af
// sass config options structure
Packit Service 7770af
struct Sass_Options : Sass_Output_Options {
Packit Service 7770af
Packit Service 7770af
  // embed sourceMappingUrl as data uri
Packit Service 7770af
  bool source_map_embed;
Packit Service 7770af
Packit Service 7770af
  // embed include contents in maps
Packit Service 7770af
  bool source_map_contents;
Packit Service 7770af
Packit Service 7770af
  // create file urls for sources
Packit Service 7770af
  bool source_map_file_urls;
Packit Service 7770af
Packit Service 7770af
  // Disable sourceMappingUrl in css output
Packit Service 7770af
  bool omit_source_map_url;
Packit Service 7770af
Packit Service 7770af
  // Treat source_string as sass (as opposed to scss)
Packit Service 7770af
  bool is_indented_syntax_src;
Packit Service 7770af
Packit Service 7770af
  // The input path is used for source map
Packit Service 7770af
  // generation. It can be used to define
Packit Service 7770af
  // something with string compilation or to
Packit Service 7770af
  // overload the input file path. It is
Packit Service 7770af
  // set to "stdin" for data contexts and
Packit Service 7770af
  // to the input file on file contexts.
Packit Service 7770af
  char* input_path;
Packit Service 7770af
Packit Service 7770af
  // The output path is used for source map
Packit Service 7770af
  // generation. LibSass will not write to
Packit Service 7770af
  // this file, it is just used to create
Packit Service 7770af
  // information in source-maps etc.
Packit Service 7770af
  char* output_path;
Packit Service 7770af
Packit Service 7770af
  // Colon-separated list of paths
Packit Service 7770af
  // Semicolon-separated on Windows
Packit Service 7770af
  // Maybe use array interface instead?
Packit Service 7770af
  char* include_path;
Packit Service 7770af
  char* plugin_path;
Packit Service 7770af
Packit Service 7770af
  // Include paths (linked string list)
Packit Service 7770af
  struct string_list* include_paths;
Packit Service 7770af
  // Plugin paths (linked string list)
Packit Service 7770af
  struct string_list* plugin_paths;
Packit Service 7770af
Packit Service 7770af
  // Path to source map file
Packit Service 7770af
  // Enables source map generation
Packit Service 7770af
  // Used to create sourceMappingUrl
Packit Service 7770af
  char* source_map_file;
Packit Service 7770af
Packit Service 7770af
  // Directly inserted in source maps
Packit Service 7770af
  char* source_map_root;
Packit Service 7770af
Packit Service 7770af
  // Custom functions that can be called from sccs code
Packit Service 7770af
  Sass_Function_List c_functions;
Packit Service 7770af
Packit Service 7770af
  // Callback to overload imports
Packit Service 7770af
  Sass_Importer_List c_importers;
Packit Service 7770af
Packit Service 7770af
  // List of custom headers
Packit Service 7770af
  Sass_Importer_List c_headers;
Packit Service 7770af
Packit Service 7770af
};
Packit Service 7770af
Packit Service 7770af
// base for all contexts
Packit Service 7770af
struct Sass_Context : Sass_Options
Packit Service 7770af
{
Packit Service 7770af
Packit Service 7770af
  // store context type info
Packit Service 7770af
  enum Sass_Input_Style type;
Packit Service 7770af
Packit Service 7770af
  // generated output data
Packit Service 7770af
  char* output_string;
Packit Service 7770af
Packit Service 7770af
  // generated source map json
Packit Service 7770af
  char* source_map_string;
Packit Service 7770af
Packit Service 7770af
  // error status
Packit Service 7770af
  int error_status;
Packit Service 7770af
  char* error_json;
Packit Service 7770af
  char* error_text;
Packit Service 7770af
  char* error_message;
Packit Service 7770af
  // error position
Packit Service 7770af
  char* error_file;
Packit Service 7770af
  size_t error_line;
Packit Service 7770af
  size_t error_column;
Packit Service 7770af
  const char* error_src;
Packit Service 7770af
Packit Service 7770af
  // report imported files
Packit Service 7770af
  char** included_files;
Packit Service 7770af
Packit Service 7770af
};
Packit Service 7770af
Packit Service 7770af
// struct for file compilation
Packit Service 7770af
struct Sass_File_Context : Sass_Context {
Packit Service 7770af
Packit Service 7770af
  // no additional fields required
Packit Service 7770af
  // input_path is already on options
Packit Service 7770af
Packit Service 7770af
};
Packit Service 7770af
Packit Service 7770af
// struct for data compilation
Packit Service 7770af
struct Sass_Data_Context : Sass_Context {
Packit Service 7770af
Packit Service 7770af
  // provided source string
Packit Service 7770af
  char* source_string;
Packit Service 7770af
  char* srcmap_string;
Packit Service 7770af
Packit Service 7770af
};
Packit Service 7770af
Packit Service 7770af
// Compiler states
Packit Service 7770af
enum Sass_Compiler_State {
Packit Service 7770af
  SASS_COMPILER_CREATED,
Packit Service 7770af
  SASS_COMPILER_PARSED,
Packit Service 7770af
  SASS_COMPILER_EXECUTED
Packit Service 7770af
};
Packit Service 7770af
Packit Service 7770af
// link c and cpp context
Packit Service 7770af
struct Sass_Compiler {
Packit Service 7770af
  // progress status
Packit Service 7770af
  Sass_Compiler_State state;
Packit Service 7770af
  // original c context
Packit Service 7770af
  Sass_Context* c_ctx;
Packit Service 7770af
  // Sass::Context
Packit Service 7770af
  Sass::Context* cpp_ctx;
Packit Service 7770af
  // Sass::Block
Packit Service 7770af
  Sass::Block_Obj root;
Packit Service 7770af
};
Packit Service 7770af
```
Packit Service 7770af