Added the ability to have a non-auto-flushing memlog. Flush is then a

manual process. Useful for triggering the dumping of the circular buffer when
an error is detected.
This commit is contained in:
Mark Riddoch
2014-10-14 11:40:23 +01:00
parent 8986a8042e
commit 52e8b33422
2 changed files with 76 additions and 19 deletions

View File

@ -40,12 +40,26 @@ typedef struct memlog {
int offset;
int size;
MEMLOGTYPE type;
unsigned int flags;
unsigned int iflags;
struct memlog *next;
} MEMLOG;
/*
* MEMLOG flag bits
*/
#define MLNOAUTOFLUSH 0x0001
/*
* MEMLOG internal flags
*/
#define MLWRAPPED 0x0001
extern MEMLOG *memlog_create(char *, MEMLOGTYPE, int);
extern void memlog_destroy(MEMLOG *);
extern void memlog_set(MEMLOG *, unsigned int);
extern void memlog_log(MEMLOG *, void *);
extern void memlog_flush_all();
extern void memlog_flush(MEMLOG *);
#endif