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

mpd_malloc struct mpd_stats* mpd_stats_begin ( void   )  [read]

Begins parsing server stats: creates a new empty mpd_stats object. Free it with mpd_stats_free().

the newly allocated mpd_stats object, or NULL if out of memory

Definition at line 51 of file stats.c.

References mpd_stats::db_play_time, mpd_stats::db_update_time, mpd_stats_begin(), mpd_stats::number_of_albums, mpd_stats::number_of_artists, mpd_stats::number_of_songs, mpd_stats::play_time, and mpd_stats::uptime.

Referenced by mpd_recv_stats(), and mpd_stats_begin().

      struct mpd_stats *stats = malloc(sizeof(struct mpd_stats));
      if (stats == NULL)
            return NULL;

      stats->number_of_artists = 0;
      stats->number_of_albums = 0;
      stats->number_of_songs = 0;
      stats->uptime = 0;
      stats->db_update_time = 0;
      stats->play_time = 0;
      stats->db_play_time = 0;

      return stats;

Generated by  Doxygen 1.6.0   Back to index