/*
Authors:
Pavel Březina <pbrezina@redhat.com>
Copyright (C) 2015 Red Hat
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 <stdlib.h>
#include "util/strtonum.h"
#include "tools/common/sss_colondb.h"
const char **_value)
{
char *rest;
char *value;
/* There is nothing else to read. */
goto done;
}
if (*line == ':') {
/* Special case for empty value. */
*line = '\0';
goto done;
}
/* Value starts at current position. */
/* Find next field delimiter. */
/* There is no more field. Remove \n from the end. */
*rest = '\0';
}
goto done;
}
/* Remove it and step one character further. */
*rest = '\0';
rest++;
done:
return rest;
}
{
const char *str;
char *rest;
*_value = 0;
return rest;
}
if (errno != 0) {
*_value = 0;
}
return rest;
}
struct sss_colondb {
};
struct sss_colondb *db,
struct sss_colondb_read_field *table)
{
int readchars;
char *tcline;
char *rest;
int i;
return ERR_INTERNAL;
}
if (readchars == -1) {
/* Nothing was read. */
if (errno != 0) {
return ret;
}
return EOF;
}
/* Copy line to mem_ctx. */
return ENOMEM;
}
case SSS_COLONDB_UINT32:
break;
case SSS_COLONDB_STRING:
break;
case SSS_COLONDB_SENTINEL:
ret = ERR_INTERNAL;
goto done;
}
"Line contains less values than expected!\n");
goto done;
"Line contains more values than expected!\n");
goto done;
}
}
done:
}
return ret;
}
struct sss_colondb_write_field *table)
{
int i;
return ERR_INTERNAL;
}
return ENOMEM;
}
goto done;
}
case SSS_COLONDB_UINT32:
} else {
}
break;
case SSS_COLONDB_STRING:
} else {
}
break;
case SSS_COLONDB_SENTINEL:
ret = ERR_INTERNAL;
goto done;
}
goto done;
}
}
/* Remove starting : */
line++;
done:
return ret;
}
{
return 0;
}
return 0;
}
{
errno = 0;
switch (mode) {
case SSS_COLONDB_READ:
break;
case SSS_COLONDB_WRITE:
break;
}
}
return fp;
}
enum sss_colondb_mode mode,
const char *filename)
{
return NULL;
}
return NULL;
}
return db;
}