/***********************************************************************
* *
* This software is part of the ast package *
* Copyright (c) 1999-2011 AT&T Intellectual Property *
* and is licensed under the *
* Eclipse Public License, Version 1.0 *
* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* (with md5 checksum b35adb5213ca9657e911e9befb180842) *
* *
* Information and Software Systems Research *
* AT&T Research *
* Florham Park NJ *
* *
* Glenn Fowler <gsf@research.att.com> *
* *
***********************************************************************/
#include "sftest.h"
static int Count = 0;
#if __STD_C
#else
Sfio_t* f;
int type;
void* data;
#endif
{
if(fd >= 0)
Count += 1;
}
tmain()
{
Sfio_t* f;
char* s;
int pid;
char* buf;
/* test to see if transforming to file is ok with sfwrite */
if(!(f = sftmp(1024)) )
terror("sftmp failed");
/* ast ed does this */
if (!(f = sftmp(SF_BUFSIZE)))
terror("sftmp");
terror("put record size %I*d expected %d",
terror("put record size %I*d offset %I*d expected %I*d",
terror("skip block size %d offset %I*d expected %I*d",
sfclose(f);
/* let two run concurrently */
return 0;
s = sfreserve(f,SF_UNBOUND,0);
if(sfvalue(f) != 5)
if(s = sfreserve(f,SF_UNBOUND,0))
strcpy(s,"5678\n");
terror("Get wrong string");
sfclose(f);
if(!(f = sftmp(0)) )
terror("sftmp");
if(Count != 1)
sfclose(f);
if(Count != 2)
if(!(f = sftmp(8)) )
terror("sftmp");
if(Count != 2)
if(Count != 3)
sfclose(f);
if(Count != 4)
if(!(f = sftmp(8)) )
terror("sftmp");
if(Count != 4)
if(Count != 5)
sfclose(f);
if(Count != 6)
if(!(f = sftmp(1024)) )
terror("sftmp");
if(sfsize(f) != 10)
terror("Wrong size");
sfdisc(f,SF_POPDISC);
if(sfsize(f) != 10)
terror("Wrong size");
s = sfreserve(f,SF_UNBOUND,0);
terror("did not create correct real file");
if(pid != 0)
texit(0);
}