Skip to content

Commit

Permalink
Add sass_context_get_included_files_size to API
Browse files Browse the repository at this point in the history
  • Loading branch information
mgreter committed Mar 29, 2015
1 parent 7757f61 commit a73ae26
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
4 changes: 4 additions & 0 deletions sass_context.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -815,6 +815,10 @@ extern "C" {
Sass_Import_Entry ADDCALL sass_compiler_get_last_import(struct Sass_Compiler* compiler) { return compiler->cpp_ctx->import_stack.back(); }
Sass_Import_Entry ADDCALL sass_compiler_get_import_entry(struct Sass_Compiler* compiler, size_t idx) { return compiler->cpp_ctx->import_stack[idx]; }

// Calculate the size of the stored null terminated array
size_t ADDCALL sass_context_get_included_files_size (struct Sass_Context* ctx)
{ size_t l = 0; auto i = ctx->included_files; while (i && *i) { ++i; ++l; } return l; }

// Create getter and setters for options
IMPLEMENT_SASS_OPTION_ACCESSOR(int, precision);
IMPLEMENT_SASS_OPTION_ACCESSOR(enum Sass_Output_Style, output_style);
Expand Down
3 changes: 3 additions & 0 deletions sass_context.h
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,9 @@ 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);

// 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);
Expand Down

0 comments on commit a73ae26

Please sign in to comment.