Home --> Documentations --> PJLIB Reference
Go to the documentation of this file.
27#include <pj/compat/errno.h>
84#define PJ_ERR_MSG_SIZE 80
89#ifndef PJ_PERROR_TITLE_BUF_SIZE
90# define PJ_PERROR_TITLE_BUF_SIZE 120
175#define PJ_PERROR(level,arg) do { \
176 pj_perror_wrapper_##level(arg); \
202 const char *title_fmt, ...);
257#ifndef PJ_RETURN_OS_ERROR
258# define PJ_RETURN_OS_ERROR(os_code) (os_code ? \
259 PJ_STATUS_FROM_OS(os_code) : -1)
272#if PJ_NATIVE_ERR_POSITIVE
273# define PJ_STATUS_FROM_OS(e) (e == 0 ? PJ_SUCCESS : e + PJ_ERRNO_START_SYS)
275# define PJ_STATUS_FROM_OS(e) (e == 0 ? PJ_SUCCESS : PJ_ERRNO_START_SYS - e)
288#if PJ_NATIVE_ERR_POSITIVE
289# define PJ_STATUS_TO_OS(e) (e == 0 ? PJ_SUCCESS : e - PJ_ERRNO_START_SYS)
291# define PJ_STATUS_TO_OS(e) (e == 0 ? PJ_SUCCESS : PJ_ERRNO_START_SYS - e)
309# define PJ_BUILD_ERR(code,msg) { code, msg " (" #code ")" }
317#define PJ_EUNKNOWN (PJ_ERRNO_START_STATUS + 1)
322#define PJ_EPENDING (PJ_ERRNO_START_STATUS + 2)
327#define PJ_ETOOMANYCONN (PJ_ERRNO_START_STATUS + 3)
332#define PJ_EINVAL (PJ_ERRNO_START_STATUS + 4)
337#define PJ_ENAMETOOLONG (PJ_ERRNO_START_STATUS + 5)
342#define PJ_ENOTFOUND (PJ_ERRNO_START_STATUS + 6)
347#define PJ_ENOMEM (PJ_ERRNO_START_STATUS + 7)
352#define PJ_EBUG (PJ_ERRNO_START_STATUS + 8)
357#define PJ_ETIMEDOUT (PJ_ERRNO_START_STATUS + 9)
362#define PJ_ETOOMANY (PJ_ERRNO_START_STATUS + 10)
367#define PJ_EBUSY (PJ_ERRNO_START_STATUS + 11)
372#define PJ_ENOTSUP (PJ_ERRNO_START_STATUS + 12)
377#define PJ_EINVALIDOP (PJ_ERRNO_START_STATUS + 13)
382#define PJ_ECANCELLED (PJ_ERRNO_START_STATUS + 14)
387#define PJ_EEXISTS (PJ_ERRNO_START_STATUS + 15)
392#define PJ_EEOF (PJ_ERRNO_START_STATUS + 16)
397#define PJ_ETOOBIG (PJ_ERRNO_START_STATUS + 17)
403#define PJ_ERESOLVE (PJ_ERRNO_START_STATUS + 18)
408#define PJ_ETOOSMALL (PJ_ERRNO_START_STATUS + 19)
413#define PJ_EIGNORED (PJ_ERRNO_START_STATUS + 20)
418#define PJ_EIPV6NOTSUP (PJ_ERRNO_START_STATUS + 21)
423#define PJ_EAFNOTSUP (PJ_ERRNO_START_STATUS + 22)
428#define PJ_EGONE (PJ_ERRNO_START_STATUS + 23)
433#define PJ_ESOCKETSTOP (PJ_ERRNO_START_STATUS + 24)
443#define PJ_ERRNO_START 20000
449#define PJ_ERRNO_SPACE_SIZE 50000
455#define PJ_ERRNO_START_STATUS (PJ_ERRNO_START + PJ_ERRNO_SPACE_SIZE)
462#define PJ_ERRNO_START_SYS (PJ_ERRNO_START_STATUS + PJ_ERRNO_SPACE_SIZE)
469#define PJ_ERRNO_START_USER (PJ_ERRNO_START_SYS + PJ_ERRNO_SPACE_SIZE)
496#if PJ_LOG_MAX_LEVEL >= 1
497 #define pj_perror_wrapper_1(arg) pj_perror_1 arg
500 const char *title_fmt, ...);
502 #define pj_perror_wrapper_1(arg)
511#if PJ_LOG_MAX_LEVEL >= 2
512 #define pj_perror_wrapper_2(arg) pj_perror_2 arg
515 const char *title_fmt, ...);
517 #define pj_perror_wrapper_2(arg)
526#if PJ_LOG_MAX_LEVEL >= 3
527 #define pj_perror_wrapper_3(arg) pj_perror_3 arg
530 const char *title_fmt, ...);
532 #define pj_perror_wrapper_3(arg)
541#if PJ_LOG_MAX_LEVEL >= 4
542 #define pj_perror_wrapper_4(arg) pj_perror_4 arg
545 const char *title_fmt, ...);
547 #define pj_perror_wrapper_4(arg)
556#if PJ_LOG_MAX_LEVEL >= 5
557 #define pj_perror_wrapper_5(arg) pj_perror_5 arg
559 PJ_DECL( void) pj_perror_5( const char *sender, pj_status_t status,
560 const char *title_fmt, ...);
562 #define pj_perror_wrapper_5(arg)
571#if PJ_LOG_MAX_LEVEL >= 6
572 #define pj_perror_wrapper_6(arg) pj_perror_6 arg
574 PJ_DECL( void) pj_perror_6( const char *sender, pj_status_t status,
575 const char *title_fmt, ...);
577 #define pj_perror_wrapper_6(arg)
void pj_errno_clear_handlers(void)
void pj_perror_4(const char *sender, pj_status_t status, const char *title_fmt,...)
void pj_perror_1(const char *sender, pj_status_t status, const char *title_fmt,...)
void pj_perror_3(const char *sender, pj_status_t status, const char *title_fmt,...)
void pj_perror_2(const char *sender, pj_status_t status, const char *title_fmt,...)
size_t pj_size_t Definition: types.h:58
int pj_status_t Definition: types.h:68
#define PJ_BEGIN_DECL Definition: config.h:1284
#define PJ_END_DECL Definition: config.h:1285
pj_str_t(* pj_error_callback)(pj_status_t e, char *msg, pj_size_t max) Definition: errno.h:214
void pj_perror(int log_level, const char *sender, pj_status_t status, const char *title_fmt,...)
pj_str_t pj_strerror(pj_status_t statcode, char *buf, pj_size_t bufsize)
void pj_set_os_error(pj_status_t code)
void pj_set_netos_error(pj_status_t code)
pj_status_t pj_get_os_error(void)
pj_status_t pj_register_strerror(pj_status_t start_code, pj_status_t err_space, pj_error_callback f)
pj_status_t pj_get_netos_error(void)
Declaration of basic types and utility.
PJLIB Open Source, high performance, small footprint, and very very portable framework
Copyright (C) 2006-2009 Teluu Inc.
|