X-Git-Url: http://git.tuebingen.mpg.de/?p=paraslash.git;a=blobdiff_plain;f=para.h;h=b406818bd52a27bfc1794e0c95d8f9c0e9ef12a0;hp=3cd1b1621509330f0df7d6d6f7f1b02095a09153;hb=4643fd6eeee81acc0e82e47e7895a3111775bbba;hpb=bd28ec9a64884d70917c4fdea1a3a70c91758f83;ds=sidebyside diff --git a/para.h b/para.h index 3cd1b162..b406818b 100644 --- a/para.h +++ b/para.h @@ -1,8 +1,4 @@ -/* - * Copyright (C) 1997 Andre Noll - * - * Licensed under the GPL v2. For licencing details see COPYING. - */ +/* Copyright (C) 1997 Andre Noll , see file COPYING. */ /** \file para.h global paraslash definitions */ @@ -103,15 +99,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 +220,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 *));