muhstik

- irc flooding solution
git clone git://git.acid.vegas/muhstik.git
Log | Files | Refs | Archive | README

string.h (1642B)

      1 /* Muhstik, Copyright (C) 2001-2002, Louis Bavoil <mulder@gmx.fr>       */
      2 /*                        2009-2011, Leon Kaiser <literalka@gnaa.eu>    */
      3 /*                                                                      */
      4 /* This program is free software; you can redistribute it and/or        */
      5 /* modify it under the terms of the GNU Library General Public License  */
      6 /* as published by the Free Software Foundation; either version 2       */
      7 /* of the License, or (at your option) any later version.               */
      8 /*                                                                      */
      9 /* This program is distributed in the hope that it will be useful,      */
     10 /* but WITHOUT ANY WARRANTY; without even the implied warranty of       */
     11 /* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        */
     12 /* GNU Library General Public License for more details.                 */
     13 
     14 #ifndef STRING_H
     15 #define STRING_H
     16 
     17 #include <string.h>
     18 #include <errno.h>
     19 extern int errno;
     20 
     21 /* Functions for handling strings */
     22 
     23 /* A delimiter for strsep */
     24 #define DELIM " \r\n"
     25 
     26 void *xmalloc (size_t size);
     27 char *StrDuplicate (char *src);
     28 int StrCompare (char *s1, char *s2);
     29 int StrCmpPrefix (char *s1, char *s2);
     30 void StrFirstToken (char *s);
     31 void StrCopy (char *s1, char *s2, size_t n);
     32 void StrCat (char *s1, char *s2, size_t n);
     33 int StrParam (char *parm, size_t size, char *s, int i);
     34 int is_in (char *w, char *s);
     35 
     36 #ifdef NO_STRSEP
     37 char *strsep (char **stringp, const char *delim);
     38 #endif
     39 
     40 /* Functions for handling patterns */
     41 
     42 int is_pattern (char *s);
     43 int is_nick (char *s);
     44 int match_pattern (char *pattern, char *s);
     45 
     46 #endif