2
* Copyright (c) 2005 Massachusetts Institute of Technology
4
* Permission is hereby granted, free of charge, to any person
5
* obtaining a copy of this software and associated documentation
6
* files (the "Software"), to deal in the Software without
7
* restriction, including without limitation the rights to use, copy,
8
* modify, merge, publish, distribute, sublicense, and/or sell copies
9
* of the Software, and to permit persons to whom the Software is
10
* furnished to do so, subject to the following conditions:
12
* The above copyright notice and this permission notice shall be
13
* included in all copies or substantial portions of the Software.
15
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
16
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
17
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
18
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
19
* BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
20
* ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
21
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
27
#ifndef __KHIMAIRA_KHERRORINTERNAL_H
28
#define __KHIMAIRA_KHERRORINTERNAL_H
37
#define IS_KHERR_CTX(c) ((c) && (c)->magic == KHERR_CONTEXT_MAGIC)
38
#define IS_KHERR_EVENT(e) ((e) && (e)->magic == KHERR_EVENT_MAGIC)
40
typedef struct tag_kherr_thread {
46
#define THREAD_STACK_SIZE 8
48
typedef struct tag_kherr_handler_node {
54
#define CTX_ALLOC_INCR 4
56
#define EVENT_MASK_UNRESOLVED \
57
(KHERR_RF_RES_SHORT_DESC|KHERR_RF_MSG_SHORT_DESC| \
58
KHERR_RF_RES_LONG_DESC|KHERR_RF_MSG_LONG_DESC| \
59
KHERR_RF_RES_SUGGEST|KHERR_RF_MSG_SUGGEST)
61
extern CRITICAL_SECTION cs_error;
62
extern DWORD tls_error;
63
extern kherr_context * ctx_free_list;
64
extern kherr_event * evt_free_list;
65
extern kherr_handler_node * ctx_handlers;
66
extern khm_size n_ctx_handlers;
68
#define parm_type(p) ((p).type)
69
#define parm_data(p) ((p).data)
71
void resolve_event_strings(kherr_event *);
72
void attach_this_thread(void);
73
void detach_this_thread(void);