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

void mpd_entity_free ( struct mpd_entity entity  ) 

Releases an entity. This also frees the wrapped object.

Definition at line 70 of file entity.c.

References mpd_entity::directory, mpd_entity::info, mpd_directory_free(), mpd_entity_free(), MPD_ENTITY_TYPE_DIRECTORY, MPD_ENTITY_TYPE_PLAYLIST, MPD_ENTITY_TYPE_SONG, MPD_ENTITY_TYPE_UNKNOWN, mpd_playlist_free(), mpd_song_free(), mpd_entity::playlistFile, mpd_entity::song, and mpd_entity::type.

Referenced by mpd_entity_free(), and mpd_recv_entity().

                                           {
      assert(entity != NULL);

      switch (entity->type) {
      case MPD_ENTITY_TYPE_UNKNOWN:
            /* nothing to free */
            break;

      case MPD_ENTITY_TYPE_DIRECTORY:
            mpd_directory_free(entity->info.directory);
            break;

      case MPD_ENTITY_TYPE_SONG:
            mpd_song_free(entity->info.song);
            break;

      case MPD_ENTITY_TYPE_PLAYLIST:
            mpd_playlist_free(entity->info.playlistFile);
            break;
      }

      free(entity);
}


Generated by  Doxygen 1.6.0   Back to index