Coda Distributed File System
Macros | Typedefs | Enumerations | Variables
odytypes.h File Reference
#include <stdlib.h>
#include <stdio.h>
#include <sys/time.h>
Include dependency graph for odytypes.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define __P(args)   ()
 
#define __FILE__   "()"
 
#define __LINE__   0
 
#define CODA_ASSERT(cond)
 
#define ALLOC(X, T)
 
#define NALLOC(X, T, S)
 
#define FREE(X)
 
#define TIME(tv)   (gettimeofday(&(tv), NULL))
 
#define TIMEDIFF(tvb, tve, tvr)
 

Typedefs

typedef unsigned long magic_t
 
typedef struct timeval TIMEVAL
 

Enumerations

enum  bool { mfalse , mtrue , TRUE = 1 , FALSE = 0 }
 

Variables

typdef int(* COMPFN )()
 

Macro Definition Documentation

◆ __FILE__

#define __FILE__   "()"

◆ __LINE__

#define __LINE__   0

◆ __P

#define __P (   args)    ()

◆ ALLOC

#define ALLOC (   X,
 
)
Value:
do { \
if (((X) = (T *)malloc(sizeof(T))) == NULL) \
CODA_ASSERT(0); \
} while (0)
#define X(a)
Definition: rvm_logrecovr.c:1879
#define NULL
Definition: voltypes.h:44

◆ CODA_ASSERT

#define CODA_ASSERT (   cond)
Value:
do { \
if (!(cond)) { \
int *j = 0; \
fprintf(stderr, "Assert failed in %s:%d\n", __FILE__, __LINE__); \
fflush(stderr); \
*j = 1; /* cause a real SIGTRAP to happen: can be caught */ \
} \
} while (0)
stderr
Definition: gensrvstats.py:48
#define __FILE__
Definition: odytypes.h:64
#define __LINE__
Definition: odytypes.h:68

◆ FREE

#define FREE (   X)
Value:
do { \
if ((X) != NULL) { \
free((X)); \
(X) = NULL; \
} \
} while (0)

◆ NALLOC

#define NALLOC (   X,
  T,
 
)
Value:
do { \
if (((X) = (T *)malloc(sizeof(T) * (S))) == NULL) { \
CODA_ASSERT(0); \
} \
} while (0)

◆ TIME

#define TIME (   tv)    (gettimeofday(&(tv), NULL))

◆ TIMEDIFF

#define TIMEDIFF (   tvb,
  tve,
  tvr 
)
Value:
do { \
CODA_ASSERT(((tve).sec > (tvb).sec) || \
(((tve).sec == (tvb).sec) && ((tve).usec > (tvb).usec))); \
if ((tve).usec < (tvb).usec) { \
(tvr).usec = 1000000 + (tve).usec - (tvb).usec; \
(tvr).sec = (tve).sec - (tvb).sec - 1; \
} else { \
(tvr).usec = (tve).usec - (tvb).usec; \
(tvr).sec = (tve).sec - (tvb).sec; \
} \
} while (0)

Typedef Documentation

◆ magic_t

typedef unsigned long magic_t

◆ TIMEVAL

typedef struct timeval TIMEVAL

Enumeration Type Documentation

◆ bool

enum bool
Enumerator
mfalse 
mtrue 
TRUE 
FALSE 

Variable Documentation

◆ COMPFN

typdef int(* COMPFN) () ( )