Skip to content

Commit 7c8a545

Browse files
committed
Add back C-API getters for plugin paths
They are probably not really useful, but we already have them documented in the context API documentation.
1 parent 9515008 commit 7c8a545

File tree

2 files changed

+20
-0
lines changed

2 files changed

+20
-0
lines changed

include/sass/context.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,9 @@ ADDAPI char** ADDCALL sass_context_get_included_files (struct Sass_Context* ctx)
125125
// Getters for options include path array
126126
ADDAPI size_t ADDCALL sass_option_get_include_path_size(struct Sass_Options* options);
127127
ADDAPI const char* ADDCALL sass_option_get_include_path(struct Sass_Options* options, size_t i);
128+
// Plugin paths to load dynamic libraries work the same
129+
ADDAPI size_t ADDCALL sass_option_get_plugin_path_size(struct Sass_Options* options);
130+
ADDAPI const char* ADDCALL sass_option_get_plugin_path(struct Sass_Options* options, size_t i);
128131

129132
// Calculate the size of the stored null terminated array
130133
ADDAPI size_t ADDCALL sass_context_get_included_files_size (struct Sass_Context* ctx);

src/sass_context.cpp

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -703,6 +703,23 @@ extern "C" {
703703
return cur->string;
704704
}
705705

706+
// Push function for plugin paths (no manipulation support for now)
707+
size_t ADDCALL sass_option_get_plugin_path_size(struct Sass_Options* options)
708+
{
709+
size_t len = 0;
710+
struct string_list* cur = options->plugin_paths;
711+
while (cur) { len++; cur = cur->next; }
712+
return len;
713+
}
714+
715+
// Push function for plugin paths (no manipulation support for now)
716+
const char* ADDCALL sass_option_get_plugin_path(struct Sass_Options* options, size_t i)
717+
{
718+
struct string_list* cur = options->plugin_paths;
719+
while (i) { i--; cur = cur->next; }
720+
return cur->string;
721+
}
722+
706723
// Push function for plugin paths (no manipulation support for now)
707724
void ADDCALL sass_option_push_plugin_path(struct Sass_Options* options, const char* path)
708725
{

0 commit comments

Comments
 (0)