luasandbox  1.4.0
Generic Lua sandbox for dynamic data analysis
error.h
Go to the documentation of this file.
1 /* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* vim: set ts=2 et sw=2 tw=80: */
3 /* This Source Code Form is subject to the terms of the Mozilla Public
4  * License, v. 2.0. If a copy of the MPL was not distributed with this
5  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
6 
7 /** Error handling and logging @file */
8 
9 #ifndef luasandbox_error_h_
10 #define luasandbox_error_h_
11 
12 // See Identify your Errors better with char[]
13 // http://accu.org/index.php/journals/2184
14 typedef const char lsb_err_id[];
15 typedef const char *lsb_err_value;
16 #define lsb_err_string(s) s ? s : "<no error>"
17 
18 typedef void (*lsb_logger_cb)(void *context,
19  const char *component,
20  int level,
21  const char *fmt,
22  ...);
23 
24 typedef struct lsb_logger {
25  void *context;
27 } lsb_logger;
28 
29 #endif
const char * lsb_err_value
Definition: error.h:15
void(* lsb_logger_cb)(void *context, const char *component, int level, const char *fmt,...)
Definition: error.h:18
const char lsb_err_id[]
Definition: error.h:14
lsb_logger_cb cb
Definition: error.h:26
void * context
Definition: error.h:25
struct lsb_logger lsb_logger