summaryrefslogtreecommitdiff
path: root/ngx_lua-0.10.28/src/ngx_http_lua_exception.h
blob: 93dfb8f57a000715c6c8ab0b12c08fff13163251 (plain)
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
/*
 * Copyright (C) Xiaozhe Wang (chaoslawful)
 * Copyright (C) Yichun Zhang (agentzh)
 */


#ifndef _NGX_HTTP_LUA_EXCEPTION_H_INCLUDED_
#define _NGX_HTTP_LUA_EXCEPTION_H_INCLUDED_


#include "ngx_http_lua_common.h"


#define NGX_LUA_EXCEPTION_TRY                                                \
    if (setjmp(ngx_http_lua_exception) == 0)

#define NGX_LUA_EXCEPTION_CATCH                                              \
    else

#define NGX_LUA_EXCEPTION_THROW(x)                                           \
    longjmp(ngx_http_lua_exception, (x))


extern jmp_buf ngx_http_lua_exception;


int ngx_http_lua_atpanic(lua_State *L);


#endif /* _NGX_HTTP_LUA_EXCEPTION_H_INCLUDED_ */

/* vi:set ft=c ts=4 sw=4 et fdm=marker: */