mojoshader_internal.h
changeset 944 9f9fa9650772
parent 939 64cc93ee5a56
child 945 f00ea3986db8
--- a/mojoshader_internal.h	Mon Nov 08 19:06:56 2010 -0500
+++ b/mojoshader_internal.h	Tue Nov 09 05:00:03 2010 -0500
@@ -84,7 +84,7 @@
 #ifdef _MSC_VER
 #include <malloc.h>
 #define va_copy(a, b) a = b
-#define snprintf _snprintf
+#define snprintf _snprintf  // !!! FIXME: not a safe replacement!
 #define strcasecmp stricmp
 typedef unsigned __int8 uint8;
 typedef unsigned __int16 uint16;
@@ -223,6 +223,22 @@
 void errorlist_destroy(ErrorList *list);
 
 
+
+// Dynamic buffers...
+
+typedef struct Buffer Buffer;
+Buffer *buffer_create(size_t blksz,MOJOSHADER_malloc m,MOJOSHADER_free f,void *d);
+int buffer_append(Buffer *buffer, const char *data, size_t len);
+int buffer_append_fmt(Buffer *buffer, const char *fmt, ...) ISPRINTF(2,3);
+int buffer_append_va(Buffer *buffer, const char *fmt, va_list va);
+size_t buffer_size(Buffer *buffer);
+void buffer_empty(Buffer *buffer);
+char *buffer_flatten(Buffer *buffer);
+char *buffer_merge(Buffer **buffers, const size_t n, size_t *_len);
+void buffer_destroy(Buffer *buffer);
+
+
+
 // This is the ID for a D3DXSHADER_CONSTANTTABLE in the bytecode comments.
 #define CTAB_ID 0x42415443  // 0x42415443 == 'CTAB'
 #define CTAB_SIZE 28  // sizeof (D3DXSHADER_CONSTANTTABLE).