comparison loader/registry.c @ 1307:d8c1b0b38edc

Add prototypes to wine/loader stuff, so that we can catch __stdcall function attribute mismatch between caller/caller. wine/loader is less sensitive to optimization now. (now that avifile-0.6 has the same patch installed, we're a bit closer to their CVS tree) Speed up win32 "QueryPerformanceFrequency" emulation on solaris.
author jkeil
date Thu, 12 Jul 2001 15:27:48 +0000
parents 1f7c824033fb
children 8e841fe5668b
comparison
equal deleted inserted replaced
1306:7ce37211e454 1307:d8c1b0b38edc
1 #include <config.h> 1 #include <config.h>
2 2
3 #include <stdio.h> 3 #include <stdio.h>
4 #include <stdlib.h>
4 #include <fcntl.h> 5 #include <fcntl.h>
6 #include <unistd.h>
5 #include <pwd.h> 7 #include <pwd.h>
6 #include <sys/types.h> 8 #include <sys/types.h>
7 9
8 #include <wine/winbase.h> 10 #include <wine/winbase.h>
9 #include <wine/winreg.h> 11 #include <wine/winreg.h>
10 #include <wine/winnt.h> 12 #include <wine/winnt.h>
11 #include <wine/winerror.h> 13 #include <wine/winerror.h>
12 14
13 #include <registry.h> 15 #include <registry.h>
16 #include <ext.h>
17
14 //#undef TRACE 18 //#undef TRACE
15 //#define TRACE printf 19 //#define TRACE printf
16 struct reg_value 20 struct reg_value
17 { 21 {
18 int type; 22 int type;
38 42
39 #define DIR -25 43 #define DIR -25
40 44
41 extern char *get_path(char *); 45 extern char *get_path(char *);
42 46
43 static void create_registry(); 47 static void create_registry(void);
44 static void open_registry(); 48 static void open_registry(void);
45 static void save_registry(); 49 static void save_registry(void);
46 50
47 51
48 52
49 53
50 static void create_registry(){ 54 static void create_registry(void){
51 if(regs) 55 if(regs)
52 { 56 {
53 printf("Logic error: create_registry() called with existing registry\n"); 57 printf("Logic error: create_registry() called with existing registry\n");
54 save_registry(); 58 save_registry();
55 return; 59 return;
63 regs[0].value=regs[1].value=NULL; 67 regs[0].value=regs[1].value=NULL;
64 regs[0].len=regs[1].len=0; 68 regs[0].len=regs[1].len=0;
65 reg_size=2; 69 reg_size=2;
66 save_registry(); 70 save_registry();
67 } 71 }
68 static void open_registry() 72 static void open_registry(void)
69 { 73 {
70 int fd; 74 int fd;
71 int i; 75 int i;
72 int len; 76 int len;
73 // struct passwd* pwent; 77 // struct passwd* pwent;
118 error: 122 error:
119 close(fd); 123 close(fd);
120 return; 124 return;
121 } 125 }
122 126
123 static void save_registry() 127 static void save_registry(void)
124 { 128 {
125 int fd, i, len; 129 int fd, i, len;
126 // struct passwd* pwent; 130 // struct passwd* pwent;
127 char* pathname; 131 char* pathname;
128 // pwent=getpwuid(getuid()); 132 // pwent=getpwuid(getuid());
225 strcpy(full_name, t->name); 229 strcpy(full_name, t->name);
226 strcat(full_name, "\\"); 230 strcat(full_name, "\\");
227 strcat(full_name, subkey); 231 strcat(full_name, subkey);
228 return full_name; 232 return full_name;
229 } 233 }
230 struct reg_value* insert_reg_value(int handle, const char* name, int type, const void* value, int len) 234 static struct reg_value* insert_reg_value(int handle, const char* name, int type, const void* value, int len)
231 { 235 {
232 reg_handle_t* t; 236 reg_handle_t* t;
233 struct reg_value* v; 237 struct reg_value* v;
234 char* fullname; 238 char* fullname;
235 if((fullname=build_keyname(handle, name))==NULL) 239 if((fullname=build_keyname(handle, name))==NULL)
261 strcpy(v->name, fullname); 265 strcpy(v->name, fullname);
262 save_registry(); 266 save_registry();
263 return v; 267 return v;
264 } 268 }
265 269
266 static void init_registry() 270 static void init_registry(void)
267 { 271 {
268 #ifdef DETAILED_OUT 272 #ifdef DETAILED_OUT
269 printf("Initializing registry\n"); 273 printf("Initializing registry\n");
270 #endif 274 #endif
271 open_registry(); 275 open_registry();