Commit 2c7bc938 authored by Per Cederqvist's avatar Per Cederqvist

Namespace cleanup.

* src/server/conf-file.c: Moved all struct datatype objects to the
end of the file, to avoid having to forward-declare all of the
static functions mentioned below.
(assign_text_no): Now static.
(assign_conf_no): Ditto.
(assign_int): Ditto.
(assign_ulong): Ditto.
(assign_uint): Ditto.
(assign_string): Ditto.
(assign_bool): Ditto.
(assign_double): Ditto.
(assign_timeval): Ditto.
(unassign_string): Ditto.
* src/server/conf-file.h: Don't declare the above functions, which
are now static.
parent 307e1e6e
2006-02-01 Per Cederqvist <ceder@lysator.liu.se>
Namespace cleanup.
* src/server/conf-file.c: Moved all struct datatype objects to the
end of the file, to avoid having to forward-declare all of the
static functions mentioned below.
(assign_text_no): Now static.
(assign_conf_no): Ditto.
(assign_int): Ditto.
(assign_ulong): Ditto.
(assign_uint): Ditto.
(assign_string): Ditto.
(assign_bool): Ditto.
(assign_double): Ditto.
(assign_timeval): Ditto.
(unassign_string): Ditto.
* src/server/conf-file.h: Don't declare the above functions, which
are now static.
Configuration file definitions: use a datatype struct, instead of
having separate "assigner" and "freer" fields in the parameter
definition table.
......
......@@ -66,43 +66,6 @@
static int *assignment_count = NULL;
static int npar = 0;
const struct datatype cf_text_no = {
assign_text_no, NULL,
};
const struct datatype cf_conf_no = {
assign_conf_no, NULL
};
const struct datatype cf_int = {
assign_int, NULL
};
const struct datatype cf_ulong = {
assign_ulong, NULL
};
const struct datatype cf_uint = {
assign_uint, NULL
};
const struct datatype cf_string = {
assign_string, unassign_string
};
const struct datatype cf_bool = {
assign_bool, NULL
};
const struct datatype cf_double = {
assign_double, NULL
};
const struct datatype cf_timeval = {
assign_timeval, NULL
};
static void
init_init(const struct parameter *par)
{
......@@ -277,7 +240,7 @@ read_config(const char *config_file,
return OK;
}
Success
static Success
assign_text_no(const char *val,
const struct parameter *par)
{
......@@ -294,7 +257,7 @@ assign_text_no(const char *val,
return OK;
}
Success
static Success
assign_conf_no(const char *val,
const struct parameter *par)
{
......@@ -311,7 +274,7 @@ assign_conf_no(const char *val,
return OK;
}
Success
static Success
assign_int(const char *val,
const struct parameter *par)
{
......@@ -328,7 +291,7 @@ assign_int(const char *val,
return OK;
}
Success
static Success
assign_ulong(const char *val,
const struct parameter *par)
{
......@@ -344,7 +307,7 @@ assign_ulong(const char *val,
return OK;
}
Success
static Success
assign_uint(const char *val,
const struct parameter *par)
{
......@@ -360,7 +323,7 @@ assign_uint(const char *val,
return OK;
}
Success
static Success
assign_string(const char *val,
const struct parameter *par)
{
......@@ -374,7 +337,7 @@ assign_string(const char *val,
return OK;
}
Success
static Success
assign_bool(const char *val,
const struct parameter *par)
{
......@@ -402,7 +365,7 @@ assign_bool(const char *val,
}
Success
static Success
assign_double(const char *val,
const struct parameter *par)
{
......@@ -461,7 +424,7 @@ static const struct suffix_conversion suffix_table[] = {
{NULL, 0.0},
};
Success
static Success
assign_timeval(const char *val,
const struct parameter *par)
{
......@@ -526,7 +489,7 @@ assign_timeval(const char *val,
}
void
static void
unassign_string(const struct parameter *par)
{
if (*(char**)par->value != NULL)
......@@ -535,3 +498,40 @@ unassign_string(const struct parameter *par)
*(char**)par->value = NULL;
}
}
const struct datatype cf_text_no = {
assign_text_no, NULL,
};
const struct datatype cf_conf_no = {
assign_conf_no, NULL
};
const struct datatype cf_int = {
assign_int, NULL
};
const struct datatype cf_ulong = {
assign_ulong, NULL
};
const struct datatype cf_uint = {
assign_uint, NULL
};
const struct datatype cf_string = {
assign_string, unassign_string
};
const struct datatype cf_bool = {
assign_bool, NULL
};
const struct datatype cf_double = {
assign_double, NULL
};
const struct datatype cf_timeval = {
assign_timeval, NULL
};
......@@ -49,18 +49,6 @@ struct parameter {
Success read_config(const char *config_file, const struct parameter *par);
extern Success assign_text_no (const char *val, const struct parameter *par);
extern Success assign_conf_no (const char *val, const struct parameter *par);
extern Success assign_int (const char *val, const struct parameter *par);
extern Success assign_ulong (const char *val, const struct parameter *par);
extern Success assign_uint (const char *val, const struct parameter *par);
extern Success assign_string (const char *val, const struct parameter *par);
extern Success assign_bool (const char *val, const struct parameter *par);
extern Success assign_double (const char *val, const struct parameter *par);
extern Success assign_timeval (const char *val, const struct parameter *par);
extern void unassign_string(const struct parameter *par);
extern const struct datatype cf_text_no;
extern const struct datatype cf_conf_no;
extern const struct datatype cf_int;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment