projects
/
apps
/
pfixtools.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Switch srsd to the server structure.
[apps/pfixtools.git]
/
main-postlicyd.c
diff --git
a/main-postlicyd.c
b/main-postlicyd.c
index
97afe21
..
bc04e85
100644
(file)
--- a/
main-postlicyd.c
+++ b/
main-postlicyd.c
@@
-31,6
+31,7
@@
/*
* Copyright © 2006-2007 Pierre Habouzit
/*
* Copyright © 2006-2007 Pierre Habouzit
+ * Copyright © 2008 Florent Bruneau
*/
#include <getopt.h>
*/
#include <getopt.h>
@@
-92,19
+93,23
@@
typedef struct query_t {
const char *eoq;
} query_t;
const char *eoq;
} query_t;
-static
void* query_new(
)
+static
query_t *query_new(void
)
{
return p_new(query_t, 1);
}
{
return p_new(query_t, 1);
}
-static void query_delete(
void *arg
)
+static void query_delete(
query_t **query
)
{
{
- query_t **query = arg;
if (*query) {
p_delete(query);
}
}
if (*query) {
p_delete(query);
}
}
+static void *query_starter(server_t* server)
+{
+ return query_new();
+}
+
static int postfix_parsejob(query_t *query, char *p)
{
#define PARSE_CHECK(expr, error, ...) \
static int postfix_parsejob(query_t *query, char *p)
{
#define PARSE_CHECK(expr, error, ...) \
@@
-333,7
+338,8
@@
int main(int argc, char *argv[])
if (start_listener(port) < 0)
return EXIT_FAILURE;
if (start_listener(port) < 0)
return EXIT_FAILURE;
- (void)server_loop(query_new, query_delete, policy_run, NULL);
+ (void)server_loop(query_starter, (delete_client_t)query_delete,
+ policy_run, NULL);
syslog(LOG_INFO, "Stopping...");
return EXIT_SUCCESS;
syslog(LOG_INFO, "Stopping...");
return EXIT_SUCCESS;