vnstat  2.9
About: vnStat is a console-based network traffic monitor (using the /proc filesystem).
  Fossies Dox: vnstat-2.9.tar.gz  ("unofficial" and yet experimental doxygen-generated source code documentation)  

misc.h
Go to the documentation of this file.
1#ifndef MISC_H
2#define MISC_H
3
4#define UNITPREFIXCOUNT 7
5
6#include "dbsql.h"
7
8typedef enum RequestType {
13
14typedef enum ListType {
21 LT_Top
23
24int spacecheck(const char *path);
25void sighandler(int sig);
26uint64_t getbtime(void);
27char *getvalue(const uint64_t bytes, const int len, const RequestType type);
28int getunitspacing(const int len, const int index);
29char *gettrafficrate(const uint64_t bytes, const time_t interval, const int len);
30const char *getunitprefix(const int index);
31const char *getrateunitprefix(const int unitmode, const int index);
32uint64_t getunitdivisor(const int unitmode, const int index);
33int getunit(void);
34char *getratestring(const uint64_t rate, const int len, const int declen);
35int getratespacing(const int len, const int unitmode, const int unitindex);
36int getpadding(const int len, const char *str);
37void cursortocolumn(const int column);
38void cursorhide(void);
39void cursorshow(void);
40void eraseline(void);
41int validatedatetime(const char *str);
42int issametimeslot(const ListType listtype, const time_t entry, const time_t updated);
43uint64_t getperiodseconds(const ListType listtype, const time_t entry, const time_t updated, const short isongoing);
44void getestimates(uint64_t *rx, uint64_t *tx, const ListType listtype, const time_t updated, dbdatalist **dbdata);
45int ishelprequest(const char *arg);
46
47#endif
int ishelprequest(const char *arg)
Definition: misc.c:553
const char * getrateunitprefix(const int unitmode, const int index)
Definition: misc.c:238
uint64_t getperiodseconds(const ListType listtype, const time_t entry, const time_t updated, const short isongoing)
Definition: misc.c:453
void cursortocolumn(const int column)
Definition: misc.c:336
void getestimates(uint64_t *rx, uint64_t *tx, const ListType listtype, const time_t updated, dbdatalist **dbdata)
Definition: misc.c:493
int validatedatetime(const char *str)
Definition: misc.c:357
uint64_t getbtime(void)
Definition: misc.c:89
void cursorshow(void)
Definition: misc.c:346
int getunit(void)
Definition: misc.c:269
int issametimeslot(const ListType listtype, const time_t entry, const time_t updated)
Definition: misc.c:403
void eraseline(void)
Definition: misc.c:351
char * getvalue(const uint64_t bytes, const int len, const RequestType type)
Definition: misc.c:148
const char * getunitprefix(const int index)
Definition: misc.c:222
ListType
Definition: misc.h:14
@ LT_5min
Definition: misc.h:16
@ LT_Hour
Definition: misc.h:17
@ LT_Year
Definition: misc.h:20
@ LT_Day
Definition: misc.h:18
@ LT_None
Definition: misc.h:15
@ LT_Top
Definition: misc.h:21
@ LT_Month
Definition: misc.h:19
int getunitspacing(const int len, const int index)
Definition: misc.c:189
char * getratestring(const uint64_t rate, const int len, const int declen)
Definition: misc.c:282
int getpadding(const int len, const char *str)
Definition: misc.c:320
void cursorhide(void)
Definition: misc.c:341
uint64_t getunitdivisor(const int unitmode, const int index)
Definition: misc.c:256
void sighandler(int sig)
Definition: misc.c:61
char * gettrafficrate(const uint64_t bytes, const time_t interval, const int len)
Definition: misc.c:203
int spacecheck(const char *path)
Definition: misc.c:20
RequestType
Definition: misc.h:8
@ RT_ImageScale
Definition: misc.h:11
@ RT_Estimate
Definition: misc.h:10
@ RT_Normal
Definition: misc.h:9
int getratespacing(const int len, const int unitmode, const int unitindex)
Definition: misc.c:308