Skip to content
Browse files
Made ErrorList struct opaque to callers.
  • Loading branch information
icculus committed Nov 9, 2010
1 parent c208fba commit 21ecec1683eb14016fe2bff89be0b76122a3160c

File 5 of 6 in 21ecec1

@@ -194,31 +194,17 @@ const char *stringcache_fmt(StringCache *cache, const char *fmt, ...);
void stringcache_destroy(StringCache *cache);

// We chain errors as a linked list with a head/tail for easy appending.
// These get flattened before passing to the application.
typedef struct ErrorItem
MOJOSHADER_error error;
struct ErrorItem *next;
} ErrorItem;

typedef struct ErrorList
ErrorItem head;
ErrorItem *tail;
int count;
MOJOSHADER_malloc m;
void *d;
} ErrorList;
// Error lists...

typedef struct ErrorList ErrorList;
ErrorList *errorlist_create(MOJOSHADER_malloc m, MOJOSHADER_free f, void *d);
int errorlist_add(ErrorList *list, const char *fname,
const int errpos, const char *str);
int errorlist_add_fmt(ErrorList *list, const char *fname,
const int errpos, const char *fmt, ...) ISPRINTF(4,5);
int errorlist_add_va(ErrorList *list, const char *_fname,
const int errpos, const char *fmt, va_list va);
int errorlist_count(ErrorList *list);
MOJOSHADER_error *errorlist_flatten(ErrorList *list); // resets the list!
void errorlist_destroy(ErrorList *list);

0 comments on commit 21ecec1

Please sign in to comment.