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

mpd_malloc struct mpd_status* mpd_status_begin ( void   )  [read]

Begins parsing the server status: creates a new empty mpd_status object. Free it with mpd_status_free().

Returns:
the newly allocated mpd_status object, or NULL if out of memory

Definition at line 113 of file status.c.

References mpd_status::audio_format, mpd_status::consume, mpd_status::crossfade, mpd_status::elapsed_ms, mpd_status::elapsed_time, mpd_status::error, mpd_status::kbit_rate, MPD_STATE_UNKNOWN, mpd_status_begin(), mpd_status::queue_length, mpd_status::queue_version, mpd_status::random, mpd_status::repeat, mpd_status::single, mpd_status::song_id, mpd_status::song_pos, mpd_status::state, mpd_status::total_time, mpd_status::update_id, and mpd_status::volume.

Referenced by mpd_recv_status(), and mpd_status_begin().

{
      struct mpd_status *status = malloc(sizeof(*status));
      if (status == NULL)
            return NULL;

      status->volume = -1;
      status->repeat = false;
      status->random = false;
      status->single = false;
      status->consume = false;
      status->queue_version = 0;
      status->queue_length = 0;
      status->state = MPD_STATE_UNKNOWN;
      status->song_pos = -1;
      status->song_id = -1;
      status->elapsed_time = 0;
      status->elapsed_ms = 0;
      status->total_time = 0;
      status->kbit_rate = 0;
      memset(&status->audio_format, 0, sizeof(status->audio_format));
      status->crossfade = 0;
      status->error = NULL;
      status->update_id = 0;

      return status;
}


Generated by  Doxygen 1.6.0   Back to index