rpm  4.11.1-rc1
rpmsw.h
Go to the documentation of this file.
1 #ifndef H_RPMSW
2 #define H_RPMSW
3 
8 #include <unistd.h>
9 #include <sys/time.h>
10 
11 #ifdef __cplusplus
12 extern "C" {
13 #endif
14 
17 typedef unsigned long int rpmtime_t;
18 
21 typedef struct rpmsw_s * rpmsw;
22 
25 typedef struct rpmop_s * rpmop;
26 
29 struct rpmsw_s {
30  union {
31  struct timeval tv;
32  unsigned long long int ticks;
33  unsigned long int tocks[2];
34  } u;
35 };
36 
40 struct rpmop_s {
41  struct rpmsw_s begin;
42  int count;
43  size_t bytes;
44  rpmtime_t usecs;
45 };
46 
52 rpmsw rpmswNow(rpmsw sw);
53 
60 rpmtime_t rpmswDiff(rpmsw end, rpmsw begin);
61 
66 rpmtime_t rpmswInit(void);
67 
74 int rpmswEnter(rpmop op, ssize_t rc);
75 
82 rpmtime_t rpmswExit(rpmop op, ssize_t rc);
83 
90 rpmtime_t rpmswAdd(rpmop to, rpmop from);
91 
98 rpmtime_t rpmswSub(rpmop to, rpmop from);
99 
100 #ifdef __cplusplus
101 }
102 #endif
103 
104 #endif /* H_RPMSW */