mirror of
https://gitlab.xiph.org/xiph/icecast-server.git
synced 2025-02-02 15:07:36 -05:00
Minor cleanup of 'static' functions.
Fixed usage bug where usage wasn't getting displayed properly. svn path=/trunk/icecast/; revision=3034
This commit is contained in:
parent
7927f1d31f
commit
4cc0705134
27
src/main.c
27
src/main.c
@ -27,14 +27,14 @@
|
|||||||
#undef CATMODULE
|
#undef CATMODULE
|
||||||
#define CATMODULE "main"
|
#define CATMODULE "main"
|
||||||
|
|
||||||
void _print_usage()
|
static void _print_usage()
|
||||||
{
|
{
|
||||||
printf("icecast 2.0 usage:\n");
|
printf("Usage:\n");
|
||||||
printf("\t-c <file>\t\tSpecify configuration file\n");
|
printf("\ticecast -c <file>\t\tSpecify configuration file\n");
|
||||||
printf("\n");
|
printf("\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
void _initialize_subsystems(void)
|
static void _initialize_subsystems(void)
|
||||||
{
|
{
|
||||||
log_initialize();
|
log_initialize();
|
||||||
thread_initialize();
|
thread_initialize();
|
||||||
@ -47,7 +47,7 @@ void _initialize_subsystems(void)
|
|||||||
refbuf_initialize();
|
refbuf_initialize();
|
||||||
}
|
}
|
||||||
|
|
||||||
void _shutdown_subsystems(void)
|
static void _shutdown_subsystems(void)
|
||||||
{
|
{
|
||||||
refbuf_shutdown();
|
refbuf_shutdown();
|
||||||
stats_shutdown();
|
stats_shutdown();
|
||||||
@ -60,11 +60,11 @@ void _shutdown_subsystems(void)
|
|||||||
log_shutdown();
|
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;
|
int i = 1;
|
||||||
|
|
||||||
if (argc < 3) return 0;
|
if (argc < 3) return -1;
|
||||||
|
|
||||||
while (i < argc) {
|
while (i < argc) {
|
||||||
if (strcmp(argv[i], "-c") == 0) {
|
if (strcmp(argv[i], "-c") == 0) {
|
||||||
@ -78,10 +78,10 @@ int _parse_config_file(int argc, char **argv, char *filename, int size)
|
|||||||
i++;
|
i++;
|
||||||
}
|
}
|
||||||
|
|
||||||
return 0;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
int _start_logging(void)
|
static int _start_logging(void)
|
||||||
{
|
{
|
||||||
char fn_error[FILENAME_MAX];
|
char fn_error[FILENAME_MAX];
|
||||||
char fn_access[FILENAME_MAX];
|
char fn_access[FILENAME_MAX];
|
||||||
@ -106,13 +106,13 @@ int _start_logging(void)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
void _stop_logging(void)
|
static void _stop_logging(void)
|
||||||
{
|
{
|
||||||
log_close(errorlog);
|
log_close(errorlog);
|
||||||
log_close(accesslog);
|
log_close(accesslog);
|
||||||
}
|
}
|
||||||
|
|
||||||
int _setup_socket(void)
|
static int _setup_socket(void)
|
||||||
{
|
{
|
||||||
ice_config_t *config;
|
ice_config_t *config;
|
||||||
|
|
||||||
@ -125,7 +125,7 @@ int _setup_socket(void)
|
|||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
int _start_listening(void)
|
static int _start_listening(void)
|
||||||
{
|
{
|
||||||
if (sock_listen(global.serversock, ICE_LISTEN_QUEUE) == SOCK_ERROR)
|
if (sock_listen(global.serversock, ICE_LISTEN_QUEUE) == SOCK_ERROR)
|
||||||
return 0;
|
return 0;
|
||||||
@ -136,7 +136,7 @@ int _start_listening(void)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* this is the heart of the beast */
|
/* this is the heart of the beast */
|
||||||
void _server_proc(void)
|
static void _server_proc(void)
|
||||||
{
|
{
|
||||||
if (!_setup_socket()) {
|
if (!_setup_socket()) {
|
||||||
ERROR1("Could not create listener socket on port %d", config_get_config()->port);
|
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) {
|
} else if (res == -1) {
|
||||||
fprintf(stderr, "FATAL: -c option must have a filename\n");
|
|
||||||
_print_usage();
|
_print_usage();
|
||||||
_shutdown_subsystems();
|
_shutdown_subsystems();
|
||||||
return 1;
|
return 1;
|
||||||
|
Loading…
Reference in New Issue
Block a user