2525# define LCURL_EXPORT_API LUALIB_API
2626#endif
2727
28+ static const char * LCURL_REGISTRY = "LCURL Registry" ;
29+ static const char * LCURL_USERVAL = "LCURL Uservalues" ;
30+ #if LCURL_CURL_VER_GE (7 ,56 ,0 )
31+ static const char * LCURL_MIME_EASY_MAP = "LCURL Mime easy" ;
32+ #endif
33+
34+ #if LCURL_CURL_VER_GE (7 ,56 ,0 )
35+ #define NUP 3
36+ #else
37+ #define NUP 2
38+ #endif
39+
2840static int lcurl_easy_new_safe (lua_State * L ){
2941 return lcurl_easy_create (L , LCURL_ERROR_RETURN );
3042}
@@ -78,6 +90,11 @@ static int lcurl_version(lua_State *L){
7890 return 1 ;
7991}
8092
93+ static int lcurl_debug_getregistry (lua_State * L ) {
94+ lua_rawgetp (L , LUA_REGISTRYINDEX , LCURL_REGISTRY );
95+ return 1 ;
96+ }
97+
8198static int push_upper (lua_State * L , const char * str ){
8299 char buffer [128 ];
83100 size_t i , n = strlen (str );
@@ -192,7 +209,9 @@ static const struct luaL_Reg lcurl_functions[] = {
192209#endif
193210 {"version" , lcurl_version },
194211 {"version_info" , lcurl_version_info },
195-
212+
213+ {"__getregistry" , lcurl_debug_getregistry },
214+
196215 {NULL ,NULL }
197216};
198217
@@ -208,6 +227,8 @@ static const struct luaL_Reg lcurl_functions_safe[] = {
208227 {"version" , lcurl_version },
209228 {"version_info" , lcurl_version_info },
210229
230+ { "__getregistry" , lcurl_debug_getregistry },
231+
211232 {NULL ,NULL }
212233};
213234
@@ -222,17 +243,6 @@ static const lcurl_const_t lcurl_flags[] = {
222243
223244static volatile int LCURL_INIT = 0 ;
224245
225- static const char * LCURL_REGISTRY = "LCURL Registry" ;
226- static const char * LCURL_USERVAL = "LCURL Uservalues" ;
227- #if LCURL_CURL_VER_GE (7 ,56 ,0 )
228- static const char * LCURL_MIME_EASY_MAP = "LCURL Mime easy" ;
229- #endif
230-
231- #if LCURL_CURL_VER_GE (7 ,56 ,0 )
232- #define NUP 3
233- #else
234- #define NUP 2
235- #endif
236246
237247#if LCURL_CURL_VER_GE (7 ,56 ,0 )
238248#define LCURL_PUSH_NUP (L ) lua_pushvalue(L, -NUP-1);lua_pushvalue(L, -NUP-1);lua_pushvalue(L, -NUP-1);
0 commit comments