|
Wireshark 4.7.0
The Wireshark network protocol analyzer
|
#include <glib.h>#include <setjmp.h>#include <stdlib.h>#include <stdarg.h>#include <assert.h>#include "ws_symbol_export.h"#include "ws_attributes.h"Go to the source code of this file.
Classes | |
| struct | except_id_t |
| struct | except_t |
| struct | except_cleanup |
| struct | except_catch |
| struct | except_stacknode |
| Represents a node in the exception handling stack. More... | |
Macros | |
| #define | XCEPT_GROUP_ANY 0 |
| #define | XCEPT_CODE_ANY 0 |
| #define | XCEPT_BAD_ALLOC 1 |
| #define | except_code(E) ((E)->except_id.except_code) |
| #define | except_group(E) ((E)->except_id.except_group) |
| #define | except_message(E) ((E)->except_message) |
| #define | except_data(E) ((E)->except_dyndata) |
| #define | except_cleanup_push(F, C) |
| #define | except_cleanup_pop(E) |
| #define | except_checked_cleanup_pop(F, E) |
| #define | except_cleanup_push_pfx(pfx, F, C) |
| #define | except_cleanup_pop_pfx(pfx, E) |
| #define | except_checked_cleanup_pop_pfx(pfx, F, E) |
| #define | except_try_push(ID, NUM, PPE) |
| #define | except_try_pop() |
Enumerations | |
| enum | { except_no_call , except_call } |
| enum | except_stacktype { XCEPT_CLEANUP , XCEPT_CATCHER } |
Functions | |
| WS_DLL_PUBLIC void | except_setup_clean (struct except_stacknode *, struct except_cleanup *, void(*)(void *), void *) |
| Set up a cleanup handler for exception handling. | |
| WS_DLL_PUBLIC void | except_setup_try (struct except_stacknode *, struct except_catch *, const except_id_t[], size_t) |
| Set up a try block for exception handling. | |
| WS_DLL_PUBLIC struct except_stacknode * | except_pop (void) |
| Pop the top node from the exception stack. | |
| WS_DLL_PUBLIC int | except_init (void) |
| Initialize the exception handling system. | |
| WS_DLL_PUBLIC void | except_deinit (void) |
| Deinitialize the exception handling system. | |
| WS_DLL_PUBLIC WS_NORETURN void | except_rethrow (except_t *except) |
| Rethrow an exception. | |
| WS_DLL_PUBLIC WS_NORETURN void | except_throw (long group, long code, const char *msg) |
| Throw an exception with a message and optional data. | |
| WS_DLL_PUBLIC WS_NORETURN void | except_throwd (long, long, const char *, void *) |
| WS_DLL_PUBLIC WS_NORETURN void | except_vthrowf (long group, long code, const char *fmt, va_list vl) |
| WS_DLL_PUBLIC WS_NORETURN void | except_throwf (long, long, const char *,...) |
| unsigned long | except_code (except_t *) |
| unsigned long | except_group (except_t *) |
| const char * | except_message (except_t *) |
| void * | except_data (except_t *) |
| WS_DLL_PUBLIC void * | except_take_data (except_t *ex) |
| Take data from an exception object. | |
| WS_DLL_PUBLIC void | except_set_allocator (void *(*)(size_t), void(*)(void *)) |
| WS_DLL_PUBLIC void * | except_alloc (size_t) |
| WS_DLL_PUBLIC void | except_free (void *ptr) |
| Frees memory allocated for an exception node. | |
| const struct except_stacknode * | except_get_top (void) |
| Get the top node from the exception stack. | |
| void | except_set_top (struct except_stacknode *node) |
| Set the top node of an exception stack. | |
Variables | |
| WS_DLL_PUBLIC void(*)(except_t *) | except_unhandled_catcher (void(*)(except_t *)) |
Portable Exception Handling for ANSI C.
Modified to support throwing an exception with a null message pointer, and to have the message not be const (as we generate messages with "ws_strdup_printf()", which means they need to be freed; using a null message means that we don't have to use a special string for exceptions with no message, and don't have to worry about not freeing that).
| #define except_checked_cleanup_pop | ( | F, | |
| E | |||
| ) |
| #define except_checked_cleanup_pop_pfx | ( | pfx, | |
| F, | |||
| E | |||
| ) |
| #define except_cleanup_pop | ( | E | ) |
| #define except_cleanup_pop_pfx | ( | pfx, | |
| E | |||
| ) |
| #define except_cleanup_push | ( | F, | |
| C | |||
| ) |
| #define except_cleanup_push_pfx | ( | pfx, | |
| F, | |||
| C | |||
| ) |
| #define except_try_pop | ( | ) |
| #define except_try_push | ( | ID, | |
| NUM, | |||
| PPE | |||
| ) |
| WS_DLL_PUBLIC void except_free | ( | void * | ptr | ) |
Frees memory allocated for an exception node.
| ptr | Pointer to the memory to be freed. |
| const struct except_stacknode * except_get_top | ( | void | ) |
Get the top node from the exception stack.
| WS_DLL_PUBLIC int except_init | ( | void | ) |
Initialize the exception handling system.
| WS_DLL_PUBLIC struct except_stacknode * except_pop | ( | void | ) |
Pop the top node from the exception stack.
| WS_DLL_PUBLIC WS_NORETURN void except_rethrow | ( | except_t * | except | ) |
Rethrow an exception.
| except | Pointer to the exception object. |
| void except_set_top | ( | struct except_stacknode * | node | ) |
Set the top node of an exception stack.
| node | Pointer to the new top node of the exception stack. |
| WS_DLL_PUBLIC void * except_take_data | ( | except_t * | ex | ) |
Take data from an exception object.
| ex | Pointer to the exception object. |
| WS_DLL_PUBLIC WS_NORETURN void except_throw | ( | long | group, |
| long | code, | ||
| const char * | msg | ||
| ) |
Throw an exception with a message and optional data.
| group | The exception group identifier. |
| code | The exception code identifier. |
| msg | The message associated with the exception. |