diff options
author | Benny Prijono <bennylp@teluu.com> | 2006-02-02 19:15:03 +0000 |
---|---|---|
committer | Benny Prijono <bennylp@teluu.com> | 2006-02-02 19:15:03 +0000 |
commit | 6cbba81e8937d6793705608e7e68e83ec950dd2a (patch) | |
tree | efc1d00495b6e80bee2bfe02ef7a9951a40ca2c0 /pjlib/include/pj/errno.h | |
parent | 0d61adeb5f784b45f76d76dad9974f4111fb3c8c (diff) |
Added framework for attaching custom error message handler
git-svn-id: http://svn.pjsip.org/repos/pjproject/trunk@128 74dad513-b988-da41-8d7b-12977e46ad98
Diffstat (limited to 'pjlib/include/pj/errno.h')
-rw-r--r-- | pjlib/include/pj/errno.h | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/pjlib/include/pj/errno.h b/pjlib/include/pj/errno.h index ffb72c19..83e0c800 100644 --- a/pjlib/include/pj/errno.h +++ b/pjlib/include/pj/errno.h @@ -106,6 +106,29 @@ PJ_DECL(void) pj_set_netos_error(pj_status_t code); PJ_DECL(pj_str_t) pj_strerror( pj_status_t statcode, char *buf, pj_size_t bufsize); +/** + * Register strerror message handler for the specified error space. + * Application can register its own handler to supply the error message + * for the specified error code range. This handler will be called + * by #pj_strerror(). + * + * @param start_code The starting error code where the handler should + * be called to retrieve the error message. + * @param err_space The size of error space. The error code range then + * will fall in start_code to start_code+err_space-1 + * range. + * @param f The handler to be called when #pj_strerror() is + * supplied with error code that falls into this range. + * + * @return PJ_SUCCESS or the specified error code. The + * registration may fail when the error space has been + * occupied by other handler, or when there are too many + * handlers registered to PJLIB. + */ +PJ_DECL(pj_status_t) pj_register_strerror(pj_status_t start_code, + pj_status_t err_space, + pj_str_t (*f)(pj_status_t,char*, + pj_size_t)); /** * @hideinitializer |