ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/svn/ircd-hybrid/trunk/src/conf.c
(Generate patch)

Comparing ircd-hybrid-7.2/src/s_conf.c (file contents):
Revision 956 by michael, Mon Jul 27 00:34:48 2009 UTC vs.
Revision 967 by michael, Sun Aug 2 18:05:28 2009 UTC

# Line 85 | Line 85 | extern char linebuf[];
85   extern char conffilebuf[IRCD_BUFSIZE];
86   extern char yytext[];
87   extern int yyparse(); /* defined in y.tab.c */
88 < int ypass = 1; /* used by yyparse()      */
88 >
89 > struct conf_parser_context conf_parser_ctx = { 0, 0, NULL };
90  
91   /* internally defined functions */
92   static void lookup_confhost(struct ConfItem *);
# Line 114 | Line 115 | static void destroy_cidr_class(struct Cl
115  
116   static void flags_to_ascii(unsigned int, const unsigned int[], char *, int);
117  
117 FBFILE *conf_fbfile_in = NULL;
118
118   /* address of default class conf */
119   static struct ConfItem *class_default;
120  
# Line 1949 | Line 1948 | read_conf(FBFILE *file)
1948    lineno = 0;
1949  
1950    set_default_conf(); /* Set default values prior to conf parsing */
1951 <  ypass = 1;
1951 >  conf_parser_ctx.pass = 1;
1952    yyparse();          /* pick up the classes first */
1953  
1954    fbrewind(file);
1955  
1956 <  ypass = 2;
1956 >  conf_parser_ctx.pass = 2;
1957    yyparse();          /* Load the values from the conf */
1958    validate_conf();    /* Check to make sure some values are still okay. */
1959                        /* Some global values are also loaded here. */
# Line 2426 | Line 2425 | read_conf_files(int cold)
2425    char chanmodes[32];
2426    char chanlimit[32];
2427  
2428 +  conf_parser_ctx.boot = cold;
2429    filename = get_conf_name(CONF_TYPE);
2430  
2431    /* We need to know the initial filename for the yyerror() to report
# Line 2436 | Line 2436 | read_conf_files(int cold)
2436    */
2437    strlcpy(conffilebuf, filename, sizeof(conffilebuf));
2438  
2439 <  if ((conf_fbfile_in = fbopen(filename, "r")) == NULL)
2439 >  if ((conf_parser_ctx.conf_file = fbopen(filename, "r")) == NULL)
2440    {
2441      if (cold)
2442      {
# Line 2456 | Line 2456 | read_conf_files(int cold)
2456    if (!cold)
2457      clear_out_old_conf();
2458  
2459 <  read_conf(conf_fbfile_in);
2460 <  fbclose(conf_fbfile_in);
2459 >  read_conf(conf_parser_ctx.conf_file);
2460 >  fbclose(conf_parser_ctx.conf_file);
2461  
2462    add_isupport("NETWORK", ServerInfo.network_name, -1);
2463    ircsprintf(chanmodes, "b%s%s:%d", ConfigChannel.use_except ? "e" : "",
# Line 3122 | Line 3122 | yyerror(const char *msg)
3122   {
3123    char newlinebuf[IRCD_BUFSIZE];
3124  
3125 <  if (ypass != 1)
3125 >  if (conf_parser_ctx.pass != 1)
3126      return;
3127  
3128    strip_tabs(newlinebuf, linebuf, sizeof(newlinebuf));

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines