IOR
iordef.h
Go to the documentation of this file.
1 /* -*- mode: c; c-basic-offset: 8; indent-tabs-mode: nil; -*-
2  * vim:expandtab:shiftwidth=8:tabstop=8:
3  */
4 /******************************************************************************\
5 * *
6 * Copyright (c) 2003, The Regents of the University of California *
7 * See the file COPYRIGHT for a complete copyright notice and license. *
8 * *
9 \******************************************************************************/
10 
11 #ifndef _IORDEF_H
12 #define _IORDEF_H
13 
14 #ifdef HAVE_CONFIG_H
15 # include "config.h"
16 #endif
17 
18 #include <stdio.h>
19 #include <stdlib.h>
20 #include <string.h>
21 
22 #ifdef _WIN32
23 # define _CRT_SECURE_NO_WARNINGS
24 # define _CRT_RAND_S
25 # pragma warning(4 : 4996) /* Don't complain about POSIX names */
26 # pragma warning(4 : 4267) /* '=' : conversion from 'size_t' to 'int' */
27 # pragma warning(4 : 4244) /* 'function' : conversion from 'IOR_offset_t' to 'int' */
28 
29 # include <Windows.h>
30 # include <io.h>
31 # include <direct.h>
32 
33 # define F_OK 00
34 # define W_OK 02
35 # define R_OK 04
36 # define X_OK 04
37 
38 # define lseek _lseeki64
39 # define fsync _commit
40 # define mkdir(dir, mode) _mkdir(dir)
41 # define strcasecmp _stricmp
42 # define strncasecmp _strnicmp
43 # define srandom srand
44 # define random() (rand() * (RAND_MAX+1) + rand()) /* Note: only 30 bits */
45 # define sleep(X) Sleep((X)*1000)
46 # define sysconf(X) 4096
47 #else
48 # include <sys/param.h> /* MAXPATHLEN */
49 # include <unistd.h>
50 # include <limits.h>
51 #endif
52 
53 /*************************** D E F I N I T I O N S ****************************/
54 
59 };
60 
61 #ifndef FALSE
62 # define FALSE 0
63 #endif /* not FALSE */
64 
65 #ifndef TRUE
66 # define TRUE 1
67 #endif /* not TRUE */
68 
69 #ifndef NULL
70 # define NULL ((void *)0)
71 #endif /* not NULL */
72 
73 #define KILOBYTE 1000
74 #define MEGABYTE 1000000
75 #define GIGABYTE 1000000000
76 
77 #define KIBIBYTE (1 << 10)
78 #define MEBIBYTE (1 << 20)
79 #define GIBIBYTE (1 << 30)
80 
81 /* for displaying MiB or MB */
82 #define BASE_TWO 0
83 #define BASE_TEN 1
84 
85 /* any write/read access in code */
86 #define WRITE 0
87 #define WRITECHECK 1
88 #define READ 2
89 #define READCHECK 3
90 
91 /* verbosity settings */
92 #define VERBOSE_0 0
93 #define VERBOSE_1 1
94 #define VERBOSE_2 2
95 #define VERBOSE_3 3
96 #define VERBOSE_4 4
97 #define VERBOSE_5 5
98 
99 #define MAX_STR 1024 /* max string length */
100 #define MAX_HINTS 16 /* max number of hints */
101 #define MAX_RETRY 10000 /* max retries for POSIX xfer */
102 #ifndef PATH_MAX
103 #define PATH_MAX 4096
104 #endif
105 
106 #define DELIMITERS " \t\r\n=" /* ReadScript() */
107 #define FILENAME_DELIMITER '@' /* ParseFileName() */
108 
109 typedef long long int IOR_offset_t;
110 typedef long long int IOR_size_t;
111 
112 #define IOR_format "%016llx"
113 
114 /******************************************************************************/
115 /*
116  * System info for Windows.
117  */
118 
119 #ifdef _WIN32
120 
121 struct utsname {
122  char sysname [16];
123  char nodename[257];
124  char release [16];
125  char version [16];
126  char machine [16];
127 };
128 
129 extern int uname(struct utsname *name);
130 
131 #endif /* _WIN32 */
132 
133 #endif /* not _IORDEF_H */
OutputFormat_t
Definition: iordef.h:55
long long int IOR_size_t
Definition: iordef.h:110
long long int IOR_offset_t
Definition: iordef.h:109