CUBRID Engine
latest
|
#include "config.h"
#include <stdlib.h>
#include <string.h>
#include <stdarg.h>
#include <limits.h>
#include <assert.h>
#include "porting.h"
#include "condition_handler.h"
#include "condition_handler_code.h"
#include "message_catalog.h"
#include "adjustable_array.h"
#include "condition_handler_err.h"
#include "intl_support.h"
Go to the source code of this file.
Classes | |
struct | co_argument |
Macros | |
#define | MAX_FLOAT_WIDTH (128*MB_LEN_MAX) /* Max size of float string */ |
#define | MAX_INT_WIDTH (64*MB_LEN_MAX) /* Max size of integer string */ |
#define | MAX_POINTER_WIDTH (128*MB_LEN_MAX) /* Max size of pointer string */ |
#define | SPACE() L" \t" |
#define | DIGITS() L"0123456789" |
#define | INTEGER_SPECS() L"dioxXuc" |
#define | STRING_SPECS() L"s" |
#define | POINTER_SPECS() L"p" |
#define | FLOAT_SPECS() L"fgGeE" |
#define | FLAGS() L"- +0#" |
#define | WC_CSPEC() L'%' |
#define | WC_PSPEC() L'$' |
#define | WC_RADIX() L'.' |
#define | SHORT_SPEC() L'h' |
#define | LONG_SPEC() L'l' |
#define | LONG_DOUBLE_SPEC() L'L' |
#define | GET_WC(wc, mbs, size) (size = mbtowc( &wc, mbs, MB_LEN_MAX), wc) |
#define | REPORT_LINE_WIDTH 72 |
#define | REPORT_LINE_INDENT 9 |
Typedefs | |
typedef enum co_format_type | CO_FORMAT_TYPE |
typedef struct co_argument | CO_ARGUMENT |
Enumerations | |
enum | co_format_type { FORMAT_INTEGER = 0, FORMAT_FLOAT, FORMAT_POINTER, FORMAT_STRING, FORMAT_LITERAL, FORMAT_LONG_INTEGER, FORMAT_LONG_DOUBLE, FORMAT_UNKNOWN } |
Functions | |
static int | co_signalv (int code, const char *format, va_list args) |
static int | co_find_conversion (const char *format, int from, int *start, CO_FORMAT_TYPE *type, int *position, int *width) |
static const char * | co_conversion_spec (const char *cspec, int size) |
int | co_signal (int code, const char *format,...) |
int | co_code (void) |
void | co_final (void) |
Variables | |
static int | co_Current_code = 0 |
static ADJ_ARRAY * | co_Current_arguments = NULL |
static ADJ_ARRAY * | co_String_values = NULL |
static ADJ_ARRAY * | co_Current_message = NULL |
static int | co_Message_completed |
static ADJ_ARRAY * | co_Parameter_string = NULL |
static ADJ_ARRAY * | co_Conversion_buffer = NULL |
static CO_DETAIL | co_Current_detail = CO_DETAIL_USER |
#define DIGITS | ( | ) | L"0123456789" |
Definition at line 77 of file condition_handler.c.
Referenced by co_find_conversion().
#define FLAGS | ( | ) | L"- +0#" |
Definition at line 82 of file condition_handler.c.
Referenced by co_find_conversion().
#define FLOAT_SPECS | ( | ) | L"fgGeE" |
Definition at line 81 of file condition_handler.c.
Referenced by co_find_conversion().
#define GET_WC | ( | wc, | |
mbs, | |||
size | |||
) | (size = mbtowc( &wc, mbs, MB_LEN_MAX), wc) |
Definition at line 90 of file condition_handler.c.
Referenced by co_find_conversion().
#define INTEGER_SPECS | ( | ) | L"dioxXuc" |
Definition at line 78 of file condition_handler.c.
Referenced by co_find_conversion().
#define LONG_DOUBLE_SPEC | ( | ) | L'L' |
Definition at line 88 of file condition_handler.c.
Referenced by co_find_conversion().
#define LONG_SPEC | ( | ) | L'l' |
Definition at line 87 of file condition_handler.c.
Referenced by co_find_conversion().
#define MAX_FLOAT_WIDTH (128*MB_LEN_MAX) /* Max size of float string */ |
Definition at line 72 of file condition_handler.c.
Referenced by co_signalv().
#define MAX_INT_WIDTH (64*MB_LEN_MAX) /* Max size of integer string */ |
Definition at line 73 of file condition_handler.c.
Referenced by co_signalv().
#define MAX_POINTER_WIDTH (128*MB_LEN_MAX) /* Max size of pointer string */ |
Definition at line 74 of file condition_handler.c.
Referenced by co_signalv().
#define POINTER_SPECS | ( | ) | L"p" |
Definition at line 80 of file condition_handler.c.
Referenced by co_find_conversion().
#define REPORT_LINE_INDENT 9 |
Definition at line 93 of file condition_handler.c.
Referenced by co_signal().
#define REPORT_LINE_WIDTH 72 |
Definition at line 92 of file condition_handler.c.
Referenced by co_signal().
#define SHORT_SPEC | ( | ) | L'h' |
Definition at line 86 of file condition_handler.c.
Referenced by co_find_conversion().
#define SPACE | ( | ) | L" \t" |
Definition at line 76 of file condition_handler.c.
Referenced by co_signal(), and is_number().
#define STRING_SPECS | ( | ) | L"s" |
Definition at line 79 of file condition_handler.c.
Referenced by co_find_conversion().
#define WC_CSPEC | ( | ) | L'%' |
Definition at line 83 of file condition_handler.c.
Referenced by co_find_conversion().
#define WC_PSPEC | ( | ) | L'$' |
Definition at line 84 of file condition_handler.c.
Referenced by co_conversion_spec(), and co_find_conversion().
#define WC_RADIX | ( | ) | L'.' |
Definition at line 85 of file condition_handler.c.
Referenced by co_find_conversion().
typedef struct co_argument CO_ARGUMENT |
Definition at line 57 of file condition_handler.c.
typedef enum co_format_type CO_FORMAT_TYPE |
Definition at line 54 of file condition_handler.c.
enum co_format_type |
Enumerator | |
---|---|
FORMAT_INTEGER | |
FORMAT_FLOAT | |
FORMAT_POINTER | |
FORMAT_STRING | |
FORMAT_LITERAL | |
FORMAT_LONG_INTEGER | |
FORMAT_LONG_DOUBLE | |
FORMAT_UNKNOWN |
Definition at line 43 of file condition_handler.c.
int co_code | ( | void | ) |
Definition at line 367 of file condition_handler.c.
References co_Current_code, co_Current_detail, CO_DETAIL_MAX, CO_ER_FMT_BAD_DETAIL, CO_ERR_BAD_DETAIL, co_signal(), and error().
Referenced by bifmt_numeric_value(), co_signal(), ffmt_value(), and mfmt_value().
Definition at line 804 of file condition_handler.c.
References adj_ar_append(), ADJ_AR_EOA, adj_ar_get_buffer(), adj_ar_new(), adj_ar_remove(), adj_ar_replace(), CAST_STRLEN, intl_mbs_chr(), MB_LEN_MAX, NULL, and WC_PSPEC.
Referenced by co_signal(), and co_signalv().
void co_final | ( | void | ) |
Definition at line 411 of file condition_handler.c.
References adj_ar_free(), and NULL.
Referenced by boot_client_all_finalize().
|
static |
Definition at line 664 of file condition_handler.c.
References ADJ_AR_EOA, CAST_STRLEN, DIGITS, FLAGS, FLOAT_SPECS, FORMAT_FLOAT, FORMAT_INTEGER, FORMAT_LITERAL, FORMAT_LONG_DOUBLE, FORMAT_LONG_INTEGER, FORMAT_POINTER, FORMAT_STRING, FORMAT_UNKNOWN, GET_WC, INTEGER_SPECS, intl_mbs_chr(), intl_mbs_nth(), intl_mbs_spn(), LONG_DOUBLE_SPEC, LONG_SPEC, p, POINTER_SPECS, SHORT_SPEC, str_to_int32(), STRING_SPECS, WC_CSPEC, WC_PSPEC, and WC_RADIX.
Referenced by co_signal(), and co_signalv().
int co_signal | ( | int | code, |
const char * | format, | ||
... | |||
) |
Definition at line 136 of file condition_handler.c.
References ADJ_AR_EOA, adj_ar_get_buffer(), adj_ar_replace(), assert, co_code(), co_conversion_spec(), CO_ERROR_SEVERITY, CO_FATAL_SEVERITY, co_find_conversion(), CO_MAX_CODE, co_Message_completed, co_signalv(), error(), FORMAT_LITERAL, intl_mbs_len(), intl_mbs_nth(), intl_mbs_spn(), MB_LEN_MAX, NULL, REPORT_LINE_INDENT, REPORT_LINE_WIDTH, SPACE, and strlen.
Referenced by bfmt_print(), bifmt_numeric_value(), cnv_bad_char(), cnv_valid_currency(), co_code(), co_signalv(), db_bit_string(), db_datetime_string(), db_string_date(), db_string_datetime(), db_string_float(), db_string_short(), db_string_time(), db_string_timestamp(), db_string_value(), db_time_string(), db_timestamp_string(), ffmt_value(), fmt_date_value(), fmt_fractional_digits(), fmt_fractional_value(), fmt_integral_digits(), fmt_integral_value(), fmt_minute_value(), fmt_second_value(), fmt_time_value(), fmt_timestamp_value(), ifmt_numeric_value(), ko_date_value(), ko_time_value(), local_am_pm_value(), mfmt_value(), num_fmt_print(), us_date_value(), and us_time_value().
|
static |
Definition at line 456 of file condition_handler.c.
References adj_ar_append(), ADJ_AR_EOA, adj_ar_get_buffer(), adj_ar_initialize(), adj_ar_length(), adj_ar_new(), adj_ar_remove(), adj_ar_replace(), co_conversion_spec(), co_Current_code, CO_ER_FMT_BAD_CODE, CO_ER_FMT_BAD_FORMAT, CO_ER_FMT_BAD_POSITION, CO_ERR_BAD_CODE, CO_ERR_BAD_FORMAT, CO_ERR_BAD_POSITION, co_find_conversion(), co_Message_completed, co_signal(), co_argument::double_value, error(), co_argument::format, FORMAT_FLOAT, FORMAT_INTEGER, FORMAT_LITERAL, FORMAT_LONG_DOUBLE, FORMAT_LONG_INTEGER, FORMAT_POINTER, FORMAT_STRING, co_argument::int_value, co_argument::long_double_value, co_argument::long_int_value, MAX_FLOAT_WIDTH, MAX_INT_WIDTH, MAX_POINTER_WIDTH, MB_LEN_MAX, NULL, co_argument::pointer_value, strlen, and co_argument::value.
Referenced by co_signal().
Definition at line 103 of file condition_handler.c.
Definition at line 97 of file condition_handler.c.
|
static |
Definition at line 96 of file condition_handler.c.
Referenced by co_code(), and co_signalv().
|
static |
Definition at line 104 of file condition_handler.c.
Referenced by co_code().
Definition at line 99 of file condition_handler.c.
|
static |
Definition at line 100 of file condition_handler.c.
Referenced by co_signal(), and co_signalv().
Definition at line 102 of file condition_handler.c.
Definition at line 98 of file condition_handler.c.