summaryrefslogtreecommitdiffstats
path: root/src/back-shr.h
blob: 44c25fe6f1cfee7b0a9eafe5d59838b3a66f1e10 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
/*
 * Copyright 2008,2012 Red Hat, Inc.
 *
 * This Program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; version 2 of the License.
 *
 * This Program is distributed in the hope that it will be useful, but
 * WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
 * General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this Program; if not, write to the
 *
 *   Free Software Foundation, Inc.
 *   59 Temple Place, Suite 330
 *   Boston, MA 02111-1307 USA
 *
 */

#ifndef back_shr_h
#define back_shr_h

struct plugin_state;

void backend_shr_free_server_name(struct plugin_state *state, char *master);
int backend_shr_read_server_name(Slapi_PBlock *pb, struct plugin_state *state,
				 char **master);

void backend_shr_free_strlist(char **strlist);
char **backend_shr_dup_strlist_n(char **strlist, int n);
char **backend_shr_dup_strlist(char **strlist);
char **backend_shr_dup_strlist_unless_empty(char **strlist);
void backend_shr_add_strlist(char ***strlist, const char *item);
void backend_shr_add_sdnlist(const Slapi_DN ***sdnlist, const char *dn);
const Slapi_DN **backend_shr_dup_sdnlist(const Slapi_DN **sdnlist);
void backend_shr_free_sdnlist(const Slapi_DN **sdnlist);

void backend_shr_startup(struct plugin_state *state,
			 Slapi_PBlock *pb, const char *set_filter);
int backend_shr_betxn_postop_init(Slapi_PBlock *pb,
				  struct plugin_state *state);
int backend_shr_postop_init(Slapi_PBlock *pb, struct plugin_state *state);
int backend_shr_internal_postop_init(Slapi_PBlock *pb,
				     struct plugin_state *state);

int backend_shr_set_config_entry_add(struct plugin_state *state,
				     Slapi_PBlock *pb,
				     Slapi_Entry *e,
				     const char *group_name,
				     const char *set_name);
int backend_shr_set_config_entry_delete(struct plugin_state *state,
					Slapi_Entry *e,
					const char *group_attr,
					const char *set_attr);
char **backend_shr_get_vattr_strlist(struct plugin_state *state,
				     Slapi_Entry *e, const char *attribute);
const Slapi_DN ** backend_shr_get_vattr_sdnlist(struct plugin_state *state,
						Slapi_Entry *e,
						const char *attribute);
char *backend_shr_get_vattr_str(struct plugin_state *state,
				Slapi_Entry *e, const char *attribute);
unsigned int backend_shr_get_vattr_uint(struct plugin_state *state,
					Slapi_Entry *e, const char *attribute,
					unsigned int default_value);
char *backend_shr_get_vattr_filter(struct plugin_state *state,
				   Slapi_Entry *e, const char *attribute);
bool_t backend_shr_get_vattr_boolean(struct plugin_state *state,
				     Slapi_Entry *e, const char *attribute,
				     bool_t default_value);
#endif