]> granicus.if.org Git - graphviz/commitdiff
remove unused sfpurge()
authorMatthew Fernandez <matthew.fernandez@gmail.com>
Sat, 10 Oct 2020 00:23:21 +0000 (17:23 -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/sfpurge.c [deleted file]

index 7ff3f5c8bd3c6ee9083900d514f1ce2c861309a2..7d4e07e9191582427638effd9483fbebf9d54d77 100644 (file)
@@ -13,7 +13,7 @@ libsfio_C_la_SOURCES = sfclose.c sfcvt.c sfdisc.c \
        sfflsbuf.c \
        sfmode.c sfnew.c \
        sfnputc.c sfopen.c sfpkrd.c \
-       sfprintf.c sfpurge.c \
+       sfprintf.c \
        sfputr.c sfraise.c sfrd.c sfread.c \
        sfresize.c sfscanf.c sfseek.c sfset.c sfsetbuf.c sfsetfd.c \
        sfsize.c sfsk.c sfstack.c sfstrtod.c sfswap.c sfsync.c \
index e7f9f3d9665fd4855cc7431aa1e3a81d657c9f12..a2242b405499bc47f9b856713f7ef6f7318a4ff9 100644 (file)
@@ -245,7 +245,6 @@ extern "C" {
 #define SF_DPOLL       7       /* see if stream is ready for I/O       */
 #define SF_DBUFFER     8       /* buffer not empty during push or pop  */
 #define SF_SYNC                9       /* announcing start/end synchronization */
-#define SF_PURGE       10      /* a sfpurge() call was issued          */
 #define SF_FINAL       11      /* closing is done except stream free   */
 #define SF_READY       12      /* a polled stream is ready             */
 #define SF_LOCKED      13      /* stream is in a locked state          */
@@ -294,7 +293,6 @@ extern "C" {
     extern Sfio_t *sfopen(Sfio_t *, const char *, const char *);
     extern Sfio_t *sfstack(Sfio_t *, Sfio_t *);
     extern Sfio_t *sfswap(Sfio_t *, Sfio_t *);
-    extern int sfpurge(Sfio_t *);
     extern int sfsync(Sfio_t *);
     extern void *sfsetbuf(Sfio_t *, void *, size_t);
     extern Sfdisc_t *sfdisc(Sfio_t *, Sfdisc_t *);
index ac93e48afa8f1ad4e0b9995d3dcc3c4b07252624..52e914e1fc7c56e1f2eba109a150697629c80f39 100644 (file)
     <ClCompile Include="sfopen.c" />
     <ClCompile Include="sfpkrd.c" />
     <ClCompile Include="sfprintf.c" />
-    <ClCompile Include="sfpurge.c" />
     <ClCompile Include="sfputr.c" />
     <ClCompile Include="sfraise.c" />
     <ClCompile Include="sfrd.c" />
index 15ea6f7fc0a42694b49d6798e86f2d350a1ac083..c46040831cdd17a70a4f7e06ea5773bd910f99cb 100644 (file)
@@ -83,9 +83,6 @@
     <ClCompile Include="sfprintf.c">
       <Filter>Source Files</Filter>
     </ClCompile>
-    <ClCompile Include="sfpurge.c">
-      <Filter>Source Files</Filter>
-    </ClCompile>
     <ClCompile Include="sfputr.c">
       <Filter>Source Files</Filter>
     </ClCompile>
diff --git a/lib/sfio/sfpurge.c b/lib/sfio/sfpurge.c
deleted file mode 100644 (file)
index 4fdc2ad..0000000
+++ /dev/null
@@ -1,73 +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>
-
-/*     Delete all pending data in the buffer
-**
-**     Written by Kiem-Phong Vo.
-*/
-
-int sfpurge(Sfio_t * f)
-{
-    int mode;
-
-    SFMTXSTART(f, -1);
-
-    if ((mode = f->mode & SF_RDWR) != (int) f->mode
-       && _sfmode(f, mode, 0) < 0)
-       SFMTXRETURN(f, -1);
-
-    if ((f->flags & SF_IOCHECK) && f->disc && f->disc->exceptf)
-       (void) (*f->disc->exceptf) (f, SF_PURGE, (void *) ((int) 1),
-                                   f->disc);
-
-    if (f->disc == _Sfudisc)
-       (void) sfclose((*_Sfstack) (f, NIL(Sfio_t *)));
-
-    /* cannot purge read string streams */
-    if ((f->flags & SF_STRING) && (f->mode & SF_READ))
-       goto done;
-
-    SFLOCK(f, 0);
-
-    switch (f->mode & ~SF_LOCK) {
-    default:
-       SFOPEN(f, 0);
-       SFMTXRETURN(f, -1);
-    case SF_WRITE:
-       f->next = f->data;
-       if (!f->proc || !(f->flags & SF_READ) || !(f->mode & SF_WRITE))
-           break;
-
-       /* 2-way pipe, must clear read buffer */
-       (void) _sfmode(f, SF_READ, 1);
-       /* fall through */
-    case SF_READ:
-       if (f->extent >= 0 && f->endb > f->next) {
-           f->here -= f->endb - f->next;
-           SFSK(f, f->here, SEEK_SET, f->disc);
-       }
-       f->endb = f->next = f->data;
-       break;
-    }
-
-    SFOPEN(f, 0);
-
-  done:
-    if ((f->flags & SF_IOCHECK) && f->disc && f->disc->exceptf)
-       (void) (*f->disc->exceptf) (f, SF_PURGE, (void *) ((int) 0),
-                                   f->disc);
-
-    SFMTXRETURN(f, 0);
-}