settings.c revision 89e195dfb5c4b0efd9b9f459771a4467674e5b1f
/* Copyright (C) 2002 Timo Sirainen */
#include "lib.h"
#include "istream.h"
#include "settings.h"
#include <stdio.h>
#include <fcntl.h>
{
else
return NULL;
}
{
int num;
return NULL;
}
const char *
{
struct setting_def *def;
case SET_STR:
*((char **) ptr) =
return NULL;
case SET_INT:
/* use %i so we can handle eg. 0600
as octal value with umasks */
case SET_BOOL:
}
}
}
}
void *context)
{
const char *errormsg;
if (fd < 0)
linenum = 0;
linenum++;
/* @UNSAFE: line is modified */
/* skip whitespace */
line++;
/* ignore comments or empty lines */
continue;
/* all lines must be in format "key = value" */
line++;
*line++ = '\0';
}
if (*line != '=') {
errormsg = "Missing value";
} else {
/* skip whitespace after '=' */
*line++ = '\0';
}
i_fatal("Error in configuration file %s line %d: %s",
}
};
}