[Freeswitch-branches] [commit] r5263 - in freeswitch/branches/greenlizard/libs: iax/src js/nsprpub/pr/src/io js/nsprpub/pr/src/misc js/nsprpub/pr/src/pthreads libedit libedit/src

Freeswitch SVN greenlizard at freeswitch.org
Tue Jun 5 12:03:01 EDT 2007


Author: greenlizard
Date: Tue Jun  5 12:03:00 2007
New Revision: 5263

Modified:
   freeswitch/branches/greenlizard/libs/iax/src/iax.c
   freeswitch/branches/greenlizard/libs/js/nsprpub/pr/src/io/prfdcach.c
   freeswitch/branches/greenlizard/libs/js/nsprpub/pr/src/io/prlog.c
   freeswitch/branches/greenlizard/libs/js/nsprpub/pr/src/misc/prinit.c
   freeswitch/branches/greenlizard/libs/js/nsprpub/pr/src/pthreads/ptthread.c
   freeswitch/branches/greenlizard/libs/libedit/Makefile.am
   freeswitch/branches/greenlizard/libs/libedit/src/el.c
   freeswitch/branches/greenlizard/libs/libedit/src/sig.c
   freeswitch/branches/greenlizard/libs/libedit/src/sig.h
   freeswitch/branches/greenlizard/libs/libedit/src/term.c
   freeswitch/branches/greenlizard/libs/libedit/src/unvis.c
   freeswitch/branches/greenlizard/libs/libedit/src/vi.c
   freeswitch/branches/greenlizard/libs/libedit/src/vis.c

Log:
merge in changes from trunk 5202 to 5240.  accidentally forgot to commit the libs directory on last commit.

Modified: freeswitch/branches/greenlizard/libs/iax/src/iax.c
==============================================================================
--- freeswitch/branches/greenlizard/libs/iax/src/iax.c	(original)
+++ freeswitch/branches/greenlizard/libs/iax/src/iax.c	Tue Jun  5 12:03:00 2007
@@ -140,7 +140,7 @@
 /* Max timeouts */
 static int maxretries = 10;
 
-/* configurable jitterbuffer options */
+/* configurable jitterbuffer options */
 static long jb_target_extra = -1; 
 
 static int do_shutdown = 0;
@@ -948,11 +948,11 @@
 	return do_shutdown++;
 }
 
-void iax_set_jb_target_extra( long value )
-{
-	/* store in jb_target_extra, a static global */
-	jb_target_extra = value ;
-}
+void iax_set_jb_target_extra( long value )
+{
+	/* store in jb_target_extra, a static global */
+	jb_target_extra = value ;
+}
 
 int iax_init(char *ip, int preferredportno)
 {
@@ -979,33 +979,33 @@
 		    return -1;
 	    }
 	    
