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