* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
* USA
*
- * $Id: irc_string.h 678 2006-02-03 20:25:01Z jilles $
+ * $Id: irc_string.h 3538 2007-07-26 14:21:57Z jilles $
*/
#ifndef INCLUDED_irc_string_h
* match - compare name with mask, mask may contain * and ? as wildcards
* match - returns 1 on successful match, 0 otherwise
*
+ * mask_match - compare one mask to another
* match_esc - compare with support for escaping chars
* match_cidr - compares u!h@addr with u!h@addr/cidr
* match_ips - compares addr with addr/cidr in ascii form
*/
extern int match(const char *mask, const char *name);
+extern int mask_match(const char *oldmask, const char *newmask);
extern int match_esc(const char *mask, const char *name);
extern int match_cidr(const char *mask, const char *name);
extern int match_ips(const char *mask, const char *name);
const char *inetntop_sock(struct sockaddr *src, char *dst, unsigned int size);
int inetpton_sock(const char *src, struct sockaddr *dst);
-#ifndef HAVE_STRLCPY
-size_t strlcpy(char *dst, const char *src, size_t siz);
-#endif
-
-#ifndef HAVE_STRLCAT
-size_t strlcat(char *dst, const char *src, size_t siz);
-#endif
-
-#ifdef HAVE_STRDUP
-#define DupString(x,y) do { x = strdup(y); if(x == NULL) outofmemory(); } while(0)
-#else
-#define DupString(x,y) do { x = malloc(strlen(y) + 1); if(x == NULL) outofmemory(); strcpy(x, y); } while(0)
-#endif
-
-#ifdef HAVE_STRNDUP
-#define DupNString(x, y, len) do { x = strndup(y, len); if(x == NULL) outofmemory(); } while (0)
-#else
-#define DupNString(x, y, len) do { x = malloc(len+1); if(x == NULL) outofmemory(); strlcpy(x, y, len+1); } while(0)
-#endif
-
/*
* clean_string - cleanup control and high ascii characters
* -Dianora
const char *myctime(time_t);
-#define EmptyString(x) (!(x) || (*(x) == '\0'))
+#define EmptyString(x) ((x) == NULL || *(x) == '\0')
#define CheckEmpty(x) EmptyString(x) ? "" : x
char *strtoken(char **save, char *str, const char *fs);
-unsigned char *ircd_base64_encode(const unsigned char *str, int length);
-unsigned char *ircd_base64_decode(const unsigned char *str, int length, int *ret);
-
/*
* character macros
*/