testlib.h
968 Bytes
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
36
37
38
39
40
41
42
43
44
45
46
47
48
#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__ */