35 #if defined(WINDOWS) && defined(DISPATCHER) 111 static char err_msg_buf[2048];
116 return (
"No such error code.");
117 if (os_error_code == 0)
120 return (err_msg_buf);
122 p = strerror (os_error_code);
126 return (err_msg_buf);
129 snprintf (err_msg_buf,
sizeof (err_msg_buf) - 1,
"%s (OS error code = %d, %s)", err_msg, os_error_code, p);
130 return (err_msg_buf);
133 #if defined (ENABLE_UNUSED_FUNCTION) 135 uw_error_message (
int error_code)
137 static char err_msg[1024];
140 return (
"No such error code.");
147 uw_error_message_r (
int error_code,
char *err_msg)
150 strcpy (err_msg,
"No such error code.");
156 uw_os_err_msg (
int os_err_code,
char *err_msg)
159 strcpy (err_msg, strerror (os_err_code));
179 strcpy (default_err_msg_file, ERROR_MSG_FILE);
184 #if defined(WINDOWS) && defined(DISPATCHER) 185 if (reg_get (REG_ERR_MSG, buf,
sizeof (buf)) < 0)
187 fp = fopen (buf,
"r");
191 p = getenv (
"UW_ER_MSG");
194 fp = fopen (default_err_msg_file,
"r");
201 fp = fopen (default_err_msg_file,
"r");
210 for (i = 0; i < err_code; i++)
212 if (fgets (buf,
sizeof (buf), fp) ==
NULL)
219 if (fgets (buf,
sizeof (buf), fp) ==
NULL)
225 p = strchr (buf,
':');
226 if ((p ==
NULL) || (atoi (buf) != err_code))
233 strcpy (msg_buf, p + 1);
int uw_get_error_code(void)
int uw_get_os_error_code(void)
void uw_set_error_code(const char *file_name, int line_no, int error_code, int os_errno)
char * get_cubrid_file(T_CUBRID_FILE_ID fid, char *buf, size_t len)
#define UW_MAX_ERROR_CODE
const char * uw_get_error_message(int error_code, int os_error_code)
#define UW_MIN_ERROR_CODE
static int cur_error_code
static int get_error_msg(int err_code, char *msg_buf)