Factor out opts parsing, clean up shutdown.

This commit is contained in:
Ian Gulliver
2016-02-20 23:22:00 -08:00
parent fe5fa29abf
commit 9df778a88a
10 changed files with 151 additions and 100 deletions

View File

@@ -82,6 +82,18 @@ void send_init() {
signal(SIGPIPE, SIG_IGN);
}
void send_cleanup() {
for (int i = 0; i < NUM_SERIALIZERS; i++) {
struct serializer *serializer = &serializers[i];
struct send *send = serializer->send_head;
while (send) {
struct send *next = send->next;
free(send);
send = next;
}
}
}
struct serializer *send_get_serializer(char *name) {
for (int i = 0; i < NUM_SERIALIZERS; i++) {
if (strcasecmp(serializers[i].name, name) == 0) {