@@ -23,7 +23,7 @@ typedef char *(*req_field_string_f) (request_rec * r);
2323typedef int (* req_field_int_f ) (request_rec * r );
2424typedef apr_table_t * (* req_field_apr_table_f ) (request_rec * r );
2525
26- void apl_rstack_dump (lua_State * L , request_rec * r , const char * msg )
26+ void ap_lua_rstack_dump (lua_State * L , request_rec * r , const char * msg )
2727{
2828 int i ;
2929 int top = lua_gettop (L );
@@ -92,7 +92,7 @@ void apl_rstack_dump(lua_State *L, request_rec *r, const char *msg)
9292 * userdata thingamajig and return it if it is. if it is not
9393 * lua will enter its error handling routine.
9494 */
95- static request_rec * apl_check_request_rec (lua_State * L , int index )
95+ static request_rec * ap_lua_check_request_rec (lua_State * L , int index )
9696{
9797 request_rec * r ;
9898 luaL_checkudata (L , index , "Apache2.Request" );
@@ -154,7 +154,7 @@ static int req_aprtable2luatable_cb(void *l, const char *key,
154154static int req_parseargs (lua_State * L )
155155{
156156 apr_table_t * form_table ;
157- request_rec * r = apl_check_request_rec (L , 1 );
157+ request_rec * r = ap_lua_check_request_rec (L , 1 );
158158 lua_newtable (L );
159159 lua_newtable (L ); /* [table, table] */
160160 ap_args_to_table (r , & form_table );
@@ -165,7 +165,7 @@ static int req_parseargs(lua_State *L)
165165/* wrap ap_rputs as r:puts(String) */
166166static int req_puts (lua_State * L )
167167{
168- request_rec * r = apl_check_request_rec (L , 1 );
168+ request_rec * r = ap_lua_check_request_rec (L , 1 );
169169
170170 int argc = lua_gettop (L );
171171 int i ;
@@ -179,7 +179,7 @@ static int req_puts(lua_State *L)
179179/* wrap ap_rwrite as r:write(String) */
180180static int req_write (lua_State * L )
181181{
182- request_rec * r = apl_check_request_rec (L , 1 );
182+ request_rec * r = ap_lua_check_request_rec (L , 1 );
183183 size_t n ;
184184 const char * buf = luaL_checklstring (L , 2 , & n );
185185
@@ -191,7 +191,7 @@ static int req_write(lua_State *L)
191191static int req_parsebody (lua_State * L )
192192{
193193 apr_table_t * form_table ;
194- request_rec * r = apl_check_request_rec (L , 1 );
194+ request_rec * r = ap_lua_check_request_rec (L , 1 );
195195 lua_newtable (L );
196196 lua_newtable (L );
197197 if (ap_body_to_table (r , & form_table ) == APR_SUCCESS ) {
@@ -203,7 +203,7 @@ static int req_parsebody(lua_State *L)
203203/* r:addoutputfilter(name|function) */
204204static int req_add_output_filter (lua_State * L )
205205{
206- request_rec * r = apl_check_request_rec (L , 1 );
206+ request_rec * r = ap_lua_check_request_rec (L , 1 );
207207 const char * name = luaL_checkstring (L , 2 );
208208 ap_log_rerror (APLOG_MARK , APLOG_DEBUG , 0 , r , "adding output filter %s" ,
209209 name );
@@ -214,7 +214,7 @@ static int req_add_output_filter(lua_State *L)
214214/* BEGIN dispatch mathods for request_rec fields */
215215
216216/* not really a field, but we treat it like one */
217- static char * req_document_root (request_rec * r )
217+ static const char * req_document_root (request_rec * r )
218218{
219219 return ap_document_root (r );
220220}
@@ -321,7 +321,7 @@ static int req_dispatch(lua_State *L)
321321{
322322 apr_hash_t * dispatch ;
323323 req_fun_t * rft ;
324- request_rec * r = apl_check_request_rec (L , 1 );
324+ request_rec * r = ap_lua_check_request_rec (L , 1 );
325325 const char * name = luaL_checkstring (L , 2 );
326326 lua_pop (L , 2 );
327327
@@ -333,13 +333,13 @@ static int req_dispatch(lua_State *L)
333333 if (rft ) {
334334 switch (rft -> type ) {
335335 case APL_REQ_FUNTYPE_TABLE :{
336+ apr_table_t * rs ;
336337 req_field_apr_table_f func = rft -> fun ;
337338 ap_log_rerror (APLOG_MARK , APLOG_DEBUG , 0 , r ,
338339 "request_rec->dispatching %s -> apr table" ,
339340 name );
340- apr_table_t * rs ;
341341 rs = (* func )(r );
342- apl_push_apr_table (L , rs );
342+ ap_lua_push_apr_table (L , rs );
343343 return 1 ;
344344 }
345345
@@ -389,7 +389,7 @@ static int req_dispatch(lua_State *L)
389389static int req_log_at (lua_State * L , int level )
390390{
391391 const char * msg ;
392- request_rec * r = apl_check_request_rec (L , 1 );
392+ request_rec * r = ap_lua_check_request_rec (L , 1 );
393393 lua_Debug dbg ;
394394
395395 lua_getstack (L , 1 , & dbg );
@@ -448,7 +448,7 @@ static int req_newindex(lua_State *L)
448448 const char * key ;
449449 /* request_rec* r = lua_touserdata(L, lua_upvalueindex(1)); */
450450 /* const char* key = luaL_checkstring(L, -2); */
451- request_rec * r = apl_check_request_rec (L , 1 );
451+ request_rec * r = ap_lua_check_request_rec (L , 1 );
452452 key = luaL_checkstring (L , 2 );
453453 if (0 == apr_strnatcmp ("status" , key )) {
454454 int code = luaL_checkinteger (L , 3 );
@@ -508,7 +508,7 @@ static req_fun_t *makefun(void *fun, int type, apr_pool_t *pool)
508508 return rft ;
509509}
510510
511- void apl_load_request_lmodule (lua_State * L , apr_pool_t * p )
511+ AP_LUA_DECLARE ( void ) ap_lua_load_request_lmodule (lua_State * L , apr_pool_t * p )
512512{
513513
514514 apr_hash_t * dispatch = apr_hash_make (p );
@@ -614,14 +614,14 @@ void apl_load_request_lmodule(lua_State *L, apr_pool_t *p)
614614
615615}
616616
617- void apl_push_connection (lua_State * L , conn_rec * c )
617+ void ap_lua_push_connection (lua_State * L , conn_rec * c )
618618{
619619 lua_boxpointer (L , c );
620620 luaL_getmetatable (L , "Apache2.Connection" );
621621 lua_setmetatable (L , -2 );
622622 luaL_getmetatable (L , "Apache2.Connection" );
623623
624- apl_push_apr_table (L , c -> notes );
624+ ap_lua_push_apr_table (L , c -> notes );
625625 lua_setfield (L , -2 , "notes" );
626626
627627 lua_pushstring (L , c -> remote_ip );
@@ -631,7 +631,7 @@ void apl_push_connection(lua_State *L, conn_rec *c)
631631}
632632
633633
634- void apl_push_server (lua_State * L , server_rec * s )
634+ void ap_lua_push_server (lua_State * L , server_rec * s )
635635{
636636 lua_boxpointer (L , s );
637637 luaL_getmetatable (L , "Apache2.Server" );
@@ -644,7 +644,7 @@ void apl_push_server(lua_State *L, server_rec *s)
644644 lua_pop (L , 1 );
645645}
646646
647- void apl_push_request (lua_State * L , request_rec * r )
647+ AP_LUA_DECLARE ( void ) ap_lua_push_request (lua_State * L , request_rec * r )
648648{
649649 lua_boxpointer (L , r );
650650 luaL_getmetatable (L , "Apache2.Request" );
0 commit comments