DMTCP
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
Macros | Functions
mtcp_util.h File Reference
#include "procmapsarea.h"

Go to the source code of this file.

Macros

#define MTCP_PRINTF(args...)
 
#define MTCP_ASSERT(condition)
 
#define DPRINTF(args...)
 

Functions

void mtcp_printf (char const *format,...)
 
ssize_t mtcp_read_all (int fd, void *buf, size_t count)
 
int mtcp_readfile (int fd, void *buf, size_t size)
 
void mtcp_skipfile (int fd, size_t size)
 
unsigned long mtcp_strtol (char *str)
 
char mtcp_readchar (int fd)
 
char mtcp_readdec (int fd, VA *value)
 
char mtcp_readhex (int fd, VA *value)
 
ssize_t mtcp_write_all (int fd, const void *buf, size_t count)
 
size_t mtcp_strlen (const char *s1)
 
const void * mtcp_strstr (const char *string, const char *substring)
 
void mtcp_strncpy (char *targ, const char *source, size_t len)
 
void mtcp_strcpy (char *dest, const char *src)
 
void mtcp_strncat (char *dest, const char *src, size_t n)
 
int mtcp_strncmp (const char *s1, const char *s2, size_t n)
 
int mtcp_strcmp (const char *s1, const char *s2)
 
char * mtcp_strchr (const char *s, int c)
 
int mtcp_strstartswith (const char *s1, const char *s2)
 
int mtcp_strendswith (const char *s1, const char *s2)
 
int mtcp_readmapsline (int mapsfd, Area *area)
 
void mtcp_sys_memcpy (void *dstpp, const void *srcpp, size_t len)
 

Macro Definition Documentation

#define DPRINTF (   args...)

Definition at line 41 of file mtcp_util.h.

#define MTCP_ASSERT (   condition)
Value:
if (! (condition)) { \
MTCP_PRINTF("Assertion failed: %s\n", #condition); \
mtcp_abort(); \
}

Definition at line 32 of file mtcp_util.h.

#define MTCP_PRINTF (   args...)
Value:
do { \
mtcp_printf("[%d] %s:%d %s:\n ", \
mtcp_sys_getpid(), __FILE__, __LINE__, __FUNCTION__); \
(void)mtcp_sys_errno; /* prevent compiler warning if we don't use it */ \
mtcp_printf(args); \
} while (0)

Definition at line 24 of file mtcp_util.h.

Function Documentation

void mtcp_printf ( char const *  format,
  ... 
)

Definition at line 631 of file mtcp_util.c.

ssize_t mtcp_read_all ( int  fd,
void *  buf,
size_t  count 
)

Definition at line 198 of file mtcp_util.c.

char mtcp_readchar ( int  fd)

Definition at line 341 of file mtcp_util.c.

char mtcp_readdec ( int  fd,
VA *  value 
)

Definition at line 355 of file mtcp_util.c.

int mtcp_readfile ( int  fd,
void *  buf,
size_t  size 
)

Definition at line 246 of file mtcp_util.c.

char mtcp_readhex ( int  fd,
VA *  value 
)

Definition at line 372 of file mtcp_util.c.

int mtcp_readmapsline ( int  mapsfd,
Area *  area 
)

Definition at line 408 of file mtcp_util.c.

void mtcp_skipfile ( int  fd,
size_t  size 
)

Definition at line 300 of file mtcp_util.c.

char* mtcp_strchr ( const char *  s,
int  c 
)

Definition at line 150 of file mtcp_util.c.

int mtcp_strcmp ( const char *  s1,
const char *  s2 
)

Definition at line 118 of file mtcp_util.c.

void mtcp_strcpy ( char *  dest,
const char *  src 
)

Definition at line 90 of file mtcp_util.c.

int mtcp_strendswith ( const char *  s1,
const char *  s2 
)

Definition at line 165 of file mtcp_util.c.

size_t mtcp_strlen ( const char *  s1)

Definition at line 68 of file mtcp_util.c.

void mtcp_strncat ( char *  dest,
const char *  src,
size_t  n 
)

Definition at line 97 of file mtcp_util.c.

int mtcp_strncmp ( const char *  s1,
const char *  s2,
size_t  n 
)

Definition at line 103 of file mtcp_util.c.

void mtcp_strncpy ( char *  targ,
const char *  source,
size_t  len 
)

Definition at line 77 of file mtcp_util.c.

int mtcp_strstartswith ( const char *  s1,
const char *  s2 
)

Definition at line 157 of file mtcp_util.c.

const void* mtcp_strstr ( const char *  string,
const char *  substring 
)

Definition at line 134 of file mtcp_util.c.

unsigned long mtcp_strtol ( char *  str)

Definition at line 37 of file mtcp_util.c.

void mtcp_sys_memcpy ( void *  dstpp,
const void *  srcpp,
size_t  len 
)
ssize_t mtcp_write_all ( int  fd,
const void *  buf,
size_t  count 
)

Definition at line 318 of file mtcp_util.c.