summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: a9eae28)
raw | patch | inline | side by side (parent: a9eae28)
author | oetiker <oetiker@a5681a0c-68f1-0310-ab6d-d61299d08faa> | |
Mon, 18 Jun 2007 16:05:07 +0000 (16:05 +0000) | ||
committer | oetiker <oetiker@a5681a0c-68f1-0310-ab6d-d61299d08faa> | |
Mon, 18 Jun 2007 16:05:07 +0000 (16:05 +0000) |
- move several static struct option out of loops and makes them
non-static
- moves some functions from old-style definitions into new-style
definitions
git-svn-id: svn://svn.oetiker.ch/rrdtool/trunk/program@1133 a5681a0c-68f1-0310-ab6d-d61299d08faa
non-static
- moves some functions from old-style definitions into new-style
definitions
git-svn-id: svn://svn.oetiker.ch/rrdtool/trunk/program@1133 a5681a0c-68f1-0310-ab6d-d61299d08faa
15 files changed:
configure.ac | patch | blob | history | |
src/parsetime.c | patch | blob | history | |
src/rrd_cgi.c | patch | blob | history | |
src/rrd_create.c | patch | blob | history | |
src/rrd_fetch.c | patch | blob | history | |
src/rrd_first.c | patch | blob | history | |
src/rrd_getopt.c | patch | blob | history | |
src/rrd_getopt1.c | patch | blob | history | |
src/rrd_graph.c | patch | blob | history | |
src/rrd_open.c | patch | blob | history | |
src/rrd_restore.c | patch | blob | history | |
src/rrd_thread_safe.c | patch | blob | history | |
src/rrd_tune.c | patch | blob | history | |
src/rrd_update.c | patch | blob | history | |
src/rrd_xport.c | patch | blob | history |
diff --git a/configure.ac b/configure.ac
index 269665ccd075de744c5ea111049ed5a20c84ac55..bac2165534902f0999665d5b8f72e00a85111468 100644 (file)
--- a/configure.ac
+++ b/configure.ac
dnl which flags does the compiler support?
if test "x$GCC" = "xyes"; then
- for flag in -fno-strict-aliasing -Wall -std=c99 -pedantic -Wundef -Wshadow -Wpointer-arith -Wcast-align -Wmissing-prototypes -Wmissing-declarations -Wnested-externs -Winline -W; do
+ for flag in -fno-strict-aliasing -Wall -std=c99 -pedantic -Wundef -Wshadow -Wpointer-arith -Wcast-align -Wmissing-prototypes -Wmissing-declarations -Wnested-externs -Winline -Wc++-compat -Wold-style-definition -W; do
oCFLAGS="$CFLAGS"
CFLAGS="$CFLAGS $flag"
cachename=rd_cv_gcc_flag_`echo $flag|sed 's/[[^A-Za-z]]/_/g'`
diff --git a/src/parsetime.c b/src/parsetime.c
index 71af06572a64b9d6183566c7cf52a287eec11ec4..a2b76eda6a7d67c2e9c5ad133e47bcca9717f47e 100644 (file)
--- a/src/parsetime.c
+++ b/src/parsetime.c
char *name; /* token name */
int value; /* token id */
};
-static struct SpecialToken VariousWords[] = {
+static const struct SpecialToken VariousWords[] = {
{"midnight", MIDNIGHT}, /* 00:00:00 of today or tomorrow */
{"noon", NOON}, /* 12:00:00 of today or tomorrow */
{"teatime", TEATIME}, /* 16:00:00 of today or tomorrow */
{NULL, 0} /*** SENTINEL ***/
};
-static struct SpecialToken TimeMultipliers[] = {
+static const struct SpecialToken TimeMultipliers[] = {
{"second", SECONDS}, /* seconds multiplier */
{"seconds", SECONDS}, /* (pluralized) */
{"sec", SECONDS}, /* (generic) */
greater than zero if S1 is lexicographically less than,
equal to or greater than S2. -- copied from GNU libc*/
static int mystrcasecmp(
- s1,
- s2)
- const char *s1;
- const char *s2;
+ const char *s1,
+ const char *s2)
{
const unsigned char *p1 = (const unsigned char *) s1;
const unsigned char *p2 = (const unsigned char *) s2;
* token() fetches a token from the input stream
*/
static int token(
- )
+ void)
{
int idx;
diff --git a/src/rrd_cgi.c b/src/rrd_cgi.c
index 75dabf4a7eecf5000518282d7e54a4c2b05b5dec..846397f6089465c01dede1510f3735fb4c6ba2eb 100644 (file)
--- a/src/rrd_cgi.c
+++ b/src/rrd_cgi.c
static size_t varheap_size = 0;
/* allocate and initialize variable heap */
-static int initvar(
- )
+static int initvar(void)
{
varheap = (vardata *) malloc(sizeof(vardata) * INIT_VARSTORE_SIZE);
if (varheap == NULL) {
}
/* cleanup: free allocated memory */
-static void donevar(
- )
+static void donevar(void)
{
int i;
if (0 == strcmp(name, varheap[i].name)) {
/* overwrite existing entry */
if (varheap[i].is_const) {
-#ifdef DEBUG_VARS
+#ifdef DEBUG_VARS
printf("<!-- setver(%s, %s): not assigning: "
"const variable -->\n", name, value);
-# endif
+#endif
return varheap[i].value;
}
-#ifdef DEBUG_VARS
+#ifdef DEBUG_VARS
printf("<!-- setvar(%s, %s): overwriting old value (%s) -->\n",
name, value, varheap[i].value);
#endif
char *server_url = NULL;
long i;
long filter = 0;
+ struct option long_options[] = {
+ {"filter", no_argument, 0, 'f'},
+ {0, 0, 0, 0}
+ };
#ifdef MUST_DISABLE_SIGFPE
signal(SIGFPE, SIG_IGN);
for (i=0;i<argc;i++)
printf("%d-'%s'\n",i,argv[i]); */
while (1) {
- static struct option long_options[] = {
- {"filter", no_argument, 0, 'f'},
- {0, 0, 0, 0}
- };
int option_index = 0;
int opt;
diff --git a/src/rrd_create.c b/src/rrd_create.c
index 766b783460e205b7f7132b820b77a6298926209c..4c9943ed6e5a18b6de0c5befbf125c0adcb76655 100644 (file)
--- a/src/rrd_create.c
+++ b/src/rrd_create.c
int argc,
char **argv)
{
+ struct option long_options[] = {
+ {"start", required_argument, 0, 'b'},
+ {"step", required_argument, 0, 's'},
+ {0, 0, 0, 0}
+ };
+ int option_index = 0;
+ int opt;
time_t last_up = time(NULL) - 10;
unsigned long pdp_step = 300;
struct rrd_time_value last_up_tv;
opterr = 0; /* initialize getopt */
while (1) {
- static struct option long_options[] = {
- {"start", required_argument, 0, 'b'},
- {"step", required_argument, 0, 's'},
- {0, 0, 0, 0}
- };
- int option_index = 0;
- int opt;
-
opt = getopt_long(argc, argv, "b:s:", long_options, &option_index);
if (opt == EOF)
diff --git a/src/rrd_fetch.c b/src/rrd_fetch.c
index 422f59b0fcf9c1e371c66dc3803ff8a53f210c05..c065793992dc0f1fcecf90bed8b40e9a1214f693 100644 (file)
--- a/src/rrd_fetch.c
+++ b/src/rrd_fetch.c
char ***ds_namv, /* names of data sources */
rrd_value_t **data)
{ /* two dimensional array containing the data */
-
-
long step_tmp = 1;
time_t start_tmp = 0, end_tmp = 0;
const char *cf;
struct rrd_time_value start_tv, end_tv;
char *parsetime_error = NULL;
+ struct option long_options[] = {
+ {"resolution", required_argument, 0, 'r'},
+ {"start", required_argument, 0, 's'},
+ {"end", required_argument, 0, 'e'},
+ {0, 0, 0, 0}
+ };
optind = 0;
opterr = 0; /* initialize getopt */
parsetime("now", &end_tv);
while (1) {
- static struct option long_options[] = {
- {"resolution", required_argument, 0, 'r'},
- {"start", required_argument, 0, 's'},
- {"end", required_argument, 0, 'e'},
- {0, 0, 0, 0}
- };
int option_index = 0;
int opt;
diff --git a/src/rrd_first.c b/src/rrd_first.c
index abba426f21ecf60ce86c2f27b3cd839605d0986b..d2b81a958bac38e86ab7565205ae617f4af2d86b 100644 (file)
--- a/src/rrd_first.c
+++ b/src/rrd_first.c
{
int target_rraindex = 0;
char *endptr;
+ struct option long_options[] = {
+ {"rraindex", required_argument, 0, 129},
+ {0, 0, 0, 0}
+ };
optind = 0;
opterr = 0; /* initialize getopt */
while (1) {
- static struct option long_options[] = {
- {"rraindex", required_argument, 0, 129},
- {0, 0, 0, 0}
- };
int option_index = 0;
int opt;
diff --git a/src/rrd_getopt.c b/src/rrd_getopt.c
index 706a67ab8b3ec3fbd8f781ec85bf0639ef2109db..d03b456e8297cc8d7446c848b56fa77ef9c8578a 100644 (file)
--- a/src/rrd_getopt.c
+++ b/src/rrd_getopt.c
of the value of `ordering'. In the case of RETURN_IN_ORDER, only
`--' can cause `getopt' to return -1 with `optind' != ARGC. */
-static enum {
+static const enum {
REQUIRE_ORDER, PERMUTE, RETURN_IN_ORDER
} ordering;
diff --git a/src/rrd_getopt1.c b/src/rrd_getopt1.c
index 6ace7943cd546794225f2d57258879e086c84a73..4c406e9f9c711ff8dbbca746dd450cf4a95bebf1 100644 (file)
--- a/src/rrd_getopt1.c
+++ b/src/rrd_getopt1.c
{
int c;
int digit_optind = 0;
+ struct option long_options[] = {
+ {"add", 1, 0, 0},
+ {"append", 0, 0, 0},
+ {"delete", 1, 0, 0},
+ {"verbose", 0, 0, 0},
+ {"create", 0, 0, 0},
+ {"file", 1, 0, 0},
+ {0, 0, 0, 0}
+ };
while (1) {
int this_option_optind = optind ? optind : 1;
int option_index = 0;
- static struct option long_options[] = {
- {"add", 1, 0, 0},
- {"append", 0, 0, 0},
- {"delete", 1, 0, 0},
- {"verbose", 0, 0, 0},
- {"create", 0, 0, 0},
- {"file", 1, 0, 0},
- {0, 0, 0, 0}
- };
c = getopt_long(argc, argv, "abc:d:0123456789",
long_options, &option_index);
diff --git a/src/rrd_graph.c b/src/rrd_graph.c
index 3022227815392680370987f85351f28c023a9e07..7fbe8651146c94b54e48ed47e33c7c44002969f9 100644 (file)
--- a/src/rrd_graph.c
+++ b/src/rrd_graph.c
long long_tmp;
struct rrd_time_value start_tv, end_tv;
long unsigned int color;
+ /* defines for long options without a short equivalent. should be bytes,
+ and may not collide with (the ASCII value of) short options */
+#define LONGOPT_UNITS_SI 255
+ struct option long_options[] = {
+ {"start", required_argument, 0, 's'},
+ {"end", required_argument, 0, 'e'},
+ {"x-grid", required_argument, 0, 'x'},
+ {"y-grid", required_argument, 0, 'y'},
+ {"vertical-label", required_argument, 0, 'v'},
+ {"width", required_argument, 0, 'w'},
+ {"height", required_argument, 0, 'h'},
+ {"full-size-mode", no_argument, 0, 'D'},
+ {"interlaced", no_argument, 0, 'i'},
+ {"upper-limit", required_argument, 0, 'u'},
+ {"lower-limit", required_argument, 0, 'l'},
+ {"rigid", no_argument, 0, 'r'},
+ {"base", required_argument, 0, 'b'},
+ {"logarithmic", no_argument, 0, 'o'},
+ {"color", required_argument, 0, 'c'},
+ {"font", required_argument, 0, 'n'},
+ {"title", required_argument, 0, 't'},
+ {"imginfo", required_argument, 0, 'f'},
+ {"imgformat", required_argument, 0, 'a'},
+ {"lazy", no_argument, 0, 'z'},
+ {"zoom", required_argument, 0, 'm'},
+ {"no-legend", no_argument, 0, 'g'},
+ {"force-rules-legend", no_argument, 0, 'F'},
+ {"only-graph", no_argument, 0, 'j'},
+ {"alt-y-grid", no_argument, 0, 'Y'},
+ {"no-minor", no_argument, 0, 'I'},
+ {"slope-mode", no_argument, 0, 'E'},
+ {"alt-autoscale", no_argument, 0, 'A'},
+ {"alt-autoscale-min", no_argument, 0, 'J'},
+ {"alt-autoscale-max", no_argument, 0, 'M'},
+ {"no-gridfit", no_argument, 0, 'N'},
+ {"units-exponent", required_argument, 0, 'X'},
+ {"units-length", required_argument, 0, 'L'},
+ {"units", required_argument, 0, LONGOPT_UNITS_SI},
+ {"step", required_argument, 0, 'S'},
+ {"tabwidth", required_argument, 0, 'T'},
+ {"font-render-mode", required_argument, 0, 'R'},
+ {"graph-render-mode", required_argument, 0, 'G'},
+ {"font-smoothing-threshold", required_argument, 0, 'B'},
+ {"watermark", required_argument, 0, 'W'},
+ {"alt-y-mrtg", no_argument, 0, 1000}, /* this has no effect it is just here to save old apps from crashing when they use it */
+ {0, 0, 0, 0}
+ };
optind = 0;
opterr = 0; /* initialize getopt */
parsetime("end-24h", &start_tv);
parsetime("now", &end_tv);
- /* defines for long options without a short equivalent. should be bytes,
- and may not collide with (the ASCII value of) short options */
-#define LONGOPT_UNITS_SI 255
-
while (1) {
- static struct option long_options[] = {
- {"start", required_argument, 0, 's'},
- {"end", required_argument, 0, 'e'},
- {"x-grid", required_argument, 0, 'x'},
- {"y-grid", required_argument, 0, 'y'},
- {"vertical-label", required_argument, 0, 'v'},
- {"width", required_argument, 0, 'w'},
- {"height", required_argument, 0, 'h'},
- {"full-size-mode", no_argument, 0, 'D'},
- {"interlaced", no_argument, 0, 'i'},
- {"upper-limit", required_argument, 0, 'u'},
- {"lower-limit", required_argument, 0, 'l'},
- {"rigid", no_argument, 0, 'r'},
- {"base", required_argument, 0, 'b'},
- {"logarithmic", no_argument, 0, 'o'},
- {"color", required_argument, 0, 'c'},
- {"font", required_argument, 0, 'n'},
- {"title", required_argument, 0, 't'},
- {"imginfo", required_argument, 0, 'f'},
- {"imgformat", required_argument, 0, 'a'},
- {"lazy", no_argument, 0, 'z'},
- {"zoom", required_argument, 0, 'm'},
- {"no-legend", no_argument, 0, 'g'},
- {"force-rules-legend", no_argument, 0, 'F'},
- {"only-graph", no_argument, 0, 'j'},
- {"alt-y-grid", no_argument, 0, 'Y'},
- {"no-minor", no_argument, 0, 'I'},
- {"slope-mode", no_argument, 0, 'E'},
- {"alt-autoscale", no_argument, 0, 'A'},
- {"alt-autoscale-min", no_argument, 0, 'J'},
- {"alt-autoscale-max", no_argument, 0, 'M'},
- {"no-gridfit", no_argument, 0, 'N'},
- {"units-exponent", required_argument, 0, 'X'},
- {"units-length", required_argument, 0, 'L'},
- {"units", required_argument, 0, LONGOPT_UNITS_SI},
- {"step", required_argument, 0, 'S'},
- {"tabwidth", required_argument, 0, 'T'},
- {"font-render-mode", required_argument, 0, 'R'},
- {"graph-render-mode", required_argument, 0, 'G'},
- {"font-smoothing-threshold", required_argument, 0, 'B'},
- {"watermark", required_argument, 0, 'W'},
- {"alt-y-mrtg", no_argument, 0, 1000}, /* this has no effect it is just here to save old apps from crashing when they use it */
- {0, 0, 0, 0}
- };
int option_index = 0;
int opt;
int col_start, col_end;
int vdef_parse(
- gdes,
- str)
- struct graph_desc_t *gdes;
- const char *const str;
+ struct graph_desc_t *gdes,
+ const char *const str)
{
/* A VDEF currently is either "func" or "param,func"
* so the parsing is rather simple. Change if needed.
int vdef_calc(
- im,
- gdi)
- image_desc_t *im;
- int gdi;
+ image_desc_t *im,
+ int gdi)
{
graph_desc_t *src, *dst;
rrd_value_t *data;
/* NaN < -INF < finite_values < INF */
int vdef_percent_compar(
- a,
- b)
- const void *a, *b;
+ const void *a, const void *b)
{
/* Equality is not returned; this doesn't hurt except
* (maybe) for a little performance.
diff --git a/src/rrd_open.c b/src/rrd_open.c
index 6e8a042544be2891bc7500eff036b90e96868e92..4b9a0f9220d126b9bc94b4ced97806a2fac25a65 100644 (file)
--- a/src/rrd_open.c
+++ b/src/rrd_open.c
* rrd_open.c Open an RRD File
*****************************************************************************
* $Id$
- * $Log$
- * Revision 1.10 2004/05/26 22:11:12 oetiker
- * reduce compiler warnings. Many small fixes. -- Mike Slifcak <slif@bellsouth.net>
- *
- * Revision 1.9 2003/04/29 21:56:49 oetiker
- * readline in rrd_open.c reads the file in 8 KB blocks, and calls realloc for
- * each block. realloc is very slow in Mac OS X for huge blocks, e.g. when
- * restoring databases from huge xml files. This patch finds the size of the
- * file, and starts out with malloc'ing the full size.
- * -- Peter Speck <speck@ruc.dk>
- *
- * Revision 1.8 2003/04/11 19:43:44 oetiker
- * New special value COUNT which allows calculations based on the position of a
- * value within a data set. Bug fix in rrd_rpncalc.c. PREV returned erroneus
- * value for the second value. Bug fix in rrd_restore.c. Bug causing seek error
- * when accesing an RRD restored from an xml that holds an RRD version <3.
- * -- Ruben Justo <ruben@ainek.com>
- *
- * Revision 1.7 2003/03/31 21:22:12 oetiker
- * enables RRDtool updates with microsecond or in case of windows millisecond
- * precision. This is needed to reduce time measurement error when archive step
- * is small. (<30s) -- Sasha Mikheev <sasha@avalon-net.co.il>
- *
- * Revision 1.6 2003/02/13 07:05:27 oetiker
- * Find attached the patch I promised to send to you. Please note that there
- * are three new source files (src/rrd_is_thread_safe.h, src/rrd_thread_safe.c
- * and src/rrd_not_thread_safe.c) and the introduction of librrd_th. This
- * library is identical to librrd, but it contains support code for per-thread
- * global variables currently used for error information only. This is similar
- * to how errno per-thread variables are implemented. librrd_th must be linked
- * alongside of libpthred
- *
- * There is also a new file "THREADS", holding some documentation.
- *
- * -- Peter Stamfest <peter@stamfest.at>
- *
- * Revision 1.5 2002/06/20 00:21:03 jake
- * More Win32 build changes; thanks to Kerry Calvert.
- *
- * Revision 1.4 2002/02/01 20:34:49 oetiker
- * fixed version number and date/time
- *
- * Revision 1.3 2001/03/04 13:01:55 oetiker
- * Aberrant Behavior Detection support. A brief overview added to rrdtool.pod.
- * Major updates to rrd_update.c, rrd_create.c. Minor update to other core files.
- * This is backwards compatible! But new files using the Aberrant stuff are not readable
- * by old rrdtool versions. See http://cricket.sourceforge.net/aberrant/rrd_hw.htm
- * -- Jake Brutlag <jakeb@corp.webtv.net>
- *
- * Revision 1.2 2001/03/04 10:29:20 oetiker
- * fixed filedescriptor leak
- * -- Mike Franusich <mike@franusich.com>
- *
- * Revision 1.1.1.1 2001/02/25 22:25:05 oetiker
- * checkin
- *
*****************************************************************************/
#include "rrd_tool.h"
diff --git a/src/rrd_restore.c b/src/rrd_restore.c
index 68a037fe6139f1daf949c1489a83dc3e8c08340d..65bbb10438b0d9a7e0e72d0fbcaaa438e20fb46d 100644 (file)
--- a/src/rrd_restore.c
+++ b/src/rrd_restore.c
char *buf;
char rc = 0;
char force_overwrite = 0;
+ struct option long_options[] = {
+ {"range-check", no_argument, 0, 'r'},
+ {"force-overwrite", no_argument, 0, 'f'},
+ {0, 0, 0, 0}
+ };
/* init rrd clean */
optind = 0;
opterr = 0; /* initialize getopt */
while (1) {
- static struct option long_options[] = {
- {"range-check", no_argument, 0, 'r'},
- {"force-overwrite", no_argument, 0, 'f'},
- {0, 0, 0, 0}
- };
int option_index = 0;
int opt;
-
opt = getopt_long(argc, argv, "rf", long_options, &option_index);
if (opt == EOF)
diff --git a/src/rrd_thread_safe.c b/src/rrd_thread_safe.c
index 074a873f2545e551455a66cd71d36ac7c1fb1bd5..7e58ca62abf8851033fc04fd52a62be832855dbe 100644 (file)
--- a/src/rrd_thread_safe.c
+++ b/src/rrd_thread_safe.c
/* Allocate the key */
static void context_get_key(
- )
+ void)
{
pthread_key_create(&context_key, context_destroy_context);
}
diff --git a/src/rrd_tune.c b/src/rrd_tune.c
index 160b32a5e66a961845e9655e98e77018cca59a68..714e7d40673993c8e421c7916470e90d3fadd35d 100644 (file)
--- a/src/rrd_tune.c
+++ b/src/rrd_tune.c
double max;
char dst[DST_SIZE];
rrd_file_t *rrd_file;
+ struct option long_options[] = {
+ {"heartbeat", required_argument, 0, 'h'},
+ {"minimum", required_argument, 0, 'i'},
+ {"maximum", required_argument, 0, 'a'},
+ {"data-source-type", required_argument, 0, 'd'},
+ {"data-source-rename", required_argument, 0, 'r'},
+ /* added parameter tuning options for aberrant behavior detection */
+ {"deltapos", required_argument, 0, 'p'},
+ {"deltaneg", required_argument, 0, 'n'},
+ {"window-length", required_argument, 0, 'w'},
+ {"failure-threshold", required_argument, 0, 'f'},
+ {"alpha", required_argument, 0, 'x'},
+ {"beta", required_argument, 0, 'y'},
+ {"gamma", required_argument, 0, 'z'},
+ {"gamma-deviation", required_argument, 0, 'v'},
+ {"aberrant-reset", required_argument, 0, 'b'},
+ {0, 0, 0, 0}
+ };
optind = 0;
opterr = 0; /* initialize getopt */
}
while (1) {
- static struct option long_options[] = {
- {"heartbeat", required_argument, 0, 'h'},
- {"minimum", required_argument, 0, 'i'},
- {"maximum", required_argument, 0, 'a'},
- {"data-source-type", required_argument, 0, 'd'},
- {"data-source-rename", required_argument, 0, 'r'},
- /* added parameter tuning options for aberrant behavior detection */
- {"deltapos", required_argument, 0, 'p'},
- {"deltaneg", required_argument, 0, 'n'},
- {"window-length", required_argument, 0, 'w'},
- {"failure-threshold", required_argument, 0, 'f'},
- {"alpha", required_argument, 0, 'x'},
- {"beta", required_argument, 0, 'y'},
- {"gamma", required_argument, 0, 'z'},
- {"gamma-deviation", required_argument, 0, 'v'},
- {"aberrant-reset", required_argument, 0, 'b'},
- {0, 0, 0, 0}
- };
int option_index = 0;
int opt;
diff --git a/src/rrd_update.c b/src/rrd_update.c
index 1feecac58f8ba2862d68ba30badbf4f7ec866de6..fa60c0b47d21c26904a1dc1b3e3ce59e04a992f4 100644 (file)
--- a/src/rrd_update.c
+++ b/src/rrd_update.c
char *tmplt = NULL;
info_t *result = NULL;
infoval rc;
+ struct option long_options[] = {
+ {"template", required_argument, 0, 't'},
+ {0, 0, 0, 0}
+ };
rc.u_int = -1;
optind = 0;
opterr = 0; /* initialize getopt */
while (1) {
- static struct option long_options[] = {
- {"template", required_argument, 0, 't'},
- {0, 0, 0, 0}
- };
int option_index = 0;
int opt;
diff --git a/src/rrd_xport.c b/src/rrd_xport.c
index ac2295bcd1aea33b42f94b4c4c5f51c84c1980bb..21110b84705e66a4efa209287bfae31985a2a69c 100644 (file)
--- a/src/rrd_xport.c
+++ b/src/rrd_xport.c
time_t start_tmp = 0, end_tmp = 0;
struct rrd_time_value start_tv, end_tv;
char *parsetime_error = NULL;
+ struct option long_options[] = {
+ {"start", required_argument, 0, 's'},
+ {"end", required_argument, 0, 'e'},
+ {"maxrows", required_argument, 0, 'm'},
+ {"step", required_argument, 0, 261},
+ {"enumds", no_argument, 0, 262}, /* these are handled in the frontend ... */
+ {0, 0, 0, 0}
+ };
optind = 0;
opterr = 0; /* initialize getopt */
parsetime("now", &end_tv);
while (1) {
- static struct option long_options[] = {
- {"start", required_argument, 0, 's'},
- {"end", required_argument, 0, 'e'},
- {"maxrows", required_argument, 0, 'm'},
- {"step", required_argument, 0, 261},
- {"enumds", no_argument, 0, 262}, /* these are handled in the frontend ... */
- {0, 0, 0, 0}
- };
int option_index = 0;
int opt;