]> git.tuebingen.mpg.de Git - paraslash.git/blobdiff - para.h
Define status items in para.h.
[paraslash.git] / para.h
diff --git a/para.h b/para.h
index 3cd1b1621509330f0df7d6d6f7f1b02095a09153..323a4fb5bce74bac7a04448a0d6581296fd7c3e4 100644 (file)
--- a/para.h
+++ b/para.h
@@ -103,15 +103,6 @@ void compute_chunk_time(long unsigned chunk_num,
                struct timeval *result);
 struct timeval *clock_get_realtime(struct timeval *tv);
 
-/** The enum of all status items. */
-enum status_items {STATUS_ITEM_ENUM NUM_STAT_ITEMS};
-extern const char *status_item_list[];
-/** Loop over each status item. */
-#define FOR_EACH_STATUS_ITEM(i) for (i = 0; i < NUM_STAT_ITEMS; i++)
-int for_each_stat_item(char *item_buf, size_t num_bytes,
-       int (*item_handler)(int, char *));
-
-
 /**
  * Return a random non-negative integer in an interval.
  *
@@ -233,3 +224,57 @@ enum loglevels {LOGLEVELS, NUM_LOGLEVELS};
 #define PARA_ERROR_LOG(f,...) para_log(LL_ERROR, "%s: " f, __FUNCTION__, ## __VA_ARGS__)
 #define PARA_CRIT_LOG(f,...) para_log(LL_CRIT, "%s: " f, __FUNCTION__, ## __VA_ARGS__)
 #define PARA_EMERG_LOG(f,...) para_log(LL_EMERG, "%s: " f, __FUNCTION__, ## __VA_ARGS__)
+
+#define STATUS_ITEMS \
+       STATUS_ITEM(basename) \
+       STATUS_ITEM(status) \
+       STATUS_ITEM(num_played) \
+       STATUS_ITEM(mtime) \
+       STATUS_ITEM(bitrate) \
+       STATUS_ITEM(frequency) \
+       STATUS_ITEM(file_size) \
+       STATUS_ITEM(status_flags) \
+       STATUS_ITEM(format) \
+       STATUS_ITEM(score) \
+       STATUS_ITEM(techinfo) \
+       STATUS_ITEM(afs_mode) \
+       STATUS_ITEM(attributes_txt) \
+       STATUS_ITEM(decoder_flags) \
+       STATUS_ITEM(audiod_status) \
+       STATUS_ITEM(play_time) \
+       STATUS_ITEM(attributes_bitmap) \
+       STATUS_ITEM(offset) \
+       STATUS_ITEM(seconds_total) \
+       STATUS_ITEM(stream_start) \
+       STATUS_ITEM(current_time) \
+       STATUS_ITEM(audiod_uptime) \
+       STATUS_ITEM(image_id) \
+       STATUS_ITEM(lyrics_id) \
+       STATUS_ITEM(duration) \
+       STATUS_ITEM(directory) \
+       STATUS_ITEM(lyrics_name) \
+       STATUS_ITEM(image_name) \
+       STATUS_ITEM(path) \
+       STATUS_ITEM(hash) \
+       STATUS_ITEM(channels) \
+       STATUS_ITEM(last_played) \
+       STATUS_ITEM(num_chunks) \
+       STATUS_ITEM(chunk_time) \
+       STATUS_ITEM(amplification) \
+       STATUS_ITEM(artist) \
+       STATUS_ITEM(title) \
+       STATUS_ITEM(year) \
+       STATUS_ITEM(album) \
+       STATUS_ITEM(comment) \
+       STATUS_ITEM(max_chunk_size) \
+
+#define STATUS_ITEM(_name) SI_ ##_name,
+enum status_items {STATUS_ITEMS NUM_STAT_ITEMS};
+#undef STATUS_ITEM
+#define STATUS_ITEM(_name) #_name,
+
+extern const char *status_item_list[];
+/** Loop over each status item. */
+#define FOR_EACH_STATUS_ITEM(i) for (i = 0; i < NUM_STAT_ITEMS; i++)
+int for_each_stat_item(char *item_buf, size_t num_bytes,
+       int (*item_handler)(int, char *));