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
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
11 * Shishi 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.
16 * You should have received a copy of the GNU General Public License
17 * along with Shishi; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
36 #define _(String) dgettext (PACKAGE, String)
37 #define gettext_noop(String) String
38 #define N_(String) gettext_noop (String)
43 /* Get getline, ssize_t. */
49 typedef int (*_Shisa_db_init
) (Shisa
* dbh
,
51 const char *options
, void **state
);
52 typedef void (*_Shisa_db_done
) (Shisa
* dbh
, void *state
);
54 typedef int (*_Shisa_db_enumerate_realms
) (Shisa
* dbh
,
56 char ***realms
, size_t * nrealms
);
57 typedef int (*_Shisa_db_enumerate_principals
) (Shisa
* dbh
,
61 size_t * nprincipals
);
63 typedef int (*_Shisa_db_principal_find
) (Shisa
* dbh
,
66 const char *principal
,
67 Shisa_principal
* ph
);
68 typedef int (*_Shisa_db_principal_update
) (Shisa
* dbh
,
71 const char *principal
,
72 const Shisa_principal
* ph
);
73 typedef int (*_Shisa_db_principal_add
) (Shisa
* dbh
,
76 const char *principal
,
77 const Shisa_principal
* ph
,
78 const Shisa_key
* key
);
79 typedef int (*_Shisa_db_principal_remove
) (Shisa
* dbh
,
82 const char *principal
);
84 typedef int (*_Shisa_db_keys_find
) (Shisa
* dbh
,
87 const char *principal
,
88 const Shisa_key
* hint
,
89 Shisa_key
*** keys
, size_t * nkeys
);
90 typedef int (*_Shisa_db_key_add
) (Shisa
* dbh
,
93 const char *principal
,
94 const Shisa_key
* key
);
95 typedef int (*_Shisa_db_key_update
) (Shisa
* dbh
,
98 const char *principal
,
99 const Shisa_key
* oldkey
,
100 const Shisa_key
* newkey
);
101 typedef int (*_Shisa_db_key_remove
) (Shisa
* dbh
,
104 const char *principal
,
105 const Shisa_key
* key
);
107 struct _Shisa_backend
112 _Shisa_db_enumerate_realms enumerate_realms
;
113 _Shisa_db_enumerate_principals enumerate_principals
;
114 _Shisa_db_principal_find principal_find
;
115 _Shisa_db_principal_update principal_update
;
116 _Shisa_db_principal_add principal_add
;
117 _Shisa_db_principal_remove principal_remove
;
118 _Shisa_db_keys_find keys_find
;
119 _Shisa_db_key_add key_add
;
120 _Shisa_db_key_update key_update
;
121 _Shisa_db_key_remove key_remove
;
123 typedef struct _Shisa_backend _Shisa_backend
;
127 _Shisa_backend
*backend
;
130 typedef struct _Shisa_db _Shisa_db
;
138 /* Return structure with function pointers implementing a Shisa
139 backend, given a name (e.g., "file"). */
140 extern _Shisa_backend
*_shisa_find_backend (const char *name
);