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}
@@ -166,6 +178,11 @@ static int lcurl_version(lua_State *L){
166178 return 1 ;
167179}
168180
181+ static int lcurl_debug_getregistry (lua_State * L ) {
182+ lua_rawgetp (L , LUA_REGISTRYINDEX , LCURL_REGISTRY );
183+ return 1 ;
184+ }
185+
169186static int push_upper (lua_State * L , const char * str ){
170187 char buffer [128 ];
171188 size_t i , n = strlen (str );
@@ -322,6 +339,8 @@ static const struct luaL_Reg lcurl_functions[] = {
322339 {"easy_option_by_id" , lcurl_easy_option_by_id },
323340 {"easy_option_by_name" , lcurl_easy_option_by_name },
324341#endif
342+
343+ {"__getregistry" , lcurl_debug_getregistry },
325344
326345 {NULL ,NULL }
327346};
@@ -343,6 +362,8 @@ static const struct luaL_Reg lcurl_functions_safe[] = {
343362 {"easy_option_by_name" , lcurl_easy_option_by_name },
344363#endif
345364
365+ { "__getregistry" , lcurl_debug_getregistry },
366+
346367 {NULL ,NULL }
347368};
348369
@@ -357,17 +378,6 @@ static const lcurl_const_t lcurl_flags[] = {
357378
358379static volatile int LCURL_INIT = 0 ;
359380
360- static const char * LCURL_REGISTRY = "LCURL Registry" ;
361- static const char * LCURL_USERVAL = "LCURL Uservalues" ;
362- #if LCURL_CURL_VER_GE (7 ,56 ,0 )
363- static const char * LCURL_MIME_EASY_MAP = "LCURL Mime easy" ;
364- #endif
365-
366- #if LCURL_CURL_VER_GE (7 ,56 ,0 )
367- #define NUP 3
368- #else
369- #define NUP 2
370- #endif
371381
372382#if LCURL_CURL_VER_GE (7 ,56 ,0 )
373383#define LCURL_PUSH_NUP (L ) lua_pushvalue(L, -NUP-1);lua_pushvalue(L, -NUP-1);lua_pushvalue(L, -NUP-1);
0 commit comments