/[LeafOK_CVS]/lbbs/src/init.c
ViewVC logotype

Diff of /lbbs/src/init.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

Revision 1.4 by sysadm, Tue Oct 19 17:11:39 2004 UTC Revision 1.5 by sysadm, Wed Oct 20 07:46:32 2004 UTC
# Line 49  init_daemon (void) Line 49  init_daemon (void)
49  int  int
50  load_conf (const char *conf_file)  load_conf (const char *conf_file)
51  {  {
52    // Innd settings    char temp[256];
   char innd_id[50] = "";  
   char innd_name[50] = "";  
   char innd_server[256] = "";  
   unsigned long innd_uid = 0;  
   char innd_address[50] = "";  
   unsigned int bbsd_port = 0;  
   unsigned int innd_port = 0;  
   unsigned int ctrl_port = 0;  
   char conn_str[256] = "";  
   unsigned int if_startup = 0;  
53    
54    // Load configuration    // Load configuration
55    char c_name[256];    char c_name[256];
# Line 74  load_conf (const char *conf_file) Line 64  load_conf (const char *conf_file)
64    while (fscanf (fin, "%s", c_name) != EOF)    while (fscanf (fin, "%s", c_name) != EOF)
65      {      {
66        if (c_name[0] == '#')        if (c_name[0] == '#')
67          continue;        {
68            fgets(temp, 256, fin);
69            continue;
70          }
71        fscanf (fin, "%*c");        fscanf (fin, "%*c");
72        if (strcmp (c_name, "bbs_id") == 0)        if (strcmp (c_name, "bbs_id") == 0)
73          {          {
# Line 100  load_conf (const char *conf_file) Line 93  load_conf (const char *conf_file)
93          {          {
94            fscanf (fin, "%d", &BBS_max_client);            fscanf (fin, "%d", &BBS_max_client);
95          }          }
96          if (strcmp (c_name, "bbs_max_user") == 0)
97            {
98              fscanf (fin, "%d", &BBS_max_user);
99            }
100          if (strcmp (c_name, "bbs_start_dt") == 0)
101            {
102              int y = 0, m = 0, d = 0;
103              fscanf (fin, "%d-%d-%d", &y, &m, &d);
104              sprintf (BBS_start_dt, "%4dÄê%2dÔÂ%2dÈÕ",y,m,d);
105            }
106        if (strcmp (c_name, "db_host") == 0)        if (strcmp (c_name, "db_host") == 0)
107          {          {
108            fscanf (fin, "%s", DB_host);            fscanf (fin, "%s", DB_host);
# Line 112  load_conf (const char *conf_file) Line 115  load_conf (const char *conf_file)
115          {          {
116            fscanf (fin, "%s", DB_password);            fscanf (fin, "%s", DB_password);
117          }          }
118          if (strcmp (c_name, "db_database") == 0)
119            {
120              fscanf (fin, "%s", DB_database);
121            }
122      }      }
123    
124    fclose (fin);    fclose (fin);


Legend:
Removed lines/characters  
Changed lines/characters
  Added lines/characters

webmaster@leafok.com
ViewVC Help
Powered by ViewVC 1.3.0-beta1