summaryrefslogtreecommitdiff
path: root/pjlib/src/pj/errno.c
diff options
context:
space:
mode:
authorBenny Prijono <bennylp@teluu.com>2006-03-18 12:26:55 +0000
committerBenny Prijono <bennylp@teluu.com>2006-03-18 12:26:55 +0000
commit1ef58d201f4613f91a9cbafa4545f37f3fab3cf6 (patch)
tree7169f9c55ab05f6140bc6f2faa0d583166b1eb94 /pjlib/src/pj/errno.c
parentf8793f52a83dd232eddf2bb61f48cca6dd759ffd (diff)
Added option to disable error message altogether, to save space footprint
git-svn-id: http://svn.pjsip.org/repos/pjproject/trunk@330 74dad513-b988-da41-8d7b-12977e46ad98
Diffstat (limited to 'pjlib/src/pj/errno.c')
-rw-r--r--pjlib/src/pj/errno.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/pjlib/src/pj/errno.c b/pjlib/src/pj/errno.c
index 9843105c..086bfcd7 100644
--- a/pjlib/src/pj/errno.c
+++ b/pjlib/src/pj/errno.c
@@ -39,6 +39,7 @@ static struct err_msg_hnd
} err_msg_hnd[PJLIB_MAX_ERR_MSG_HANDLER];
/* PJLIB's own error codes/messages */
+#if defined(PJ_HAS_ERROR_STRING) && PJ_HAS_ERROR_STRING!=0
static const struct
{
int code;
@@ -62,6 +63,8 @@ static const struct
{ PJ_EEXISTS, "Object already exists" },
{ PJ_EEOF, "End of file" },
};
+#endif /* PJ_HAS_ERROR_STRING */
+
/*
* pjlib_error()
@@ -70,6 +73,7 @@ static const struct
*/
static int pjlib_error(pj_status_t code, char *buf, pj_size_t size)
{
+#if defined(PJ_HAS_ERROR_STRING) && PJ_HAS_ERROR_STRING!=0
unsigned i;
for (i=0; i<sizeof(err_str)/sizeof(err_str[0]); ++i) {
@@ -81,12 +85,9 @@ static int pjlib_error(pj_status_t code, char *buf, pj_size_t size)
return len;
}
}
+#endif
- *buf++ = '?';
- *buf++ = '?';
- *buf++ = '?';
- *buf++ = '\0';
- return 3;
+ return pj_ansi_snprintf( buf, size, "Unknown pjlib error %d", code);
}
#define IN_RANGE(val,start,end) ((val)>=(start) && (val)<(end))