/**
- * collectd - src/sn-apply.c
- * Copyright (C) 2008 Florian octo Forster
+ * libsortnetwork - src/sn-apply.c
+ * Copyright (C) 2008-2010 Florian octo Forster
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
* 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*
* Authors:
- * Florian octo Forster <octo at verplant.org>
+ * Florian octo Forster <ff at octo.it>
**/
-#define _ISOC99_SOURCE
-#define _POSIX_C_SOURCE 200112L
+#include "config.h"
#include <stdlib.h>
#include <stdio.h>
" -i <file> File holding the network (REQUIRED)\n"
"\n",
name);
- exit (1);
+ exit (EXIT_FAILURE);
} /* void exit_usage */
int read_options (int argc, char **argv)
for (i = 0; i < stages_num; i++)
{
sn_stage_t *s;
- int j;
s = SN_NETWORK_STAGE_GET (network, i);
-
- for (j = 0; j < SN_STAGE_COMP_NUM (s); j++)
- {
- sn_comparator_t *c;
-
- c = SN_STAGE_COMP_GET (s, j);
-
- if (values[c->min] > values[c->max])
- {
- int temp = values[c->min];
- values[c->min] = values[c->max];
- values[c->max] = temp;
- }
- } /* for (comparators) */
+ sn_stage_sort (s, values);
show_values (SN_NETWORK_INPUT_NUM (network), values);
} /* for (stages) */
}
if (status < 0)
- return (1);
- return (0);
+ exit (EXIT_FAILURE);
+ exit (EXIT_SUCCESS);
} /* int main */
/* vim: set shiftwidth=2 softtabstop=2 : */