diff options
author | Vincent Sanders <vince@kyllikki.org> | 2012-10-21 12:56:50 +0100 |
---|---|---|
committer | Vincent Sanders <vince@kyllikki.org> | 2012-10-21 12:56:50 +0100 |
commit | d264e721abc7848ae4f82fbaae444245f0e1e2b9 (patch) | |
tree | 00255013bf0803c4badfa02313af5cdec4ff054d /src/webidl-ast.c | |
parent | 903f328e2ea9405a0d351c828389cf0080670b6c (diff) | |
download | nsgenbind-d264e721abc7848ae4f82fbaae444245f0e1e2b9.tar.gz nsgenbind-d264e721abc7848ae4f82fbaae444245f0e1e2b9.tar.bz2 |
add includes in binding files to allow binding definitions to be split up
Diffstat (limited to 'src/webidl-ast.c')
-rw-r--r-- | src/webidl-ast.c | 24 |
1 files changed, 13 insertions, 11 deletions
diff --git a/src/webidl-ast.c b/src/webidl-ast.c index 75dbdeb..7e6fc2c 100644 --- a/src/webidl-ast.c +++ b/src/webidl-ast.c @@ -359,23 +359,25 @@ int webidl_ast_dump(struct webidl_node *node, int indent) static FILE *idlopen(const char *filename) { FILE *idlfile; + char *fullname; + int fulllen; if (options->idlpath == NULL) { if (options->verbose) { printf("Opening IDL file %s\n", filename); } - idlfile = fopen(filename, "r"); - } else { - char *fullname; - int fulllen = strlen(options->idlpath) + strlen(filename) + 2; - fullname = malloc(fulllen); - snprintf(fullname, fulllen, "%s/%s", options->idlpath, filename); - if (options->verbose) { - printf("Opening IDL file %s\n", fullname); - } - idlfile = fopen(fullname, "r"); - free(fullname); + return fopen(filename, "r"); + } + + fulllen = strlen(options->idlpath) + strlen(filename) + 2; + fullname = malloc(fulllen); + snprintf(fullname, fulllen, "%s/%s", options->idlpath, filename); + if (options->verbose) { + printf("Opening IDL file %s\n", fullname); } + idlfile = fopen(fullname, "r"); + free(fullname); + return idlfile; } |