1 /* This file has been automatically generated by builder part of the ferite distribution */
2 /* file:  reflection_Namespace.c */
3 /* class: Namespace */
4 
5 #include <ferite.h>       /* we need this without a doubt */
6 #include "reflection_header.h"  /* this is the module header */
7 
FE_NATIVE_FUNCTION(ferite_reflection_Namespace_getClasses_)8 FE_NATIVE_FUNCTION( ferite_reflection_Namespace_getClasses_ )
9 {
10    FeriteObject *self = FE_CONTAINER_TO_OBJECT;
11    FeriteObject *super = FE_CONTAINER_TO_OBJECT;
12 
13    { /* Main function body. */
14 #line 129 "reflection.fec"
15 
16 
17         FeriteVariable *v = reflection_ns_get_list( script, NSObj, FENS_CLS );
18         FE_RETURN_VAR(v);
19 
20    }
21    FE_RETURN_VOID;
22    self = NULL;
23    super = NULL;
24 }
25 
FE_NATIVE_FUNCTION(ferite_reflection_Namespace_getVariables_)26 FE_NATIVE_FUNCTION( ferite_reflection_Namespace_getVariables_ )
27 {
28    FeriteObject *self = FE_CONTAINER_TO_OBJECT;
29    FeriteObject *super = FE_CONTAINER_TO_OBJECT;
30 
31    { /* Main function body. */
32 #line 90 "reflection.fec"
33 
34 
35         FeriteVariable *array = NULL, *var = NULL, *tmp = NULL;
36         FeriteHashBucket *buk = NULL;
37         FeriteIterator *iter = NULL;
38 
39         ChkSelf;
40         array = ferite_create_uarray_variable(script, "ns::getVars", NSObj->data_fork->size, FE_STATIC);
41         iter = ferite_create_iterator(script);
42         while((buk = (FeriteHashBucket*)ferite_hash_walk(script, NSObj->data_fork,iter)) != NULL)
43         {
44             FeriteNamespaceBucket *b = buk->data;
45             if( b->type == FENS_VAR )
46             {
47                 tmp = b->data;
48                 var = fe_new_str(buk->id,ferite_variable_id_to_str( script, tmp->type ), 0, FE_CHARSET_DEFAULT);
49                 ferite_uarray_add(script,VAUA(array),var,buk->id, FE_ARRAY_ADD_AT_END );
50             }
51         }
52         ffree(iter);
53         FE_RETURN_VAR(array);
54 
55    }
56    FE_RETURN_VOID;
57    self = NULL;
58    super = NULL;
59 }
60 
FE_NATIVE_FUNCTION(ferite_reflection_Namespace_getNamespace_)61 FE_NATIVE_FUNCTION( ferite_reflection_Namespace_getNamespace_ )
62 {
63    FeriteObject *self = FE_CONTAINER_TO_OBJECT;
64    FeriteObject *super = FE_CONTAINER_TO_OBJECT;
65 
66    { /* Main function body. */
67 #line 151 "reflection.fec"
68 
69 
70         FeriteVariable *k = ferite_create_namespace_variable(script,"getNamespace()",NSObj,FE_STATIC);
71         FE_RETURN_VAR(k);
72 
73    }
74    FE_RETURN_VOID;
75    self = NULL;
76    super = NULL;
77 }
78 
FE_NATIVE_FUNCTION(ferite_reflection_Namespace_getFunctions_)79 FE_NATIVE_FUNCTION( ferite_reflection_Namespace_getFunctions_ )
80 {
81    FeriteObject *self = FE_CONTAINER_TO_OBJECT;
82    FeriteObject *super = FE_CONTAINER_TO_OBJECT;
83 
84    { /* Main function body. */
85 #line 118 "reflection.fec"
86 
87 
88         FeriteVariable *v = reflection_ns_get_list( script, NSObj, FENS_FNC );
89         FE_RETURN_VAR(v);
90 
91    }
92    FE_RETURN_VOID;
93    self = NULL;
94    super = NULL;
95 }
96 
FE_NATIVE_FUNCTION(ferite_reflection_Namespace_constructor_v)97 FE_NATIVE_FUNCTION( ferite_reflection_Namespace_constructor_v )
98 {
99    FeriteVariable *ns = params[0];
100    FeriteObject *self = FE_CONTAINER_TO_OBJECT;
101    FeriteObject *super = FE_CONTAINER_TO_OBJECT;
102 
103    ferite_get_parameters( params, 1, NULL );
104 
105    { /* Main function body. */
106 #line 74 "reflection.fec"
107 
108 
109         if( ns->type != F_VAR_NS )
110         {
111             FE_RETURN_NULL_OBJECT;
112         }
113         self->odata = VAN(ns);
114 
115    }
116    FE_RETURN_VOID;
117    self = NULL;
118    super = NULL;
119 }
120 
FE_NATIVE_FUNCTION(ferite_reflection_Namespace_fullyQualifiedName_)121 FE_NATIVE_FUNCTION( ferite_reflection_Namespace_fullyQualifiedName_ )
122 {
123    FeriteObject *self = FE_CONTAINER_TO_OBJECT;
124    FeriteObject *super = FE_CONTAINER_TO_OBJECT;
125 
126    { /* Main function body. */
127 #line 185 "reflection.fec"
128 
129 
130         char *n = ferite_generate_namespace_fqn( script, NSObj );
131         FE_RETURN_CSTR( n, FE_TRUE );
132 
133    }
134    FE_RETURN_VOID;
135    self = NULL;
136    super = NULL;
137 }
138 
FE_NATIVE_FUNCTION(ferite_reflection_Namespace_getNamespaces_)139 FE_NATIVE_FUNCTION( ferite_reflection_Namespace_getNamespaces_ )
140 {
141    FeriteObject *self = FE_CONTAINER_TO_OBJECT;
142    FeriteObject *super = FE_CONTAINER_TO_OBJECT;
143 
144    { /* Main function body. */
145 #line 140 "reflection.fec"
146 
147 
148         FeriteVariable *v = reflection_ns_get_list( script, NSObj, FENS_NS );
149         FE_RETURN_VAR(v);
150 
151    }
152    FE_RETURN_VOID;
153    self = NULL;
154    super = NULL;
155 }
156 
FE_NATIVE_FUNCTION(ferite_reflection_Namespace_getScriptNamespace_)157 FE_NATIVE_FUNCTION( ferite_reflection_Namespace_getScriptNamespace_ )
158 {
159    FeriteClass *self = FE_CONTAINER_TO_CLASS;
160 
161    { /* Main function body. */
162 #line 163 "reflection.fec"
163 
164 
165         FeriteVariable **params = fmalloc(sizeof(FeriteVariable*) * 2);
166         FeriteVariable  *ns = NULL;
167 
168         params[0] = ferite_create_namespace_variable(script, "NS", script->mainns, FE_STATIC);
169         MARK_VARIABLE_AS_DISPOSABLE(params[0]);
170         params[1] = NULL;
171 
172         ns = ferite_new_object( script, self, params );
173         ferite_delete_parameter_list( script, params );
174 
175         if( ns != NULL )
176             FE_RETURN_VAR(ns);
177         FE_RETURN_NULL_OBJECT;
178 
179    }
180    FE_RETURN_VOID;
181    self = NULL;
182 }
183 
184