@@ -7,7 +7,7 @@ With this module it is possible to declare inline C code in nodejs
77and run it on the fly. This is possible due to the fascinating
88Tiny C Compiler originally made by Fabrice Bellard.
99
10- ** Requires** : <code >module: node-gyp </code >, <code >module: ffi </code >, <code >module: ref </code >
10+ ** Requires** : <code >module: node-gyp </code >, <code >module:@ napi- ffi/ffi-napi </code >, <code >module:@ napi-ffi/ ref-napi </code >
1111** Note** : The module is still alpha, interfaces are still likely to change a lot.
1212** Example**
1313``` js
@@ -111,7 +111,7 @@ let state1 = Tcc();
111111...
112112state1 .compile (' ...' ) && state1 .relocate (); // finished with state1
113113
114- let state2 = Tcc (); // state1 got corrupted but we are with it anyways
114+ let state2 = Tcc (); // state1 got corrupted but we are done with it anyways
115115...
116116state2 .compile (' ...' ) && state2 .relocate (); // finished with state2
117117
@@ -499,7 +499,7 @@ It adds the following types:
499499| ulonglong | unsigned long long |
500500
501501Furthermore it includes ` <stddef.h> ` , ` <stdint.h> ` and ` <stdbool.h> ` .
502- If the module ` ref-wchar ` is installed, ` WCString ` is typedef'd as
502+ If the module ` ref-wchar-napi ` is installed, ` WCString ` is typedef'd as
503503` wchar_t ` pointer.
504504
505505** Kind** : instance method of [ <code >CodeGenerator</code >] ( #module_node-tinycc.CodeGenerator )
@@ -563,7 +563,7 @@ corresponding type.
563563Helper function for easy wide string creation.
564564
565565** Kind** : static method of [ <code >node-tinycc</code >] ( #module_node-tinycc )
566- ** Note** : The function is only exported, if the module ` ref-wchar ` is installed.
566+ ** Note** : The function is only exported, if the module ` ref-wchar-napi ` is installed.
567567
568568| Param | Type |
569569| --- | --- |
@@ -577,7 +577,7 @@ This is useful when writing C source code strings directly in Javascript.
577577The function escapes the UTF-8 input to the appropriate wchar_t type.
578578
579579** Kind** : static method of [ <code >node-tinycc</code >] ( #module_node-tinycc )
580- ** Note** : The function is only exported, if the module ` ref-wchar ` is installed.
580+ ** Note** : The function is only exported, if the module ` ref-wchar-napi ` is installed.
581581
582582| Param | Type |
583583| --- | --- |
@@ -615,7 +615,7 @@ until we got the real C symbol pointer.
615615
616616<a name =" module_node-tinycc.c_callable " ></a >
617617
618- ### tcc.c_callable (restype, name, args, f) ⇒ <code >Declaration</code >
618+ ### tcc.c \_ callable (restype, name, args, f) ⇒ <code >Declaration</code >
619619Convenvient declaration function to import a function symbol from JS to C code.
620620
621621The function creates a function pointer declaration in C. After
@@ -641,7 +641,7 @@ gen.addDeclaration(decl);
641641
642642<a name =" module_node-tinycc.c_function " ></a >
643643
644- ### tcc.c_function (restype, name, args, code) ⇒ <code >func</code >
644+ ### tcc.c \_ function (restype, name, args, code) ⇒ <code >func</code >
645645Convenient declaration function to create a C function that is usable from Javascript.
646646
647647The Javascript code:
@@ -682,10 +682,10 @@ console.log(add(23, 42)); // use it
682682
683683<a name =" module_node-tinycc.c_struct " ></a >
684684
685- ### tcc.c_struct (name, structType) ⇒ <code >StructType</code >
685+ ### tcc.c \_ struct (name, structType) ⇒ <code >StructType</code >
686686Convenient declaration function to declare a struct type usable in C and Javascript.
687687
688- This function extracts the field names and types of a StructType (module ` ref-struct ` )
688+ This function extracts the field names and types of a StructType (module ` ref-struct-napi ` )
689689to create a struct declaration (forward section) and definition for C (code section).
690690A field type is resolved recursively to catch complicated type mixtures that
691691can easily be build with StructTypes, ArrayTypes and pointer types
@@ -695,7 +695,7 @@ struct type by `struct name` in C. The struct type can be used at any point wher
695695a ` ref.types ` type is needed, e.g. as function parameter or return type.
696696Usage example:
697697``` js
698- const StructType = require (' ref-struct' );
698+ const StructType = require (' ref-struct-napi ' );
699699let gen = tcc .CodeGenerator ();
700700let S = tcc .c_struct (' S' , StructType ({a: ' int' , b: ' char*' }));
701701addDeclaration (S );
0 commit comments