-
-#define COPYRIGHT "Copyright (c) 1997-2006 by Andre Noll"
-
-#define LICENSE "This is free software with ABSOLUTELY NO WARRANTY. " \
- "See COPYING for details."
-
-#define AWAITING_DATA_MSG "\nAwaiting Data."
-#define PROCEED_MSG "\nProceed.\n"
-#define PROCEED_MSG_LEN strlen(PROCEED_MSG)
-#define EOC_MSG "\nEnd of Command."
-#define CHALLENGE_RESPONSE_MSG "challenge_response:"
-
-/* gui_common */
-int para_open_audiod_pipe(char *);
-int read_audiod_pipe(int, void (*)(char *));
-
-/* exec */
-int para_exec_cmdline_pid(pid_t *pid, const char *cmdline, int *fds);
-
-/* signal */
-int para_signal_init(void);
-int para_install_sighandler(int);
-void para_reap_children(void);
-pid_t para_reap_child(void);
-int para_next_signal(void);
-
-/* time */
-int tv_diff(const struct timeval *b, const struct timeval *a, struct timeval *diff);
-long unsigned tv2ms(const struct timeval*);
-void d2tv(double, struct timeval*);
-void tv_add(const struct timeval*, const struct timeval *, struct timeval *);
-void tv_scale(const unsigned long, const struct timeval *, struct timeval *);
-void tv_divide(const unsigned long div, const struct timeval *tv,
- struct timeval *result);
-int tv_convex_combination(const long a, const struct timeval *tv1,
- const long b, const struct timeval *tv2,
- struct timeval *result);
-void ms2tv(const long unsigned n, struct timeval *tv);
-
-/* stat */
-enum {
- SI_STATUS_BAR, SI_STATUS, SI_NUM_PLAYED,
- SI_MTIME, SI_LENGTH_MIN, SI_LENGTH_SEC,
- SI_FILE_SIZE, SI_STATUS_FLAGS, SI_FORMAT,
- SI_SCORE, SI_AUDIO_INFO1, SI_AUDIO_INFO2,
- SI_AUDIO_INFO3, SI_DBINFO1, SI_DBINFO2,
- SI_DBINFO3, SI_DECODER_FLAGS, SI_AUDIOD_STATUS,
- SI_PLAY_TIME, SI_UPTIME, SI_OFFSET,
- SI_LENGTH, SI_STREAM_START, SI_CURRENT_TIME,
- SI_AUDIOD_UPTIME, SI_SELECTOR, NUM_STAT_ITEMS
-};
-
-int stat_item_valid(const char *item);
-int stat_line_valid(const char *);
-void stat_client_write(char *msg, int itemnum);
-int stat_client_add(int fd, long unsigned mask);
-void dump_empty_status(void);
-unsigned for_each_line(char *, int, void (*)(char *));
-
-struct stat_item_data {
- const char *prefix, *postfix;
- unsigned x, y, len;
- int fg, bg, align;
-};
-
-/* gui_theme */
-struct gui_theme {
- const char *name;
- const char *author;
- int sb_fg, sb_bg;
- int cmd_fg, cmd_bg;
- int output_fg, output_bg;
- int msg_fg, msg_bg;
- int err_msg_fg, err_msg_bg;
- int welcome_fg, welcome_bg;
- int sep_fg, sep_bg;
- const char *sep_str;
- int default_fg, default_bg;
-
- int top_lines_default, top_lines_min;
- int lines_min, cols_min;
- struct stat_item_data data[NUM_STAT_ITEMS];
-};
-
-void init_theme(int i, struct gui_theme *);
-void next_theme(struct gui_theme *);
-void prev_theme(struct gui_theme *);
-#define LEFT 1
-#define RIGHT 2
-#define CENTER 3
-
-
-__printf_2_3 void para_log(int, const char*, ...);
-
-/* taken from printf man page */
-#define PARA_VSPRINTF(fmt, p) \
-{ \
- int n, size = 100; \
- p = para_malloc(size); \
- while (1) { \
- va_list ap; \
- /* Try to print in the allocated space. */ \
- va_start(ap, fmt); \
- n = vsnprintf(p, size, fmt, ap); \
- va_end(ap); \
- /* If that worked, return the string. */ \
- if (n > -1 && n < size) \
- break; \
- /* Else try again with more space. */ \
- if (n > -1) /* glibc 2.1 */ \
- size = n + 1; /* precisely what is needed */ \
- else /* glibc 2.0 */ \
- size *= 2; /* twice the old size */ \
- p = para_realloc(p, size); \
- } \
-}