]> granicus.if.org Git - graphviz/commitdiff
remove unused sfset()
authorMatthew Fernandez <matthew.fernandez@gmail.com>
Sat, 10 Oct 2020 00:29:14 +0000 (17:29 -0700)
committerMatthew Fernandez <matthew.fernandez@gmail.com>
Fri, 16 Oct 2020 03:01:20 +0000 (20:01 -0700)
lib/sfio/Makefile.am
lib/sfio/sfio.h
lib/sfio/sfio.vcxproj
lib/sfio/sfio.vcxproj.filters
lib/sfio/sfset.c [deleted file]

index 7d4e07e9191582427638effd9483fbebf9d54d77..f5eb571c471cf6cce4c14db92c23dfdb7c484b74 100644 (file)
@@ -15,7 +15,7 @@ libsfio_C_la_SOURCES = sfclose.c sfcvt.c sfdisc.c \
        sfnputc.c sfopen.c sfpkrd.c \
        sfprintf.c \
        sfputr.c sfraise.c sfrd.c sfread.c \
-       sfresize.c sfscanf.c sfseek.c sfset.c sfsetbuf.c sfsetfd.c \
+       sfresize.c sfscanf.c sfseek.c sfsetbuf.c sfsetfd.c \
        sfsize.c sfsk.c sfstack.c sfstrtod.c sfswap.c sfsync.c \
        sftable.c sftell.c sftmp.c sfungetc.c sfvprintf.c \
        sfvscanf.c sfwr.c sfwrite.c
index a2242b405499bc47f9b856713f7ef6f7318a4ff9..c533cafe77b9ce673b18b571b4a8365ac8106fec 100644 (file)
@@ -297,7 +297,6 @@ extern "C" {
     extern void *sfsetbuf(Sfio_t *, void *, size_t);
     extern Sfdisc_t *sfdisc(Sfio_t *, Sfdisc_t *);
     extern int sfraise(Sfio_t *, int, void *);
-    extern int sfset(Sfio_t *, int, int);
     extern int sfsetfd(Sfio_t *, int);
     extern ssize_t sfread(Sfio_t *, void *, size_t);
     extern ssize_t sfwrite(Sfio_t *, const void *, size_t);
index 52e914e1fc7c56e1f2eba109a150697629c80f39..c42e669f4b6479e84e57336fde171334f7d9e6bb 100644 (file)
     <ClCompile Include="sfresize.c" />
     <ClCompile Include="sfscanf.c" />
     <ClCompile Include="sfseek.c" />
-    <ClCompile Include="sfset.c" />
     <ClCompile Include="sfsetbuf.c" />
     <ClCompile Include="sfsetfd.c" />
     <ClCompile Include="sfsize.c" />
index c46040831cdd17a70a4f7e06ea5773bd910f99cb..c3c86e8c6b1b308067b95fde9daad6b0d404e786 100644 (file)
     <ClCompile Include="sfseek.c">
       <Filter>Source Files</Filter>
     </ClCompile>
-    <ClCompile Include="sfset.c">
-      <Filter>Source Files</Filter>
-    </ClCompile>
     <ClCompile Include="sfsetbuf.c">
       <Filter>Source Files</Filter>
     </ClCompile>
diff --git a/lib/sfio/sfset.c b/lib/sfio/sfset.c
deleted file mode 100644 (file)
index cbff5e6..0000000
+++ /dev/null
@@ -1,76 +0,0 @@
-/* $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>
-
-/*     Set some control flags or file descript for the stream
-**
-**     Written by Kiem-Phong Vo.
-*/
-
-int sfset(Sfio_t * f, int flags, int set)
-{
-    int oflags;
-
-    SFMTXSTART(f, 0);
-
-    if (flags == 0 && set == 0)
-       SFMTXRETURN(f, (f->flags & SF_FLAGS));
-
-    if ((oflags = (f->mode & SF_RDWR)) != (int) f->mode
-       && _sfmode(f, oflags, 0) < 0)
-       SFMTXRETURN(f, 0);
-
-    if (flags == 0)
-       SFMTXRETURN(f, (f->flags & SF_FLAGS));
-
-    SFLOCK(f, 0);
-
-    /* preserve at least one rd/wr flag */
-    oflags = f->flags;
-    if (!(f->bits & SF_BOTH) || (flags & SF_RDWR) == SF_RDWR)
-       flags &= ~SF_RDWR;
-
-    /* set the flag */
-    if (set)
-       f->flags |= (flags & SF_SETS);
-    else
-       f->flags &= (unsigned short)~(flags & SF_SETS);
-
-    /* must have at least one of read/write */
-    if (!(f->flags & SF_RDWR))
-       f->flags |= (oflags & SF_RDWR);
-
-    if (f->extent < 0)
-       f->flags &= ~SF_APPENDWR;
-
-    /* turn to appropriate mode as necessary */
-    if ((flags &= SF_RDWR)) {
-       if (!set) {
-           if (flags == SF_READ)
-               flags = SF_WRITE;
-           else
-               flags = SF_READ;
-       }
-       if ((flags == SF_WRITE && !(f->mode & SF_WRITE)) ||
-           (flags == SF_READ && !(f->mode & (SF_READ | SF_SYNCED))))
-           (void) _sfmode(f, flags, 1);
-    }
-
-    /* if not shared or unseekable, public means nothing */
-    if (!(f->flags & SF_SHARE) || f->extent < 0)
-       f->flags &= (unsigned short)~SF_PUBLIC;
-
-    SFOPEN(f, 0);
-    SFMTXRETURN(f, (oflags & SF_FLAGS));
-}