Logo Search packages:      
Sourcecode: libmpdclient version File versions  Download package

mpd_malloc struct mpd_pair* mpd_recv_sticker ( struct mpd_connection connection  )  [read]

Receives the next sticker. You have to free the return value with mpd_return_sticker().

Parameters:
connection the connection to MPD
Returns:
a mpd_pair object on success, NULL on end of response or error

Definition at line 132 of file sticker.c.

References mpd_recv_pair_named(), mpd_recv_sticker(), mpd_pair::name, and mpd_pair::value.

Referenced by mpd_recv_sticker().

{
      struct mpd_pair *pair;
      char *eq;

      pair = mpd_recv_pair_named(connection, "sticker");
      if (pair == NULL)
            return NULL;

      pair->name = pair->value;

      eq = strchr(pair->value, '=');
      if (eq != NULL) {
            /* we shouldn't modify a const string, but in this
               case, we know that this points to the writable
               input buffer */
            *eq = 0;
            pair->value = eq + 1;
      } else
            /* malformed response?  what to do now?  pretend
               nothing has happened... */
            pair->value = "";

      return pair;
}


Generated by  Doxygen 1.6.0   Back to index