src/irc_proto.h
changeset 75 ff6272398d2e
parent 72 43084f103c2a
child 87 f0db6ebf18b9
--- a/src/irc_proto.h	Thu Mar 26 22:54:25 2009 +0200
+++ b/src/irc_proto.h	Thu Mar 26 23:15:55 2009 +0200
@@ -32,7 +32,8 @@
 #define IRC_CHANFLAGS "@+"
 
 /**
- * Parsed nickmask
+ * Parsed nickmask. For normal user prefixes, all fields will be non-NULL. For server prefixes, nickname and username
+ * will be NULL, and hostname will be the server name.
  */
 struct irc_nm {
     /** Nickname, not normalized */
@@ -46,10 +47,14 @@
 };
 
 /**
- * Parse a full nickmask from a prefix. This fails if the prefix is a server name.
- *
- * Since we cannot modify the prefix string, the user must provide a buffer of at least IRC_PREFIX_MAX bytes to store
- * the procesed prefix. The returned nm's fields will point into this buffer.
+ * Parse a full nickmask from a prefix, mutating the value of the given buffer, and returning pointers into the buffer
+ * inside \a nm.
+ */
+err_t irc_nm_parse_buf (struct irc_nm *nm, char *prefix);
+
+/**
+ * Same as irc_nm_parse_buf(), but copies the prefix into the given mutable buffer of at least IRC_PREFIX_MAX bytes and
+ * returns pointers into that instead.
  */
 err_t irc_nm_parse (struct irc_nm *nm, char *buf, const char *prefix);