forked from openresty/lua-nginx-module
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathngx_http_lua_log_ringbuf.h
More file actions
31 lines (21 loc) · 1009 Bytes
/
Copy pathngx_http_lua_log_ringbuf.h
File metadata and controls
31 lines (21 loc) · 1009 Bytes
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
#ifndef _NGX_HTTP_LUA_RINGBUF_H_INCLUDED_
#define _NGX_HTTP_LUA_RINGBUF_H_INCLUDED_
#include "ngx_http_lua_common.h"
typedef struct {
ngx_uint_t filter_level;
char *tail; /* writed point */
char *head; /* readed point */
char *data; /* buffer */
char *sentinel;
size_t size; /* buffer total size */
size_t count; /* count of logs */
} ngx_http_lua_log_ringbuf_t;
void ngx_http_lua_log_ringbuf_init(ngx_http_lua_log_ringbuf_t *rb,
void *buf, size_t len);
void ngx_http_lua_log_ringbuf_reset(ngx_http_lua_log_ringbuf_t *rb);
ngx_int_t ngx_http_lua_log_ringbuf_read(ngx_http_lua_log_ringbuf_t *rb,
int *log_level, void **buf, size_t *n, double *log_time);
ngx_int_t ngx_http_lua_log_ringbuf_write(ngx_http_lua_log_ringbuf_t *rb,
int log_level, void *buf, size_t n);
#endif /* _NGX_HTTP_LUA_RINGBUF_H_INCLUDED_ */
/* vi:set ft=c ts=4 sw=4 et fdm=marker: */