"Fossies" - the Fresh Open Source Software Archive

Member "vnstat-2.9/src/misc.h" (20 Jul 2021, 1472 Bytes) of package /linux/misc/vnstat-2.9.tar.gz:

As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) C and C++ source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file. For more information about "misc.h" see the Fossies "Dox" file reference documentation and the last Fossies "Diffs" side-by-side code changes report: 2.7_vs_2.8.

    1 #ifndef MISC_H
    2 #define MISC_H
    4 #define UNITPREFIXCOUNT 7
    6 #include "dbsql.h"
    8 typedef enum RequestType {
    9     RT_Normal = 1,
   10     RT_Estimate,
   11     RT_ImageScale
   12 } RequestType;
   14 typedef enum ListType {
   15     LT_None = 0,
   16     LT_5min,
   17     LT_Hour,
   18     LT_Day,
   19     LT_Month,
   20     LT_Year,
   21     LT_Top
   22 } ListType;
   24 int spacecheck(const char *path);
   25 void sighandler(int sig);
   26 uint64_t getbtime(void);
   27 char *getvalue(const uint64_t bytes, const int len, const RequestType type);
   28 int getunitspacing(const int len, const int index);
   29 char *gettrafficrate(const uint64_t bytes, const time_t interval, const int len);
   30 const char *getunitprefix(const int index);
   31 const char *getrateunitprefix(const int unitmode, const int index);
   32 uint64_t getunitdivisor(const int unitmode, const int index);
   33 int getunit(void);
   34 char *getratestring(const uint64_t rate, const int len, const int declen);
   35 int getratespacing(const int len, const int unitmode, const int unitindex);
   36 int getpadding(const int len, const char *str);
   37 void cursortocolumn(const int column);
   38 void cursorhide(void);
   39 void cursorshow(void);
   40 void eraseline(void);
   41 int validatedatetime(const char *str);
   42 int issametimeslot(const ListType listtype, const time_t entry, const time_t updated);
   43 uint64_t getperiodseconds(const ListType listtype, const time_t entry, const time_t updated, const short isongoing);
   44 void getestimates(uint64_t *rx, uint64_t *tx, const ListType listtype, const time_t updated, dbdatalist **dbdata);
   45 int ishelprequest(const char *arg);
   47 #endif