widl: Convert typelib lists to standard Wine lists.
This commit is contained in:
parent
5aba7b0c67
commit
5b0bf5dc76
|
@ -230,8 +230,8 @@ void start_typelib(char *name, attr_t *attrs)
|
|||
typelib->name = xstrdup(name);
|
||||
typelib->filename = xstrdup(typelib_name);
|
||||
typelib->attrs = attrs;
|
||||
typelib->entry = NULL;
|
||||
typelib->importlibs = NULL;
|
||||
list_init( &typelib->entries );
|
||||
list_init( &typelib->importlibs );
|
||||
}
|
||||
|
||||
void end_typelib(void)
|
||||
|
@ -251,8 +251,7 @@ void add_typelib_entry(type_t *t)
|
|||
chat("add kind %i: %s\n", t->kind, t->name);
|
||||
entry = xmalloc(sizeof(*entry));
|
||||
entry->type = t;
|
||||
LINK(entry, typelib->entry);
|
||||
typelib->entry = entry;
|
||||
list_add_tail( &typelib->entries, &entry->entry );
|
||||
}
|
||||
|
||||
static void tlb_read(int fd, void *buf, int count)
|
||||
|
@ -365,10 +364,9 @@ void add_importlib(const char *name)
|
|||
|
||||
if(!typelib) return;
|
||||
|
||||
for(importlib = typelib->importlibs; importlib; importlib = NEXT_LINK(importlib)) {
|
||||
LIST_FOR_EACH_ENTRY( importlib, &typelib->importlibs, importlib_t, entry )
|
||||
if(!strcmp(name, importlib->name))
|
||||
return;
|
||||
}
|
||||
|
||||
chat("add_importlib: %s\n", name);
|
||||
|
||||
|
@ -377,7 +375,5 @@ void add_importlib(const char *name)
|
|||
importlib->name = xstrdup(name);
|
||||
|
||||
read_importlib(importlib);
|
||||
|
||||
LINK(importlib, typelib->importlibs);
|
||||
typelib->importlibs = importlib;
|
||||
list_add_head( &typelib->importlibs, &importlib->entry );
|
||||
}
|
||||
|
|
|
@ -24,6 +24,7 @@
|
|||
#include <stdarg.h>
|
||||
#include "guiddef.h"
|
||||
#include "wine/rpcfc.h"
|
||||
#include "wine/list.h"
|
||||
|
||||
#ifndef UUID_DEFINED
|
||||
#define UUID_DEFINED
|
||||
|
@ -254,7 +255,7 @@ struct _ifref_t {
|
|||
|
||||
struct _typelib_entry_t {
|
||||
type_t *type;
|
||||
DECL_LINK(typelib_entry_t);
|
||||
struct list entry;
|
||||
};
|
||||
|
||||
struct _importinfo_t {
|
||||
|
@ -279,15 +280,15 @@ struct _importlib_t {
|
|||
|
||||
int allocated;
|
||||
|
||||
DECL_LINK(importlib_t);
|
||||
struct list entry;
|
||||
};
|
||||
|
||||
struct _typelib_t {
|
||||
char *name;
|
||||
char *filename;
|
||||
attr_t *attrs;
|
||||
typelib_entry_t *entry;
|
||||
importlib_t *importlibs;
|
||||
struct list entries;
|
||||
struct list importlibs;
|
||||
};
|
||||
|
||||
void init_types(void);
|
||||
|
|
|
@ -716,7 +716,8 @@ static importinfo_t *find_importinfo(msft_typelib_t *typelib, const char *name)
|
|||
if(!name)
|
||||
return NULL;
|
||||
|
||||
for(importlib = typelib->typelib->importlibs; importlib; importlib = NEXT_LINK(importlib)) {
|
||||
LIST_FOR_EACH_ENTRY( importlib, &typelib->typelib->importlibs, importlib_t, entry )
|
||||
{
|
||||
for(i=0; i < importlib->ntypeinfos; i++) {
|
||||
if(!strcmp(name, importlib->importinfos[i].name)) {
|
||||
chat("Found %s in importlib.\n", name);
|
||||
|
@ -2517,10 +2518,7 @@ int create_msft_typelib(typelib_t *typelib)
|
|||
set_custdata(msft, &midl_time_guid, VT_UI4, &cur_time, &msft->typelib_header.CustomDataOffset);
|
||||
set_custdata(msft, &midl_version_guid, VT_UI4, &version, &msft->typelib_header.CustomDataOffset);
|
||||
|
||||
for(entry = typelib->entry; entry && NEXT_LINK(entry); entry = NEXT_LINK(entry))
|
||||
;
|
||||
|
||||
for( ; entry; entry = PREV_LINK(entry))
|
||||
LIST_FOR_EACH_ENTRY( entry, &typelib->entries, typelib_entry_t, entry )
|
||||
add_entry(msft, entry);
|
||||
|
||||
save_all_changes(msft);
|
||||
|
|
Loading…
Reference in New Issue