2014-06-22 18:44:35 -04:00
|
|
|
#ifndef UI_BUFFER_H
|
|
|
|
#define UI_BUFFER_H
|
|
|
|
|
|
|
|
#include "config.h"
|
|
|
|
|
|
|
|
#define BUFF_SIZE 1000
|
|
|
|
|
|
|
|
typedef struct prof_buff_entry_t {
|
2014-07-16 17:22:15 -04:00
|
|
|
char show_char;
|
|
|
|
char *date_fmt;
|
|
|
|
int flags;
|
|
|
|
int attrs;
|
|
|
|
char *from;
|
|
|
|
char *message;
|
2014-06-22 18:44:35 -04:00
|
|
|
} ProfBuffEntry;
|
|
|
|
|
|
|
|
typedef struct prof_buff_t {
|
2014-07-16 17:22:15 -04:00
|
|
|
ProfBuffEntry entry[BUFF_SIZE];
|
|
|
|
int wrap;
|
|
|
|
int current;
|
2014-06-22 18:44:35 -04:00
|
|
|
} ProfBuff;
|
|
|
|
|
|
|
|
ProfBuff* buffer_create();
|
|
|
|
void buffer_free(ProfBuff* buffer);
|
2014-06-29 09:04:23 -04:00
|
|
|
void buffer_push(ProfBuff* buffer, const char show_char, const char * const date_fmt, int flags, int attrs, const char * const from, const char * const message);
|
|
|
|
int buffer_size(ProfBuff* buffer);
|
|
|
|
ProfBuffEntry buffer_yield_entry(ProfBuff* buffer, int entry);
|
2014-07-16 17:22:15 -04:00
|
|
|
#endif
|