xpidl_process_idl(char *filename, IncludePathEntry *include_path)
xpidl_process_idl(char *filename, IncludePathEntry *include_path, char *basename)
xpidl_process_idl(char *filename, IncludePathEntry *include_path){    char *basename, *tmp;    IDL_tree top;    TreeState state;    int rv;    struct input_callback_stack stack;    stack.includes = g_hash_table_new(g_str_hash, g_str_equal);    stack.include_path = include_path;    if (!stack.includes)        return 0;    rv = IDL_parse_filename_with_input(filename, input_callback, &stack,                                       msg_callback, &top,                                       &state.ns, IDLF_XPIDL,                                       enable_warnings ? IDL_WARNING1 : 0);    if (rv != IDL_SUCCESS) {        if (rv == -1) {            g_warning("Parse of %s failed: %s", filename, g_strerror(errno));        } else {            g_warning("Parse of %s failed", filename);        }        return 0;    }    basename = g_strdup(filename);    tmp = strrchr(basename, '.');    if (tmp)        *tmp = '\0';    state.file = stdout;	/* XXX */    state.basename = basename;    state.includes = stack.includes;    state.include_path = include_path;    nodeDispatch[TREESTATE_HEADER] = headerDispatch();    nodeDispatch[TREESTATE_INVOKE] = invokeDispatch();    nodeDispatch[TREESTATE_DOC] = docDispatch();    if (generate_headers) {        state.mode = TREESTATE_HEADER;        state.tree = top;        if (!process_tree(&state))            return 0;    }    if (generate_invoke) {        state.mode = TREESTATE_INVOKE;        state.tree = top;        if (!process_tree(&state))            return 0;    }    if (generate_docs) {        state.mode = TREESTATE_DOC;        state.tree = top;        if (!process_tree(&state))            return 0;    }    free(state.basename);    /* g_hash_table_foreach(state.includes, free_name, NULL);       g_hash_table_destroy(state.includes);    */    IDL_ns_free(state.ns);    IDL_tree_free(top);        return 1;}