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

Diff of /trunk/Src/wptRegistryMobile.cpp

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

revision 270 by twoaday, Sat Oct 21 18:08:57 2006 UTC revision 299 by twoaday, Sun Mar 18 19:58:12 2007 UTC
# Line 1  Line 1 
1  /* wptRegistryMobile.cpp - Mobile config access  /* wptRegistryMobile.cpp - Registry emulation for the mobile mode
2   *      Copyright (C) 2006 Timo Schulz   *      Copyright (C) 2006, 2007 Timo Schulz
3   *   *
4   * This file is part of WinPT.   * This file is part of WinPT.
5   *   *
# Line 12  Line 12 
12   * but WITHOUT ANY WARRANTY; without even the implied warranty of   * but WITHOUT ANY WARRANTY; without even the implied warranty of
13   * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU   * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14   * General Public License for more details.   * General Public License for more details.
  *  
  * You should have received a copy of the GNU General Public License  
  * along with WinPT; if not, write to the Free Software Foundation,  
  * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA  
15   */   */
16  #ifdef HAVE_CONFIG_H  #ifdef HAVE_CONFIG_H
17  #include <config.h>  #include <config.h>
# Line 31  Line 27 
27  #include "wptW32API.h"  #include "wptW32API.h"
28  #include "wptErrors.h"  #include "wptErrors.h"
29    
30  static config_file_t pr = NULL;  
31    static config_file_t cfg_file = NULL;
32    
33  struct winpt_prefs_s reg_prefs;  struct winpt_prefs_s reg_prefs;
34    
# Line 49  int is_gpg4win_installed (void) Line 46  int is_gpg4win_installed (void)
46  void  void
47  free_reg_prefs (void)  free_reg_prefs (void)
48  {  {
49      if (pr != NULL) {      if (cfg_file != NULL) {
50          commit_config ("c:\\winpt_prefs.txt", &pr);          commit_config ("c:\\winpt_prefs.txt", &cfg_file);
51          release_config (pr);          release_config (cfg_file);
52      }      }
53      pr = NULL;      cfg_file = NULL;
54  }  }
55    
56    
57  static gpg_option_t  static gpg_option_t
58  reg_find_option (const char *key)  reg_find_option (const char *key)
59  {  {
60      if (pr == NULL)      if (cfg_file == NULL)
61          parse_config ("c:\\winpt_prefs.txt", &pr);          parse_config ("c:\\winpt_prefs.txt", &pr);
62      return find_option (pr, key);      return find_option (pr, key);
63  }  }
# Line 71  set_reg_winpt_prefs (winpt_prefs_t opt) Line 68  set_reg_winpt_prefs (winpt_prefs_t opt)
68  {  {
69      char buf[128];      char buf[128];
70      size_t i;      size_t i;
     int rc = 0;  
71    
72      if (pr == NULL)      if (cfg_file == NULL)
73          new_config (&pr);          new_config (&cfg_file);
74    
75      for (i=1; i < DIM (cfg); i++) {      for (i=1; i < DIM (cfg); i++) {
76          switch (i) {          switch (i) {
# Line 210  get_reg_winpt_prefs (winpt_prefs_t opt) Line 206  get_reg_winpt_prefs (winpt_prefs_t opt)
206    
207    
208    
209    /* Just a dummy needed for 1-to-1 mapping. */
210  int  int
211  regist_inst_gnupg (int create_mokey)  regist_inst_gnupg (int create_mokey)
212  {  {
# Line 218  regist_inst_gnupg (int create_mokey) Line 215  regist_inst_gnupg (int create_mokey)
215    
216    
217    
218    /* Just a dummy for 1-to-1 mapping. */
219  int  int
220  regist_inst_winpt (int with_ext, int *created)  regist_inst_winpt (int with_ext, int *created)
221  {  {
# Line 259  set_reg_key (HKEY root_key, const char * Line 257  set_reg_key (HKEY root_key, const char *
257  int  int
258  set_reg_entry_gpg (const char *key, const char *value)  set_reg_entry_gpg (const char *key, const char *value)
259  {  {
       
260      return set_reg_entry (HKEY_CURRENT_USER, NULL, key, value);      return set_reg_entry (HKEY_CURRENT_USER, NULL, key, value);
261  }  }
262    
# Line 330  get_reg_winpt_single (int id) Line 327  get_reg_winpt_single (int id)
327  }  }
328    
329    
   
330  int  int
331  set_reg_winpt_flag (const char *name, int val)  set_reg_winpt_flag (const char *name, int val)
332  {  {

Legend:
Removed from v.270  
changed lines
  Added in v.299

[email protected]
ViewVC Help
Powered by ViewVC 1.1.26