[xiph-cvs] cvs commit: icecast/src main.c

Jack Moffitt jack at xiph.org
Thu Feb 7 19:59:18 PST 2002



jack        02/02/07 19:59:17

  Modified:    src      main.c
  Log:
  Minor cleanup of 'static' functions.
  
  Fixed usage bug where usage wasn't getting displayed properly.

Revision  Changes    Path
1.4       +13 -14    icecast/src/main.c

Index: main.c
===================================================================
RCS file: /usr/local/cvsroot/icecast/src/main.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- main.c	2001/10/20 06:51:29	1.3
+++ main.c	2002/02/08 03:59:17	1.4
@@ -27,14 +27,14 @@
 #undef CATMODULE
 #define CATMODULE "main"
 
-void _print_usage()
+static void _print_usage()
 {
-	printf("icecast 2.0 usage:\n");
-	printf("\t-c <file>\t\tSpecify configuration file\n");
+	printf("Usage:\n");
+	printf("\ticecast -c <file>\t\tSpecify configuration file\n");
         printf("\n");
 }
 
-void _initialize_subsystems(void)
+static void _initialize_subsystems(void)
 {
         log_initialize();
         thread_initialize();
@@ -47,7 +47,7 @@
         refbuf_initialize();
 }
 
-void _shutdown_subsystems(void)
+static void _shutdown_subsystems(void)
 {
         refbuf_shutdown();
         stats_shutdown();
@@ -60,11 +60,11 @@
         log_shutdown();
 }
 
-int _parse_config_file(int argc, char **argv, char *filename, int size)
+static int _parse_config_file(int argc, char **argv, char *filename, int size)
 {
         int i = 1;
 
-	if (argc < 3) return 0;
+	if (argc < 3) return -1;
 
         while (i < argc) {
                 if (strcmp(argv[i], "-c") == 0) {
@@ -78,10 +78,10 @@
                 i++;
         }
 
-	return 0;
+	return -1;
 }
 
-int _start_logging(void)
+static int _start_logging(void)
 {
         char fn_error[FILENAME_MAX];
         char fn_access[FILENAME_MAX];
@@ -106,13 +106,13 @@
         return 0;
 }
 
-void _stop_logging(void)
+static void _stop_logging(void)
 {
         log_close(errorlog);
         log_close(accesslog);
 }
 
-int _setup_socket(void)
+static int _setup_socket(void)
 {
         ice_config_t *config;
 
@@ -125,7 +125,7 @@
         return 1;
 }
 
-int _start_listening(void)
+static int _start_listening(void)
 {
         if (sock_listen(global.serversock, ICE_LISTEN_QUEUE) == SOCK_ERROR)
                 return 0;
@@ -136,7 +136,7 @@
 }
 
 /* this is the heart of the beast */
-void _server_proc(void)
+static void _server_proc(void)
 {
         if (!_setup_socket()) {
                 ERROR1("Could not create listener socket on port %d", config_get_config()->port);
@@ -189,7 +189,6 @@
                         }
                 }
         } else if (res == -1) {
-		fprintf(stderr, "FATAL: -c option must have a filename\n");
                 _print_usage();
                 _shutdown_subsystems();
                 return 1;

<p><p><p>--- >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