mojoshader_internal.h
changeset 944 9f9fa9650772
parent 939 64cc93ee5a56
child 945 f00ea3986db8
equal deleted inserted replaced
943:775cd2ac324b 944:9f9fa9650772
    82 typedef unsigned int uint;  // this is a printf() helper. don't use for code.
    82 typedef unsigned int uint;  // this is a printf() helper. don't use for code.
    83 
    83 
    84 #ifdef _MSC_VER
    84 #ifdef _MSC_VER
    85 #include <malloc.h>
    85 #include <malloc.h>
    86 #define va_copy(a, b) a = b
    86 #define va_copy(a, b) a = b
    87 #define snprintf _snprintf
    87 #define snprintf _snprintf  // !!! FIXME: not a safe replacement!
    88 #define strcasecmp stricmp
    88 #define strcasecmp stricmp
    89 typedef unsigned __int8 uint8;
    89 typedef unsigned __int8 uint8;
    90 typedef unsigned __int16 uint16;
    90 typedef unsigned __int16 uint16;
    91 typedef unsigned __int32 uint32;
    91 typedef unsigned __int32 uint32;
    92 typedef unsigned __int64 uint64;
    92 typedef unsigned __int64 uint64;
   219                       const int errpos, const char *fmt, ...) ISPRINTF(4,5);
   219                       const int errpos, const char *fmt, ...) ISPRINTF(4,5);
   220 int errorlist_add_va(ErrorList *list, const char *_fname,
   220 int errorlist_add_va(ErrorList *list, const char *_fname,
   221                      const int errpos, const char *fmt, va_list va);
   221                      const int errpos, const char *fmt, va_list va);
   222 MOJOSHADER_error *errorlist_flatten(ErrorList *list); // resets the list!
   222 MOJOSHADER_error *errorlist_flatten(ErrorList *list); // resets the list!
   223 void errorlist_destroy(ErrorList *list);
   223 void errorlist_destroy(ErrorList *list);
       
   224 
       
   225 
       
   226 
       
   227 // Dynamic buffers...
       
   228 
       
   229 typedef struct Buffer Buffer;
       
   230 Buffer *buffer_create(size_t blksz,MOJOSHADER_malloc m,MOJOSHADER_free f,void *d);
       
   231 int buffer_append(Buffer *buffer, const char *data, size_t len);
       
   232 int buffer_append_fmt(Buffer *buffer, const char *fmt, ...) ISPRINTF(2,3);
       
   233 int buffer_append_va(Buffer *buffer, const char *fmt, va_list va);
       
   234 size_t buffer_size(Buffer *buffer);
       
   235 void buffer_empty(Buffer *buffer);
       
   236 char *buffer_flatten(Buffer *buffer);
       
   237 char *buffer_merge(Buffer **buffers, const size_t n, size_t *_len);
       
   238 void buffer_destroy(Buffer *buffer);
       
   239 
   224 
   240 
   225 
   241 
   226 // This is the ID for a D3DXSHADER_CONSTANTTABLE in the bytecode comments.
   242 // This is the ID for a D3DXSHADER_CONSTANTTABLE in the bytecode comments.
   227 #define CTAB_ID 0x42415443  // 0x42415443 == 'CTAB'
   243 #define CTAB_ID 0x42415443  // 0x42415443 == 'CTAB'
   228 #define CTAB_SIZE 28  // sizeof (D3DXSHADER_CONSTANTTABLE).
   244 #define CTAB_SIZE 28  // sizeof (D3DXSHADER_CONSTANTTABLE).