Skip to content
This repository has been archived by the owner on Jan 25, 2024. It is now read-only.

Commit

Permalink
feat(cwrap): expose more interfaces
Browse files Browse the repository at this point in the history
  • Loading branch information
kwonoj committed Jul 12, 2018
1 parent 33b2105 commit fbe1f8f
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 9 deletions.
17 changes: 13 additions & 4 deletions src/interop/options/wrapSassOptions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,11 @@ const wrapSassOptions = (cwrap: cwrapSignature) => ({
//const char* sass_option_get_linefeed (struct Sass_Options* options);
option_get_linefeed: null,
//const char* sass_option_get_input_path (struct Sass_Options* options);
option_get_input_path: null,
option_get_input_path: cwrap<(sassOptionsPtr: number) => number>(`sass_option_get_input_path`, 'number', ['number']),
//const char* sass_option_get_output_path (struct Sass_Options* options);
option_get_output_path: null,
option_get_output_path: cwrap<(sassOptionsPtr: number) => number>(`sass_option_get_output_path`, 'number', [
'number'
]),
//const char* sass_option_get_source_map_file (struct Sass_Options* options);
option_get_source_map_file: cwrap<(sassOptionsPtr: number) => number>(`sass_option_get_source_map_file`, 'number', [
'number'
Expand Down Expand Up @@ -109,9 +111,16 @@ const wrapSassOptions = (cwrap: cwrapSignature) => ({
//void sass_option_set_linefeed (struct Sass_Options* options, const char* linefeed);
option_set_linefeed: null,
//void sass_option_set_input_path (struct Sass_Options* options, const char* input_path);
option_set_input_path: null,
option_set_input_path: cwrap<(sassOptionsPtr: number, outPath: number) => void>(`sass_option_set_input_path`, null, [
'number',
'number'
]),
//void sass_option_set_output_path (struct Sass_Options* options, const char* output_path);
option_set_output_path: null,
option_set_output_path: cwrap<(sassOptionsPtr: number, outPath: number) => void>(
`sass_option_set_output_path`,
null,
['number', 'number']
),
//void sass_option_set_plugin_path (struct Sass_Options* options, const char* plugin_path);
option_set_plugin_path: null,
//void sass_option_set_include_path (struct Sass_Options* options, const char* include_path);
Expand Down
18 changes: 13 additions & 5 deletions src/interop/wrapSassContext.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ const wrapSassContext = (cwrap: cwrapSignature) => ({
make_options: cwrap<() => number>(`sass_make_options`, 'number'),

//struct Sass_File_Context* sass_make_file_context (const char* input_path);
make_file_context: null,
make_file_context: cwrap<(inputPath: number) => number>(`sass_make_file_context`, 'number', ['number']),
//struct Sass_Data_Context* sass_make_data_context (char* source_string);
make_data_context: null,

Expand All @@ -33,23 +33,31 @@ const wrapSassContext = (cwrap: cwrapSignature) => ({
delete_options: cwrap<(sassOptionsPtr: number) => void>(`sass_delete_options`, null, ['number']),

//void sass_delete_file_context (struct Sass_File_Context* ctx);
delete_file_context: null,
delete_file_context: cwrap<(sassFileContextptr: number) => void>(`sass_delete_file_context`, null, ['number']),
//void sass_delete_data_context (struct Sass_Data_Context* ctx);
delete_data_context: null,

//struct Sass_Context* sass_file_context_get_context (struct Sass_File_Context* file_ctx);
file_context_get_context: null,
file_context_get_context: cwrap<(sassFileCtxPtr: number) => number>(`sass_file_context_get_context`, 'number', [
'number'
]),
//struct Sass_Context* sass_data_context_get_context (struct Sass_Data_Context* data_ctx);
data_context_get_context: null,

//struct Sass_Options* sass_context_get_options (struct Sass_Context* ctx);
context_get_options: null,
//struct Sass_Options* sass_file_context_get_options (struct Sass_File_Context* file_ctx);
file_context_get_options: null,
file_context_get_options: cwrap<(sassFileCtxPtr: number) => number>(`sass_file_context_get_options`, 'number', [
'number'
]),
//struct Sass_Options* sass_data_context_get_options (struct Sass_Data_Context* data_ctx);
data_context_get_options: null,
//void sass_file_context_set_options (struct Sass_File_Context* file_ctx, struct Sass_Options* opt);
file_context_set_options: null,
file_context_set_options: cwrap<(sassFileCtxPtr: number, sassOptionsPtr: number) => void>(
`sass_file_context_set_options`,
null,
['number', 'number']
),
//void sass_data_context_set_options (struct Sass_Data_Context* data_ctx, struct Sass_Options* opt);
data_context_set_options: null,

Expand Down

0 comments on commit fbe1f8f

Please sign in to comment.