data_provider_opts.c revision 8e3b80291c0ecfd26cfdb87a7c9dba4af9dbc10e
/*
SSSD
Data Provider Helpers
Copyright (C) Simo Sorce <ssorce@redhat.com> 2009
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3 of the License, or
(at your option) any later version.
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, see <http://www.gnu.org/licenses/>.
*/
#include "data_provider.h"
/* =Retrieve-Options====================================================== */
struct confdb_ctx *cdb,
const char *conf_path,
int num_opts,
{
int i, ret;
for (i = 0; i < num_opts; i++) {
char *tmp;
case DP_OPT_STRING:
DEBUG(0, ("Failed to retrieve value for option (%s)\n",
goto done;
}
break;
case DP_OPT_BLOB:
DEBUG(0, ("Failed to retrieve value for option (%s)\n",
goto done;
}
if (tmp) {
} else {
}
break;
case DP_OPT_NUMBER:
DEBUG(0, ("Failed to retrieve value for option (%s)\n",
goto done;
}
break;
case DP_OPT_BOOL:
DEBUG(0, ("Failed to retrieve value for option (%s)\n",
goto done;
}
break;
}
}
done:
return ret;
}
/* =Basic-Option-Helpers================================================== */
int num_opts,
{
for (i = 0; i < num_opts; i++) {
case DP_OPT_STRING:
}
DEBUG(0, ("Failed to copy value for option (%s)\n",
goto done;
}
break;
case DP_OPT_BLOB:
}
DEBUG(0, ("Failed to retrieve value for option (%s)\n",
goto done;
}
break;
case DP_OPT_NUMBER:
}
DEBUG(0, ("Failed to retrieve value for option (%s)\n",
goto done;
}
break;
case DP_OPT_BOOL:
}
DEBUG(0, ("Failed to retrieve value for option (%s)\n",
goto done;
}
break;
}
}
done:
return ret;
}
{
switch (type) {
case DP_OPT_STRING:
return "String";
case DP_OPT_BLOB:
return "Blob";
case DP_OPT_NUMBER:
return "Number";
case DP_OPT_BOOL:
return "Boolean";
}
return NULL;
}
/* Getters */
{
DEBUG(0, ("[%s] Requested type 'String' for option '%s'"
" but value is of type '%s'!\n",
return NULL;
}
}
{
DEBUG(0, ("[%s] Requested type 'String' for option '%s'"
" but value is of type '%s'!\n",
return NULL;
}
}
{
DEBUG(0, ("[%s] Requested type 'Blob' for option '%s'"
" but value is of type '%s'!\n",
return null_blob;
}
}
{
DEBUG(0, ("[%s] Requested type 'Number' for option '%s'"
" but value is of type '%s'!\n",
return 0;
}
}
{
DEBUG(0, ("[%s] Requested type 'Boolean' for option '%s'"
" but value is of type '%s'!\n",
return false;
}
}
/* Setters */
const char *s, const char *location)
{
DEBUG(0, ("[%s] Requested type 'String' for option '%s'"
" but type is '%s'!\n",
return EINVAL;
}
}
if (s) {
DEBUG(0, ("talloc_strdup() failed!\n"));
return ENOMEM;
}
}
return EOK;
}
struct dp_opt_blob b, const char *location)
{
DEBUG(0, ("[%s] Requested type 'Blob' for option '%s'"
" but type is '%s'!\n",
return EINVAL;
}
}
if (b.data) {
DEBUG(0, ("talloc_memdup() failed!\n"));
return ENOMEM;
}
}
return EOK;
}
int i, const char *location)
{
DEBUG(0, ("[%s] Requested type 'Number' for option '%s'"
" but type is '%s'!\n",
return EINVAL;
}
return EOK;
}
bool b, const char *location)
{
DEBUG(0, ("[%s] Requested type 'Boolean' for option '%s'"
" but type is '%s'!\n",
return EINVAL;
}
return EOK;
}