summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 425f4b1)
raw | patch | inline | side by side (parent: 425f4b1)
| author | oetiker <oetiker@a5681a0c-68f1-0310-ab6d-d61299d08faa> | |
| Sat, 12 Mar 2005 17:06:46 +0000 (17:06 +0000) | ||
| committer | oetiker <oetiker@a5681a0c-68f1-0310-ab6d-d61299d08faa> | |
| Sat, 12 Mar 2005 17:06:46 +0000 (17:06 +0000) | 
index 558bdc0720b27183ca6eee891d2e5c6f9df4acd7..b97872e00d65b906c5796788c70334430143cd71 100644 (file)
       OUTPUT:
             RETVAL
+int
+rrd_last(...)
+      PROTOTYPE: @
+      PREINIT:
+      int i;
+      char **argv;
+      CODE:
+              rrdcode(rrd_first);
+      OUTPUT:
+            RETVAL
+
 int
 rrd_create(...)
index 3074b613c72487deca38dfb6b82c43075cacd01b..d23f49f4bacf796019ac2da171d164b81a9aeafd 100644 (file)
--- a/program/doc/Makefile.am
+++ b/program/doc/Makefile.am
 PODOLD = rrdgraph-old.pod
-POD = rrdtool.pod rrdlast.pod rrdcreate.pod rrdupdate.pod  rrdtutorial.es.pod \
+POD = rrdtool.pod rrdlast.pod rrdfirst.pod rrdcreate.pod rrdupdate.pod  rrdtutorial.es.pod \
        cdeftutorial.pod rpntutorial.pod rrdthreads.pod bin_dec_hex.pod \
        rrdfetch.pod rrdrestore.pod rrddump.pod rrdtune.pod rrdresize.pod \
        rrdcgi.pod rrdtutorial.pod rrdinfo.pod rrdxport.pod rrd-beginners.pod \
index 68875df779550a2cbb4db6a8c48eb667213daf5a..246ef789a4579fab9c9941bd5f85f166534e09b0 100644 (file)
--- a/program/src/Makefile.am
+++ b/program/src/Makefile.am
        rrd_graph.c     \
        rrd_graph_helper.c      \
        rrd_last.c      \
+       rrd_first.c     \
        rrd_open.c      \
        rrd_resize.c    \
        rrd_restore.c   \
diff --git a/program/src/rrd.h b/program/src/rrd.h
index 2868ebb9098d3f74e583174fd821390ed1a57308..49164e381fdd9e9baeb1d13fabb8f664778e2326 100644 (file)
--- a/program/src/rrd.h
+++ b/program/src/rrd.h
 int    rrd_dump(int, char **);
 int    rrd_tune(int, char **);
 time_t rrd_last(int, char **);
+time_t rrd_first(int, char **);
 int    rrd_resize(int, char **);
 int    rrd_xport(int, char **, int *, time_t *, time_t *,
                 unsigned long *, unsigned long *,
                    int argc, char **argv);
 int    rrd_dump_r(char *filename);
 time_t rrd_last_r(const char *filename);
+time_t rrd_first_r(const char *filename, int rraindex);
 /* Transplanted from parsetime.h */
 typedef enum {
diff --git a/program/src/rrd_tool.c b/program/src/rrd_tool.c
index 94c2b157bc94f79a4afdcb503647750ab89e505f..f4cfa11af0e3153cd1f68b3c65237b189319152b 100644 (file)
--- a/program/src/rrd_tool.c
+++ b/program/src/rrd_tool.c
     char help_list[] =
           "Valid commands: create, update, updatev, graph, dump, restore,\n"
-          "\t\tlast, info, fetch, tune, resize, xport\n\n";
+          "\t\tlast, first, info, fetch, tune, resize, xport\n\n";
     char help_listremote[] =
            "Valid remote commands: quit, ls, cd, mkdir\n\n";
            "* last - show last update time for RRD\n\n"
            "\trrdtool last filename.rrd\n\n";
+    char help_first[] =
+           "* first - show first update time for RRA within an RRD\n\n"
+           "\trrdtool first filename.rrd [--rraindex number]\n\n";
+
     char help_update[] =
           "* update - update an RRD\n\n"
           "\trrdtool update filename\n"
           "For more information read the RRD manpages\n\n";
-    enum { C_NONE, C_CREATE, C_DUMP, C_INFO, C_RESTORE, C_LAST,
+    enum { C_NONE, C_CREATE, C_DUMP, C_INFO, C_RESTORE, C_LAST, C_FIRST,
           C_UPDATE, C_FETCH, C_GRAPH, C_TUNE, C_RESIZE, C_XPORT,
            C_QUIT, C_LS, C_CD, C_MKDIR, C_UPDATEV };
                help_cmd = C_RESTORE;
            else if (!strcmp(cmd,"last"))
                help_cmd = C_LAST;
+           else if (!strcmp(cmd,"first"))
+               help_cmd = C_FIRST;
            else if (!strcmp(cmd,"update"))
                help_cmd = C_UPDATE;
            else if (!strcmp(cmd,"updatev"))
            case C_LAST:
                fputs(help_last, stdout);
                break;
+           case C_FIRST:
+               fputs(help_first, stdout);
+               break;
            case C_UPDATE:
                fputs(help_update, stdout);
                break;
        rrd_resize(argc-1, &argv[1]);
     else if (strcmp("last", argv[1]) == 0)
         printf("%ld\n",rrd_last(argc-1, &argv[1]));
+    else if (strcmp("first", argv[1]) == 0)
+        printf("%ld\n",rrd_first(argc-1, &argv[1]));
     else if (strcmp("update", argv[1]) == 0)
        rrd_update(argc-1, &argv[1]);
     else if (strcmp("fetch", argv[1]) == 0) {
![[tokkee]](http://tokkee.org/images/avatar.png)
