OSDN Git Service

* dcrt0.cc (dll_crt0_1): Move internal locale setting prior to potential
[pf3gnuchains/pf3gnuchains3x.git] / winsup / cygwin / registry.h
1 /* registry.h: shared info for cygwin
2
3    Copyright 2000, 2001, 2004, 2006, 2008 Red Hat, Inc.
4
5 This file is part of Cygwin.
6
7 This software is a copyrighted work licensed under the terms of the
8 Cygwin license.  Please consult the file "CYGWIN_LICENSE" for
9 details. */
10
11 class reg_key
12 {
13 private:
14
15   HKEY key;
16   LONG key_is_invalid;
17   DWORD _disposition;
18
19 public:
20
21   reg_key (HKEY toplev, REGSAM access, ...);
22   reg_key (bool isHKLM, REGSAM access, ...);
23
24   void *operator new (size_t, void *p) {return p;}
25   void build_reg (HKEY key, REGSAM access, va_list av);
26
27   int error () {return key == (HKEY) INVALID_HANDLE_VALUE;}
28
29   int kill (const char *child);
30   int killvalue (const char *name);
31
32   HKEY get_key ();
33
34   int get_int (const char *, int);
35   int get_int (const PWCHAR, int);
36   int get_string (const char *, char *, size_t, const char *);
37   int get_string (const PWCHAR, PWCHAR, size_t, const PWCHAR);
38
39   int set_int (const char *, int);
40   int set_int (const PWCHAR, int);
41   int set_string (const char *, const char *);
42   int set_string (const PWCHAR, const PWCHAR);
43
44   bool created () const {return _disposition & REG_CREATED_NEW_KEY;}
45
46   ~reg_key ();
47 };
48
49 /* Evaluates path to the directory of the local user registry hive */
50 PWCHAR __stdcall get_registry_hive_path (const PWCHAR name, PWCHAR path);
51 void __stdcall load_registry_hive (const PWCHAR name);