[xiph-cvs] cvs commit: icecast/src config.c connection.c connection.h format.c logging.c main.c source.c stats.c util.c

Jack Moffitt jack at xiph.org
Fri Oct 19 23:43:06 PDT 2001



jack        01/10/19 23:43:05

  Modified:    src      config.c connection.c connection.h format.c
                        logging.c main.c source.c stats.c util.c
  Log:
  Win32 fixes.  Look how portable this was ;)  Just header stuff and some defines.
  Whee!

Revision  Changes    Path
1.2       +8 -2      icecast/src/config.c

Index: config.c
===================================================================
RCS file: /usr/local/cvsroot/icecast/src/config.c,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- config.c	2001/09/10 02:21:48	1.1
+++ config.c	2001/10/20 06:43:04	1.2
@@ -16,10 +16,16 @@
 #define CONFIG_DEFAULT_TOUCH_FREQ 5
 #define CONFIG_DEFAULT_HOSTNAME "localhost"
 #define CONFIG_DEFAULT_PORT 8888
-#define CONFIG_DEFAULT_BASE_DIR "/usr/local/icecast"
-#define CONFIG_DEFAULT_LOG_DIR "/usr/local/icecast/logs"
 #define CONFIG_DEFAULT_ACCESS_LOG "access.log"
 #define CONFIG_DEFAULT_ERROR_LOG "error.log"
+
+#ifndef _WIN32
+#define CONFIG_DEFAULT_BASE_DIR "/usr/local/icecast"
+#define CONFIG_DEFAULT_LOG_DIR "/usr/local/icecast/logs"
+#else
+#define CONFIG_DEFAULT_BASE_DIR ".\\"
+#define CONFIG_DEFAULT_LOG_DIR ".\\logs"
+#endif
 
 ice_config_t _configuration;
 char *_config_filename;

1.2       +8 -2      icecast/src/connection.c

Index: connection.c
===================================================================
RCS file: /usr/local/cvsroot/icecast/src/connection.c,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- connection.c	2001/09/10 02:21:51	1.1
+++ connection.c	2001/10/20 06:43:04	1.2
@@ -1,11 +1,17 @@
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
-#include <sys/time.h>
+#include <time.h>
 #include <sys/types.h>
+
+#ifndef _WIN32
+#include <sys/time.h>
 #include <sys/socket.h>
 #include <netinet/in.h>
-#include <time.h>
+#else
+#define snprintf _snprintf
+#define strcasecmp stricmp
+#endif
 
 #include "os.h"
 

1.2       +1 -1      icecast/src/connection.h

Index: connection.h
===================================================================
RCS file: /usr/local/cvsroot/icecast/src/connection.h,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- connection.h	2001/09/10 02:21:52	1.1
+++ connection.h	2001/10/20 06:43:04	1.2
@@ -6,7 +6,7 @@
         unsigned long id;
 
         time_t con_time;
-	long long sent_bytes;
+	uint64_t sent_bytes;
 
         int sock;
         int error;

1.2       +1 -0      icecast/src/format.c

Index: format.c
===================================================================
RCS file: /usr/local/cvsroot/icecast/src/format.c,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- format.c	2001/09/10 02:21:51	1.1
+++ format.c	2001/10/20 06:43:04	1.2
@@ -6,6 +6,7 @@
 
 #include <stdlib.h>
 #include <string.h>
+#include <time.h>
 
 #include "connection.h"
 #include "refbuf.h"

1.2       +4 -0      icecast/src/logging.c

Index: logging.c
===================================================================
RCS file: /usr/local/cvsroot/icecast/src/logging.c,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- logging.c	2001/09/10 02:21:49	1.1
+++ logging.c	2001/10/20 06:43:04	1.2
@@ -11,6 +11,10 @@
 
 #include "logging.h"
 
+#ifdef _WIN32
+#define snprintf _snprintf
+#endif
+
 /* the global log descriptors */
 int errorlog;
 int accesslog;

1.2       +3 -0      icecast/src/main.c

Index: main.c
===================================================================
RCS file: /usr/local/cvsroot/icecast/src/main.c,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- main.c	2001/09/10 02:21:49	1.1
+++ main.c	2001/10/20 06:43:04	1.2
@@ -20,6 +20,9 @@
 #include "stats.h"
 #include "logging.h"
 
+#ifdef _WIN32
+#define snprintf _snprintf
+
 #undef CATMODULE
 #define CATMODULE "main"
 

1.2       +6 -1      icecast/src/source.c

Index: source.c
===================================================================
RCS file: /usr/local/cvsroot/icecast/src/source.c,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- source.c	2001/09/10 02:21:50	1.1
+++ source.c	2001/10/20 06:43:04	1.2
@@ -3,9 +3,14 @@
 #include <string.h>
 #include <unistd.h>
 #include <sys/types.h>
+#include <ogg/ogg.h>
+
+#ifndef _WIN32
 #include <sys/time.h>
 #include <sys/socket.h>
-#include <ogg/ogg.h>
+#else
+#include <window.h>
+#endif
 
 #include "thread.h"
 #include "avl.h"

1.2       +1 -1      icecast/src/stats.c

Index: stats.c
===================================================================
RCS file: /usr/local/cvsroot/icecast/src/stats.c,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- stats.c	2001/09/10 02:21:52	1.1
+++ stats.c	2001/10/20 06:43:04	1.2
@@ -19,7 +19,7 @@
 #include "client.h"
 #include "stats.h"
 
-
+#define vsnprintf _vsnprintf
 
 typedef struct _event_listener_tag
 {

1.2       +4 -2      icecast/src/util.c

Index: util.c
===================================================================
RCS file: /usr/local/cvsroot/icecast/src/util.c,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- util.c	2001/09/10 02:21:49	1.1
+++ util.c	2001/10/20 06:43:04	1.2
@@ -1,9 +1,11 @@
-#include <sys/time.h>
 #include <sys/types.h>
-#include <sys/socket.h>
 
 #ifndef _WIN32
+#include <sys/time.h>
+#include <sys/socket.h>
 #include <unistd.h>
+#else
+#include <windows.h>
 #endif
 
 #include "sock.h"

--- >8 ----
List archives:  http://www.xiph.org/archives/
Ogg project homepage: http://www.xiph.org/ogg/
To unsubscribe from this list, send a message to 'cvs-request at xiph.org'
containing only the word 'unsubscribe' in the body.  No subject is needed.
Unsubscribe messages sent to the list will be ignored/filtered.



More information about the commits mailing list