Coda Distributed File System
Macros | Functions | Variables
util.h File Reference
#include "coda_assert.h"
#include <unistd.h>
#include <stdlib.h>
#include <signal.h>
#include <stdio.h>
Include dependency graph for util.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define IN   /* Input parameter */
 
#define OUT   /* Output parameter */
 
#define INOUT   /* Obvious */
 
#define TRUE   1
 
#define FALSE   0
 
#define VLog(level, fmt, a...)   LogMsg(level, VolDebugLevel, stdout, fmt, ##a)
 
#define SLog(level, fmt, a...)   LogMsg(level, SrvDebugLevel, stdout, fmt, ##a)
 
#define DLog(level, fmt, a...)   LogMsg(level, DirDebugLevel, stdout, fmt, ##a)
 
#define ALog(level, fmt, a...)   LogMsg(level, VolDebugLevel, stdout, fmt, ##a)
 
#define CLog(level, fmt, a...)   LogMsg(level, VolDebugLevel, stdout, fmt, ##a)
 
#define U_wlock(b)   ObtainWriteLock(&((b)->lock))
 
#define U_rlock(b)   ObtainReadLock(&((b)->lock))
 
#define U_wunlock(b)   ReleaseWriteLock(&((b)->lock))
 
#define U_runlock(b)   ReleaseReadLock(&((b)->lock))
 

Functions

int HashString (char *s, unsigned int size)
 
void eprint (const char *,...)
 
void fdprint (long afd, const char *fmt,...)
 
void LogMsg (int msglevel, int debuglevel, FILE *fout, const char *fmt,...)
 
void PrintTimeStamp (FILE *fout)
 
int UtilHostEq (const char *name1, const char *name2)
 
char * hostname (char *name)
 
void UtilDetach ()
 

Variables

int SrvDebugLevel
 
int VolDebugLevel
 
int DirDebugLevel
 
int AL_DebugLevel
 
int AuthDebugLevel
 

Macro Definition Documentation

◆ ALog

#define ALog (   level,
  fmt,
  a... 
)    LogMsg(level, VolDebugLevel, stdout, fmt, ##a)

◆ CLog

#define CLog (   level,
  fmt,
  a... 
)    LogMsg(level, VolDebugLevel, stdout, fmt, ##a)

◆ DLog

#define DLog (   level,
  fmt,
  a... 
)    LogMsg(level, DirDebugLevel, stdout, fmt, ##a)

◆ FALSE

#define FALSE   0

◆ IN

#define IN   /* Input parameter */

◆ INOUT

#define INOUT   /* Obvious */

◆ OUT

#define OUT   /* Output parameter */

◆ SLog

#define SLog (   level,
  fmt,
  a... 
)    LogMsg(level, SrvDebugLevel, stdout, fmt, ##a)

◆ TRUE

#define TRUE   1

◆ U_rlock

#define U_rlock (   b)    ObtainReadLock(&((b)->lock))

◆ U_runlock

#define U_runlock (   b)    ReleaseReadLock(&((b)->lock))

◆ U_wlock

#define U_wlock (   b)    ObtainWriteLock(&((b)->lock))

◆ U_wunlock

#define U_wunlock (   b)    ReleaseWriteLock(&((b)->lock))

◆ VLog

#define VLog (   level,
  fmt,
  a... 
)    LogMsg(level, VolDebugLevel, stdout, fmt, ##a)

Function Documentation

◆ eprint()

void eprint ( const char *  fmt,
  ... 
)

◆ fdprint()

void fdprint ( long  afd,
const char *  fmt,
  ... 
)

◆ HashString()

int HashString ( char *  s,
unsigned int  size 
)

◆ hostname()

char * hostname ( char *  name)

◆ LogMsg()

void LogMsg ( int  msglevel,
int  debuglevel,
FILE *  fout,
const char *  fmt,
  ... 
)

◆ PrintTimeStamp()

void PrintTimeStamp ( FILE *  fout)

◆ UtilDetach()

void UtilDetach ( )

◆ UtilHostEq()

int UtilHostEq ( const char *  name1,
const char *  name2 
)

Variable Documentation

◆ AL_DebugLevel

int AL_DebugLevel
extern

◆ AuthDebugLevel

int AuthDebugLevel
extern

◆ DirDebugLevel

int DirDebugLevel
extern

◆ SrvDebugLevel

int SrvDebugLevel
extern

◆ VolDebugLevel

int VolDebugLevel
extern