7
#include "ngx_http_lua_consts.h"
11
ngx_http_lua_inject_core_consts(lua_State *L)
13
/* {{{ core constants */
14
lua_pushinteger(L, NGX_OK);
15
lua_setfield(L, -2, "OK");
17
lua_pushinteger(L, NGX_AGAIN);
18
lua_setfield(L, -2, "AGAIN");
20
lua_pushinteger(L, NGX_DONE);
21
lua_setfield(L, -2, "DONE");
23
lua_pushinteger(L, NGX_ERROR);
24
lua_setfield(L, -2, "ERROR");
30
ngx_http_lua_inject_http_consts(lua_State *L)
32
/* {{{ HTTP status constants */
33
lua_pushinteger(L, NGX_HTTP_GET);
34
lua_setfield(L, -2, "HTTP_GET");
36
lua_pushinteger(L, NGX_HTTP_POST);
37
lua_setfield(L, -2, "HTTP_POST");
39
lua_pushinteger(L, NGX_HTTP_PUT);
40
lua_setfield(L, -2, "HTTP_PUT");
42
lua_pushinteger(L, NGX_HTTP_DELETE);
43
lua_setfield(L, -2, "HTTP_DELETE");
45
lua_pushinteger(L, NGX_HTTP_HEAD);
46
lua_setfield(L, -2, "HTTP_HEAD");
48
lua_pushinteger(L, NGX_HTTP_OK);
49
lua_setfield(L, -2, "HTTP_OK");
51
lua_pushinteger(L, NGX_HTTP_CREATED);
52
lua_setfield(L, -2, "HTTP_CREATED");
54
lua_pushinteger(L, NGX_HTTP_SPECIAL_RESPONSE);
55
lua_setfield(L, -2, "HTTP_SPECIAL_RESPONSE");
57
lua_pushinteger(L, NGX_HTTP_MOVED_PERMANENTLY);
58
lua_setfield(L, -2, "HTTP_MOVED_PERMANENTLY");
60
lua_pushinteger(L, NGX_HTTP_MOVED_TEMPORARILY);
61
lua_setfield(L, -2, "HTTP_MOVED_TEMPORARILY");
63
#if defined(nginx_version) && nginx_version >= 8042
64
lua_pushinteger(L, NGX_HTTP_SEE_OTHER);
65
lua_setfield(L, -2, "HTTP_SEE_OTHER");
68
lua_pushinteger(L, NGX_HTTP_NOT_MODIFIED);
69
lua_setfield(L, -2, "HTTP_NOT_MODIFIED");
71
lua_pushinteger(L, NGX_HTTP_BAD_REQUEST);
72
lua_setfield(L, -2, "HTTP_BAD_REQUEST");
74
lua_pushinteger(L, NGX_HTTP_UNAUTHORIZED);
75
lua_setfield(L, -2, "HTTP_UNAUTHORIZED");
78
lua_pushinteger(L, NGX_HTTP_FORBIDDEN);
79
lua_setfield(L, -2, "HTTP_FORBIDDEN");
81
lua_pushinteger(L, NGX_HTTP_NOT_FOUND);
82
lua_setfield(L, -2, "HTTP_NOT_FOUND");
84
lua_pushinteger(L, NGX_HTTP_NOT_ALLOWED);
85
lua_setfield(L, -2, "HTTP_NOT_ALLOWED");
87
lua_pushinteger(L, 410);
88
lua_setfield(L, -2, "HTTP_GONE");
90
lua_pushinteger(L, NGX_HTTP_INTERNAL_SERVER_ERROR);
91
lua_setfield(L, -2, "HTTP_INTERNAL_SERVER_ERROR");
93
lua_pushinteger(L, NGX_HTTP_SERVICE_UNAVAILABLE);
94
lua_setfield(L, -2, "HTTP_SERVICE_UNAVAILABLE");