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

Comparing:
ircd-hybrid/src/numeric.c (file contents), Revision 1028 by michael, Sun Nov 8 13:03:38 2009 UTC vs.
ircd-hybrid-8/src/numeric.c (file contents), Revision 1325 by michael, Sat Mar 31 10:29:02 2012 UTC

# Line 26 | Line 26
26  
27   #include "numeric.h"
28   #include "irc_string.h"
29 #include "common.h"     /* NULL cripes */
29   #include "memory.h"
30 < #include "s_log.h"
32 < #include "fileio.h"
30 > #include "log.h"
31   #include "send.h"
32   #include "client.h"
33   #include "messages.tab"
# Line 91 | Line 89 | change_reply(const char *locale, int lin
89                for (; *old >= '0' && *old <= '9'; old++); /* skip size prefix */
90                if (*new != *old++)
91                {
92 <                ilog(L_ERROR, "Incompatible format symbols (%s.lang, %d)",
93 <                              locale, linecnt);
92 >                ilog(LOG_TYPE_IRCD, "Incompatible format symbols (%s.lang, %d)",
93 >                     locale, linecnt);
94                  return 0;
95                }
96                found = 1;
# Line 102 | Line 100 | change_reply(const char *locale, int lin
100          }
101          if (!found)
102          {
103 <          ilog(L_ERROR, "Too many format symbols (%s.lang, %d)", locale, linecnt);
103 >          ilog(LOG_TYPE_IRCD, "Too many format symbols (%s.lang, %d)", locale, linecnt);
104            return(0);
105          }
106        }
# Line 121 | Line 119 | set_locale(const char *locale)
119    int i, res = 1, linecnt = 0;
120    char buffer[IRCD_BUFSIZE + 1];
121    char *ident, *reply;
122 <  FBFILE *f;
122 >  FILE *f;
123  
124    /* Restore standard replies */
125    for (i = 0; i <= ERR_LAST_ERR_MSG; i++)   /* 0 isn't a magic number! ;> */
# Line 144 | Line 142 | set_locale(const char *locale)
142     * of MSGPATH.
143     */
144    snprintf(buffer, sizeof(buffer), "%s/%s.lang", MSGPATH, locale);
145 <  if ((f = fbopen(buffer, "r")) == NULL)
145 >  if ((f = fopen(buffer, "r")) == NULL)
146    {
147      strlcpy(used_locale, "standard", sizeof(used_locale));  /* XXX */
148      return;
149    }
150  
151    /* Process the language file */
152 <  while (fbgets(buffer, sizeof(buffer), f))
152 >  while (fgets(buffer, sizeof(buffer), f))
153    {
154      ++linecnt;
155      if (buffer[0] == ';')
# Line 176 | Line 174 | set_locale(const char *locale)
174        if (*reply != ':')
175        {
176          error:
177 <        ilog(L_ERROR, "Invalid line in language file (%s.lang, %d)",
178 <                      locale, linecnt);
177 >        ilog(LOG_TYPE_IRCD, "Invalid line in language file (%s.lang, %d)",
178 >             locale, linecnt);
179          res = 0;
180          continue;
181        }
# Line 206 | Line 204 | set_locale(const char *locale)
204      }
205      if (i != -1)
206      {
207 <      ilog(L_ERROR,
207 >      ilog(LOG_TYPE_IRCD,
208             "Unknown numeric %s (%s.lang, %d)", ident, locale, linecnt);
209        res = 0;
210      }
211    }
212 <  fbclose(f);
212 >  fclose(f);
213  
214    strlcpy(used_locale, locale, sizeof(used_locale));
215    if (!res)

Diff Legend

Removed lines
+ Added lines
< Changed lines (old)
> Changed lines (new)