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

Comparing:
ircd-hybrid/src/irc_string.c (file contents), Revision 30 by adx, Sun Oct 2 20:03:27 2005 UTC vs.
ircd-hybrid-7.2/src/irc_string.c (file contents), Revision 1009 by michael, Sun Sep 13 15:02:30 2009 UTC

# Line 19 | Line 19
19   *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307
20   *  USA
21   *
22 < *  $Id: irc_string.c,v 7.74 2005/09/03 11:39:21 michael Exp $
22 > *  $Id$
23   */
24  
25 + #include "config.h"
26 + #ifdef HAVE_LIBPCRE
27 + #include <pcre.h>
28 + #endif
29 +
30   #include "stdinc.h"
31   #include "tools.h"
27 #include "pcre.h"
32   #include "irc_string.h"
33   #include "sprintf_irc.h"
34   #include "client.h"
# Line 44 | Line 48
48   #endif
49  
50  
47 char *
48 xstrldup(const char *s, size_t n)
49 {
50  size_t len = strlen(s) + 1;
51  char *p = NULL;
52
53  if (len > n)
54    len = n;
55  return strlcpy((p = malloc(len)), s, len), p;
56 }
57
51   /*
52   * myctime - This is like standard ctime()-function, but it zaps away
53   *   the newline from the end of that string. Also, it takes
# Line 249 | Line 242 | inetntoa(const char *in)
242    return buf;
243   }
244  
245 < #ifndef HAVE_BASENAME
253 <
254 < /* basename()
245 > /* libio_basename()
246   *
247   * input        - i.e. "/usr/local/ircd/modules/m_whois.so"
248   * output       - i.e. "m_whois.so"
249   * side effects - this will be overwritten on subsequent calls
250   */
251 < char *
252 < basename(char *path)
251 > const char *
252 > libio_basename(const char *path)
253   {
254 <  char *s;
254 >  const char *s;
255  
256    if ((s = strrchr(path, '/')) == NULL)
257      s = path;
# Line 270 | Line 261 | basename(char *path)
261    return s;
262   }
263  
273 #endif /* !HAVE_BASENAME */
274
264   /*
265   * Copyright (c) 1996-1999 by Internet Software Consortium.
266   *
# Line 339 | Line 328 | inet_ntop6(const unsigned char *src, cha
328           * to use pointer overlays.  All the world's not a VAX.
329           */
330          char tmp[sizeof "ffff:ffff:ffff:ffff:ffff:ffff:255.255.255.255"], *tp;
331 <        struct { int base, len; } best, cur;
331 >        struct { int base, len; } best = {0,0}, cur = {0,0};
332          unsigned int words[IN6ADDRSZ / INT16SZ];
333          int i;
334  
# Line 542 | Line 531 | strlcpy(char *dst, const char *src, size
531   }
532   #endif
533  
534 < pcre *
534 > #ifdef HAVE_LIBPCRE
535 > void *
536   ircd_pcre_compile(const char *pattern, const char **errptr)
537   {
538    int erroroffset = 0;
# Line 554 | Line 544 | ircd_pcre_compile(const char *pattern, c
544   }
545  
546   int
547 < ircd_pcre_exec(const pcre *code, const char *subject)
547 > ircd_pcre_exec(const void *code, const char *subject)
548   {
549    assert(code && subject);
550  
551    return pcre_exec(code, NULL, subject, strlen(subject), 0, 0, NULL, 0) < 0;
552   }
553 + #endif

Comparing:
ircd-hybrid/src/irc_string.c (property svn:keywords), Revision 30 by adx, Sun Oct 2 20:03:27 2005 UTC vs.
ircd-hybrid-7.2/src/irc_string.c (property svn:keywords), Revision 1009 by michael, Sun Sep 13 15:02:30 2009 UTC

# Line 1 | Line 1
1 < "Id Revision"
1 > Id Revision

Diff Legend

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