libaard_types.h
Overview
ibaard_types.h contains definitions of datatypes, constants and functions which should be present on UNIX systems. If they are not present they get defined.
Functions
strcasecmp() and strncasecmp()
int strcasecmp(const char *s1, const char *s2);
int strncasecmp(const char *s1, const char *s2, size_t n);
strcasecmp() and strncasecmp() are usually not available under Windows. However, there is stricmp() and strnicmp() with the same syntax. Therefore we define strcasecmp() as stricmp() and strncasecmp() as strnicmp() for Win32.
pclose() and popen()
FILE *popen(const char *command, const char *type);
int pclose(FILE *stream);
Borland C defines _pclose() and _popen(). We just add defines for Borland C
Types
ibaard_types.h tries to include the standard int definitions of different platforms
struct addrinfo
struct addrinfo {
int ai_flags;
int ai_family;
int ai_socktype;
int ai_protocol;
size_t ai_addrlen;
struct sockaddr *ai_addr;
char *ai_canonname;
struct addrinfo *ai_next;
};
Borland C does not know about the addrinfo structure which is needed for using modern socket functions (like getaddrinfo)
uint32_t, uint16_t, socklen_t, pid_t
typedef unsigned __int32 uint32_t;
typedef unsigned __int16 uint16_t;
typedef uint32_t socklen_t;
typedef int pid_t;
Constants
#define AM_MAXUSER 1025
#define AM_MAXPASS 1025
#define AM_MAXPATH 1025
#define NI_MAXHOST 1025
#define NI_MAXSERV 32
#define NI_NUMERICSERV 8
#define NI_NUMERICHOST 2
#define EAI_FAMILY -1
#define EAI_NONAME -4
#define EAI_SERVICE -5
#define EAI_NODATA -7
#define EAI_MEMORY -8
#define EAI_FAIL -9
#define EAI_AGAIN -10
// socket stuff
#define AI_NUMERICHOST 1
#define AI_CANONNAME 2
#define AI_PASSIVE 4