Commit 816f239e authored by rswindell's avatar rswindell
Browse files

Address GCC warnings and add -import option to usage output.

parent 7cd354b2
......@@ -55,7 +55,7 @@ char **opt;
char tmp[256];
char error[256];
int backup_level=5;
char* area_sort_desc[] = { "Index Position", "Long Name", "Short Name", "Internal Code", NULL };
char* area_sort_desc[] = { "Index Position", "Long Name", "Short Name", "Internal Code" };
char *invalid_code=
"`Invalid Internal Code:`\n\n"
......@@ -292,6 +292,7 @@ int main(int argc, char **argv)
"-c = force color mode\r\n"
"-m = force monochrome mode\r\n"
"-e# = set escape delay to #msec\r\n"
"-import=<filename> = import a message area list file\r\n"
"-g# = set group number to import into\r\n"
"-iX = set interface mode to X (default=auto) where X is one of:\r\n"
#ifdef __unix__
......@@ -331,7 +332,7 @@ int main(int argc, char **argv)
backslashcolon(cfg.ctrl_dir);
if(import != NULL && *import != 0) {
enum { msgbase = 'M', filebase = 'F', xtrns = 'X' } base = msgbase;
enum { msgbase = 'M', filebase = 'F' } base = msgbase;
char fname[MAX_PATH+1];
SAFECOPY(fname, import);
p = strchr(fname, ',');
......@@ -374,6 +375,11 @@ int main(int argc, char **argv)
ported = import_msg_areas(list_type, fp, grpnum, 1, 99999, /* qhub: */NULL, &added);
break;
}
case filebase:
{
fprintf(stderr, "!Not yet supported\n");
break;
}
}
fclose(fp);
if(ported < 0)
......
......@@ -53,6 +53,16 @@
#define SUB_HDRMOD (1L<<31) /* Modified sub-board header info */
#define MAX_UNIQUE_CODE_ATTEMPTS (36*36*36)
enum import_list_type {
IMPORT_LIST_TYPE_SUBS_TXT,
IMPORT_LIST_TYPE_QWK_CONTROL_DAT,
IMPORT_LIST_TYPE_GENERIC_AREAS_BBS,
IMPORT_LIST_TYPE_SBBSECHO_AREAS_BBS,
IMPORT_LIST_TYPE_BACKBONE_NA,
};
/************/
/* Typedefs */
/************/
......@@ -70,7 +80,7 @@ extern char *nulstr;
extern char *invalid_code,*num_flags;
extern int backup_level;
extern BOOL new_install;
char* area_sort_desc[];
char* area_sort_desc[AREA_SORT_TYPES];
/***********************/
/* Function Prototypes */
......@@ -119,15 +129,6 @@ void sort_dirs(int libnum);
unsigned subs_in_group(unsigned grpnum);
char random_code_char(void);
#define MAX_UNIQUE_CODE_ATTEMPTS (36*36*36)
enum import_list_type {
IMPORT_LIST_TYPE_SUBS_TXT,
IMPORT_LIST_TYPE_QWK_CONTROL_DAT,
IMPORT_LIST_TYPE_GENERIC_AREAS_BBS,
IMPORT_LIST_TYPE_SBBSECHO_AREAS_BBS,
IMPORT_LIST_TYPE_BACKBONE_NA,
};
long import_msg_areas(enum import_list_type, FILE*, unsigned grpnum, int min_confnum, int max_confnum, qhub_t*, long* added);
......
......@@ -169,6 +169,8 @@ while(1) {
name = cfg.sub[i]->code_suffix;
name_len = LEN_CODE;
break;
default: /* Defeat stupid GCC warning */
break;
}
sprintf(str, "%-*s %c", name_len, name, cfg.sub[i]->misc&SUB_TEMPLATE ? '*' : ' ');
truncsp(str);
......
......@@ -959,6 +959,8 @@ void dir_cfg(uint libnum)
name = cfg.dir[i]->code_suffix;
name_len = LEN_CODE;
break;
default: /* Defeat stupid GCC warning */
break;
}
sprintf(str, "%-*s %c", name_len, name, cfg.dir[i]->misc&DIR_TEMPLATE ? '*' : ' ');
truncsp(str);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment