testparse.c
author icculus
Mon, 11 Feb 2008 22:39:03 -0500
branchtrunk
changeset 10 8104628081a8
parent 9 aea1b254e6a5
child 14 7075b6e31471
permissions -rw-r--r--
[svn] Renamed parse to testparse.
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);
18bf77bb8c07 [svn] Cleanups, split things out.
icculus
parents:
diff changeset
    15
            D3D2GLSL_parse(buf, rc);
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