3
3
~~~ c
4
4
// Public functions
5
5
6
- int LuaCEmbed_ensure_arg_exist (LuaCEmbed * self, private_lua_cembed_incremented_arg index);
6
+ int LuaCEmbed_ensure_arg_exist (LuaCEmbed * self, lua_Integer index);
7
7
8
8
9
9
lua_Integer LuaCEmbed_get_total_args(LuaCEmbed * self);
@@ -59,15 +59,6 @@ void LuaCEmbed_clear_errors(LuaCEmbed *self);
59
59
void LuaCEmbed_dangerous_raise_error_jumping(LuaCEmbed * self,const char * error_msg,...);
60
60
61
61
void LuaCEmbed_dangerous_raise_self_error_jumping(LuaCEmbed * self);
62
- #ifdef _ WIN32
63
- VOID CALLBACK TimerHandler(HWND hwnd, UINT uMsg, UINT_PTR idEvent, DWORD dwTime);
64
- #else
65
- void private_LuaCembed_handle_timeout(int signum);
66
- #endif
67
-
68
- int privateLuaCEmbed_start_func_evaluation(lua_State * state);
69
- int private_LuaCEmbed_ensure_evaluation_type(LuaCEmbed * self,int type);
70
- int private_LuaCEmbed_evaluate_puting_on_top_of_stack(LuaCEmbed * self,const char * code, va_list args);
71
62
72
63
// Public Functions
73
64
int LuaCEmbed_evaluate(LuaCEmbed * self, const char * code, ...);
@@ -136,50 +127,8 @@ int LuaCemb_perform(LuaCEmbed *self);
136
127
int LuaCembed_send_self_as_lib(LuaCEmbed * self);
137
128
138
129
int LuaCembed_send_global_as_lib(LuaCEmbed * self,const char * global_name);
139
- #define PRIVATE_LUA_CEMBED_PROTECT_VOID \
140
- if(!self){ \
141
- return; \
142
- }
143
-
144
-
145
- #define PRIVATE_LUA_CEMBED_PROTECT_NUM \
146
- if(!self){ \
147
- return LUA_CEMBED_GENERIC_ERROR; \
148
- }
149
-
150
- #define PRIVATE_LUA_CEMBED_PROTECT_BOOL \
151
- if(!self){ \
152
- return false; \
153
- }
154
-
155
- #define PRIVATE_LUA_CEMBED_PROTECT_NULL \
156
- if(!self){ \
157
- return NULL; \
158
- }
159
130
160
- #define PRIVATE_LUA_CEMBED_TABLE_CLEAR_STACK if(lua_gettop(self->main_object->state)){lua_settop(self->main_object->state,0);}
161
-
162
- #define PRIVATE_LUA_CEMBED_CLEAR_STACK if(lua_gettop(self->state)){lua_settop(self->state,0);}
163
131
void LuaCEmbed_set_memory_limit(LuaCEmbed * self, double limit);
164
- #define PRIVATE_LUA_CEMBED_TABLE_PROTECT_VOID \
165
- if(!self){ \
166
- return; \
167
- }
168
-
169
- #define PRIVATE_LUA_CEMBED_TABLE_PROTECT_NUM \
170
- if(!self){ \
171
- return LUA_CEMBED_GENERIC_ERROR; \
172
- }
173
-
174
- #define PRIVATE_LUA_CEMBED_TABLE_PROTECT_BOOL \
175
- if(!self){ \
176
- return false; \
177
- }
178
-
179
- #define PRIVATE_LUA_CEMBED_TABLE_PROTECT_NULL \
180
- if(!self){ \
181
- return NULL; \
182
- }
183
132
void LuaCEmbedTable_append_table(LuaCEmbedTable * self, LuaCEmbedTable * table);
184
133
185
134
void LuaCEmbedTable_append_evaluation(LuaCEmbedTable * self, const char * code, ...);
@@ -195,16 +144,7 @@ void LuaCEmbedTable_append_bool(LuaCEmbedTable *self, bool value);
195
144
void LuaCEmbedTable_append_global(LuaCEmbedTable * self, const char * global_name);
196
145
197
146
void LuaCEmbedTable_append_arg(LuaCEmbedTable * self, int index);
198
- // Public functions (none found in this code)
199
-
200
- // Private functions
201
- LuaCEmbedTable * private_newLuaCembedTable(LuaCEmbed * main_embed, const char * format, ...);
202
-
203
- int private_lua_cEmbed_unpack(LuaCEmbedTable * self, const char * previews_function);
204
-
205
- void privateLuaCEmbedTable_free(LuaCEmbedTable * self);
206
147
207
- void privateLuaCEmbedTable_free_setting_nill(LuaCEmbedTable * self);
208
148
void LuaCembedTable_destroy_prop(LuaCEmbedTable * self, const char * name);
209
149
210
150
void LuaCEmbedTable_destroy_by_index(LuaCEmbedTable * self, long index);
@@ -243,7 +183,6 @@ bool LuaCembedTable_get_bool_prop(LuaCEmbedTable *self, const char *name);
243
183
244
184
int LuaCEmbedTable_get_type_prop(LuaCEmbedTable * self, const char * name);
245
185
246
- // No public functions defined in this file - only includes other modules
247
186
// Public Functions:
248
187
249
188
void LuaCEmbedTable_set_string_by_index(LuaCEmbedTable * self, lua_Integer index, const char * value);
@@ -304,19 +243,14 @@ LuaCEmbedTable *LuaCEmbedTable_new_sub_table_by_key(LuaCEmbedTable *self, const
304
243
LuaCEmbedTable * LuaCEmbedTable_get_sub_table_by_key(LuaCEmbedTable * self, const char * name);
305
244
306
245
void LuaCEmbedTable_set_sub_table_prop(LuaCEmbedTable * self, const char * name, LuaCEmbedTable * sub_table);
246
+
307
247
typedef struct {
308
248
LuaCEmbed * main_object;
309
249
char * prop_name;
310
250
char * global_name;
311
251
void * sub_tables;
312
252
long index;
313
253
} LuaCEmbedTable;
314
-
315
-
316
-
317
- LuaCEmbedTable * privateLuaCEmbedTableArray_find_by_internal_index(privateLuaCEmbedTableArray * self, lua_Integer internal_index);
318
-
319
- void privateLuaCEmbedTableArray_free(privateLuaCEmbedTableArray * self);
320
254
typedef struct LuaCEmbed{
321
255
lua_State * state;
322
256
const char * current_function;
@@ -366,64 +300,14 @@ typedef struct {
366
300
char *table_prop_name;
367
301
368
302
}LuaCEmbedResponse;
303
+
369
304
#ifndef LUA_CEMBED_INDEX_DIF
370
305
#define LUA_CEMBED_INDEX_DIF 1
371
306
#endif
372
307
373
- #define PRIVATE_LUA_EMBED_FILE_EVALUATION_TYPE 1
374
- #define PRIVATE_LUA_EMBED_STRING_EVALUATION_TYPE 2
375
308
#define LUA_CEMBED_DEFAULT_TIMEOUT 10
376
309
#define LUA_CEMBED_DEFAULT_MEMORY_LIMIT 100
377
310
378
- #define PRIVATE_LUA_CEMBED_ONE_MB (1024 * 1024)
379
- #define PRIVATE_LUA_CEMBED_TIMEOUT_ERROR "timeout error"
380
- #define PRIVATE_LUA_CEMBED_ARG_NOT_PROVIDED "arg %ld at function:%s not provided"
381
- #define PRIVATE_LUA_CEMBED_ARG_WRONG_TYPE "arg %d at function:%s its %s instead of %s"
382
- #define PRIVATE_LUA_CEMBED_GLOBAL_WRONG_TYPE "global variable:%s its %s instead of %s"
383
- #define PRIVATE_LUA_CEMBED_RESULT_EVALUATION_WRONG_TYPE "result evaluation its:%s instead of %s"
384
- #define PRIVATE_LUA_CEMBED_RESULT_EVALUATION_ARG_WRONG_TYPE "result evaluation of function %s at index %d its:%s instead of %s"
385
- #define PRIVATE_LUA_CEMBED_CODE_ITS_NOT_A_FUNCTION "value %s its not a function"
386
- #define PRIVATE_LUA_CEMBED_WRONG_TYPE_PROPETY "propety %s at object %s its %s instead of %s"
387
- #define PRIVATE_LUA_CEMBED_WRONG_TYPE_INDEX "index %d at object %s its %s instead of %s"
388
- #define PRIVATE_LUA_CEMBED_ELEMENT_DOES_NOT_HAVE_KEY "index %d at object %s not have a key"
389
- #define PRIVVATE_LUA_CEMBED_TIMEOUT_ERROR "timeout error"
390
- #define PRIVATE_LUA_CEMBED_LIB_PROP_WRONG_TYPE "lib prop %s its %s insteadd of %s"
391
-
392
- #define PRIVATE_LUA_CEMBED_TOTAL_LIBS "private_lua_c_embed_total_running_libs"
393
- #define PRIVATE_LUA_CEMBED_STACK_LEVEL "private_lua_c_embed_stack_level"
394
-
395
- #define PRIVATE_LUA_CEMBED_EVALUATION_NAME "private_lua_c_embed_evaluation"
396
- #define PRIVATE_LUA_CEMBED_DEL_PREFIX "__ gc"
397
- #define PRIVATE_LUA_CEMBED_GLOBAL_EVALUATION_CODE "%s = %s\n"
398
-
399
-
400
-
401
-
402
- #define PRIVATE_LUA_CEMBED_SELFNAME "private_lua_c_embed_self"
403
- #define PRIVATE_LUA_CEMBED_STAGE_AREA_TABLE "private_lua_c_embed_stage_area_table"
404
- #define PRIVATE_LUA_CEMBED_TABLE_RETURN "private_lua_embed_table_return"
405
-
406
- #define PRIVATE_LUA_CEMBED_MAIN_LIB_TABLE_NAME__ "private_lua_c_embed_main_lib_table_ %d"
407
- #define PRIVATE_LUA_CEMBED_MAIN_LIB_SUB_TABLE "private_lua_c_embed_main_lib_table_ %d_ %s"
408
-
409
- #define PRIVATE_LUA_CEMBED_MAIN_META_TABLE__ "private_lua_c_embed_main_meta_table_ %d"
410
- #define PRIVATE_LUA_CEMBED_ANONYMOUS_TABLE_ "private_lua_c_embed_anononymous_table_ %d_ %d"
411
- #define PRIVATE_LUA_CEMBED_ANONYMOUS_FUNC_TABLE_ "private_lua_c_embed_anononymous_func_table_ %d_ %d"
412
- #define PRIVATE_LUA_CEMBED_ARGS_ "private_lua_c_embed_args_ %d_ %d"
413
- #define PRIVATE_LUA_CEMBED_MULTIRETURN_ "private_lua_c_embed_multi_return_ %d_ %d"
414
- #define PRIVATE_LUA_CEMBED_GENERAL_TEMP "private_lua_c_embed_general_temp_ %d"
415
- #define PRIVATE_LUACEMBED_NO_RETURN 0
416
- #define PRIVATE_LUACEMBED_ONE_RETURN 1
417
- #define PRIVATE_LUA_CEMBED_STRING_RESPONSE 1
418
- #define PRIVATE_LUA_CEMBED_LONG_RESPONSE 2
419
- #define PRIVATE_LUA_CEMBED_DOUBLE_RESPONSE 3
420
- #define PRIVATE_LUA_CEMBED_BOOL_RESPONSE 4
421
- #define PRIVATE_LUA_CEMBED_TABLE_RESPONSE 5
422
-
423
- #define PRIVATE_LUA_CEMBED_EVALUATION 6
424
- #define PRIVATE_LUA_CEMBED_ERROR_RESPONSE 7
425
- #define PRIVATE_LUA_CEMBED_MULTI_RESPONSE 8
426
- #define PRIVATE_LUA_CEMBED_TABLE_PROP_RESPONSE 9
427
311
#define LUA_CEMBED_OK 0
428
312
#define LUA_CEMBED_GENERIC_ERROR (-1)
429
313
#define LUA_CEMBED_NOT_FOUND LUA_TNONE
@@ -434,15 +318,6 @@ typedef struct {
434
318
#define LUA_CEMBED_FUNCTION LUA_TFUNCTION
435
319
#define LUA_CEMBED_TABLE LUA_TTABLE
436
320
437
- #define PRIVATE_LUA_CEMBED_NOT_FOUND_STRING "not Found"
438
- #define PRIVATE_LUA_CEMBED_STRING_STRING "string"
439
- #define PRIVATE_LUA_CEMBED_NUMBER_STRING "number"
440
- #define PRIVATE_LUA_CEMBED_BOOL_STRING "boolean"
441
- #define PRIVATE_LUA_CEMBED_NIL_STRING "nil"
442
- #define PRIVATE_LUA_CEMBED_TABLE_STRING "table"
443
- #define PRIVATE_LUA_CEMBED_FUNCTION_STRING "function"
444
- #define PRIVATE_LUA_CEMBED_UNKNOW_STRING "unknow"
445
-
446
321
const char * LuaCembed_convert_arg_code(int arg_code);
447
322
448
323
LuaCEmbedNamespace newLuaCEmbedNamespace();
@@ -689,6 +564,4 @@ typedef struct {
689
564
int FUNCTION;
690
565
} LuaCEmbedTypeModule;
691
566
692
- typedef lua_Integer private_lua_cembed_incremented_arg;
693
-
694
567
~~~
0 commit comments