CUBRID Engine
latest
|
#include "config.h"
#include "message_catalog.h"
#include <sys/types.h>
#include <sys/stat.h>
#include <sys/mman.h>
#include <netinet/in.h>
#include <errno.h>
#include <fcntl.h>
#include <stdlib.h>
#include <locale.h>
#include <string.h>
#include <limits.h>
#include <stdio.h>
#include "porting.h"
#include "environment_variable.h"
#include "error_code.h"
#include "error_manager.h"
#include "language_support.h"
Go to the source code of this file.
Classes | |
struct | nls_cat_hdr |
struct | nls_set_hdr |
struct | nls_msg_hdr |
struct | _nl_cat_d |
struct | msgcat_def |
Macros | |
#define | NLS_MAGIC 0xff88ff89 |
#define | ENCODING_LEN 40 |
#define | CUB_NL_SETD 0 |
#define | CUB_NL_CAT_LOCALE 1 |
#define | DEFAULT_NLS_PATH "/usr/share/nls/%L/%N.cat:/usr/share/nls/%N/%L:/usr/local/share/nls/%L/%N.cat:/usr/local/share/nls/%N/%L" |
#define | MSGCAT_SYSTEM_DIM (sizeof(msgcat_System) / sizeof(struct msgcat_def)) |
Typedefs | |
typedef struct _nl_cat_d * | cub_nl_catd |
Functions | |
static cub_nl_catd | cub_catopen (const char *, int) |
static char * | cub_catgets (cub_nl_catd, int, int, const char *) |
static int | cub_catclose (cub_nl_catd) |
static cub_nl_catd | load_msgcat (const char *) |
int | msgcat_init (void) |
int | msgcat_final (void) |
char * | msgcat_message (int cat_id, int set_id, int msg_id) |
MSG_CATD | msgcat_open (const char *name) |
MSG_CATD | msgcat_get_descriptor (int cat_id) |
char * | msgcat_gets (MSG_CATD msg_catd, int set_id, int msg_id, const char *s) |
int | msgcat_close (MSG_CATD msg_catd) |
FILE * | msgcat_open_file (const char *name) |
Variables | |
struct msgcat_def | msgcat_System [] |
#define CUB_NL_CAT_LOCALE 1 |
Definition at line 107 of file message_catalog.c.
Referenced by cub_catopen().
#define CUB_NL_SETD 0 |
Definition at line 106 of file message_catalog.c.
#define DEFAULT_NLS_PATH "/usr/share/nls/%L/%N.cat:/usr/share/nls/%N/%L:/usr/local/share/nls/%L/%N.cat:/usr/local/share/nls/%N/%L" |
Definition at line 125 of file message_catalog.c.
Referenced by cub_catopen().
#define ENCODING_LEN 40 |
Definition at line 103 of file message_catalog.c.
Referenced by cub_catopen().
#define MSGCAT_SYSTEM_DIM (sizeof(msgcat_System) / sizeof(struct msgcat_def)) |
Definition at line 491 of file message_catalog.c.
Referenced by msgcat_final(), msgcat_init(), and msgcat_message().
#define NLS_MAGIC 0xff88ff89 |
Definition at line 77 of file message_catalog.c.
Referenced by load_msgcat().
typedef struct _nl_cat_d * cub_nl_catd |
|
static |
Definition at line 365 of file message_catalog.c.
References _nl_cat_d::_data, _nl_cat_d::_size, and NULL.
Referenced by msgcat_close(), and msgcat_open().
|
static |
Definition at line 291 of file message_catalog.c.
References _nl_cat_d::_data, nls_cat_hdr::_msg_hdr_offset, nls_cat_hdr::_msg_txt_offset, nls_msg_hdr::_msgno, nls_cat_hdr::_nsets, nls_msg_hdr::_offset, i, ntohl(), and NULL.
Referenced by msgcat_gets().
|
static |
Definition at line 130 of file message_catalog.c.
References CAST_STRLEN, CUB_NL_CAT_LOCALE, DEFAULT_NLS_PATH, ENCODING_LEN, load_msgcat(), NULL, strdup(), strlcpy(), and strlen.
Referenced by msgcat_open().
|
static |
Definition at line 388 of file message_catalog.c.
References nls_cat_hdr::_magic, NLS_MAGIC, ntohl(), and NULL.
Referenced by cub_catopen().
int msgcat_close | ( | MSG_CATD | msg_catd | ) |
Definition at line 675 of file message_catalog.c.
References msg_catd::catd, cub_catclose(), ER_FAILED, msg_catd::file, and NO_ERROR.
Referenced by msgcat_final().
int msgcat_final | ( | void | ) |
Definition at line 527 of file message_catalog.c.
References ER_FAILED, i, msgcat_def::msg_catd, msgcat_close(), MSGCAT_SYSTEM_DIM, NO_ERROR, NULL, and rc.
Referenced by boot_client_all_finalize(), boot_restart_server(), boot_server_all_finalize(), and main().
MSG_CATD msgcat_get_descriptor | ( | int | cat_id | ) |
Definition at line 642 of file message_catalog.c.
Referenced by er_init().
Definition at line 659 of file message_catalog.c.
References msg_catd::catd, and cub_catgets().
Referenced by er_init(), and msgcat_message().
int msgcat_init | ( | void | ) |
Definition at line 499 of file message_catalog.c.
References ER_FAILED, i, msgcat_def::msg_catd, msgcat_open(), MSGCAT_SYSTEM_DIM, msgcat_def::name, NO_ERROR, and NULL.
Referenced by boot_initialize_client(), boot_remove_all_volumes(), boot_restart_client(), boot_restart_server(), er_init(), net_server_start(), sysprm_load_and_init_internal(), utility_initialize(), xboot_delete(), xboot_emergency_patch(), xboot_initialize_server(), and xboot_restart_from_backup().
char* msgcat_message | ( | int | cat_id, |
int | set_id, | ||
int | msg_id | ||
) |
Definition at line 558 of file message_catalog.c.
References msgcat_def::cat_id, msgcat_def::msg_catd, msgcat_gets(), msgcat_open(), MSGCAT_SYSTEM_DIM, msgcat_def::name, and NULL.
Referenced by acldb(), addvoldb(), alterdbhost(), applyinfo(), applylogdb(), au_dump_to_file(), au_dump_user(), au_export_grants(), au_print_auth(), au_print_cache(), au_print_grant_entry(), backupdb(), boot_initialize_client(), boot_restart_server(), changemode(), check_commit(), check_dbname(), checkdb(), checksumdb(), compact_usage(), compactdb(), compactdb_start(), compactdb_usage(), copydb(), copylogdb(), createdb(), csql_get_message(), csql_help_info(), csql_help_menu(), csql_help_schema(), csql_help_trigger(), css_process_activate_heartbeat(), css_process_deact_confirm_no_server(), css_process_deact_confirm_stop_all(), css_process_deact_stop_all(), css_process_deactivate_heartbeat(), css_process_get_server_ha_mode(), css_process_ha_admin_info(), css_process_ha_deregister_by_args(), css_process_ha_deregister_by_pid(), css_process_ha_node_list_info(), css_process_ha_ping_host_info(), css_process_ha_process_list_info(), css_process_ha_start_util_process(), css_process_is_registered_ha_proc(), css_process_kill_all_ha_process(), css_process_kill_immediate(), css_process_kill_slave(), css_process_reconfig_heartbeat(), css_process_shutdown(), deletedb(), desc_obj_to_disk(), desc_value_print(), desc_value_special_fprint(), diagdb(), disk_update_instance(), display_empty_result(), display_error_line(), do_reclaim_addresses(), dump_locale_collation(), dump_trantb(), dump_tz(), dumplocale(), er_event_final(), er_event_init(), er_find_fmt(), er_init(), extract_objects(), fh_create(), fh_dump(), fileio_backup_volume(), fileio_continue_restore(), fileio_find_restore_volume(), fileio_finish_backup(), fileio_get_backup_volume(), fileio_get_next_backup_volume(), fileio_list_restore(), fileio_make_error_message(), fileio_read_backup_info_entries(), fileio_restore_volume(), gen_tz(), genlocale(), get_class_mops(), cubload::error_handler::get_message_from_catalog(), hb_resource_demote_start_shutdown_server_proc(), hb_resource_job_proc_dereg(), hb_resource_shutdown_all_ha_procs(), help_print_obj(), class_description::init(), insert_instance(), insert_meth_instance(), installdb(), invalid_class_id_error(), iq_format_err(), kill_transactions(), killtran(), la_insert_ha_apply_info(), la_remove_archive_logs(), ldr_act_add_class_all_attrs(), ldr_act_elem(), ldr_act_init_context(), ldr_check_file(), ldr_date_time_conversion_error(), ldr_exec_query_from_file(), ldr_finish_context(), ldr_invalid_class_error(), ldr_report_num_of_commits(), ldr_sa_load(), ldr_server_load(), ldr_signal_handler(), ldr_sys_class_db_generic(), ldr_sys_user_db_generic(), ldr_update_statistics(), ldr_validate_object_file(), load_usage(), loaddb_internal(), locale_dump(), lock_demote_class_lock(), lockdb(), log_change_tran_as_completed(), log_complete_for_2pc(), log_create_internal(), log_recovery_analysis(), log_recovery_notpartof_archives(), log_recovery_resetlog(), log_rv_analysis_complete(), logpb_append_archives_removed_to_log_info(), logpb_archive_active_log(), logpb_backup(), logpb_checkpoint(), logpb_copy_database(), logpb_create_log_info(), logpb_fetch_from_archive(), logpb_get_guess_archive_num(), logpb_remote_ask_user_before_delete_volumes(), logpb_remove_archive_logs_exceed_limit(), logpb_rename_all_volumes_files(), logpb_restore(), main(), nonscr_display_error(), optimizedb(), otable_insert(), otable_reserve(), paramdump(), parse_error(), parse_user_define_line(), patchdb(), plandump(), print_tran_entry(), prm_check_parameters(), prm_read_and_parse_ini_file(), process_class(), process_object(), process_status_query(), process_value(), pt_db_value_initialize(), pt_expand_analytic_node(), pt_function_to_regu(), pt_insert_conjunct(), pt_insert_entity(), pt_make_connect_by_proc(), pt_make_vid(), pt_record_error(), pt_set_analytic_node_etc(), pt_to_aggregate_node(), pt_to_analytic_final_node(), pt_to_analytic_node(), pt_to_fetch_as_scan_proc(), pt_to_fetch_proc(), ptqo_to_merge_list_proc(), ptqo_to_scan_proc(), rel_build_type(), renamedb(), restoredb(), restoreslave(), set_iso_level(), show_statistics(), spacedb(), statdump(), synccoll_check(), synccolldb(), sysprm_final(), sysprm_load_and_init_internal(), tde(), tranlist(), unload_usage(), unloaddb(), usage(), util_get_class_oids_and_index_btid(), util_print_deprecated(), utility_get_generic_message(), vacuumdb(), xboot_initialize_server(), and xlock_dump().
Definition at line 600 of file message_catalog.c.
References ARG_FILE_LINE, msg_catd::catd, cub_catclose(), cub_catopen(), envvar_localedir_file(), ER_ERROR_SEVERITY, ER_OUT_OF_VIRTUAL_MEMORY, er_set(), msg_catd::file, lang_get_msg_Loc_name(), LANG_NAME_DEFAULT, msgcat_def::msg_catd, NULL, and strdup().
Referenced by msgcat_init(), and msgcat_message().
FILE* msgcat_open_file | ( | const char * | name | ) |
Definition at line 696 of file message_catalog.c.
References envvar_localedir_file(), lang_get_msg_Loc_name(), LANG_NAME_DEFAULT, and NULL.
struct msgcat_def msgcat_System[] |
Definition at line 485 of file message_catalog.c.