testparse.c
author icculus
Sun, 10 Feb 2008 18:34:12 -0500
branchtrunk
changeset 7 18bf77bb8c07
child 9 aea1b254e6a5
permissions -rw-r--r--
[svn] Cleanups, split things out.
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>
18bf77bb8c07 [svn] Cleanups, split things out.
icculus
parents:
diff changeset
     2
#include "d3d2glsl.h"
18bf77bb8c07 [svn] Cleanups, split things out.
icculus
parents:
diff changeset
     3
18bf77bb8c07 [svn] Cleanups, split things out.
icculus
parents:
diff changeset
     4
int main(int argc, char **argv)
18bf77bb8c07 [svn] Cleanups, split things out.
icculus
parents:
diff changeset
     5
{
18bf77bb8c07 [svn] Cleanups, split things out.
icculus
parents:
diff changeset
     6
    if (argv[1] != NULL)
18bf77bb8c07 [svn] Cleanups, split things out.
icculus
parents:
diff changeset
     7
    {
18bf77bb8c07 [svn] Cleanups, split things out.
icculus
parents:
diff changeset
     8
        FILE *io = fopen(argv[1], "rb");
18bf77bb8c07 [svn] Cleanups, split things out.
icculus
parents:
diff changeset
     9
        if (io != NULL)
18bf77bb8c07 [svn] Cleanups, split things out.
icculus
parents:
diff changeset
    10
        {
18bf77bb8c07 [svn] Cleanups, split things out.
icculus
parents:
diff changeset
    11
            uint8 *buf = (uint8 *) malloc(1000000);
18bf77bb8c07 [svn] Cleanups, split things out.
icculus
parents:
diff changeset
    12
            int rc = fread(buf, 1, 1000000, io);
18bf77bb8c07 [svn] Cleanups, split things out.
icculus
parents:
diff changeset
    13
            fclose(io);
18bf77bb8c07 [svn] Cleanups, split things out.
icculus
parents:
diff changeset
    14
            D3D2GLSL_parse(buf, rc);
18bf77bb8c07 [svn] Cleanups, split things out.
icculus
parents:
diff changeset
    15
            free(buf);
18bf77bb8c07 [svn] Cleanups, split things out.
icculus
parents:
diff changeset
    16
        } // if
18bf77bb8c07 [svn] Cleanups, split things out.
icculus
parents:
diff changeset
    17
    } // if
18bf77bb8c07 [svn] Cleanups, split things out.
icculus
parents:
diff changeset
    18
18bf77bb8c07 [svn] Cleanups, split things out.
icculus
parents:
diff changeset
    19
    return 0;
18bf77bb8c07 [svn] Cleanups, split things out.
icculus
parents:
diff changeset
    20
} // main
18bf77bb8c07 [svn] Cleanups, split things out.
icculus
parents:
diff changeset
    21
18bf77bb8c07 [svn] Cleanups, split things out.
icculus
parents:
diff changeset
    22
// end of testparse.c ...
18bf77bb8c07 [svn] Cleanups, split things out.
icculus
parents:
diff changeset
    23