10 typedef __int64 ssize_t;
26 lseek(
fp, 0L, SEEK_SET);
61 assert(
sizeof(
char) == 1);
74 cerr <<
"Allocation error in df1b2_gradlist" <<
endl;
86 fp=open((
char*)(
filename), O_RDWR | O_CREAT | O_TRUNC |
89 fp=open((
char*)(
filename), O_RDWR | O_CREAT | O_TRUNC |
94 cerr <<
"Error trying to open file " <<
filename
95 <<
" in class test_smartlist " <<
endl;
99 lseek(
fp,0L,SEEK_CUR);
108 #if defined(__MINGW64__) || (defined(_MSC_VER) && defined(_WIN64))
110 assert(n <= UINT_MAX);
116 if (nw <= -1 || n != (
size_t)nw)
132 lseek(
fp,0L,SEEK_SET);
134 unsigned int nbytes = 0;
136 ::read(
fp,&nbytes,
sizeof(
unsigned int));
138 ssize_t ret =
::read(
fp,&nbytes,
sizeof(
unsigned int));
143 cerr <<
"Error -- record size in file seems to be larger than"
144 " the buffer it was created from " <<
endl
145 <<
" buffer size is " <<
bufsize <<
" record size is supposedly "
159 lseek(
fp, (off_t)
sizeof(off_t), SEEK_CUR);
161 ret = lseek(
fp, (off_t)
sizeof(off_t), SEEK_CUR);
177 lseek(
fp,0L,SEEK_SET);
197 cout <<
"Need to increase buffsize in list" <<
endl;
246 const unsigned int nbytes = (
unsigned int)_nbytes;
250 off_t
pos=lseek(
fp,0L,SEEK_CUR);
253 #if defined(OPT_LIB) && !defined(_MSC_VER)
256 ssize_t ret =
::write(
fp,&nbytes,
sizeof(
int));
262 if (nw <= -1 || (
unsigned int)nw != nbytes)
272 #if defined(OPT_LIB) && !defined(_MSC_VER)
298 off_t
pos =
sizeof(off_t);
303 lseek(
fp,-pos,SEEK_CUR);
307 ssize_t ret =
read(
fp,&pos,
sizeof(off_t));
311 lseek(
fp,pos,SEEK_SET);
315 unsigned int nbytes = 0;
317 ::read(
fp,&nbytes,
sizeof(
unsigned int));
319 ssize_t result =
::read(
fp,&nbytes,
sizeof(
unsigned int));
320 assert(result != -1);
322 if (nbytes <= 0 || nbytes >
bufsize)
324 cerr <<
"Error -- record size in file seems to be larger than"
325 " the buffer it was created from " <<
endl
326 <<
" buffer size is " << bufsize <<
" record size is supposedly "
332 if (nr <= -1 || (
size_t)nr != nbytes)
334 cerr <<
"Error reading -- should be " << nbytes <<
" got " << nr <<
endl;
344 lseek(
fp,pos,SEEK_SET);
346 off_t ret = lseek(
fp,pos,SEEK_SET);
355 lseek(
fp, pos, SEEK_CUR);
357 off_t ret = lseek(
fp, pos, SEEK_CUR);
389 source.
bptr += nsize;
402 cerr <<
" Sanity error in test_smartlist::operator -= (int)" <<
endl;
432 if ((
unsigned int)nsize>
bufsize)
434 cout <<
"Need to increase buffsize in list" <<
endl;
466 off_t
pos=lseek(
fp,0L,SEEK_END);
473 <<
" = " << pos <<
endl;
478 #if defined (_MSC_VER)
void read_buffer(void)
Description not yet available.
void read(const test_smartlist &, void *, int nsize)
void check_buffer_size(const size_t)
Description not yet available.
void memcpy(test_smartlist &dest, void *source, const size_t nsize)
memcpy for test_smartlist
static ofstream * global_logfile
void write_buffer(void)
Description not yet available.
int adptr_diff(void *x, void *y)
void save_end(void)
Description not yet available.
void initialize(void)
Description not yet available.
void allocate(const size_t bufsize, const adstring &filename)
Description not yet available.
void reset(void)
Author: David Fournier Copyright (c) 2008-2012 Regents of the University of California.
prnstream & endl(prnstream &)
void write(const size_t n)
Description not yet available.
test_smartlist(void)
Default constructor.
Description not yet available.
static int get_passnumber(void)
int option_match(int argc, char *argv[], const char *string)
Checks if the program has been invoked with a particular command line argument ("string").
void operator+=(const int)
Description not yet available.
size_t pos(const adstring &substr, const adstring &s)
void operator-=(const int)
Description not yet available.
Description not yet available.
~test_smartlist()
Destructor.
void restore_end(void)
Description not yet available.
void rewind(void)
Description not yet available.