Fix bug in glue.c when accessing void*

Also added struct test to C generator tests.
Specify C Generator tests explicitly

This makes it easier to run a test individually.
Add restrict test; It doesn't work with nacl-gcc

The stupid solution is to just undefine restrict. Adding -std=c99
doesn't work because we compile all files in one command-line (C and
C++).
bin/gen.py can read additional options from file

Add the following to the file being parsed:

// naclbind-gen: <args>

or

/* naclbind-gen: <args>
                 <more args>
 */
Change gen.py Acceptor to use match, not search

This makes it easier to do the common thing:

    -W malloc  // only matches malloc

But also allows the uncommon thing:

    -W ".*foo.*"  // matches any symbol with "foo" in it

I also modified the rot13 integration test to use this instead of
wrapping malloc, free and memcpy.

Finally, I changed gen.py to default to including all symbols in the
current file, regardless of the whitelist/blacklist. This is commonly
what you want if you wrote that header by hand. If not, you can always
explicitly blacklist the header and whitelist the symbols you want.
Change -triple to -target in gen.py

This makes the type sizes correct when generating code.

I also added a compile-time assert to the generated C code to test the
size of structs and the offsets of their fields.
Remove manual defines from gen.py

Now that the target is correct, automatically defined values are passed
through properly, so I don't need to set them manually.
Move Record field definition out of constructor

This allows you to create self-referencing data types, e.g.

struct A {
  struct A* foo;
};

This change also required using the generated "type" module in the JS
generator tests, instead of the required one. Otherwise the isinstance
check fails because the Type constructors are different (they're being
generated twice!)
Fix bug in gen.py WRT array definition order

Array type's element types were not being included in the topological
sort.

So if the element type needed to be defined first (such as a
typedef), it was not being defined in time and causing a JavaScript
reference error.
Remove Type.equals and move it to test code

As far as I can tell, testing types for equality will not be useful in
client code. Moving it out of naclbind.js reduces the API footprint.

The current implementation is also incorrect; it doesn't work properly
with recursive types. The new one in test/js/equals.js properly tracks
types so it doesn't infinitely recurse.
Make mutually recursive types work.

This allows for constructs like:

    struct A { struct B* b; }
    struct B { struct A* a; }
Use underlying_typedef_type instead of get_canonical

I didn't see this function before because it is defined on Cursor
instead of Type. It is necessary to use this, however to define all
typedefs in the correct order.

The test I added exercises this issue that occurs with FILE, basically:

    typedef struct __sFILE __FILE;
    struct __sFILE {
      __FILE* f;
    };
    typedef __FILE FILE;

get_canonical causes us to map FILE -> __sFILE and skip __FILE.
Fix bug hashing typedef types

This bug would prevent creating typedefs for types whose underlying
types were already processed, e.g.

    typedef char t1;
    typedef char t2;

t1 would be generated, but t2 wouldn't.
Fix bug in gen.py, should visit result type
Disable restrict in naclbind-test

See 1560c307a9
Print error messages and disable warnings in glue.c

This CL fixes compilation, and adds error messages in the following
cases:

* Function pointers
* va_list
* non-PP_Var records
* variadic functions
* Don't perform size checks on anonymous types
* Fix compilation error when returning a record

Also add comments in generated C for the following:
* function signature
* function id number
integration tests can specify build config

Each test_*.js file must now have node-style wrapper so it can be
required. If it has a "buildopts" key, it will be called to extend the
build options.
Add debug log-level to gen.py

Fix log.debug in Collector.Visit*.
Add nacl_io integration test