testparse.c
branchtrunk
changeset 9 aea1b254e6a5
parent 7 18bf77bb8c07
child 14 7075b6e31471
equal deleted inserted replaced
8:6903b0d7d877 9:aea1b254e6a5
     1 #include <stdio.h>
     1 #include <stdio.h>
       
     2 #include <stdlib.h>
     2 #include "d3d2glsl.h"
     3 #include "d3d2glsl.h"
     3 
     4 
     4 int main(int argc, char **argv)
     5 int main(int argc, char **argv)
     5 {
     6 {
     6     if (argv[1] != NULL)
     7     if (argv[1] != NULL)
     7     {
     8     {
     8         FILE *io = fopen(argv[1], "rb");
     9         FILE *io = fopen(argv[1], "rb");
     9         if (io != NULL)
    10         if (io != NULL)
    10         {
    11         {
    11             uint8 *buf = (uint8 *) malloc(1000000);
    12             unsigned char *buf = (unsigned char *) malloc(1000000);
    12             int rc = fread(buf, 1, 1000000, io);
    13             int rc = fread(buf, 1, 1000000, io);
    13             fclose(io);
    14             fclose(io);
    14             D3D2GLSL_parse(buf, rc);
    15             D3D2GLSL_parse(buf, rc);
    15             free(buf);
    16             free(buf);
    16         } // if
    17         } // if