dict.c revision 10399559650f552a23949772be79eb6a80198c5a
/* Copyright (c) 2005-2012 Dovecot authors, see the included COPYING file */
#include "lib.h"
#include "array.h"
#include "str.h"
#include "dict-sql.h"
#include "dict-private.h"
static struct dict_iterate_context dict_iter_unsupported;
{
return dict;
}
return NULL;
}
{
if (!array_is_created(&dict_drivers))
i_fatal("dict_driver_register(%s): Already registered",
}
}
{
unsigned int idx = -1U;
break;
}
}
if (array_count(&dict_drivers) == 0)
}
void dict_drivers_register_builtin(void)
{
}
void dict_drivers_unregister_builtin(void)
{
}
{
const char *p, *name;
if (p == NULL) {
return -1;
}
T_BEGIN {
} T_END;
return -1;
}
{
}
{
}
static bool dict_key_prefix_is_valid(const char *key)
{
}
const char **value_r)
{
}
struct dict_iterate_context *
enum dict_iterate_flags flags)
{
const char *paths[2];
}
struct dict_iterate_context *
enum dict_iterate_flags flags)
{
unsigned int i;
/* not supported by backend */
return &dict_iter_unsupported;
}
}
{
}
{
}
{
}
{
}
void *context)
{
}
{
}
{
}
const char *key)
{
}
{
}
{
if (diff != 0) {
}
}
const char *dict_escape_string(const char *str)
{
const char *p;
/* see if we need to escape it */
for (p = str; *p != '\0'; p++) {
if (*p == '/' || *p == '\\')
break;
}
if (*p == '\0')
return str;
/* escape */
for (; *p != '\0'; p++) {
switch (*p) {
case '/':
break;
case '\\':
break;
default:
str_append_c(ret, *p);
break;
}
}
}
const char *dict_unescape_string(const char *str)
{
const char *p;
/* see if we need to unescape it */
for (p = str; *p != '\0'; p++) {
if (*p == '\\')
break;
}
if (*p == '\0')
return str;
/* unescape */
for (; *p != '\0'; p++) {
if (*p != '\\')
str_append_c(ret, *p);
else {
if (*++p == '|')
else if (*p == '\0')
break;
else
str_append_c(ret, *p);
}
}
}