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

mpd_malloc struct mpd_output* mpd_output_begin ( const struct mpd_pair pair  )  [read]

Begins parsing a new mpd_output.

pair the first pair in this output (name is "outputid")
the new mpd_output object, or NULL on error (out of memory, or wrong pair name)

Definition at line 47 of file output.c.

References mpd_output::enabled, mpd_output::id, mpd_output_begin(), mpd_output::name, mpd_pair::name, and mpd_pair::value.

Referenced by mpd_output_begin(), and mpd_recv_output().

      struct mpd_output *output;

      assert(pair != NULL);

      if (strcmp(pair->name, "outputid") != 0)
            return NULL;

      output = malloc(sizeof(*output));
      if (output == NULL)
            return NULL;

      output->id = atoi(pair->value);

      output->name = NULL;
      output->enabled = false;

      return output;

Generated by  Doxygen 1.6.0   Back to index