24 |
#endif |
#endif |
25 |
|
|
26 |
#include <windows.h> |
#include <windows.h> |
27 |
|
#include <shlobj.h> |
28 |
#include <stdio.h> |
#include <stdio.h> |
29 |
#include <sys/stat.h> |
#include <sys/stat.h> |
30 |
#include <ctype.h> |
#include <ctype.h> |
34 |
#include "wptTypes.h" |
#include "wptTypes.h" |
35 |
#include "wptNLS.h" |
#include "wptNLS.h" |
36 |
#include "wptW32API.h" |
#include "wptW32API.h" |
|
#include "wptVersion.h" |
|
37 |
#include "wptGPG.h" |
#include "wptGPG.h" |
38 |
#include "wptRegistry.h" |
#include "wptRegistry.h" |
39 |
|
|
329 |
void |
void |
330 |
wsock_end (void) |
wsock_end (void) |
331 |
{ |
{ |
332 |
|
char *p; |
333 |
int i; |
int i; |
334 |
|
|
335 |
|
p = make_special_filename (CSIDL_APPDATA, "winpt\\keyserver.conf", NULL); |
336 |
|
kserver_save_conf (p); |
337 |
|
free_if_alloc (p); |
338 |
free_if_alloc (default_keyserver); |
free_if_alloc (default_keyserver); |
339 |
for (i=0; i < MAX_KEYSERVERS; i++) { |
for (i=0; i < MAX_KEYSERVERS; i++) { |
340 |
if (server[i].used) |
if (server[i].used) |
524 |
} |
} |
525 |
|
|
526 |
|
|
527 |
|
/* Save the keyserver config file in @conf. */ |
528 |
|
int |
529 |
|
kserver_save_conf (const char *conf) |
530 |
|
{ |
531 |
|
FILE *fp; |
532 |
|
int pos; |
533 |
|
|
534 |
|
fp = fopen (conf, "wb"); |
535 |
|
if (!fp) { |
536 |
|
msg_box (NULL, _("Could not save keyserver.conf file"), |
537 |
|
_("Keyserver"), MB_ERR); |
538 |
|
return -1; |
539 |
|
} |
540 |
|
|
541 |
|
fprintf (fp, "# do NOT manually modify this file, it will be generated automatically!!\r\n"); |
542 |
|
for (pos = 0; pos < MAX_KEYSERVERS; pos++) { |
543 |
|
if (!server[pos].used) |
544 |
|
continue; |
545 |
|
fprintf (fp, "%s\r\n", server[pos].name); |
546 |
|
} |
547 |
|
fclose (fp); |
548 |
|
return 0; |
549 |
|
} |
550 |
|
|
551 |
|
|
552 |
/* Load the keyserver config file @conf. */ |
/* Load the keyserver config file @conf. */ |
553 |
int |
int |
554 |
kserver_load_conf (const char *conf) |
kserver_load_conf (const char *conf) |