testparse.c
author icculus
Fri, 14 Mar 2008 07:07:49 -0400
branchtrunk
changeset 18 0dbdb2be8bf8
parent 14 7075b6e31471
child 37 63b5ba0bcda0
permissions -rw-r--r--
[svn] Bunch More Work. Cleanups, added app-supplied allocators, flexible output, etc.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
7
18bf77bb8c07 [svn] Cleanups, split things out.
icculus
parents:
diff changeset
     1
#include <stdio.h>
9
aea1b254e6a5 [svn] Patched to compile.
icculus
parents: 7
diff changeset
     2
#include <stdlib.h>
7
18bf77bb8c07 [svn] Cleanups, split things out.
icculus
parents:
diff changeset
     3
#include "d3d2glsl.h"
18bf77bb8c07 [svn] Cleanups, split things out.
icculus
parents:
diff changeset
     4
18bf77bb8c07 [svn] Cleanups, split things out.
icculus
parents:
diff changeset
     5
int main(int argc, char **argv)
18bf77bb8c07 [svn] Cleanups, split things out.
icculus
parents:
diff changeset
     6
{
18bf77bb8c07 [svn] Cleanups, split things out.
icculus
parents:
diff changeset
     7
    if (argv[1] != NULL)
18bf77bb8c07 [svn] Cleanups, split things out.
icculus
parents:
diff changeset
     8
    {
18bf77bb8c07 [svn] Cleanups, split things out.
icculus
parents:
diff changeset
     9
        FILE *io = fopen(argv[1], "rb");
18bf77bb8c07 [svn] Cleanups, split things out.
icculus
parents:
diff changeset
    10
        if (io != NULL)
18bf77bb8c07 [svn] Cleanups, split things out.
icculus
parents:
diff changeset
    11
        {
9
aea1b254e6a5 [svn] Patched to compile.
icculus
parents: 7
diff changeset
    12
            unsigned char *buf = (unsigned char *) malloc(1000000);
7
18bf77bb8c07 [svn] Cleanups, split things out.
icculus
parents:
diff changeset
    13
            int rc = fread(buf, 1, 1000000, io);
18bf77bb8c07 [svn] Cleanups, split things out.
icculus
parents:
diff changeset
    14
            fclose(io);
18
0dbdb2be8bf8 [svn] Bunch More Work. Cleanups, added app-supplied allocators, flexible output, etc.
icculus
parents: 14
diff changeset
    15
            D3D2GLSL_parse("d3d", buf, rc, NULL, NULL);
7
18bf77bb8c07 [svn] Cleanups, split things out.
icculus
parents:
diff changeset
    16
            free(buf);
18bf77bb8c07 [svn] Cleanups, split things out.
icculus
parents:
diff changeset
    17
        } // if
18bf77bb8c07 [svn] Cleanups, split things out.
icculus
parents:
diff changeset
    18
    } // if
18bf77bb8c07 [svn] Cleanups, split things out.
icculus
parents:
diff changeset
    19
18bf77bb8c07 [svn] Cleanups, split things out.
icculus
parents:
diff changeset
    20
    return 0;
18bf77bb8c07 [svn] Cleanups, split things out.
icculus
parents:
diff changeset
    21
} // main
18bf77bb8c07 [svn] Cleanups, split things out.
icculus
parents:
diff changeset
    22
18bf77bb8c07 [svn] Cleanups, split things out.
icculus
parents:
diff changeset
    23
// end of testparse.c ...
18bf77bb8c07 [svn] Cleanups, split things out.
icculus
parents:
diff changeset
    24