1 /* info.h --- Internal header file for shisa library.
2 * Copyright (C) 2002, 2003, 2004, 2007 Simon Josefsson
4 * This file is part of Shishi.
6 * Shishi is free software; you can redistribute it and/or modify it
7 * 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.
11 * Shishi is distributed in the hope that it will be useful, but
12 * WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * General Public License for more details.
16 * You should have received a copy of the GNU General Public License
17 * along with Shishi; if not, see http://www.gnu.org/licenses or write
18 * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth
19 * Floor, Boston, MA 02110-1301, USA
37 #define _(String) dgettext (PACKAGE, String)
38 #define gettext_noop(String) String
39 #define N_(String) gettext_noop (String)
47 typedef int (*_Shisa_db_init
) (Shisa
* dbh
,
49 const char *options
, void **state
);
50 typedef void (*_Shisa_db_done
) (Shisa
* dbh
, void *state
);
52 typedef int (*_Shisa_db_enumerate_realms
) (Shisa
* dbh
,
54 char ***realms
, size_t * nrealms
);
55 typedef int (*_Shisa_db_enumerate_principals
) (Shisa
* dbh
,
59 size_t * nprincipals
);
61 typedef int (*_Shisa_db_principal_find
) (Shisa
* dbh
,
64 const char *principal
,
65 Shisa_principal
* ph
);
66 typedef int (*_Shisa_db_principal_update
) (Shisa
* dbh
,
69 const char *principal
,
70 const Shisa_principal
* ph
);
71 typedef int (*_Shisa_db_principal_add
) (Shisa
* dbh
,
74 const char *principal
,
75 const Shisa_principal
* ph
,
76 const Shisa_key
* key
);
77 typedef int (*_Shisa_db_principal_remove
) (Shisa
* dbh
,
80 const char *principal
);
82 typedef int (*_Shisa_db_keys_find
) (Shisa
* dbh
,
85 const char *principal
,
86 const Shisa_key
* hint
,
87 Shisa_key
*** keys
, size_t * nkeys
);
88 typedef int (*_Shisa_db_key_add
) (Shisa
* dbh
,
91 const char *principal
,
92 const Shisa_key
* key
);
93 typedef int (*_Shisa_db_key_update
) (Shisa
* dbh
,
96 const char *principal
,
97 const Shisa_key
* oldkey
,
98 const Shisa_key
* newkey
);
99 typedef int (*_Shisa_db_key_remove
) (Shisa
* dbh
,
102 const char *principal
,
103 const Shisa_key
* key
);
105 struct _Shisa_backend
110 _Shisa_db_enumerate_realms enumerate_realms
;
111 _Shisa_db_enumerate_principals enumerate_principals
;
112 _Shisa_db_principal_find principal_find
;
113 _Shisa_db_principal_update principal_update
;
114 _Shisa_db_principal_add principal_add
;
115 _Shisa_db_principal_remove principal_remove
;
116 _Shisa_db_keys_find keys_find
;
117 _Shisa_db_key_add key_add
;
118 _Shisa_db_key_update key_update
;
119 _Shisa_db_key_remove key_remove
;
121 typedef struct _Shisa_backend _Shisa_backend
;
125 _Shisa_backend
*backend
;
128 typedef struct _Shisa_db _Shisa_db
;
136 /* Return structure with function pointers implementing a Shisa
137 backend, given a name (e.g., "file"). */
138 extern _Shisa_backend
*_shisa_find_backend (const char *name
);