2 Unix SMB/CIFS implementation.
4 This file contains the _internal_ structs for the registry
5 subsystem. Backends and the subsystem itself are the only
6 files that need to include this file.
7 Copyright (C) Gerald Carter 2002.
8 Copyright (C) Jelmer Vernooij 2003-2004.
10 This program is free software; you can redistribute it and/or modify
11 it under the terms of the GNU General Public License as published by
12 the Free Software Foundation; either version 2 of the License, or
13 (at your option) any later version.
15 This program is distributed in the hope that it will be useful,
16 but WITHOUT ANY WARRANTY; without even the implied warranty of
17 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 GNU General Public License for more details.
20 You should have received a copy of the GNU General Public License
21 along with this program; if not, write to the Free Software
22 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
25 #ifndef _REGISTRY_REGISTRY_H /* _REGISTRY_REGISTRY_H */
26 #define _REGISTRY_REGISTRY_H
28 #define REGISTRY_INTERFACE_VERSION 1
30 /* structure to store the registry handles */
32 char *name; /* Name of the key */
33 char *path; /* Full path to the key */
34 smb_ucs2_t *class_name; /* Name of key class */
35 NTTIME last_mod; /* Time last modified */
39 REG_VAL **cache_values;
40 int cache_values_count;
41 REG_KEY **cache_subkeys;
42 int cache_subkeys_count;
51 void *data_blk; /* Might want a separate block */
59 * Container for function pointers to enumeration routines
60 * for virtual registry view
65 BOOL (*open_registry) (REG_HANDLE *, const char *location, BOOL try_complete_load);
66 BOOL (*sync)(REG_HANDLE *, const char *location);
67 BOOL (*close_registry) (REG_HANDLE *);
69 /* Either implement these */
70 REG_KEY *(*open_root_key) (REG_HANDLE *);
71 int (*num_subkeys) (REG_KEY *);
72 int (*num_values) (REG_KEY *);
73 REG_KEY *(*get_subkey_by_index) (REG_KEY *, int idx);
74 REG_KEY *(*get_subkey_by_name) (REG_KEY *, const char *name);
75 REG_VAL *(*get_value_by_index) (REG_KEY *, int idx);
76 REG_VAL *(*get_value_by_name) (REG_KEY *, const char *name);
79 REG_KEY *(*open_key) (REG_HANDLE *, const char *name);
80 BOOL (*fetch_subkeys) (REG_KEY *, int *count, REG_KEY ***);
81 BOOL (*fetch_values) (REG_KEY *, int *count, REG_VAL ***);
84 BOOL (*add_key)(REG_KEY *, const char *name);
85 BOOL (*del_key)(REG_KEY *);
87 /* Value management */
88 REG_VAL *(*add_value)(REG_KEY *, const char *name, int type, void *data, int len);
89 BOOL (*del_value)(REG_VAL *);
91 /* If update is not available, value will first be deleted and then added
93 BOOL (*update_value)(REG_VAL *, int type, void *data, int len);
95 void (*free_key_backend_data) (REG_KEY *);
96 void (*free_val_backend_data) (REG_VAL *);
99 typedef struct reg_sub_tree_s {
102 struct reg_sub_tree_s *prev, *next;
105 struct reg_handle_s {
107 REG_SUBTREE *subtrees;
112 struct reg_init_function_entry {
113 /* Function to create a member of the pdb_methods list */
115 struct reg_init_function_entry *prev, *next;
118 /* Used internally */
119 #define SMB_REG_ASSERT(a) { if(!(a)) { DEBUG(0,("%s failed! (%s:%d)", #a, __FILE__, __LINE__)); }}
121 #endif /* _REGISTRY_H */