-	    if (preferredportno == 0) preferredportno = IAX_DEFAULT_PORTNO;
-		if (preferredportno < 0)  preferredportno = 0;
-
-		sin.sin_family = AF_INET;
-		sin.sin_addr.s_addr = 0;
-		sin.sin_port = htons((short)preferredportno);
-		if (bind(netfd, (struct sockaddr *) &sin, sizeof(sin)) < 0) 
-		{
-#if defined(WIN32)  ||  defined(_WIN32_WCE)
-			if (WSAGetLastError() == WSAEADDRINUSE)
-#else
-			if (errno == EADDRINUSE)
-#endif
-			{
-				/*the port is already in use, so bind to a free port chosen by the IP stack*/
-				DEBU(G "Unable to bind to preferred port - port is in use. Trying to bind to a free one");
-				sin.sin_port = htons((short)0);
-				if (bind(netfd, (struct sockaddr *) &sin, sizeof(sin)) < 0)
-				{
-					IAXERROR "Unable to bind UDP socket\n");
-					return -1;
-				}
-			} else
-			{
-				IAXERROR "Unable to bind UDP socket\n");
-				return -1;
-			}
+	    if (preferredportno == 0) preferredportno = IAX_DEFAULT_PORTNO;
+		if (preferredportno < 0)  preferredportno = 0;
+
+		sin.sin_family = AF_INET;
+		sin.sin_addr.s_addr = 0;
+		sin.sin_port = htons((short)preferredportno);
+		if (bind(netfd, (struct sockaddr *) &sin, sizeof(sin)) < 0) 
+		{
+#if defined(WIN32)  ||  defined(_WIN32_WCE)
+			if (WSAGetLastError() == WSAEADDRINUSE)
+#else
+			if (errno == EADDRINUSE)
+#endif
+			{
+				/*the port is already in use, so bind to a free port chosen by the IP stack*/
+				DEBU(G "Unable to bind to preferred port - port is in use. Trying to bind to a free one");
+				sin.sin_port = htons((short)0);
+				if (bind(netfd, (struct sockaddr *) &sin, sizeof(sin)) < 0)
+				{
+					IAXERROR "Unable to bind UDP socket\n");
+					return -1;
+				}
+			} else
+			{
+				IAXERROR "Unable to bind UDP socket\n");
+				return -1;
+			}
 		}
 		sinlen = sizeof(sin);
 	    if (getsockname(netfd, (struct sockaddr *) &sin, &sinlen) < 0) {
@@ -1587,12 +1587,12 @@
 				iax_send_pong(event->session, event->ts);
 				iax_event_free(event);
 				break;
-			case IAX_EVENT_POKE:
-				event->etype = IAX_EVENT_PONG;
-				iax_send_pong(event->session, event->ts);
-				iax_destroy(event->session);
-				iax_event_free(event);
-				break;         
+			case IAX_EVENT_POKE:
+				event->etype = IAX_EVENT_PONG;
+				iax_send_pong(event->session, event->ts);
+				iax_destroy(event->session);
+				iax_event_free(event);
+				break;         
 			default:
 				return event;
 			}
@@ -2702,9 +2702,9 @@
 				e->ts = ts;
 				e = schedule_delivery(e, ts, updatehistory);
 				break;
-			case IAX_COMMAND_POKE:
-				e->etype = IAX_EVENT_POKE;
-				e->ts = ts;
+			case IAX_COMMAND_POKE:
+				e->etype = IAX_EVENT_POKE;
+				e->ts = ts;
 				break;
 			case IAX_COMMAND_PING:
 				/* PINGS and PONGS don't get scheduled; */

Modified: freeswitch/branches/greenlizard/libs/js/nsprpub/pr/src/io/prfdcach.c
==============================================================================
--- freeswitch/branches/greenlizard/libs/js/nsprpub/pr/src/io/prfdcach.c	(original)
+++ freeswitch/branches/greenlizard/libs/js/nsprpub/pr/src/io/prfdcach.c	Tue Jun  5 12:03:00 2007
@@ -259,8 +259,8 @@
     ** be overridden at runtime using environment variables
     ** or a super-wiz-bang API.
     */
-    //const char *low = PR_GetEnv("NSPR_FD_CACHE_SIZE_LOW");
-    //const char *high = PR_GetEnv("NSPR_FD_CACHE_SIZE_HIGH");
+    /* const char *low = PR_GetEnv("NSPR_FD_CACHE_SIZE_LOW"); */
+    /* const char *high = PR_GetEnv("NSPR_FD_CACHE_SIZE_HIGH"); */
 
     /* 
     ** _low is allowed to be zero, _high is not.
@@ -274,8 +274,8 @@
     _pr_fd_cache.limit_high = 0;
 #endif  /* defined(DEBUG) */
 
-    //if (NULL != low) _pr_fd_cache.limit_low = atoi(low);
-    //if (NULL != high) _pr_fd_cache.limit_high = atoi(high);
+    /*if (NULL != low) _pr_fd_cache.limit_low = atoi(low);*/
+    /*if (NULL != high) _pr_fd_cache.limit_high = atoi(high);*/
 
     if (_pr_fd_cache.limit_high < _pr_fd_cache.limit_low)
         _pr_fd_cache.limit_high = _pr_fd_cache.limit_low;

