From 4cc07051347128853f86fc29b8a21a4650a4589a Mon Sep 17 00:00:00 2001 From: Jack Moffitt Date: Fri, 8 Feb 2002 03:59:17 +0000 Subject: [PATCH] Minor cleanup of 'static' functions. Fixed usage bug where usage wasn't getting displayed properly. svn path=/trunk/icecast/; revision=3034 --- src/main.c | 27 +++++++++++++-------------- 1 file changed, 13 insertions(+), 14 deletions(-) diff --git a/src/main.c b/src/main.c index 115717bc..edd30ce8 100644 --- a/src/main.c +++ b/src/main.c @@ -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 \t\tSpecify configuration file\n"); + printf("Usage:\n"); + printf("\ticecast -c \t\tSpecify configuration file\n"); printf("\n"); } -void _initialize_subsystems(void) +static void _initialize_subsystems(void) { log_initialize(); thread_initialize(); @@ -47,7 +47,7 @@ void _initialize_subsystems(void) refbuf_initialize(); } -void _shutdown_subsystems(void) +static void _shutdown_subsystems(void) { refbuf_shutdown(); stats_shutdown(); @@ -60,11 +60,11 @@ void _shutdown_subsystems(void) 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 @@ int _parse_config_file(int argc, char **argv, char *filename, int size) 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 @@ int _start_logging(void) 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 @@ int _setup_socket(void) 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 @@ int _start_listening(void) } /* 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 @@ int main(int argc, char **argv) } } } else if (res == -1) { - fprintf(stderr, "FATAL: -c option must have a filename\n"); _print_usage(); _shutdown_subsystems(); return 1;