rpm  5.4.15
rpmzlog.h
Go to the documentation of this file.
1 #ifndef _H_RPMZLOG_
2 #define _H_RPMZLOG_
3 
7 #include <stdio.h>
8 #include <sys/time.h>
9 
11 typedef /*@abstract@*/ /*@refcounted@*/ struct rpmzLog_s * rpmzLog;
12 
13 #ifdef _RPMZLOG_INTERNAL
14 #include <yarn.h>
15 
17 typedef /*@abstract@*/ struct rpmzMsg_s * rpmzMsg;
18 
20 struct rpmzMsg_s {
21  struct timeval when; /* time of entry */
22  char *msg; /* message */
23  rpmzMsg next; /* next entry */
24 };
25 
27 struct rpmzLog_s {
28  struct rpmioItem_s _item;
29  struct timeval start;
30 /*@null@*/
31  rpmzMsg msg_head;
32 /*@shared@*/ /*@relnull@*/
33  rpmzMsg *msg_tail;
34  int msg_count;
35 #if defined(__LCLINT__)
36 /*@refs@*/
37  int nrefs;
38 #endif
39 };
40 #endif /* _RPMZLOG_INTERNAL */
41 
42 #ifdef __cplusplus
43 extern "C" {
44 #endif
45 
49 /*@newref@*/ /*@null@*/
50 rpmzLog rpmzLogLink(/*@null@*/ rpmzLog zlog)
51  /*@globals fileSystem, internalState @*/
52  /*@modifies zlog, fileSystem, internalState @*/;
53 
57 /*@newref@*/
58 rpmzLog rpmzLogNew(/*@null@*/ struct timeval *tv)
59  /*@globals fileSystem, internalState @*/
60  /*@modifies fileSystem, internalState @*/;
61 
65 void rpmzLogAdd(/*@null@*/ rpmzLog zlog, const char *fmt, ...)
66  /*@globals fileSystem, internalState @*/
67  /*@modifies zlog, fileSystem, internalState @*/;
68 
72 /*@null@*/
73 rpmzLog rpmzLogFree(/*@killref@*/ /*@null@*/ rpmzLog zlog)
74  /*@globals fileSystem, internalState @*/
75  /*@modifies zlog, fileSystem, internalState @*/;
76 
80 /*@null@*/
81 rpmzLog rpmzLogDump(/*@killref@*/ /*@null@*/ rpmzLog zlog, /*@null@*/ FILE * fp)
82  /*@globals fileSystem, internalState @*/
83  /*@modifies zlog, *fp, fileSystem, internalState @*/;
84 
85 #ifdef __cplusplus
86 }
87 #endif
88 
89 #endif /* _H_RPMZLOG_ */
rpmzLog rpmzLogDump(rpmzLog zlog, FILE *fp)
Show entries until no more, free log.
Definition: rpmzlog.c:222
rpmzLog rpmzLogFree(rpmzLog zlog)
Release a reference to the log data.
Definition: rpmzlog.c:176
struct rpmzLog_s * rpmzLog
trace log pointer
Definition: rpmzlog.h:11
void rpmzLogAdd(rpmzLog zlog, const char *fmt,...)
Add entry to trace log.
Definition: rpmzlog.c:101
rpmzLog rpmzLogNew(struct timeval *tv)
Set up log (call from main thread before other threads launched).
Definition: rpmzlog.c:81
rpmzLog rpmzLogLink(rpmzLog zlog)
Reference the log data.
Definition: rpmzlog.c:67