forked from openresty/meta-lua-nginx-module
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathngx_subsys_lua_api.h.tt2
More file actions
69 lines (40 loc) · 1.46 KB
/
ngx_subsys_lua_api.h.tt2
File metadata and controls
69 lines (40 loc) · 1.46 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
/*
* Copyright (C) Yichun Zhang (agentzh)
*/
#ifndef _NGX_[% SUBSYS %]_LUA_API_H_INCLUDED_
#define _NGX_[% SUBSYS %]_LUA_API_H_INCLUDED_
#include <nginx.h>
#include <ngx_core.h>
[% IF http_subsys %]
#include <ngx_http.h>
[% END %]
#include <lua.h>
#include <stdint.h>
/* Public API for other Nginx modules */
#define ngx_[% subsys %]_lua_version 10012
typedef struct {
uint8_t type;
union {
int b; /* boolean */
lua_Number n; /* number */
ngx_str_t s; /* string */
} value;
} ngx_[% subsys %]_lua_value_t;
#ifndef NGX_LUA_NO_FFI_API
typedef struct {
int len;
/* this padding hole on 64-bit systems is expected */
u_char *data;
} ngx_[% subsys %]_lua_ffi_str_t;
#endif /* NGX_LUA_NO_FFI_API */
lua_State *ngx_[% subsys %]_lua_get_global_state(ngx_conf_t *cf);
[% req_type %] *ngx_[% subsys %]_lua_get_request(lua_State *L);
ngx_int_t ngx_[% subsys %]_lua_add_package_preload(ngx_conf_t *cf,
const char *package, lua_CFunction func);
ngx_int_t ngx_[% subsys %]_lua_shared_dict_get(ngx_shm_zone_t *shm_zone,
u_char *key_data, size_t key_len, ngx_[% subsys %]_lua_value_t *value);
ngx_shm_zone_t *ngx_[% subsys %]_lua_find_zone(u_char *name_data, size_t name_len);
ngx_shm_zone_t *ngx_[% subsys %]_lua_shared_memory_add(ngx_conf_t *cf,
ngx_str_t *name, size_t size, void *tag);
#endif /* _NGX_[% SUBSYS %]_LUA_API_H_INCLUDED_ */
/* vi:set ft=c ts=4 sw=4 et fdm=marker: */