|
Home --> Documentations --> PJLIB Reference
Go to the documentation of this file.
20 #ifndef __PJ_ERRNO_H__
21 #define __PJ_ERRNO_H__
28 #include <pj/compat/errno.h>
85 #define PJ_ERR_MSG_SIZE 80
90 #ifndef PJ_PERROR_TITLE_BUF_SIZE
91 # define PJ_PERROR_TITLE_BUF_SIZE 120
176 #define PJ_PERROR(level,arg) do { \
177 pj_perror_wrapper_##level(arg); \
203 const char *title_fmt, ...);
258 #ifndef PJ_RETURN_OS_ERROR
259 # define PJ_RETURN_OS_ERROR(os_code) (os_code ? \
260 PJ_STATUS_FROM_OS(os_code) : -1)
273 #if PJ_NATIVE_ERR_POSITIVE
274 # define PJ_STATUS_FROM_OS(e) (e == 0 ? PJ_SUCCESS : e + PJ_ERRNO_START_SYS)
276 # define PJ_STATUS_FROM_OS(e) (e == 0 ? PJ_SUCCESS : PJ_ERRNO_START_SYS - e)
289 #if PJ_NATIVE_ERR_POSITIVE
290 # define PJ_STATUS_TO_OS(e) (e == 0 ? PJ_SUCCESS : e - PJ_ERRNO_START_SYS)
292 # define PJ_STATUS_TO_OS(e) (e == 0 ? PJ_SUCCESS : PJ_ERRNO_START_SYS - e)
310 # define PJ_BUILD_ERR(code,msg) { code, msg " (" #code ")" }
318 #define PJ_EUNKNOWN (PJ_ERRNO_START_STATUS + 1)
323 #define PJ_EPENDING (PJ_ERRNO_START_STATUS + 2)
328 #define PJ_ETOOMANYCONN (PJ_ERRNO_START_STATUS + 3)
333 #define PJ_EINVAL (PJ_ERRNO_START_STATUS + 4)
338 #define PJ_ENAMETOOLONG (PJ_ERRNO_START_STATUS + 5)
343 #define PJ_ENOTFOUND (PJ_ERRNO_START_STATUS + 6)
348 #define PJ_ENOMEM (PJ_ERRNO_START_STATUS + 7)
353 #define PJ_EBUG (PJ_ERRNO_START_STATUS + 8)
358 #define PJ_ETIMEDOUT (PJ_ERRNO_START_STATUS + 9)
363 #define PJ_ETOOMANY (PJ_ERRNO_START_STATUS + 10)
368 #define PJ_EBUSY (PJ_ERRNO_START_STATUS + 11)
373 #define PJ_ENOTSUP (PJ_ERRNO_START_STATUS + 12)
378 #define PJ_EINVALIDOP (PJ_ERRNO_START_STATUS + 13)
383 #define PJ_ECANCELLED (PJ_ERRNO_START_STATUS + 14)
388 #define PJ_EEXISTS (PJ_ERRNO_START_STATUS + 15)
393 #define PJ_EEOF (PJ_ERRNO_START_STATUS + 16)
398 #define PJ_ETOOBIG (PJ_ERRNO_START_STATUS + 17)
404 #define PJ_ERESOLVE (PJ_ERRNO_START_STATUS + 18)
409 #define PJ_ETOOSMALL (PJ_ERRNO_START_STATUS + 19)
414 #define PJ_EIGNORED (PJ_ERRNO_START_STATUS + 20)
419 #define PJ_EIPV6NOTSUP (PJ_ERRNO_START_STATUS + 21)
424 #define PJ_EAFNOTSUP (PJ_ERRNO_START_STATUS + 22)
429 #define PJ_EGONE (PJ_ERRNO_START_STATUS + 23)
439 #define PJ_ERRNO_START 20000
445 #define PJ_ERRNO_SPACE_SIZE 50000
451 #define PJ_ERRNO_START_STATUS (PJ_ERRNO_START + PJ_ERRNO_SPACE_SIZE)
458 #define PJ_ERRNO_START_SYS (PJ_ERRNO_START_STATUS + PJ_ERRNO_SPACE_SIZE)
465 #define PJ_ERRNO_START_USER (PJ_ERRNO_START_SYS + PJ_ERRNO_SPACE_SIZE)
481 void pj_errno_clear_handlers( void);
492 #if PJ_LOG_MAX_LEVEL >= 1
493 #define pj_perror_wrapper_1(arg) pj_perror_1 arg
496 const char *title_fmt, ...);
498 #define pj_perror_wrapper_1(arg)
507 #if PJ_LOG_MAX_LEVEL >= 2
508 #define pj_perror_wrapper_2(arg) pj_perror_2 arg
511 const char *title_fmt, ...);
513 #define pj_perror_wrapper_2(arg)
522 #if PJ_LOG_MAX_LEVEL >= 3
523 #define pj_perror_wrapper_3(arg) pj_perror_3 arg
526 const char *title_fmt, ...);
528 #define pj_perror_wrapper_3(arg)
537 #if PJ_LOG_MAX_LEVEL >= 4
538 #define pj_perror_wrapper_4(arg) pj_perror_4 arg
541 const char *title_fmt, ...);
543 #define pj_perror_wrapper_4(arg)
552 #if PJ_LOG_MAX_LEVEL >= 5
553 #define pj_perror_wrapper_5(arg) pj_perror_5 arg
555 PJ_DECL( void) pj_perror_5(const char *sender, pj_status_t status,
556 const char *title_fmt, ...);
558 #define pj_perror_wrapper_5(arg)
567 #if PJ_LOG_MAX_LEVEL >= 6
568 #define pj_perror_wrapper_6(arg) pj_perror_6 arg
570 PJ_DECL( void) pj_perror_6(const char *sender, pj_status_t status,
571 const char *title_fmt, ...);
573 #define pj_perror_wrapper_6(arg)
PJLIB Open Source, high performance, small footprint, and very very portable framework
Copyright (C) 2006-2009 Teluu Inc.
|