Nickname parsing.(3)

NAME
Nickname parsing. -

  Functions
void irc_target_get_nick (const char *target, char *nick, size_t size)
Gets the nick part from the target.
void irc_target_get_host (const char *target, char *nick, size_t size)
Gets the host part from the target.

Function Documentation

  void irc_target_get_host (const char * target, char * nick, size_t size)

Gets the host part from the target.

Parameters:
    target A nick in common IRC server form like tim!root@mydomain.com
    nick A buffer to hold the nickname.
    size A buffer size. If nick is longer than buffer size, it will be truncated.

For most events IRC server returns 'origin' (i.e. the person, who generated this event) in i.e. 'common' form, like nick!host@domain. I don't know any command, which requires host, but it may be useful :) This function parses this origin, and gets the host, storing it into user-provided buffer.

  void irc_target_get_nick (const char * target, char * nick, size_t size)

Gets the nick part from the target.

Parameters:
    target A nick in common IRC server form like tim!root@mycomain.com
    nick A buffer to hold the nickname.
    size A buffer size. If nick is longer than buffer size, it will be truncated.

For most events IRC server returns 'origin' (i.e. the person, who generated this event) in i.e. 'common' form, like nick!host@domain. However, all the irc_cmd_* functions require just a nick/ This function parses this origin, and gets the nick, storing it into user-provided buffer. A buffer of size 90 should be enough for most nicks :)