Modified: freeswitch/branches/greenlizard/libs/js/nsprpub/pr/src/io/prlog.c
==============================================================================
--- freeswitch/branches/greenlizard/libs/js/nsprpub/pr/src/io/prlog.c	(original)
+++ freeswitch/branches/greenlizard/libs/js/nsprpub/pr/src/io/prlog.c	Tue Jun  5 12:03:00 2007
@@ -208,7 +208,7 @@
 
     _pr_logLock = PR_NewLock();
 
-//    ev = PR_GetEnv("NSPR_LOG_MODULES");
+    /*   ev = PR_GetEnv("NSPR_LOG_MODULES"); */
     if (ev && ev[0]) {
         char module[64];  /* Security-Critical: If you change this
                            * size, you must also change the sscanf
@@ -255,7 +255,7 @@
         }
         PR_SetLogBuffering(isSync ? bufSize : 0);
 
-        //ev = PR_GetEnv("NSPR_LOG_FILE");
+        /* ev = PR_GetEnv("NSPR_LOG_FILE"); */
         if (ev && ev[0]) {
             if (!PR_SetLogFile(ev)) {
 #ifdef XP_PC
@@ -318,7 +318,7 @@
 {
     char *ev = NULL;
 
-    //ev = PR_GetEnv("NSPR_LOG_MODULES");
+    /* ev = PR_GetEnv("NSPR_LOG_MODULES"); */
     if (ev && ev[0]) {
         char module[64];  /* Security-Critical: If you change this
                            * size, you must also change the sscanf

Modified: freeswitch/branches/greenlizard/libs/js/nsprpub/pr/src/misc/prinit.c
==============================================================================
--- freeswitch/branches/greenlizard/libs/js/nsprpub/pr/src/misc/prinit.c	(original)
+++ freeswitch/branches/greenlizard/libs/js/nsprpub/pr/src/misc/prinit.c	Tue Jun  5 12:03:00 2007
@@ -202,7 +202,6 @@
     _PR_InitSegs();
     _PR_InitStacks();
 	_PR_InitTPD();
-    //_PR_InitEnv();
     _PR_InitLayerCache();
     _PR_InitClock();
 
@@ -234,22 +233,10 @@
     _PR_InitMem();
 #endif
 
-    //_PR_InitCMon();
     _PR_InitIO();
-    //_PR_InitNet();
     _PR_InitLog();
-    //_PR_InitLinker();
     _PR_InitCallOnce();
-    //_PR_InitDtoa();
     _PR_InitMW();
-    //_PR_InitRWLocks();
-
-    //nspr_InitializePRErrorTable();
-
-#if !defined(_PR_INET6) || defined(_PR_INET6_PROBE)
-	//_pr_init_ipv6();
-#endif
-	
     _PR_MD_FINAL_INIT();
 }
 
@@ -420,9 +407,7 @@
 #endif
 
         _PR_CleanupMW();
-        //_PR_CleanupDtoa();
         _PR_CleanupCallOnce();
-		//_PR_ShutdownLinker();
         /* Release the primordial thread's private data, etc. */
         _PR_CleanupThread(me);
 
@@ -452,7 +437,6 @@
          * Ideally, for each _PR_InitXXX(), there should be a corresponding
          * _PR_XXXCleanup() that we can call here.
          */
-        //_PR_CleanupNet();
         _PR_CleanupIO();
 #ifdef WINNT
         _PR_CleanupCPUs();
@@ -461,7 +445,6 @@
         PR_DestroyLock(_pr_sleeplock);
         _pr_sleeplock = NULL;
         _PR_CleanupLayerCache();
-        //_PR_CleanupEnv();
         _PR_CleanupStacks();
         _PR_CleanupBeforeExit();
         _pr_initialized = PR_FALSE;

Modified: freeswitch/branches/greenlizard/libs/js/nsprpub/pr/src/pthreads/ptthread.c
==============================================================================
--- freeswitch/branches/greenlizard/libs/js/nsprpub/pr/src/pthreads/ptthread.c	(original)
+++ freeswitch/branches/greenlizard/libs/js/nsprpub/pr/src/pthreads/ptthread.c	Tue Jun  5 12:03:00 2007
@@ -938,9 +938,7 @@
         PR_Unlock(pt_book.ml);
 
         _PR_CleanupMW();
-        //_PR_CleanupDtoa();
         _PR_CleanupCallOnce();
-        //_PR_ShutdownLinker();
         _PR_LogCleanup();
         _PR_CleanupNet();
         /* Close all the fd's before calling _PR_CleanupIO */
@@ -963,7 +961,6 @@
         PR_DestroyLock(_pr_sleeplock);
         _pr_sleeplock = NULL;
         _PR_CleanupLayerCache();
-        //_PR_CleanupEnv();
 #ifdef _PR_ZONE_ALLOCATOR
         _PR_DestroyZones();
 #endif

Modified: freeswitch/branches/greenlizard/libs/libedit/Makefile.am
==============================================================================
--- freeswitch/branches/greenlizard/libs/libedit/Makefile.am	(original)
+++ freeswitch/branches/greenlizard/libs/libedit/Makefile.am	Tue Jun  5 12:03:00 2007
@@ -1,7 +1,7 @@
 
 AUTOMAKE_OPTIONS = foreign
 
-SUBDIRS = src examples doc
+SUBDIRS = src
 
 ## GENERATED BY SCRIPT - DO NOT EDIT BELOW
 

Modified: freeswitch/branches/greenlizard/libs/libedit/src/el.c
==============================================================================
--- freeswitch/branches/greenlizard/libs/libedit/src/el.c	(original)
+++ freeswitch/branches/greenlizard/libs/libedit/src/el.c	Tue Jun  5 12:03:00 2007
@@ -522,7 +522,9 @@
 	sigset_t oset, nset;
 
 	(void) sigemptyset(&nset);
+#ifdef SIGWINCH
 	(void) sigaddset(&nset, SIGWINCH);
+#endif
 	(void) sigprocmask(SIG_BLOCK, &nset, &oset);
 
 	/* get the correct window size */

Modified: freeswitch/branches/greenlizard/libs/libedit/src/sig.c
==============================================================================
--- freeswitch/branches/greenlizard/libs/libedit/src/sig.c	(original)
+++ freeswitch/branches/greenlizard/libs/libedit/src/sig.c	Tue Jun  5 12:03:00 2007
@@ -83,9 +83,11 @@
 		term__flush();
 		break;
 
+#ifdef SIGWINCH
 	case SIGWINCH:
 		el_resize(sel);
 		break;
+#endif
 
 	default:
 		tty_cookedmode(sel);

Modified: freeswitch/branches/greenlizard/libs/libedit/src/sig.h
==============================================================================
--- freeswitch/branches/greenlizard/libs/libedit/src/sig.h	(original)
+++ freeswitch/branches/greenlizard/libs/libedit/src/sig.h	Tue Jun  5 12:03:00 2007
@@ -48,6 +48,7 @@
  * Define here all the signals we are going to handle
  * The _DO macro is used to iterate in the source code
  */
+#ifdef SIGWINCH
 #define	ALLSIGS		\
 	_DO(SIGINT)	\
 	_DO(SIGTSTP)	\
@@ -57,6 +58,16 @@
 	_DO(SIGTERM)	\
 	_DO(SIGCONT)	\
 	_DO(SIGWINCH)
+#else
+#define ALLSIGS     \
+    _DO(SIGINT) \
+    _DO(SIGTSTP)    \
+    _DO(SIGSTOP)    \
+    _DO(SIGQUIT)    \
+    _DO(SIGHUP) \
+    _DO(SIGTERM)    \
+    _DO(SIGCONT)
+#endif
 
 typedef void (*el_signalhandler_t)(int);
 typedef el_signalhandler_t *el_signal_t;

Modified: freeswitch/branches/greenlizard/libs/libedit/src/term.c
==============================================================================
--- freeswitch/branches/greenlizard/libs/libedit/src/term.c	(original)
+++ freeswitch/branches/greenlizard/libs/libedit/src/term.c	Tue Jun  5 12:03:00 2007
@@ -905,7 +905,9 @@
 	int lins, cols;
 
 	(void) sigemptyset(&nset);
+#ifdef SIGWINCH
 	(void) sigaddset(&nset, SIGWINCH);
+#endif
 	(void) sigprocmask(SIG_BLOCK, &nset, &oset);
 
 	area = buf;

Modified: freeswitch/branches/greenlizard/libs/libedit/src/unvis.c
==============================================================================
--- freeswitch/branches/greenlizard/libs/libedit/src/unvis.c	(original)
+++ freeswitch/branches/greenlizard/libs/libedit/src/unvis.c	Tue Jun  5 12:03:00 2007
@@ -63,7 +63,7 @@
 #define	S_HEX1		7	/* hex digit */
 #define	S_HEX2		8	/* hex digit 2 */
 
-#define	isoctal(c)	(((u_char)(c)) >= '0' && ((u_char)(c)) <= '7')
+#define	isoctal(c)	(((unsigned char)(c)) >= '0' && ((unsigned char)(c)) <= '7')
 #define xtod(c)		(isdigit(c) ? (c - '0') : ((tolower(c) - 'a') + 10))
 
 /*

Modified: freeswitch/branches/greenlizard/libs/libedit/src/vi.c
==============================================================================
--- freeswitch/branches/greenlizard/libs/libedit/src/vi.c	(original)
+++ freeswitch/branches/greenlizard/libs/libedit/src/vi.c	Tue Jun  5 12:03:00 2007
@@ -915,14 +915,14 @@
  * NB: posix implies that we should enter insert mode, however
  * this is against historical precedent...
  */
-#ifdef __weak_reference
+#if defined(__weak_reference) && !defined(__FreeBSD__)
 extern char *get_alias_text(const char *) __weak_reference(get_alias_text);
 #endif
 protected el_action_t
 /*ARGSUSED*/
 vi_alias(EditLine *el, int c)
 {
-#ifdef __weak_reference
+#if defined(__weak_reference) && !defined(__FreeBSD__)
 	char alias_name[3];
 	char *alias_text;
 

Modified: freeswitch/branches/greenlizard/libs/libedit/src/vis.c
==============================================================================
--- freeswitch/branches/greenlizard/libs/libedit/src/vis.c	(original)
+++ freeswitch/branches/greenlizard/libs/libedit/src/vis.c	Tue Jun  5 12:03:00 2007
@@ -106,7 +106,7 @@
 #undef BELL
 #define BELL '\a'
 
-#define isoctal(c)	(((u_char)(c)) >= '0' && ((u_char)(c)) <= '7')
+#define isoctal(c)	(((unsigned char)(c)) >= '0' && ((unsigned char)(c)) <= '7')
 #define iswhite(c)	(c == ' ' || c == '\t' || c == '\n')
 #define issafe(c)	(c == '\b' || c == BELL || c == '\r')
 #define xtoa(c)		"0123456789abcdef"[c]
@@ -208,8 +208,8 @@
 	}								      \
 	if (isextra || ((c & 0177) == ' ') || (flag & VIS_OCTAL)) {	      \
 		*dst++ = '\\';						      \
-		*dst++ = (u_char)(((u_int32_t)(u_char)c >> 6) & 03) + '0';    \
-		*dst++ = (u_char)(((u_int32_t)(u_char)c >> 3) & 07) + '0';    \
+		*dst++ = (unsigned char)(((u_int32_t)(unsigned char)c >> 6) & 03) + '0';    \
+		*dst++ = (unsigned char)(((u_int32_t)(unsigned char)c >> 3) & 07) + '0';    \
 		*dst++ =			     (c	      & 07) + '0';    \
 	} else {							      \
 		if ((flag & VIS_NOSLASH) == 0) *dst++ = '\\';		      \



More information about the Freeswitch-branches mailing list