Mercurial > emacs
comparison src/w32.c @ 12451:4439dcb1496a
(PASSWD_FIELD_SIZE): Defined.
(the_passwd_name, the_passwd_passwd, the_passwd_gecos,
the_passwd_dir, the_passwd_shell, getpwuid): Use PASSWD_FIELD_SIZE.
(get_emacs_configuration): Check if processor macros are defined.
author | Geoff Voelker <voelker@cs.washington.edu> |
---|---|
date | Fri, 30 Jun 1995 21:12:37 +0000 |
parents | 47685fb0fbd1 |
children | a398dbd2b945 |
comparison
equal
deleted
inserted
replaced
12450:2d08a807d233 | 12451:4439dcb1496a |
---|---|
204 | 204 |
205 /* Emulate getpwuid and getpwnam. */ | 205 /* Emulate getpwuid and getpwnam. */ |
206 | 206 |
207 int getuid (); /* forward declaration */ | 207 int getuid (); /* forward declaration */ |
208 | 208 |
209 static char the_passwd_name[256]; | 209 #define PASSWD_FIELD_SIZE 256 |
210 static char the_passwd_passwd[256]; | 210 |
211 static char the_passwd_gecos[256]; | 211 static char the_passwd_name[PASSWD_FIELD_SIZE]; |
212 static char the_passwd_dir[256]; | 212 static char the_passwd_passwd[PASSWD_FIELD_SIZE]; |
213 static char the_passwd_shell[256]; | 213 static char the_passwd_gecos[PASSWD_FIELD_SIZE]; |
214 static char the_passwd_dir[PASSWD_FIELD_SIZE]; | |
215 static char the_passwd_shell[PASSWD_FIELD_SIZE]; | |
214 | 216 |
215 static struct passwd the_passwd = | 217 static struct passwd the_passwd = |
216 { | 218 { |
217 the_passwd_name, | 219 the_passwd_name, |
218 the_passwd_passwd, | 220 the_passwd_passwd, |
225 }; | 227 }; |
226 | 228 |
227 struct passwd * | 229 struct passwd * |
228 getpwuid (int uid) | 230 getpwuid (int uid) |
229 { | 231 { |
230 int size = 256; | 232 int size = PASSWD_FIELD_SIZE; |
231 | 233 |
232 if (!GetUserName (the_passwd.pw_name, &size)) | 234 if (!GetUserName (the_passwd.pw_name, &size)) |
233 return NULL; | 235 return NULL; |
234 | 236 |
235 the_passwd.pw_passwd[0] = '\0'; | 237 the_passwd.pw_passwd[0] = '\0'; |
271 char *arch, *oem, *os; | 273 char *arch, *oem, *os; |
272 | 274 |
273 /* Determine the processor type. */ | 275 /* Determine the processor type. */ |
274 switch (get_processor_type ()) | 276 switch (get_processor_type ()) |
275 { | 277 { |
278 | |
279 #ifdef PROCESSOR_INTEL_386 | |
276 case PROCESSOR_INTEL_386: | 280 case PROCESSOR_INTEL_386: |
277 case PROCESSOR_INTEL_486: | 281 case PROCESSOR_INTEL_486: |
278 case PROCESSOR_INTEL_PENTIUM: | 282 case PROCESSOR_INTEL_PENTIUM: |
279 arch = "i386"; | 283 arch = "i386"; |
280 break; | 284 break; |
285 #endif | |
286 | |
287 #ifdef PROCESSOR_INTEL_860 | |
281 case PROCESSOR_INTEL_860: | 288 case PROCESSOR_INTEL_860: |
282 arch = "i860"; | 289 arch = "i860"; |
283 break; | 290 break; |
291 #endif | |
292 | |
293 #ifdef PROCESSOR_MIPS_R2000 | |
284 case PROCESSOR_MIPS_R2000: | 294 case PROCESSOR_MIPS_R2000: |
285 case PROCESSOR_MIPS_R3000: | 295 case PROCESSOR_MIPS_R3000: |
286 case PROCESSOR_MIPS_R4000: | 296 case PROCESSOR_MIPS_R4000: |
287 arch = "mips"; | 297 arch = "mips"; |
288 break; | 298 break; |
299 #endif | |
300 | |
301 #ifdef PROCESSOR_ALPHA_21064 | |
289 case PROCESSOR_ALPHA_21064: | 302 case PROCESSOR_ALPHA_21064: |
290 arch = "alpha"; | 303 arch = "alpha"; |
291 break; | 304 break; |
305 #endif | |
306 | |
292 default: | 307 default: |
293 arch = "unknown"; | 308 arch = "unknown"; |
294 break; | 309 break; |
295 } | 310 } |
296 | 311 |