Skip to content

Latest commit

 

History

History
27 lines (22 loc) · 638 Bytes

testparse.c

File metadata and controls

27 lines (22 loc) · 638 Bytes
 
Feb 10, 2008
Feb 10, 2008
1
#include <stdio.h>
Feb 12, 2008
Feb 12, 2008
2
#include <stdlib.h>
Mar 22, 2008
Mar 22, 2008
3
#include "mojoshader.h"
Feb 10, 2008
Feb 10, 2008
4
5
6
int main(int argc, char **argv)
{
Mar 22, 2008
Mar 22, 2008
7
8
9
printf("Compiled against version %d\n", MOJOSHADER_VERSION);
printf("Linked against version %d\n", MOJOSHADER_version());
Feb 10, 2008
Feb 10, 2008
10
11
12
13
14
if (argv[1] != NULL)
{
FILE *io = fopen(argv[1], "rb");
if (io != NULL)
{
Feb 12, 2008
Feb 12, 2008
15
unsigned char *buf = (unsigned char *) malloc(1000000);
Feb 10, 2008
Feb 10, 2008
16
17
int rc = fread(buf, 1, 1000000, io);
fclose(io);
Mar 22, 2008
Mar 22, 2008
18
MOJOSHADER_parse("d3d", buf, rc, NULL, NULL);
Feb 10, 2008
Feb 10, 2008
19
20
21
22
23
24
25
26
free(buf);
} // if
} // if
return 0;
} // main
// end of testparse.c ...