Skip to content

Commit 53698b5

Browse files
syy
1 parent 8138f58 commit 53698b5

File tree

1 file changed

+3
-130
lines changed

1 file changed

+3
-130
lines changed

docs/ai_doc.md

Lines changed: 3 additions & 130 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
~~~c
44
// Public functions
55

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);
77

88

99
lua_Integer LuaCEmbed_get_total_args(LuaCEmbed *self);
@@ -59,15 +59,6 @@ void LuaCEmbed_clear_errors(LuaCEmbed *self);
5959
void LuaCEmbed_dangerous_raise_error_jumping(LuaCEmbed *self,const char *error_msg,...);
6060

6161
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);
7162

7263
// Public Functions
7364
int LuaCEmbed_evaluate(LuaCEmbed *self, const char *code, ...);
@@ -136,50 +127,8 @@ int LuaCemb_perform(LuaCEmbed *self);
136127
int LuaCembed_send_self_as_lib(LuaCEmbed *self);
137128

138129
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-
}
159130

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);}
163131
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-
}
183132
void LuaCEmbedTable_append_table(LuaCEmbedTable *self, LuaCEmbedTable *table);
184133

185134
void LuaCEmbedTable_append_evaluation(LuaCEmbedTable *self, const char *code, ...);
@@ -195,16 +144,7 @@ void LuaCEmbedTable_append_bool(LuaCEmbedTable *self, bool value);
195144
void LuaCEmbedTable_append_global(LuaCEmbedTable *self, const char *global_name);
196145

197146
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);
206147

207-
void privateLuaCEmbedTable_free_setting_nill(LuaCEmbedTable *self);
208148
void LuaCembedTable_destroy_prop(LuaCEmbedTable *self, const char *name);
209149

210150
void LuaCEmbedTable_destroy_by_index(LuaCEmbedTable *self, long index);
@@ -243,7 +183,6 @@ bool LuaCembedTable_get_bool_prop(LuaCEmbedTable *self, const char *name);
243183

244184
int LuaCEmbedTable_get_type_prop(LuaCEmbedTable *self, const char *name);
245185

246-
// No public functions defined in this file - only includes other modules
247186
// Public Functions:
248187

249188
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
304243
LuaCEmbedTable *LuaCEmbedTable_get_sub_table_by_key(LuaCEmbedTable *self, const char *name);
305244

306245
void LuaCEmbedTable_set_sub_table_prop(LuaCEmbedTable *self, const char *name, LuaCEmbedTable *sub_table);
246+
307247
typedef struct {
308248
LuaCEmbed *main_object;
309249
char *prop_name;
310250
char *global_name;
311251
void *sub_tables;
312252
long index;
313253
} LuaCEmbedTable;
314-
315-
316-
317-
LuaCEmbedTable *privateLuaCEmbedTableArray_find_by_internal_index(privateLuaCEmbedTableArray *self, lua_Integer internal_index);
318-
319-
void privateLuaCEmbedTableArray_free(privateLuaCEmbedTableArray *self);
320254
typedef struct LuaCEmbed{
321255
lua_State *state;
322256
const char *current_function;
@@ -366,64 +300,14 @@ typedef struct {
366300
char *table_prop_name;
367301
368302
}LuaCEmbedResponse;
303+
369304
#ifndef LUA_CEMBED_INDEX_DIF
370305
#define LUA_CEMBED_INDEX_DIF 1
371306
#endif
372307

373-
#define PRIVATE_LUA_EMBED_FILE_EVALUATION_TYPE 1
374-
#define PRIVATE_LUA_EMBED_STRING_EVALUATION_TYPE 2
375308
#define LUA_CEMBED_DEFAULT_TIMEOUT 10
376309
#define LUA_CEMBED_DEFAULT_MEMORY_LIMIT 100
377310

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
427311
#define LUA_CEMBED_OK 0
428312
#define LUA_CEMBED_GENERIC_ERROR (-1)
429313
#define LUA_CEMBED_NOT_FOUND LUA_TNONE
@@ -434,15 +318,6 @@ typedef struct {
434318
#define LUA_CEMBED_FUNCTION LUA_TFUNCTION
435319
#define LUA_CEMBED_TABLE LUA_TTABLE
436320

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-
446321
const char * LuaCembed_convert_arg_code(int arg_code);
447322

448323
LuaCEmbedNamespace newLuaCEmbedNamespace();
@@ -689,6 +564,4 @@ typedef struct {
689564
int FUNCTION;
690565
} LuaCEmbedTypeModule;
691566

692-
typedef lua_Integer private_lua_cembed_incremented_arg;
693-
694567
~~~

0 commit comments

Comments
 (0)