00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016 #ifndef PIO_STANDALONE_H__
00017 #define PIO_PERF_H__
00018
00019
00020
00021
00022
00025 #include "H5public.h"
00026
00027
00028
00029
00030
00031 #ifdef H5_STDC_HEADERS
00032 # include <assert.h>
00033 # include <ctype.h>
00034 # include <errno.h>
00035 # include <fcntl.h>
00036 # include <float.h>
00037 # include <limits.h>
00038 # include <math.h>
00039 # include <signal.h>
00040 # include <stdarg.h>
00041 # include <stdio.h>
00042 # include <stdlib.h>
00043 # include <string.h>
00044 #endif
00045
00046
00047
00048
00049
00050 #ifdef _WIN32
00051 #define HDstrdup(S) _strdup(S)
00052 #else
00053
00054 #if !defined strdup && !defined H5_HAVE_STRDUP
00055 extern char *strdup(const char *s);
00056 #endif
00057
00058 #define HDstrdup(S) strdup(S)
00059
00060 #endif
00061
00062 H5_DLL int HDfprintf (FILE *stream, const char *fmt, ...);
00063 #define HDstrcmp(S,T) strcmp(S,T)
00064 #define HDstrlen(S) strlen(S)
00065 #define HDstrncmp(S,T,L) strncmp(S,T,L)
00066 #define HDstrncpy(X,Y,Z) strncpy(X,Y,Z)
00067 #define HDstrchr(S,C) strchr(S,C)
00068 #define HDfree(M) free(M)
00069
00070
00071 #ifdef _O_BINARY
00072 #define HDopen(S,F,M) open(S,F|_O_BINARY,M)
00073 #else
00074 #define HDopen(S,F,M) open(S,F,M)
00075 #endif
00076 #define HDclose(F) close(F)
00077
00078 #ifdef _WIN32
00079 #ifdef __MWERKS__
00080 #define HDlseek(F,O,W) lseek(F,O,W)
00081 #else
00082 #define HDlseek(F,O,W) _lseeki64(F,O,W)
00083 #endif
00084 #else
00085 #define HDlseek(F,O,W) lseek(F,O,W)
00086 #endif
00087
00088 #if defined (__MWERKS__)
00089
00090
00091
00092 #define HDwrite(F,M,Z) write(F,(void*)M,Z)
00093 #else
00094 #define HDwrite(F,M,Z) write(F,M,Z)
00095 #endif
00096
00097 #define HDread(F,M,Z) read(F,M,Z)
00098
00099 #ifdef _WIN32
00100 #ifdef __MWERKS__
00101 #define HDstat(S,B) stat(S,B)
00102 #else
00103 #define HDstat(S,B) _stati64(S,B)
00104 #endif
00105 #else
00106 #define HDstat(S,B) stat(S,B)
00107 #endif
00108
00109 #ifdef _WIN32
00110 #ifdef __MWERKS__
00111 #define HDfstat(F,B) fstat(F,B)
00112 typedef struct stat h5_stat_t;
00113 typedef off_t h5_stat_size_t;
00114 #else
00115 #define HDfstat(F,B) _fstati64(F,B)
00116 typedef struct _stati64 h5_stat_t;
00117 typedef __int64 h5_stat_size_t;
00118 #endif
00119 #else
00120 #define HDfstat(F,B) fstat(F,B)
00121 typedef struct stat h5_stat_t;
00122 typedef off_t h5_stat_size_t;
00123 #endif
00124
00125
00126
00127
00128 #ifndef FALSE
00129 # define FALSE 0
00130 #endif
00131 #ifndef TRUE
00132 # define TRUE 1
00133 #endif
00134
00135
00138 #ifdef H5_HAVE_PARALLEL
00139 extern MPI_Info h5_io_info_g;
00140 #endif
00141
00142 #ifdef H5_HAVE_PARALLEL
00143 H5TEST_DLL int h5_set_info_object(void);
00144 H5TEST_DLL void h5_dump_info_object(MPI_Info info);
00145 #endif
00146
00147
00148
00151 extern int opt_err;
00152 extern int opt_ind;
00153 extern const char *opt_arg;
00154
00155
00156 enum {
00157 no_arg = 0,
00158 require_arg,
00159 optional_arg
00160 };
00161
00162
00163 typedef struct long_options {
00164 const char *name;
00165 int has_arg;
00166 char shortval;
00167
00168 } long_options;
00169
00170 extern int get_option(int argc, const char **argv, const char *opt,
00171 const struct long_options *l_opt);
00172
00173 extern int nCols;
00174
00175
00176 extern void print_version(const char *progname);
00177
00178 #endif