Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
9d1f1a3f
Commit
9d1f1a3f
authored
Jan 24, 2023
by
Rémi Bernon
Committed by
Alexandre Julliard
Mar 16, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
widl: Use a struct list to keep imported files.
parent
b35f4424
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
14 deletions
+13
-14
parser.l
tools/widl/parser.l
+13
-14
No files found.
tools/widl/parser.l
View file @
9d1f1a3f
...
...
@@ -89,6 +89,13 @@ struct {
} import_stack[MAX_IMPORT_DEPTH];
int import_stack_ptr = 0;
struct import
{
const char *name;
struct list entry;
};
static struct list imports = LIST_INIT( imports );
/* converts an integer in string form to an unsigned long and prints an error
* on overflow */
static unsigned int xstrtoul(const char *nptr, char **endptr, int base)
...
...
@@ -513,28 +520,20 @@ void pop_import(void)
import_stack_ptr--;
}
struct imports {
char *name;
struct imports *next;
} *first_import;
int do_import(char *fname)
{
FILE *f;
char *path, *name;
struct import
s
*import;
struct import *import;
int ptr = import_stack_ptr;
int ret;
import = first_import;
while (import && strcmp(import->name, fname))
import = import->next;
if (import) return 0; /* already imported */
LIST_FOR_EACH_ENTRY( import, &imports, struct import, entry )
if (!strcmp( import->name, fname )) return 0; /* already imported */
import = xmalloc(sizeof(struct imports));
import->name = xstrdup(fname);
import->next = first_import;
first_import = import;
import = xmalloc( sizeof(struct import) );
import->name = xstrdup( fname );
list_add_tail( &imports, &import->entry );
/* don't search for a file name with a path in the include directories,
* for compatibility with MIDL */
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment