mojoshader_common.c
changeset 945 f00ea3986db8
parent 944 9f9fa9650772
child 946 16fec3a3f687
--- a/mojoshader_common.c	Tue Nov 09 05:00:03 2010 -0500
+++ b/mojoshader_common.c	Tue Nov 09 05:05:41 2010 -0500
@@ -390,6 +390,23 @@
 } // stringcache_destroy
 
 
+// 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;
+
+struct ErrorList
+{
+    ErrorItem head;
+    ErrorItem *tail;
+    int count;
+    MOJOSHADER_malloc m;
+    MOJOSHADER_free f;
+    void *d;
+};
 
 ErrorList *errorlist_create(MOJOSHADER_malloc m, MOJOSHADER_free f, void *d)
 {
@@ -483,6 +500,12 @@
 } // errorlist_add_va
 
 
+int errorlist_count(ErrorList *list)
+{
+    return list->count;
+} // errorlist_count
+
+
 MOJOSHADER_error *errorlist_flatten(ErrorList *list)
 {
     if (list->count == 0)