You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/api-doc.md
+29-11Lines changed: 29 additions & 11 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -16,24 +16,14 @@ This will automatically load all other headers too!
16
16
#include"sass/context.h"
17
17
```
18
18
19
-
### Deprecated usage
20
-
21
-
The old API is kept in the source for backward compatibility.
22
-
It's deprecated and incompatible with this documentation, use `sass/context.h`!
23
-
24
-
```C
25
-
// deprecated interface
26
-
#include"sass/interface.h"
27
-
```
28
-
29
19
## Basic C Example
30
20
31
21
```C
32
22
#include<stdio.h>
33
23
#include"sass/context.h"
34
24
35
25
intmain() {
36
-
puts(libsass_VERSION());
26
+
puts(libsass_version());
37
27
return 0;
38
28
}
39
29
```
@@ -114,6 +104,34 @@ This mirrors very well how `libsass` uses these structures.
114
104
115
105
Structs can be down-casted to access `context` or `options`!
116
106
107
+
## Memory handling and life-cycles
108
+
109
+
We keep memory around for as long as the main [context](api-context.md) object is not destroyed (`sass_delete_context`). LibSass will create copies of most inputs/options beside the main sass code.
110
+
You need to allocate and fill that buffer before passing it to LibSass. You may also overtake memory management from libsass for certain return values (i.e. `sass_context_take_output_string`).
0 commit comments