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