-static struct afs_table afs_tables[] = {
- {.init = aft_init, .name = "audio_files"},
- {.init = attribute_init, .name = "attributes"},
- {.init = score_init, .name = "scores"},
- {.init = moods_init, .name = "moods"},
- {.init = lyrics_init, .name = "lyrics"},
- {.init = images_init, .name = "images"},
- {.init = playlists_init, .name = "playlists"},
+/**
+ * The array of tables of the audio file selector.
+ *
+ * We organize them in an array to be able to loop over all tables.
+ */
+static const struct afs_table {
+ /** The name is no table operation, so define it here. */
+ const char * const name;
+ /** The only way to invoke the ops is via this pointer. */
+ const struct afs_table_operations *ops;
+} afs_tables[] = {
+ {.name = "audio_files", .ops = &aft_ops},
+ {.name = "attributes", .ops = &attr_ops},
+ {.name = "scores", .ops = &score_ops},
+ {.name = "moods", .ops = &moods_ops},
+ {.name = "lyrics", .ops = &lyrics_ops},
+ {.name = "images", .ops = &images_ops},
+ {.name = "playlists", .ops = &playlists_ops},