s3:utils: Remove double error check
[garming/samba-autobuild/.git] / source3 / utils / regedit.h
1 /*
2  * Samba Unix/Linux SMB client library
3  * Registry Editor
4  * Copyright (C) Christopher Davis 2012
5  *
6  * This program is free software; you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License as published by
8  * the Free Software Foundation; either version 3 of the License, or
9  * (at your option) any later version.
10  *
11  * This program is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
18  */
19
20 #ifndef _REGEDIT_H_
21 #define _REGEDIT_H_
22
23 struct registry_context;
24 struct security_token;
25 struct registry_key;
26
27 struct samba3_registry_key {
28         struct registry_key *key;
29 };
30
31 WERROR reg_openhive_wrap(TALLOC_CTX *ctx, const char *hive,
32                          struct samba3_registry_key *key);
33 WERROR reg_openkey_wrap(TALLOC_CTX *ctx, struct samba3_registry_key *parent,
34                         const char *name, struct samba3_registry_key *key);
35 WERROR reg_enumvalue_wrap(TALLOC_CTX *ctx, struct samba3_registry_key *key,
36                           uint32_t idx, char **name, uint32_t *type,
37                           DATA_BLOB *data);
38 WERROR reg_queryvalue_wrap(TALLOC_CTX *ctx, struct samba3_registry_key *key,
39                            const char *name, uint32_t *type, DATA_BLOB *data);
40 WERROR reg_enumkey_wrap(TALLOC_CTX *ctx, struct samba3_registry_key *key,
41                         uint32_t idx, char **name, NTTIME *last_write_time);
42 WERROR reg_createkey_wrap(TALLOC_CTX *ctx, struct samba3_registry_key *parent,
43                           const char *subkeypath,
44                           struct samba3_registry_key *pkey);
45 WERROR reg_deletekey_wrap(struct samba3_registry_key *parent,
46                           const char *path);
47 WERROR reg_deletevalue_wrap(struct samba3_registry_key *key, const char *name);
48 WERROR reg_queryinfokey_wrap(struct samba3_registry_key *key,
49                              uint32_t *num_subkeys, uint32_t *max_subkeylen,
50                              uint32_t *max_subkeysize, uint32_t *num_values,
51                              uint32_t *max_valnamelen,
52                              uint32_t *max_valbufsize, uint32_t *secdescsize,
53                              NTTIME *last_changed_time);
54 WERROR reg_setvalue_wrap(struct samba3_registry_key *key, const char *name,
55                          uint32_t type, const DATA_BLOB data);
56 WERROR reg_init_wrap(void);
57
58 WERROR reg_open_samba3(TALLOC_CTX *mem_ctx, struct registry_context **ctx);
59
60 int regedit_getch(void);
61
62 typedef bool (*regedit_search_match_fn_t)(const char *, const char *);
63
64 struct regedit_search_opts {
65         const char *query;
66         regedit_search_match_fn_t match;
67         bool search_key;
68         bool search_value;
69         bool search_recursive;
70         bool search_case;
71 };
72
73 #define PAIR_YELLOW_CYAN 1
74 #define PAIR_BLACK_CYAN 2
75 #define PAIR_YELLOW_BLUE 3
76
77 #endif