Doxyfy ircd_string.h and ircd_string.c.
[ircu2.10.12-pk.git] / include / ircd_string.h
index b98c7e50473c38a009e762bf95eabab74c76c77e..2cd1d1c5ed9de4df97316d012e0c710a4e822cba 100644 (file)
@@ -1,7 +1,6 @@
-/*
- * ircd_string.h
- *
- * $Id$
+/** @file ircd_string.h
+ * @brief Public declarations and APIs for string operations.
+ * @version $Id$
  */
 #ifndef INCLUDED_ircd_string_h
 #define INCLUDED_ircd_string_h
@@ -14,6 +13,7 @@ struct irc_in_addr;
 /*
  * Macros
  */
+/** Check whether \a x is a NULL or empty string. */
 #define EmptyString(x) (!(x) || !(*x))
 
 /*
@@ -25,8 +25,6 @@ extern int string_is_hostname(const char* str);
 extern int string_is_address(const char* str);
 extern int string_has_wildcards(const char* str);
 
-/*! Return hash for string using PJW algorithm */
-extern unsigned hash_pjw(const char* str);
 extern char*       ircd_strncpy(char* dest, const char* src, size_t len);
 extern int         ircd_strcmp(const char *a, const char *b);
 extern int         ircd_strncmp(const char *a, const char *b, size_t n);
@@ -42,24 +40,37 @@ extern char*       ircd_strtok(char** save, char* str, char* fs);
 
 extern char*       canonize(char* buf);
 
+/** Make \a y a duplicate \a x, a la strdup(). */
 #define DupString(x, y)  (strcpy((x = (char*) MyMalloc(strlen(y) + 1)), y))
 
 
 /* String classification pseudo-functions, when others are needed add them,
    strIsXxxxx(s) is true when IsXxxxx(c) is true for every char in s */
 
+/** Test whether all characters in \a s are alphanumeric. */
 #define strIsAlnum(s)     (strChattr(s) & NTL_ALNUM)
+/** Test whether all characters in \a s are alphabetic. */
 #define strIsAlpha(s)     (strChattr(s) & NTL_ALPHA)
+/** Test whether all characters in \a s are digits. */
 #define strIsDigit(s)     (strChattr(s) & NTL_DIGIT)
+/** Test whether all characters in \a s are lower case. */
 #define strIsLower(s)     (strChattr(s) & NTL_LOWER)
+/** Test whether all characters in \a s are whitespace. */
 #define strIsSpace(s)     (strChattr(s) & NTL_SPACE)
+/** Test whether all characters in \a s are upper case. */
 #define strIsUpper(s)     (strChattr(s) & NTL_UPPER)
 
+/** Test whether all characters in \a s are channel name characters. */
 #define strIsIrcCh(s)     (strChattr(s) & NTL_IRCCH)
+/** Test whether all characters in \a s are forced to lower-case in channel names. */
 #define strIsIrcCl(s)     (strChattr(s) & NTL_IRCCL)
+/** Test whether all characters in \a s are valid in nicknames. */
 #define strIsIrcNk(s)     (strChattr(s) & NTL_IRCNK)
+/** Test whether all characters in \a s are valid in a user field. */
 #define strIsIrcUi(s)     (strChattr(s) & NTL_IRCUI)
+/** Test whether all characters in \a s are valid in host names. */
 #define strIsIrcHn(s)     (strChattr(s) & NTL_IRCHN)
+/** Test whether all characters in \a s are valid in IP addresses. */
 #define strIsIrcIp(s)     (strChattr(s) & NTL_IRCIP)
 
 /*
@@ -68,8 +79,10 @@ extern char*       canonize(char* buf);
  * `inline').
  */
 
+/** Declaration for strChattr(). */
 #define NTL_HDR_strChattr   unsigned int strChattr(const char *s)
 
+/** Body for strChattr(). */
 #define NTL_SRC_strChattr   const char *rs = s; \
                             unsigned int x = ~0; \
                             while(*rs) \
@@ -79,8 +92,10 @@ extern char*       canonize(char* buf);
 /*
  * XXX - bleah should return 1 if different 0 if the same
  */
+/** Declaration for strCasediff(). */
 #define NTL_HDR_strCasediff int strCasediff(const char *a, const char *b)
 
+/** Body for strCasediff(). */
 #define NTL_SRC_strCasediff const char *ra = a; \
                             const char *rb = b; \
                             while(ToLower(*ra) == ToLower(*rb++)) \