rpm  5.4.15
Macros | Functions | Variables
rpmzlog.c File Reference

Trace logging (originally swiped from PIGZ). More...

#include "system.h"
#include <stdarg.h>
#include <rpmiotypes.h>
#include "yarn.h"
#include "rpmzlog.h"
#include "debug.h"
Include dependency graph for rpmzlog.c:

Go to the source code of this file.

Macros

#define _RPMZLOG_INTERNAL
 
#define _RPMZLOG_MAXMSG   256
 

Functions

rpmzLog rpmzLogLink (rpmzLog zlog)
 Reference the log data. More...
 
rpmzLog rpmzLogNew (struct timeval *tv)
 Set up log (call from main thread before other threads launched). More...
 
void rpmzLogAdd (rpmzLog zlog, const char *fmt,...)
 Add entry to trace log. More...
 
static int rpmzMsgShow (rpmzLog zlog, FILE *fp)
 
rpmzLog rpmzLogFree (rpmzLog zlog)
 Release a reference to the log data. More...
 
rpmzLog rpmzLogDump (rpmzLog zlog, FILE *fp)
 Show entries until no more, free log. More...
 

Variables

static int _rpmzlog_debug = 0
 

Detailed Description

Trace logging (originally swiped from PIGZ).

Definition in file rpmzlog.c.

Macro Definition Documentation

#define _RPMZLOG_INTERNAL

Definition at line 45 of file rpmzlog.c.

#define _RPMZLOG_MAXMSG   256

Definition at line 65 of file rpmzlog.c.

Referenced by rpmzLogAdd().

Function Documentation

void rpmzLogAdd ( rpmzLog  zlog,
const char *  fmt,
  ... 
)

Add entry to trace log.

Definition at line 101 of file rpmzlog.c.

References _RPMZLOG_MAXMSG, vsnprintf(), xmalloc, yarnPossess(), and yarnRelease().

rpmzLog rpmzLogDump ( rpmzLog  zlog,
FILE *  fp 
)

Show entries until no more, free log.

Definition at line 222 of file rpmzlog.c.

References rpmzLogFree(), and rpmzMsgShow().

rpmzLog rpmzLogFree ( rpmzLog  zlog)

Release a reference to the log data.

Definition at line 176 of file rpmzlog.c.

References _free(), _rpmzlog_debug, BY, yarnFreeLock(), yarnPeekLock(), yarnPossess(), and yarnTwist().

Referenced by rpmzLogDump().

rpmzLog rpmzLogLink ( rpmzLog  zlog)

Reference the log data.

Definition at line 67 of file rpmzlog.c.

References _rpmzlog_debug, BY, yarnPeekLock(), yarnPossess(), and yarnTwist().

Referenced by rpmzLogNew().

rpmzLog rpmzLogNew ( struct timeval *  tv)

Set up log (call from main thread before other threads launched).

Definition at line 81 of file rpmzlog.c.

References rpmzLogLink(), xcalloc(), and yarnNewLock().

static int rpmzMsgShow ( rpmzLog  zlog,
FILE *  fp 
)
static
  • Pull entry from trace log and print it, return false if empty.

Definition at line 139 of file rpmzlog.c.

References _free(), L, yarnPossess(), and yarnRelease().

Referenced by rpmzLogDump().

Variable Documentation

int _rpmzlog_debug = 0
static

Definition at line 51 of file rpmzlog.c.

Referenced by rpmzLogFree(), and rpmzLogLink().