icedb  version 0.5.1
Snow particle scattering database API
error_context.h
Go to the documentation of this file.
1 #pragma once
2 #ifndef ICEDB_H_ERROR_CONTEXT
3 #define ICEDB_H_ERROR_CONTEXT
4 #include "defs.h"
5 #include "error.h"
7 
15  char* varname;
16  char* val;
17  };
21  size_t message_size;
23  char* message_text;
27  };
28 
30 
33  typedef struct ICEDB_error_context* (*ICEDB_error_context_create_impl_f)(int,const char*, int, const char*);
35 #define ICEDB_error_context_create(x) ICEDB_error_context_create_impl(x, (__FILE__), (int)__LINE__,(ICEDB_DEBUG_FSIG));
36 
38  typedef struct ICEDB_error_context* (*ICEDB_error_context_copy_f)(const struct ICEDB_error_context*);
40 
42  typedef void (*ICEDB_error_context_appendA_f)(struct ICEDB_error_context*, size_t sz, const char* data);
43  typedef void (*ICEDB_error_context_append_strA_f)(struct ICEDB_error_context*, const char* data);
46 
49  size_t var_sz, const char* var_name, size_t val_sz, const char* var_val);
52  const char* var_name, const char* var_val);
54 
56  typedef void (*ICEDB_error_context_widen_f)(struct ICEDB_error_context*, size_t numNewSpaces);
58 
59 
60 #define ICEDB_error_context_append ICEDB_error_context_appendA
61 #define ICEDB_error_context_append_str ICEDB_error_context_append_strA
62 #define ICEDB_error_context_add_string ICEDB_error_context_add_stringA
63 #define ICEDB_error_context_add_string2 ICEDB_error_context_add_string2A
64 /*#ifdef UNICODE
65 #define ICEDB_error_context_append ICEDB_error_context_appendW
66 #define ICEDB_error_context_append_str ICEDB_error_context_append_strW
67 #define ICEDB_error_context_add_string ICEDB_error_context_add_stringW
68 #define ICEDB_error_context_add_string2 ICEDB_error_context_add_string2W
69 #else
70 #define ICEDB_error_context_append ICEDB_error_context_appendA
71 #define ICEDB_error_context_append_str ICEDB_error_context_append_strA
72 #define ICEDB_error_context_add_string ICEDB_error_context_add_stringA
73 #define ICEDB_error_context_add_string2 ICEDB_error_context_add_string2A
74 #endif*/
75 
85  };
87 
88  // end of errs
91 #endif
ICEDB_error_context_appendA_f appendA
Definition: error_context.h:80
#define DL_ICEDB
Definition: defs.h:124
DL_ICEDB ICEDB_error_context_widen_f ICEDB_error_context_widen
#define ICEDB_BEGIN_DECL_C
Definition: defs.h:20
ICEDB_error_context_append_strA_f appendStrA
Definition: error_context.h:81
ICEDB_error_context_widen_f widen
Definition: error_context.h:84
void(* ICEDB_error_context_append_strA_f)(struct ICEDB_error_context *, const char *data)
Definition: error_context.h:43
ICEDB_error_code code
Definition: error_context.h:20
ICEDB_error_context_var_val * var_vals
Definition: error_context.h:26
#define ICEDB_END_DECL_C
Definition: defs.h:21
DL_ICEDB ICEDB_error_context_copy_f ICEDB_error_context_copy
DL_ICEDB ICEDB_error_context_appendA_f ICEDB_error_context_appendA
ICEDB_error_context_create_impl_f createImpl
Definition: error_context.h:78
void(* ICEDB_error_context_appendA_f)(struct ICEDB_error_context *, size_t sz, const char *data)
Definition: error_context.h:42
DL_ICEDB ICEDB_error_context_append_strA_f ICEDB_error_context_append_strA
ICEDB_THREAD_LOCAL ICEDB_error_context * __ICEDB_LOCAL_THREAD_error_context
ICEDB_error_context_copy_f copy
Definition: error_context.h:79
DL_ICEDB ICEDB_error_context_create_impl_f ICEDB_error_context_create_impl
struct ICEDB_error_context *(* ICEDB_error_context_create_impl_f)(int, const char *, int, const char *)
Definition: error_context.h:33
ICEDB_error_context_add_stringA_f addStringA
Definition: error_context.h:82
A convenience wrapper for all error functions.
Definition: error_context.h:77
DL_ICEDB ICEDB_error_context_add_string2A_f ICEDB_error_context_add_string2A
DL_ICEDB ICEDB_error_context_add_stringA_f ICEDB_error_context_add_stringA
DL_ICEDB const struct ICEDB_error_context_container_ftable ICEDB_ct_error_context
void(* ICEDB_error_context_add_stringA_f)(struct ICEDB_error_context *, size_t var_sz, const char *var_name, size_t val_sz, const char *var_val)
Definition: error_context.h:48
void(* ICEDB_error_context_add_string2A_f)(struct ICEDB_error_context *, const char *var_name, const char *var_val)
Definition: error_context.h:51
void(* ICEDB_error_context_widen_f)(struct ICEDB_error_context *, size_t numNewSpaces)
Definition: error_context.h:56
ICEDB_error_context_add_string2A_f addString2A
Definition: error_context.h:83
struct ICEDB_error_context *(* ICEDB_error_context_copy_f)(const struct ICEDB_error_context *)
Definition: error_context.h:38
int ICEDB_error_code
Definition: error.h:17