X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=src%2Frrd_format.c;h=b53311048ddea6c4ff563706844a1afe0e71caa7;hb=7d5dc08e976de9fa166f35f8e343011019b7f0ec;hp=4e53e196481e9de2d0a9fcf50eadb4d5deed9d0d;hpb=aff0a2728543eee1ac21f3fa02f171caae8d9362;p=rrdtool.git diff --git a/src/rrd_format.c b/src/rrd_format.c index 4e53e19..b533110 100644 --- a/src/rrd_format.c +++ b/src/rrd_format.c @@ -1,5 +1,5 @@ /***************************************************************************** - * RRDtool 1.3.2 Copyright by Tobi Oetiker, 1997-2008 + * RRDtool 1.4.2 Copyright by Tobi Oetiker, 1997-2009 ***************************************************************************** * rrd_format.c RRD Database Format helper functions ***************************************************************************** @@ -98,3 +98,16 @@ long ds_match( rrd_set_error("unknown data source name '%s'", ds_nam); return -1; } + +off_t rrd_get_header_size( + rrd_t *rrd) +{ + return sizeof(stat_head_t) + \ + sizeof(ds_def_t) * rrd->stat_head->ds_cnt + \ + sizeof(rra_def_t) * rrd->stat_head->rra_cnt + \ + sizeof(time_t) + \ + sizeof(live_head_t) + \ + sizeof(pdp_prep_t) * rrd->stat_head->ds_cnt + \ + sizeof(cdp_prep_t) * rrd->stat_head->ds_cnt * rrd->stat_head->rra_cnt + \ + sizeof(rra_ptr_t) * rrd->stat_head->rra_cnt; +}