Improving the debug capabilities of the heap code, changed VFS to use const char...
[tpg/acess2.git] / Usermode / Libraries / libspiderscript.so_src / exports.c
1 /*
2  * Acess2 - SpiderScript
3  * - Script Exports (Lang. Namespace)
4  */
5 #include <string.h>
6 #include <stdlib.h>
7 #include <stdio.h>
8 #include <spiderscript.h>
9
10 // === PROTOTYPES ===
11 tSpiderValue    *Exports_Lang_Struct(tSpiderScript *Script, int NArgs, tSpiderValue **Args);
12
13 // === GLOBALS ===
14  int    gaExports_Lang_Struct_Args[] = {SS_DATATYPE_STRING,-1};
15
16 tSpiderFunction gaSpiderScript_Exports[] = {
17         {"Lang.Struct", Exports_Lang_Struct, gaExports_Lang_Struct_Args}
18 };
19 const int       giSpiderScript_NumExports = sizeof(gaSpiderScript_Exports)/sizeof(tSpiderFunction);
20
21 // === CODE ===
22 tSpiderValue *Exports_Lang_Struct(tSpiderScript *Script, int NArgs, tSpiderValue **Args)
23 {
24          int    i;
25         printf("Exports_Lang_Struct: (Script=%p, NArgs=%i, Args=%p)\n", Script, NArgs, Args);
26         
27         for( i = 0; i < NArgs; i ++ )
28         {
29                 printf(" Args[%i] = {Type: %i, ", i, Args[i]->Type);
30                 switch(Args[i]->Type)
31                 {
32                 case SS_DATATYPE_INTEGER:
33                         printf(" Integer: 0x%lx", Args[i]->Integer);
34                         break;
35                 case SS_DATATYPE_REAL:
36                         printf(" Real: %f", Args[i]->Real);
37                         break;
38                 case SS_DATATYPE_STRING:
39                         printf(" Length: %i, Data = '%s'", Args[i]->String.Length, Args[i]->String.Data);
40                         break;
41                 default:
42                         break;
43                 }
44                 printf("}\n");
45         }
46         
47         return NULL;
48 }

UCC git Repository :: git.ucc.asn.au