File: compat.h

package info (click to toggle)
pktstat 1.8.5-8
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 696 kB
  • sloc: ansic: 5,105; sh: 1,032; makefile: 34
file content (35 lines) | stat: -rw-r--r-- 804 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35

#include "type.h"

#if DEBUG_MALLOC
#include <stdlib.h>
#include <string.h>
void *xx_malloc(size_t, const char *, int);
void *xx_realloc(void *, size_t, const char *, int);
void xx_free(void *);
char *xx_strdup(const char *s, const char *, int);
#define malloc(sz)      xx_malloc(sz,__FILE__,__LINE__)
#define realloc(ptr,sz) xx_realloc(ptr,sz,__FILE__,__LINE__)
#define free            xx_free
#define strdup(s)       xx_strdup(s,__FILE__,__LINE__)
#endif

#if !HAVE_MEMCMP
int memcmp(const void *, const void *, size_t);
#endif

#if HAVE_ERR_H
# include <err.h>
#else
# if !HAVE_ERR
void err(int, const char *, ...);
void errx(int, const char *, ...);
void warn(const char *, ...);
void warnx(const char *, ...);
# endif
#endif


#if !HAVE_STRNCPY
size_t strlcpy(char *, const char *, size_t);
#endif