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

index f5eb571c471cf6cce4c14db92c23dfdb7c484b74..708b8b3718f39d2a8163c03a757c24bfc4c31fda 100644 (file)
@@ -16,7 +16,7 @@ libsfio_C_la_SOURCES = sfclose.c sfcvt.c sfdisc.c \
        sfprintf.c \
        sfputr.c sfraise.c sfrd.c sfread.c \
        sfresize.c sfscanf.c sfseek.c sfsetbuf.c sfsetfd.c \
-       sfsize.c sfsk.c sfstack.c sfstrtod.c sfswap.c sfsync.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 c533cafe77b9ce673b18b571b4a8365ac8106fec..025040b3694aa4f03dc3411d5cd3be361c7e518c 100644 (file)
@@ -331,7 +331,6 @@ extern "C" {
     extern int _sffilbuf(Sfio_t *, int);
 
 /* miscellaneous function analogues of fast in-line functions */
-    extern Sfoff_t sfsize(Sfio_t *);
     extern int sffileno(Sfio_t *);
     extern ssize_t sfslen(void);
 
index c42e669f4b6479e84e57336fde171334f7d9e6bb..2d8e2da289efa85f2e31916824e0ad880dac61ec 100644 (file)
     <ClCompile Include="sfseek.c" />
     <ClCompile Include="sfsetbuf.c" />
     <ClCompile Include="sfsetfd.c" />
-    <ClCompile Include="sfsize.c" />
     <ClCompile Include="sfsk.c" />
     <ClCompile Include="sfstack.c" />
     <ClCompile Include="sfstrtod.c" />
index c3c86e8c6b1b308067b95fde9daad6b0d404e786..366224108f85877ef8aec5bf3973170eba77de70 100644 (file)
     <ClCompile Include="sfsetfd.c">
       <Filter>Source Files</Filter>
     </ClCompile>
-    <ClCompile Include="sfsize.c">
-      <Filter>Source Files</Filter>
-    </ClCompile>
     <ClCompile Include="sfsk.c">
       <Filter>Source Files</Filter>
     </ClCompile>
diff --git a/lib/sfio/sfsize.c b/lib/sfio/sfsize.c
deleted file mode 100644 (file)
index 5afa218..0000000
+++ /dev/null
@@ -1,89 +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>
-
-/*     Get the size of a stream.
-**
-**     Written by Kiem-Phong Vo.
-*/
-Sfoff_t sfsize(Sfio_t * f)
-{
-    Sfdisc_t *disc;
-    int mode;
-    Sfoff_t s;
-
-    SFMTXSTART(f, (Sfoff_t) (-1));
-
-    if ((mode = f->mode & SF_RDWR) != (int) f->mode
-       && _sfmode(f, mode, 0) < 0)
-       SFMTXRETURN(f, (Sfoff_t) (-1));
-
-    if (f->flags & SF_STRING) {
-       SFSTRSIZE(f);
-       SFMTXRETURN(f, f->extent);
-    }
-
-    SFLOCK(f, 0);
-
-    s = f->here;
-
-    if (f->extent >= 0) {
-       if (f->flags & (SF_SHARE | SF_APPENDWR)) {
-           for (disc = f->disc; disc; disc = disc->disc)
-               if (disc->seekf)
-                   break;
-           if (!HAVE_SYS_STAT_H || disc) {
-               Sfoff_t e;
-               if ((e = SFSK(f, 0, SEEK_END, disc)) >= 0)
-                   f->extent = e;
-               if (SFSK(f, f->here, SEEK_SET, disc) != f->here)
-                   f->here = SFSK(f, (Sfoff_t) 0, SEEK_CUR, disc);
-           }
-#ifdef HAVE_SYS_STAT_H
-           else {
-               Stat_t st;
-               if (fstat(f->file, &st) < 0)
-                   f->extent = -1;
-               else if ((f->extent = st.st_size) < f->here)
-                   f->here = SFSK(f, (Sfoff_t) 0, SEEK_CUR, disc);
-           }
-#endif
-       }
-
-       if ((f->flags & (SF_SHARE | SF_PUBLIC)) == (SF_SHARE | SF_PUBLIC))
-           f->here = SFSK(f, (Sfoff_t) 0, SEEK_CUR, f->disc);
-    }
-
-    if (f->here != s && (f->mode & SF_READ)) { /* buffered data is known to be invalid */
-       f->next = f->endb = f->endr = f->endw = f->data;
-    }
-
-    if (f->here < 0)
-       f->extent = -1;
-    else if (f->extent < f->here)
-       f->extent = f->here;
-
-    if ((s = f->extent) >= 0) {
-       if (f->flags & SF_APPENDWR)
-           s += (f->next - f->data);
-       else if (f->mode & SF_WRITE) {
-           s = f->here + (f->next - f->data);
-           if (s < f->extent)
-               s = f->extent;
-       }
-    }
-
-    SFOPEN(f, 0);
-    SFMTXRETURN(f, s);
-}