| 17 |
|
|
| 18 |
#include "bbs.h" |
#include "bbs.h" |
| 19 |
#include "common.h" |
#include "common.h" |
| 20 |
|
#include "io.h" |
| 21 |
|
#include <string.h> |
| 22 |
|
|
| 23 |
void |
void |
| 24 |
app_help(void) |
app_help(void) |
| 25 |
{ |
{ |
| 26 |
printf ( |
prints ( |
| 27 |
"Usage: bbsd [-fhv] [...]\n\n" |
"Usage: bbsd [-fhv] [...]\n\n" |
| 28 |
"-f\t--foreground\t\tForce program run in foreground\n" |
"-f\t--foreground\t\tForce program run in foreground\n" |
| 29 |
"-h\t--help\t\t\tDisplay this help message\n" |
"-h\t--help\t\t\tDisplay this help message\n" |
| 37 |
void |
void |
| 38 |
arg_error(void) |
arg_error(void) |
| 39 |
{ |
{ |
| 40 |
printf ("Invalid arguments\n"); |
prints ("Invalid arguments\n"); |
| 41 |
app_help(); |
app_help(); |
| 42 |
} |
} |
| 43 |
|
|
| 111 |
|
|
| 112 |
//Initialize log |
//Initialize log |
| 113 |
strncpy(app_home_dir, argv[0], rindex(argv[0],'/')-argv[0]+1); |
strncpy(app_home_dir, argv[0], rindex(argv[0],'/')-argv[0]+1); |
| 114 |
|
strcat(app_home_dir, "../"); |
| 115 |
strcpy(log_dir, app_home_dir); |
strcpy(log_dir, app_home_dir); |
| 116 |
strcat(log_dir, "log/"); |
strcat(log_dir, "log/"); |
| 117 |
strcpy(file_log_std, log_dir); |
strcpy(file_log_std, log_dir); |