noinst_HEADERS = sfhdr.h sfio.h sfio_t.h vthread.h
noinst_LTLIBRARIES = libsfio_C.la
-libsfio_C_la_SOURCES = sfclose.c sfclrlock.c sfcvt.c sfdisc.c \
+libsfio_C_la_SOURCES = sfclose.c sfcvt.c sfdisc.c \
sfexcept.c sfexit.c sfextern.c sffilbuf.c \
sfflsbuf.c sfgetd.c sfgetl.c sfgetm.c sfgetr.c sfgetu.c \
sfmode.c sfnew.c sfnotify.c \
+++ /dev/null
-/* $Id$ $Revision$ */
-/* vim:set shiftwidth=4 ts=8: */
-
-/*************************************************************************
- * Copyright (c) 2011 AT&T Intellectual Property
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors: See CVS logs. Details at http://www.graphviz.org/
- *************************************************************************/
-
-#include <sfio/sfhdr.h>
-
-/* Function to clear a locked stream.
-** This is useful for programs that longjmp from the mid of an sfio function.
-** There is no guarantee on data integrity in such a case.
-**
-** Written by Kiem-Phong Vo
-*/
-int sfclrlock(Sfio_t * f)
-{
- int rv;
-
- /* already closed */
- if (f && (f->mode & SF_AVAIL))
- return 0;
-
- SFMTXSTART(f, 0);
-
- /* clear error bits */
- f->flags &= (unsigned short)~(SF_ERROR | SF_EOF);
-
- /* clear peek locks */
- if (f->mode & SF_PKRD) {
- f->here -= f->endb - f->next;
- f->endb = f->next;
- }
-
- SFCLRBITS(f);
-
- /* throw away all lock bits except for stacking state SF_PUSH */
- f->mode &=
- (SF_RDWR | SF_INIT | SF_POOL | SF_PUSH | SF_SYNCED | SF_STDIO);
-
- rv = (f->mode & SF_PUSH) ? 0 : (f->flags & SF_FLAGS);
-
- SFMTXRETURN(f, rv);
-}
/* on closing, don't be a hero about reread/rewrite on interrupts */
#define SF_ENDING 00000400
-/* private flags that must be cleared in sfclrlock */
#define SF_DCDOWN 00001000 /* recurse down the discipline stack */
-#define SF_MVSIZE 00002000
-#define SFMVSET(f) (((f)->size *= SF_NMAP), ((f)->bits |= SF_MVSIZE) )
-#define SFMVUNSET(f) (!((f)->bits&SF_MVSIZE) ? 0 : \
- (((f)->bits &= (unsigned short)~SF_MVSIZE), ((f)->size /= SF_NMAP)) )
-#define SFCLRBITS(f) (SFMVUNSET(f), ((f)->bits &= (unsigned short)~(SF_DCDOWN|SF_MVSIZE)) )
/* bits for the mode field, SF_INIT defined in sfio_t.h */
#define SF_RC 00000010u /* peeking for a record */
#define SFDIRECT(f,n) (((ssize_t)(n) >= (f)->size) || \
((n) >= SF_GRAIN && (ssize_t)(n) >= (f)->size/16 ) )
-/* number of pages to memory map at a time */
-#define SF_NMAP 8
-
/* the bottomless bit bucket */
#define DEVNULL "/dev/null"
#define SFSETNULL(f) ((f)->extent = (Sfoff_t)(-1), (f)->bits |= SF_NULL)
extern int sfpoll(Sfio_t **, int, int);
extern void *sfreserve(Sfio_t *, ssize_t, int);
extern int sfsync(Sfio_t *);
- extern int sfclrlock(Sfio_t *);
extern void *sfsetbuf(Sfio_t *, void *, size_t);
extern Sfdisc_t *sfdisc(Sfio_t *, Sfdisc_t *);
extern int sfraise(Sfio_t *, int, void *);
</ItemGroup>
<ItemGroup>
<ClCompile Include="sfclose.c" />
- <ClCompile Include="sfclrlock.c" />
<ClCompile Include="sfcvt.c" />
<ClCompile Include="sfdisc.c" />
<ClCompile Include="sfexcept.c" />
<ClCompile Include="sfclose.c">
<Filter>Source Files</Filter>
</ClCompile>
- <ClCompile Include="sfclrlock.c">
- <Filter>Source Files</Filter>
- </ClCompile>
<ClCompile Include="sfcvt.c">
<Filter>Source Files</Filter>
</ClCompile>