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_VALUELIST_H_ 21 #define _REGEDIT_VALUELIST_H_ 22 23 #include <ncurses.h> 24 #include <panel.h> 25 26 struct registry_key; 27 28 struct value_item { 29 uint32_t type; 30 DATA_BLOB data; 31 const char *value_name; 32 char *value; 33 bool unprintable; 34 }; 35 36 struct multilist; 37 38 struct value_list { 39 WINDOW *window; 40 WINDOW *sub; 41 PANEL *panel; 42 size_t nvalues; 43 struct value_item *values; 44 struct multilist *list; 45 }; 46 struct value_list *value_list_new(TALLOC_CTX *ctx, int nlines, int ncols, 47 int begin_y, int begin_x); 48 void value_list_show(struct value_list *vl); 49 void value_list_set_selected(struct value_list *vl, bool select); 50 const char **value_list_load_names(TALLOC_CTX *ctx, struct registry_key *key); 51 WERROR value_list_load(struct value_list *vl, struct registry_key *key); 52 void value_list_resize(struct value_list *vl, int nlines, int ncols, 53 int begin_y, int begin_x); 54 struct value_item *value_list_get_current_item(struct value_list *vl); 55 void value_list_set_current_item(struct value_list *vl, 56 const struct value_item *item); 57 void value_list_set_current_item_by_name(struct value_list *vl, 58 const char *name); 59 void value_list_driver(struct value_list *vl, int c); 60 61 WERROR value_list_load_quick(struct value_list *vl, struct registry_key *key); 62 WERROR value_list_sync(struct value_list *vl); 63 struct value_item *value_list_find_next_item(struct value_list *vl, 64 struct value_item *vitem, 65 const char *s, 66 regedit_search_match_fn_t match); 67 struct value_item *value_list_find_prev_item(struct value_list *vl, 68 struct value_item *vitem, 69 const char *s, 70 regedit_search_match_fn_t match); 71 72 #endif 73