@@ -5,7 +5,7 @@ By using custom importers, Sass stylesheets can be implemented in any possible w
5
5
You actually have to return a list of imports, since some importers may want to import multiple files from one import statement (ie. a glob/star importer). The memory you pass with source and srcmap is taken over by LibSass and freed automatically when the import is done. You are also allowed to return ` 0 ` instead of a list, which will tell LibSass to handle the import by itself (as if no custom importer was in use).
6
6
7
7
``` C
8
- struct Sass_Import* * rv = sass_make_import_list(1 );
8
+ Sass_Import_Entry * rv = sass_make_import_list(1 );
9
9
rv[0 ] = sass_make_import(rel, abs, source, srcmap);
10
10
```
11
11
@@ -31,7 +31,7 @@ struct Sass_C_Import_Descriptor;
31
31
// Typedef defining the custom importer callback
32
32
typedef struct Sass_C_Import_Descriptor (* Sass_C_Import_Callback);
33
33
// Typedef defining the importer c function prototype
34
- typedef struct Sass_Import * * (* Sass_C_Import_Fn) (const char* url, const char* prev, void* cookie);
34
+ typedef Sass_Import_Entry * (* Sass_C_Import_Fn) (const char* url, const char* prev, void* cookie);
35
35
36
36
// Creators for custom importer callback (with some additional pointer)
37
37
// The pointer is mostly used to store the callback into the actual function
@@ -45,38 +45,38 @@ void* sass_import_get_cookie (Sass_C_Import_Callback fn);
45
45
void sass_delete_importer (Sass_C_Import_Callback fn);
46
46
47
47
// Creator for sass custom importer return argument list
48
- struct Sass_Import * * sass_make_import_list (size_t length);
48
+ Sass_Import_Entry * sass_make_import_list (size_t length);
49
49
// Creator for a single import entry returned by the custom importer inside the list
50
- struct Sass_Import * sass_make_import_entry (const char* path, char* source, char* srcmap);
51
- struct Sass_Import * sass_make_import (const char* rel, const char* abs, char* source, char* srcmap);
50
+ Sass_Import_Entry sass_make_import_entry (const char* path, char* source, char* srcmap);
51
+ Sass_Import_Entry sass_make_import (const char* rel, const char* abs, char* source, char* srcmap);
52
52
53
53
// set error message to abort import and to print out a message (path from existing object is used in output)
54
- struct Sass_Import * sass_import_set_error(struct Sass_Import * import, const char* message, size_t line, size_t col);
54
+ Sass_Import_Entry sass_import_set_error(Sass_Import_Entry import, const char* message, size_t line, size_t col);
55
55
56
56
// Setters to insert an entry into the import list (you may also use [ ] access directly)
57
57
// Since we are dealing with pointers they should have a guaranteed and fixed size
58
- void sass_import_set_list_entry (struct Sass_Import ** list, size_t idx, struct Sass_Import * entry);
59
- struct Sass_Import * sass_import_get_list_entry (struct Sass_Import * * list, size_t idx);
58
+ void sass_import_set_list_entry (Sass_Import_Entry * list, size_t idx, Sass_Import_Entry entry);
59
+ Sass_Import_Entry sass_import_get_list_entry (Sass_Import_Entry * list, size_t idx);
60
60
61
61
// Getters for import entry
62
- const char* sass_import_get_rel_path (struct Sass_Import * );
63
- const char* sass_import_get_abs_path (struct Sass_Import * );
64
- const char* sass_import_get_source (struct Sass_Import * );
65
- const char* sass_import_get_srcmap (struct Sass_Import * );
62
+ const char* sass_import_get_imp_path (Sass_Import_Entry );
63
+ const char* sass_import_get_abs_path (Sass_Import_Entry );
64
+ const char* sass_import_get_source (Sass_Import_Entry );
65
+ const char* sass_import_get_srcmap (Sass_Import_Entry );
66
66
// Explicit functions to take ownership of these items
67
67
// The property on our struct will be reset to NULL
68
- char* sass_import_take_source (struct Sass_Import * );
69
- char* sass_import_take_srcmap (struct Sass_Import * );
68
+ char* sass_import_take_source (Sass_Import_Entry );
69
+ char* sass_import_take_srcmap (Sass_Import_Entry );
70
70
71
71
// Getters for import error entries
72
- size_t sass_import_get_error_line (struct Sass_Import * );
73
- size_t sass_import_get_error_column (struct Sass_Import * );
74
- const char* sass_import_get_error_message (struct Sass_Import * );
72
+ size_t sass_import_get_error_line (Sass_Import_Entry );
73
+ size_t sass_import_get_error_column (Sass_Import_Entry );
74
+ const char* sass_import_get_error_message (Sass_Import_Entry );
75
75
76
76
// Deallocator for associated memory (incl. entries)
77
- void sass_delete_import_list (struct Sass_Import * * );
77
+ void sass_delete_import_list (Sass_Import_Entry * );
78
78
// Just in case we have some stray import structs
79
- void sass_delete_import (struct Sass_Import * );
79
+ void sass_delete_import (Sass_Import_Entry );
80
80
```
81
81
82
82
### More links
0 commit comments