/[winpt]/trunk/Src/wptKeyserver.cpp
ViewVC logotype

Diff of /trunk/Src/wptKeyserver.cpp

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 149 by twoaday, Fri Jan 13 14:21:16 2006 UTC revision 150 by twoaday, Wed Jan 18 11:52:45 2006 UTC
# Line 24  Line 24 
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>
# Line 33  Line 34 
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    
# Line 329  wsock_init (void) Line 329  wsock_init (void)
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)
# Line 520  skip_whitespace (const char *str) Line 524  skip_whitespace (const char *str)
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)

Legend:
Removed from v.149  
changed lines
  Added in v.150

[email protected]
ViewVC Help
Powered by ViewVC 1.1.26