testlib.h 968 Bytes
#ifndef __TESTLIB_H__
#define __TESTLIB_H__ 1
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <ctype.h>
#include <errno.h>
#ifndef WIN32
#include <unistd.h>
#include <netinet/in.h>
#include <sys/time.h>
#include <sys/wait.h>
#else
#include <winsock2.h>
#include <io.h>
#endif
#include <sys/stat.h>
#include <sys/types.h>
#include <fcntl.h>
#include <signal.h>
#include <bbcard.h>
#define _OS_CONT_H_	/* kludge to avoid include conflicts */
#include "bbclocal.h"

#ifdef USB
#define DEVICE_NAME  "/dev/usb/bbrdb0"
#else
#define DEVICE_NAME  "/dev/sg0"
#endif

#define	BLK_SIZE	BB_FL_BLOCK_SIZE
#define BYTE_TO_BLOCK(x)	((u32)(x)>>14)
#define BLOCK_TO_BYTE(x)	((u32)(x)<<14)

extern int mkfile(const char *name, int len);
extern int mksksa(const char *name, int sklen, int sa1len, int sa2len);

#ifdef DEBUG
#define VERBOSE fprintf
#else 
#ifndef WIN32
#define VERBOSE(format, args...)
#else
#define VERBOSE
#endif
#endif

#endif /* __TESTLIB_H__ */