summaryrefslogtreecommitdiff
path: root/pjlib/src
diff options
context:
space:
mode:
Diffstat (limited to 'pjlib/src')
-rw-r--r--pjlib/src/pj/ctype.c24
-rw-r--r--pjlib/src/pj/log.c4
-rw-r--r--pjlib/src/pj/os_core_win32.c4
-rw-r--r--pjlib/src/pj/string.c12
4 files changed, 28 insertions, 16 deletions
diff --git a/pjlib/src/pj/ctype.c b/pjlib/src/pj/ctype.c
new file mode 100644
index 00000000..b274ccaf
--- /dev/null
+++ b/pjlib/src/pj/ctype.c
@@ -0,0 +1,24 @@
+/* $Id: $ */
+/*
+ * Copyright (C)2003-2006 Benny Prijono <benny@prijono.org>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+#include <pj/ctype.h>
+
+
+char pj_hex_digits[] = {'0', '1', '2', '3', '4', '5', '6', '7',
+ '8', '9', 'a', 'b', 'c', 'd', 'e', 'f' };
+
diff --git a/pjlib/src/pj/log.c b/pjlib/src/pj/log.c
index 2e4e931b..55e7cf39 100644
--- a/pjlib/src/pj/log.c
+++ b/pjlib/src/pj/log.c
@@ -64,8 +64,8 @@ PJ_DEF(pj_log_func*) pj_log_get_log_func(void)
return log_writer;
}
-static void pj_log(const char *sender, int level,
- const char *format, va_list marker)
+PJ_DEF(void) pj_log( const char *sender, int level,
+ const char *format, va_list marker)
{
pj_time_val now;
pj_parsed_time ptime;
diff --git a/pjlib/src/pj/os_core_win32.c b/pjlib/src/pj/os_core_win32.c
index 05f3f341..b8e6b281 100644
--- a/pjlib/src/pj/os_core_win32.c
+++ b/pjlib/src/pj/os_core_win32.c
@@ -129,17 +129,13 @@ PJ_DEF(pj_status_t) pj_init(void)
pj_str_t guid;
pj_status_t rc;
- PJ_LOG(5, ("pj_init", "Initializing PJ Library.."));
-
/* Init Winsock.. */
if (WSAStartup(MAKEWORD(2,0), &wsa) != 0) {
- PJ_LOG(1, ("pj_init", "Winsock initialization has returned an error"));
return PJ_RETURN_OS_ERROR(WSAGetLastError());
}
/* Init this thread's TLS. */
if ((rc=pj_thread_init()) != PJ_SUCCESS) {
- PJ_LOG(1, ("pj_init", "Thread initialization has returned an error"));
return rc;
}
diff --git a/pjlib/src/pj/string.c b/pjlib/src/pj/string.c
index 34a518fb..5c152fb5 100644
--- a/pjlib/src/pj/string.c
+++ b/pjlib/src/pj/string.c
@@ -27,9 +27,6 @@
#endif
-static char hex[] = {'0', '1', '2', '3', '4', '5', '6', '7',
- '8', '9', 'a', 'b', 'c', 'd', 'e', 'f' };
-
PJ_DEF(pj_str_t*) pj_strltrim( pj_str_t *str )
{
register char *p = str->ptr;
@@ -50,12 +47,6 @@ PJ_DEF(pj_str_t*) pj_strrtrim( pj_str_t *str )
return str;
}
-PJ_INLINE(void) pj_val_to_hex_digit(unsigned value, char *p)
-{
- *p++ = hex[ (value & 0xF0) >> 4 ];
- *p++ = hex[ (value & 0x0F) ];
-}
-
PJ_DEF(char*) pj_create_random_string(char *str, pj_size_t len)
{
unsigned i;
@@ -72,7 +63,7 @@ PJ_DEF(char*) pj_create_random_string(char *str, pj_size_t len)
p += 8;
}
for (i=i * 8; i<len; ++i) {
- *p++ = hex[ pj_rand() & 0x0F ];
+ *p++ = pj_hex_digits[ pj_rand() & 0x0F ];
}
return str;
}
@@ -129,3 +120,4 @@ PJ_DEF(int) pj_utoa_pad( unsigned long val, char *buf, int min_dig, int pad)
return len;
}
+