2 * This function reads the citadel.config file. It should be called at
3 * the beginning of EVERY Citadel program.
14 extern void get_config(void);
16 char bbs_home_directory[256];
17 int home_specified = 0;
19 void get_config(void) {
22 if (chdir( home_specified ? bbs_home_directory : BBSDIR ) != 0) {
23 fprintf(stderr, "Cannot start.\nThere is no Citadel installation in %s\n%s\n",
24 (home_specified ? bbs_home_directory : BBSDIR),
28 cfp=fopen("citadel.config","r");
30 fprintf(stderr, "Cannot start.\n");
31 fprintf(stderr, "There is no citadel.config in %s\n%s\n",
32 (home_specified ? bbs_home_directory : BBSDIR),
36 fread((char *)&config,sizeof(struct config),1,cfp);
38 if ( (config.c_setup_level / 10) != (REV_LEVEL/10) ) {
39 fprintf(stderr, "config: Your data files are out of date. ");
40 fprintf(stderr, "Run setup to update them.\n");
42 " This program requires level %d.%02d\n",
43 (REV_LEVEL / 100), (REV_LEVEL % 100) );
45 " Data files are currently at %d.%02d\n",
46 (config.c_setup_level / 100),
47 (config.c_setup_level % 100) );