15#define _stricmp strcasecmp
29 if (
feof(inFile) && nullTerminate)
32 if (!
feof(inFile) || nullTerminate)
35 if ((bufLen % 16) == 0)
39 fprintf(outCFile,
" 0x%02x,", (
unsigned int)ch);
43 }
while (!
feof(inFile));
65 if ((bufLen != 0) && (bufLen % 16) == 0)
73 fprintf(outCFile,
"\\x%02x", (
unsigned int)ch);
84 }
while (!
feof(inFile));
91 fprintf(
stdout,
"Usage: %s infile.bin outfile.c outfile.h [BIN|BINSTR|STR] array_name [array_attribute [header_for_attribute]]\n",
name);
141 fprintf(outCFile,
"/* This file is autogenerated, do not edit. */\n\n");
155 fprintf(outCFile,
"unsigned char %s[] =",
argv[5]);
159 bufLen =
dumpHex(inFile, outCFile, 0);
161 bufLen =
dumpHex(inFile, outCFile, 1);
163 bufLen =
dumpStr(inFile, outCFile);
169 fprintf(outHFile,
"/* This file is autogenerated, do not edit. */\n\n");
170 fprintf(outHFile,
"#define %s_SIZE %lu\n" ,
argv[5], (
unsigned long)bufLen);
171 fprintf(outHFile,
"extern unsigned char %s[%lu];\n",
argv[5], (
unsigned long)bufLen);
static size_t dumpHex(FILE *inFile, FILE *outCFile, char nullTerminate)
static size_t dumpStr(FILE *inFile, FILE *outCFile)
GLsizeiptr const GLvoid GLenum usage
_Check_return_opt_ _CRTIMP int __cdecl fgetc(_Inout_ FILE *_File)
_Check_return_ _CRTIMP int __cdecl feof(_In_ FILE *_File)
_Check_return_opt_ _CRTIMP int __cdecl fprintf(_Inout_ FILE *_File, _In_z_ _Printf_format_string_ const char *_Format,...)
_Check_return_ _CRTIMP FILE *__cdecl fopen(_In_z_ const char *_Filename, _In_z_ const char *_Mode)
_Check_return_opt_ _CRTIMP int __cdecl fclose(_Inout_ FILE *_File)