- Timestamp:
- Mar 20, 2006 12:39:24 PM (19 years ago)
- Location:
- pjproject/trunk
- Files:
-
- 7 added
- 20 edited
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
pjproject/trunk/configure
r316 r338 4 4 # Detect machine 5 5 # 6 MACHINE=`uname - m`6 MACHINE=`uname -p` 7 7 8 8 if echo $MACHINE | grep sun4u > /dev/null; then … … 12 12 elif echo $MACHINE | grep alpha > /dev/null; then 13 13 MACHINE_NAME=alpha 14 elif echo $MACHINE | grep powerpc > /dev/null; then 15 MACHINE_NAME=powerpc 14 16 else 15 echo "Unable to detect processor type ('uname - m' == '$MACHINE')"17 echo "Unable to detect processor type ('uname -p' == '$MACHINE')" 16 18 exit 1 17 19 fi … … 45 47 OS_NAME=win32 46 48 HOST_NAME=mingw 49 elif echo $SYSTEM | grep -i darwin > /dev/null; then 50 OS_NAME=darwinos 51 HOST_NAME=unix 47 52 else 48 53 echo "Unable to detect system type ('uname -s' == '$SYSTEM')" -
pjproject/trunk/pjlib/build
- Property svn:ignore
-
old new 8 8 test*.txt 9 9 *.vcproj* 10 .gdb*
-
- Property svn:ignore
-
pjproject/trunk/pjlib/build/Makefile
r153 r338 23 23 export PJLIB_OBJS += $(OS_OBJS) $(M_OBJS) $(CC_OBJS) $(HOST_OBJS) \ 24 24 array.o config.o ctype.o errno.o except.o fifobuf.o guid.o \ 25 hash.o list.o lock.o log.o \25 hash.o list.o lock.o log.o os_time_common.o \ 26 26 pool.o pool_caching.o rand.o \ 27 27 rbtree.o string.o timer.o \ -
pjproject/trunk/pjlib/build/os-linux.mak
r65 r338 10 10 export PJLIB_OBJS += addr_resolv_sock.o guid_simple.o \ 11 11 log_writer_stdout.o os_core_unix.o \ 12 os_error_unix.o os_time_ ansi.o \12 os_error_unix.o os_time_unix.o \ 13 13 os_timestamp_common.o os_timestamp_linux.o \ 14 14 os_time_ansi.o \ -
pjproject/trunk/pjlib/build/os-sunos.mak
r65 r338 10 10 export PJLIB_OBJS += addr_resolv_sock.o guid_simple.o \ 11 11 log_writer_stdout.o os_core_unix.o \ 12 os_error_unix.o os_time_ ansi.o \12 os_error_unix.o os_time_unix.o \ 13 13 os_timestamp_common.o os_timestamp_linux.o \ 14 14 os_time_ansi.o \ -
pjproject/trunk/pjlib/include/pj/compat/errno.h
r125 r338 27 27 # define pj_get_native_netos_error() WSAGetLastError() 28 28 29 #elif (defined(PJ_LINUX) && PJ_LINUX != 0) || \ 30 (defined(PJ_LINUX_KERNEL) && PJ_LINUX_KERNEL != 0) || \ 31 (defined(PJ_SUNOS) && PJ_SUNOS != 0) 29 #elif defined(PJ_HAS_ERRNO_VAR) && PJ_HAS_ERRNO_VAR!= 0 32 30 33 31 typedef int pj_os_err_type; … … 37 35 #else 38 36 39 # error "Please define pj_os_err_typefor this platform here!"37 # error "Please define how to get errno for this platform here!" 40 38 41 39 #endif -
pjproject/trunk/pjlib/include/pj/compat/os_linux.h
r153 r338 44 44 #define PJ_HAS_SYS_SELECT_H 1 45 45 #define PJ_HAS_SYS_SOCKET_H 1 46 #define PJ_HAS_SYS_TIME_H 0 46 47 #define PJ_HAS_SYS_TIMEB_H 1 47 48 #define PJ_HAS_SYS_TYPES_H 1 … … 54 55 55 56 #define PJ_SOCK_HAS_INET_ATON 1 57 #define PJ_SOCKADDR_HAS_LEN 0 58 59 /* Is errno a good way to retrieve OS errors? 60 */ 61 #define PJ_HAS_ERRNO_VAR 1 56 62 57 63 /* When this macro is set, getsockopt(SOL_SOCKET, SO_ERROR) will return -
pjproject/trunk/pjlib/include/pj/compat/os_linux_kernel.h
r153 r338 44 44 #define PJ_HAS_SYS_SELECT_H 0 45 45 #define PJ_HAS_SYS_SOCKET_H 0 46 #define PJ_HAS_SYS_TIME_H 0 46 47 #define PJ_HAS_SYS_TIMEB_H 0 47 48 #define PJ_HAS_SYS_TYPES_H 0 … … 54 55 55 56 #define PJ_SOCK_HAS_INET_ATON 0 57 #define PJ_SOCKADDR_HAS_LEN 0 56 58 57 59 /* When this macro is set, getsockopt(SOL_SOCKET, SO_ERROR) will return -
pjproject/trunk/pjlib/include/pj/compat/os_palmos.h
r153 r338 53 53 54 54 #define PJ_SOCK_HAS_INET_ATON 0 55 #define PJ_SOCKADDR_HAS_LEN 0 56 57 /* Is errno a good way to retrieve OS errors? 58 */ 59 #define PJ_HAS_ERRNO_VAR 0 55 60 56 61 /* When this macro is set, getsockopt(SOL_SOCKET, SO_ERROR) will return -
pjproject/trunk/pjlib/include/pj/compat/os_sunos.h
r153 r338 44 44 #define PJ_HAS_SYS_SELECT_H 1 45 45 #define PJ_HAS_SYS_SOCKET_H 1 46 #define PJ_HAS_SYS_TIME_H 0 46 47 #define PJ_HAS_SYS_TIMEB_H 1 47 48 #define PJ_HAS_SYS_TYPES_H 1 … … 54 55 55 56 #define PJ_SOCK_HAS_INET_ATON 0 57 #define PJ_SOCKADDR_HAS_LEN 0 58 59 /* Is errno a good way to retrieve OS errors? 60 */ 61 #define PJ_HAS_ERRNO_VAR 1 56 62 57 63 /* When this macro is set, getsockopt(SOL_SOCKET, SO_ERROR) will return -
pjproject/trunk/pjlib/include/pj/compat/os_win32.h
r239 r338 50 50 #define PJ_HAS_SYS_SELECT_H 0 51 51 #define PJ_HAS_SYS_SOCKET_H 0 52 #define PJ_HAS_SYS_TIME_H 0 52 53 #define PJ_HAS_SYS_TIMEB_H 1 53 54 #define PJ_HAS_SYS_TYPES_H 1 … … 60 61 61 62 #define PJ_SOCK_HAS_INET_ATON 0 63 #define PJ_SOCKADDR_HAS_LEN 0 64 65 /* Is errno a good way to retrieve OS errors? (No) 66 */ 67 #define PJ_HAS_ERRNO_VAR 0 62 68 63 69 /* When this macro is set, getsockopt(SOL_SOCKET, SO_ERROR) will return -
pjproject/trunk/pjlib/include/pj/compat/os_win32_wince.h
r125 r338 48 48 #define PJ_HAS_SYS_SELECT_H 0 49 49 #define PJ_HAS_SYS_SOCKET_H 0 50 #define PJ_HAS_SYS_TIME_H 0 50 51 #define PJ_HAS_SYS_TIMEB_H 0 /* Doesn't have sys/timeb.h */ 51 52 #define PJ_HAS_SYS_TYPES_H 0 /* Doesn't have sys/types.h */ … … 58 59 59 60 #define PJ_SOCK_HAS_INET_ATON 0 61 #define PJ_SOCKADDR_HAS_LEN 0 62 63 /* Is errno a good way to retrieve OS errors? (no) 64 */ 65 #define PJ_HAS_ERRNO_VAR 0 60 66 61 67 /* When this macro is set, getsockopt(SOL_SOCKET, SO_ERROR) will return … … 98 104 99 105 #endif /* __PJ_COMPAT_OS_WIN32_WINCE_H__ */ 106 -
pjproject/trunk/pjlib/include/pj/compat/time.h
r65 r338 29 29 #endif 30 30 31 #if defined(PJ_HAS_SYS_TIME_H) && PJ_HAS_SYS_TIME_H != 0 32 # include <sys/time.h> 33 #endif 34 31 35 #if defined(PJ_HAS_SYS_TIMEB_H) && PJ_HAS_SYS_TIMEB_H != 0 32 36 # include <sys/timeb.h> … … 35 39 36 40 #endif /* __PJ_COMPAT_TIME_H__ */ 41 -
pjproject/trunk/pjlib/include/pj/config.h
r331 r338 52 52 #elif defined(PJ_SUNOS) && PJ_SUNOS!=0 53 53 # include <pj/compat/os_sunos.h> 54 #elif defined(PJ_DARWINOS) && PJ_DARWINOS!=0 55 # include <pj/compat/os_darwinos.h> 54 56 #else 55 57 # error "Please specify target os." … … 70 72 #elif defined (PJ_M_ARMV4) && PJ_M_ARMV4 != 0 71 73 # include <pj/compat/m_armv4.h> 74 #elif defined (PJ_M_POWERPC) && PJ_M_POWERPC != 0 75 # include <pj/compat/m_powerpc.h> 72 76 #else 73 77 # error "Please specify target machine." … … 247 251 * be set to this value). 248 252 * 249 * Default: 256 (64 for WinCE) 253 * Default: if FD_SETSIZE is defined and the value is greather than 256, 254 * then it will be used. Otherwise 256 (64 for WinCE). 250 255 */ 251 256 #ifndef PJ_IOQUEUE_MAX_HANDLES -
pjproject/trunk/pjlib/include/pj/sock.h
r122 r338 157 157 /** 158 158 * Structure describing a generic socket address. 159 * If PJ_SOCKADDR_HAS_LEN is not zero, then sa_zero_len member is added 160 * to this struct. As far the application is concerned, the value of 161 * this member will always be zero. Internally, PJLIB may modify the value 162 * before calling OS socket API, and reset the value back to zero before 163 * returning the struct to application. 159 164 */ 160 165 typedef struct pj_sockaddr 161 166 { 167 #if defined(PJ_SOCKADDR_HAS_LEN) && PJ_SOCKADDR_HAS_LEN!=0 168 pj_uint8_t sa_zero_len; 169 pj_uint8_t sa_family; 170 #else 162 171 pj_uint16_t sa_family; /**< Common data: address family. */ 172 #endif 163 173 char sa_data[14]; /**< Address data. */ 164 174 } pj_sockaddr; … … 176 186 /** 177 187 * This structure describes Internet socket address. 188 * If PJ_SOCKADDR_HAS_LEN is not zero, then sin_zero_len member is added 189 * to this struct. As far the application is concerned, the value of 190 * this member will always be zero. Internally, PJLIB may modify the value 191 * before calling OS socket API, and reset the value back to zero before 192 * returning the struct to application. 178 193 */ 179 194 struct pj_sockaddr_in 180 195 { 196 #if defined(PJ_SOCKADDR_HAS_LEN) && PJ_SOCKADDR_HAS_LEN!=0 197 pj_uint8_t sin_zero_len; /**< Just ignore this. */ 198 pj_uint8_t sin_family; /**< Address family. */ 199 #else 181 200 pj_uint16_t sin_family; /**< Address family. */ 201 #endif 182 202 pj_uint16_t sin_port; /**< Transport layer port number. */ 183 203 pj_in_addr sin_addr; /**< IP address. */ … … 213 233 /** 214 234 * This structure describes IPv6 socket address. 235 * If PJ_SOCKADDR_HAS_LEN is not zero, then sin_zero_len member is added 236 * to this struct. As far the application is concerned, the value of 237 * this member will always be zero. Internally, PJLIB may modify the value 238 * before calling OS socket API, and reset the value back to zero before 239 * returning the struct to application. 215 240 */ 216 241 typedef struct pj_sockaddr_in6 217 242 { 243 #if defined(PJ_SOCKADDR_HAS_LEN) && PJ_SOCKADDR_HAS_LEN!=0 244 pj_uint8_t sin_zero_len; /**< Just ignore this. */ 245 pj_uint8_t sin_family; /**< Address family. */ 246 #else 218 247 pj_uint16_t sin6_family; /**< Address family */ 248 #endif 219 249 pj_uint16_t sin6_port; /**< Transport layer port number. */ 220 250 pj_uint32_t sin6_flowinfo; /**< IPv6 flow information */ -
pjproject/trunk/pjlib/src/pj/guid_simple.c
r66 r338 21 21 #include <pj/rand.h> 22 22 #include <pj/string.h> 23 #include <pj/compat/sprintf.h>24 23 25 24 const unsigned PJ_GUID_STRING_LENGTH=20; -
pjproject/trunk/pjlib/src/pj/os_core_unix.c
r304 r338 25 25 #include <pj/string.h> 26 26 #include <pj/guid.h> 27 #include <pj/compat/sprintf.h>28 27 #include <pj/except.h> 29 28 #include <pj/errno.h> … … 205 204 206 205 if(cstr_thread_name && pj_strlen(&thread_name) < sizeof(thread->obj_name)-1) 207 pj_ sprintf(thread->obj_name, cstr_thread_name, thread->thread);206 pj_ansi_sprintf(thread->obj_name, cstr_thread_name, thread->thread); 208 207 else 209 pj_ sprintf(thread->obj_name, "thr%p", (void*)thread->thread);208 pj_ansi_sprintf(thread->obj_name, "thr%p", (void*)thread->thread); 210 209 211 210 rc = pj_thread_local_set(thread_tls_id, thread); … … 315 314 316 315 if (strchr(thread_name, '%')) { 317 pj_ snprintf(rec->obj_name, PJ_MAX_OBJ_NAME, thread_name, rec);316 pj_ansi_snprintf(rec->obj_name, PJ_MAX_OBJ_NAME, thread_name, rec); 318 317 } else { 319 318 strncpy(rec->obj_name, thread_name, PJ_MAX_OBJ_NAME); … … 805 804 } 806 805 if (strchr(name, '%')) { 807 pj_ snprintf(mutex->obj_name, PJ_MAX_OBJ_NAME, name, mutex);806 pj_ansi_snprintf(mutex->obj_name, PJ_MAX_OBJ_NAME, name, mutex); 808 807 } else { 809 808 strncpy(mutex->obj_name, name, PJ_MAX_OBJ_NAME); … … 1126 1125 } 1127 1126 if (strchr(name, '%')) { 1128 pj_ snprintf(sem->obj_name, PJ_MAX_OBJ_NAME, name, sem);1127 pj_ansi_snprintf(sem->obj_name, PJ_MAX_OBJ_NAME, name, sem); 1129 1128 } else { 1130 1129 strncpy(sem->obj_name, name, PJ_MAX_OBJ_NAME); -
pjproject/trunk/pjlib/src/pj/os_time_bsd.c
r337 r338 34 34 } 35 35 36 PJ_DEF(pj_status_t) pj_time_decode(const pj_time_val *tv, pj_parsed_time *pt)37 {38 struct tm *local_time;39 40 PJ_CHECK_STACK();41 42 local_time = localtime((time_t*)&tv->sec);43 44 pt->year = local_time->tm_year+1900;45 pt->mon = local_time->tm_mon;46 pt->day = local_time->tm_mday;47 pt->hour = local_time->tm_hour;48 pt->min = local_time->tm_min;49 pt->sec = local_time->tm_sec;50 pt->wday = local_time->tm_wday;51 pt->msec = tv->msec;52 53 return PJ_SUCCESS;54 }55 56 /**57 * Encode parsed time to time value.58 */59 PJ_DEF(pj_status_t) pj_time_encode(const pj_parsed_time *pt, pj_time_val *tv)60 {61 struct tm local_time;62 63 local_time.tm_year = pt->year-1900;64 local_time.tm_mon = pt->mon;65 local_time.tm_mday = pt->day;66 local_time.tm_hour = pt->hour;67 local_time.tm_min = pt->min;68 local_time.tm_sec = pt->sec;69 local_time.tm_isdst = 0;70 71 tv->sec = mktime(&local_time);72 tv->msec = pt->msec;73 74 return PJ_SUCCESS;75 }76 77 /**78 * Convert local time to GMT.79 */80 PJ_DEF(pj_status_t) pj_time_local_to_gmt(pj_time_val *tv);81 82 /**83 * Convert GMT to local time.84 */85 PJ_DEF(pj_status_t) pj_time_gmt_to_local(pj_time_val *tv);86 87 -
pjproject/trunk/pjlib/src/pj/pool_caching.c
r232 r338 58 58 cp->factory.dump_status = &cpool_dump_status; 59 59 60 cp->pool = pj_pool_create_int(&cp->factory, "cachingpool", 128,60 cp->pool = pj_pool_create_int(&cp->factory, "cachingpool", 256, 61 61 0, NULL); 62 62 i = pj_mutex_create_simple(cp->pool, "cachingpool", &cp->mutex); -
pjproject/trunk/pjlib/src/pj/sock_bsd.c
r153 r338 83 83 84 84 85 #if defined(PJ_SOCKADDR_HAS_LEN) && PJ_SOCKADDR_HAS_LEN!=0 86 # define SET_LEN(addr,len) (((pj_sockaddr*)(addr))->sa_zero_len=(len)) 87 # define RESET_LEN(addr) (((pj_sockaddr*)(addr))->sa_zero_len=0) 88 #else 89 # define SET_LEN(addr,len) 90 # define RESET_LEN(addr) 91 #endif 92 93 85 94 /* 86 95 * Convert 16-bit value from network byte order to host byte order. … … 191 200 (addr->sin_addr.s_addr=PJ_INADDR_NONE, PJ_EINVAL)); 192 201 202 RESET_LEN(addr); 193 203 addr->sin_family = AF_INET; 194 204 … … 227 237 PJ_ASSERT_RETURN(addr, (addr->sin_addr.s_addr=PJ_INADDR_NONE, PJ_EINVAL)); 228 238 239 RESET_LEN(addr); 229 240 addr->sin_family = PJ_AF_INET; 230 241 pj_sockaddr_in_set_port(addr, port); … … 347 358 PJ_CHECK_STACK(); 348 359 360 SET_LEN(&addr, sizeof(pj_sockaddr_in)); 349 361 addr.sin_family = PJ_AF_INET; 350 362 addr.sin_addr.s_addr = pj_htonl(addr32); … … 386 398 if (getpeername(sock, (struct sockaddr*)addr, (socklen_t*)namelen) != 0) 387 399 return PJ_RETURN_OS_ERROR(pj_get_native_netos_error()); 388 else 389 return PJ_SUCCESS; 400 else { 401 RESET_LEN(addr); 402 return PJ_SUCCESS; 403 } 390 404 } 391 405 … … 400 414 if (getsockname(sock, (struct sockaddr*)addr, (socklen_t*)namelen) != 0) 401 415 return PJ_RETURN_OS_ERROR(pj_get_native_netos_error()); 402 else 403 return PJ_SUCCESS; 416 else { 417 RESET_LEN(addr); 418 return PJ_SUCCESS; 419 } 404 420 } 405 421 … … 484 500 if (*len < 0) 485 501 return PJ_RETURN_OS_ERROR(pj_get_native_netos_error()); 486 else 487 return PJ_SUCCESS; 502 else { 503 RESET_LEN(from); 504 return PJ_SUCCESS; 505 } 488 506 } 489 507 … … 575 593 PJ_ASSERT_RETURN(newsock != NULL, PJ_EINVAL); 576 594 595 #if defined(PJ_SOCKADDR_HAS_LEN) && PJ_SOCKADDR_HAS_LEN!=0 596 if (addr) { 597 SET_LEN(addr, *addrlen); 598 } 599 #endif 600 577 601 *newsock = accept(serverfd, (struct sockaddr*)addr, (socklen_t*)addrlen); 578 602 if (*newsock==PJ_INVALID_SOCKET) 579 603 return PJ_RETURN_OS_ERROR(pj_get_native_netos_error()); 580 else 581 return PJ_SUCCESS; 604 else { 605 606 #if defined(PJ_SOCKADDR_HAS_LEN) && PJ_SOCKADDR_HAS_LEN!=0 607 if (addr) { 608 RESET_LEN(addr); 609 } 610 #endif 611 612 return PJ_SUCCESS; 613 } 582 614 } 583 615 #endif /* PJ_HAS_TCP */ -
pjproject/trunk/pjlib/src/pj/sock_select.c
r66 r338 25 25 #if defined(PJ_HAS_STRING_H) && PJ_HAS_STRING_H!=0 26 26 # include <string.h> 27 #endif 28 29 #if defined(PJ_HAS_SYS_TIME_H) && PJ_HAS_SYS_TIME_H!=0 30 # include <sys/time.h> 27 31 #endif 28 32
Note: See TracChangeset
for help on using the changeset viewer.