Revision: 75729
          http://sourceforge.net/p/brlcad/code/75729
Author:   starseeker
Date:     2020-05-07 17:21:13 +0000 (Thu, 07 May 2020)
Log Message:
-----------
Get bio.h out of public headers and fix windows build for lseek and friends.  
Passes make check on MSVC 2017, Linux GCC 9.2, Linux clang 9,  OSX (github 
runner), and OpenBSD (clang 8).

Modified Paths:
--------------
    brlcad/trunk/include/bio.h
    brlcad/trunk/include/brep/defines.h
    brlcad/trunk/include/bu/cmd.h
    brlcad/trunk/include/bu/file.h
    brlcad/trunk/include/bu/glob.h
    brlcad/trunk/include/bu/ptbl.h
    brlcad/trunk/include/bu/tc.h
    brlcad/trunk/include/bu/time.h
    brlcad/trunk/include/bu/vls.h
    brlcad/trunk/include/common.h
    brlcad/trunk/include/fb/fb_osgl.h
    brlcad/trunk/include/fb/fb_wgl.h
    brlcad/trunk/include/fb.h
    brlcad/trunk/include/ged/defines.h
    brlcad/trunk/include/nmg.h
    brlcad/trunk/include/rt/anim.h
    brlcad/trunk/include/rt/calc.h
    brlcad/trunk/include/rt/cmd.h
    brlcad/trunk/include/rt/db_fullpath.h
    brlcad/trunk/include/rt/db_instance.h
    brlcad/trunk/include/rt/db_internal.h
    brlcad/trunk/include/rt/db_io.h
    brlcad/trunk/include/rt/directory.h
    brlcad/trunk/include/rt/mater.h
    brlcad/trunk/include/rt/mem.h
    brlcad/trunk/include/rt/vlist.h
    brlcad/trunk/src/burst/ui.c
    brlcad/trunk/src/conv/asc/asc2g.c
    brlcad/trunk/src/conv/conv-vg2g.c
    brlcad/trunk/src/conv/dxf/dxf-g.c
    brlcad/trunk/src/conv/fast4-g.c
    brlcad/trunk/src/conv/g-acad.c
    brlcad/trunk/src/conv/iges/findp.c
    brlcad/trunk/src/conv/iges/g-iges.c
    brlcad/trunk/src/conv/iges/n_iges.cpp
    brlcad/trunk/src/conv/iges/n_iges.hpp
    brlcad/trunk/src/conv/iges/readrec.c
    brlcad/trunk/src/conv/iges/recsize.c
    brlcad/trunk/src/conv/nastran-g.c
    brlcad/trunk/src/conv/shp/shapelib/shpopen.c
    brlcad/trunk/src/conv/stl/g-stl.c
    brlcad/trunk/src/conv/vdeck/vdeck.c
    brlcad/trunk/src/fb/bw-fb.c
    brlcad/trunk/src/fb/fb-bw.c
    brlcad/trunk/src/fb/fb-pix.c
    brlcad/trunk/src/fb/fb-png.c
    brlcad/trunk/src/fb/fbcbars.c
    brlcad/trunk/src/fb/fbcmap.c
    brlcad/trunk/src/fb/fbcolor.c
    brlcad/trunk/src/fb/fbfade.c
    brlcad/trunk/src/fb/fbframe.c
    brlcad/trunk/src/fb/fbgrid.c
    brlcad/trunk/src/fb/fbpoint.c
    brlcad/trunk/src/fb/fbstretch.c
    brlcad/trunk/src/fb/fbzoom.c
    brlcad/trunk/src/fb/gif-fb.c
    brlcad/trunk/src/fb/gif2fb.c
    brlcad/trunk/src/fb/pix-fb.c
    brlcad/trunk/src/fb/plot3-fb.c
    brlcad/trunk/src/fb/png-fb.c
    brlcad/trunk/src/fb/spm-fb.c
    brlcad/trunk/src/gtools/ganalyze.cpp
    brlcad/trunk/src/halftone/main.c
    brlcad/trunk/src/libbu/file.c
    brlcad/trunk/src/libbu/vfont.c
    brlcad/trunk/src/libfb/fb_generic.c
    brlcad/trunk/src/libfb/fbserv_obj.c
    brlcad/trunk/src/libfb/if_X24.c
    brlcad/trunk/src/libfb/if_disk.c
    brlcad/trunk/src/libfb/if_tk.c
    brlcad/trunk/src/libgcv/plugins/fastgen4/fastgen4_read.c
    brlcad/trunk/src/libgcv/plugins/stl/stl_write.c
    brlcad/trunk/src/libged/bot_dump.c
    brlcad/trunk/src/libged/editit.c
    brlcad/trunk/src/libged/facetize_log.c
    brlcad/trunk/src/libged/fb2pix.c
    brlcad/trunk/src/libged/pix2fb.c
    brlcad/trunk/src/libged/tables.c
    brlcad/trunk/src/libicv/rot.c
    brlcad/trunk/src/librt/cache.c
    brlcad/trunk/src/librt/db5_scan.c
    brlcad/trunk/src/librt/db_corrupt.c
    brlcad/trunk/src/librt/db_io.c
    brlcad/trunk/src/librt/db_scan.c
    brlcad/trunk/src/librt/primitives/primitive_util.c
    brlcad/trunk/src/libtclcad/tclcad_obj.c
    brlcad/trunk/src/mged/cmd.c
    brlcad/trunk/src/mged/fbserv.c
    brlcad/trunk/src/mged/mged.c
    brlcad/trunk/src/mged/plot.c
    brlcad/trunk/src/remrt/remrt.c
    brlcad/trunk/src/remrt/rtsrv.c
    brlcad/trunk/src/rt/do.c
    brlcad/trunk/src/rt/main.c
    brlcad/trunk/src/rt/view.c
    brlcad/trunk/src/sig/ddisp.c
    brlcad/trunk/src/util/ap-pix.c
    brlcad/trunk/src/util/bw-a.c
    brlcad/trunk/src/util/bw-png.c
    brlcad/trunk/src/util/bwcrop.c
    brlcad/trunk/src/util/bwhist.c
    brlcad/trunk/src/util/bwhisteq.c
    brlcad/trunk/src/util/bwrot.c
    brlcad/trunk/src/util/bwscale.c
    brlcad/trunk/src/util/double-asc.c
    brlcad/trunk/src/util/dpix-pix.c
    brlcad/trunk/src/util/pix-png.c
    brlcad/trunk/src/util/pix-ppm.c
    brlcad/trunk/src/util/pixbgstrip.c
    brlcad/trunk/src/util/pixborder.c
    brlcad/trunk/src/util/pixbustup.c
    brlcad/trunk/src/util/pixcrop.c
    brlcad/trunk/src/util/pixelswap.c
    brlcad/trunk/src/util/pixhalve.c
    brlcad/trunk/src/util/pixhist.c
    brlcad/trunk/src/util/pixhist3d.c
    brlcad/trunk/src/util/pixmorph.c
    brlcad/trunk/src/util/pixrot.c
    brlcad/trunk/src/util/pixscale.c
    brlcad/trunk/src/util/plot3rot.c
    brlcad/trunk/src/util/wavelet.c

Property Changed:
----------------
    brlcad/trunk/
    brlcad/trunk/include/
    brlcad/trunk/src/libbu/
    brlcad/trunk/src/other/
    brlcad/trunk/src/other/libregex/

Index: brlcad/trunk
===================================================================
--- brlcad/trunk        2020-05-07 16:17:26 UTC (rev 75728)
+++ brlcad/trunk        2020-05-07 17:21:13 UTC (rev 75729)

Property changes on: brlcad/trunk
___________________________________________________________________
Modified: svn:mergeinfo
## -1,4 +1,5 ##
 
/brlcad/branches/RELEASE:57439,57447-57860,69901-69913,70323-70333,71915-72242,72525-72534,72826-72858,74376-74454,74964-75140,75682-75685
+/brlcad/branches/bioh:75720-75728
 
/brlcad/branches/brep-debug:61373,61375,61404,61427,61429,61470,61544,61567,61576,61999,62018,62094,62098,62107,62117,62406,62416-62519,62521-62584,62593-62614,62623,62658,62660-62674,62681-62771,62876,62901,62907,62910,62925,62928,62931-63025,63027,63051,63054-63056,63069,63071-63073,63122,63160-63161,63165,63171,63184,63187,63189-63190,63193-63196,63200,63202,63205-63210,63213,63219-63225,63232-63233,63236,63238,63338,63350-63353,63481,63618,63669,64173-64174,64176-64177,64229-64233,64242,64244,64360-64362,65165,65245,65249,65334,65833-65834,66370-66375,66931-66932,66934,67012-67015,67018-67019,67021-67022,67406,67740,67746-67748,67950,67952,68144-68145,68636,68640-68643,68820,69081,69109,69168,69206,69289,69346,69460-69461,69582-69583,69719-69721,69857-69859,69927,69995-69996,70148-70149,70347-70349,70377,70526-70527,71006-71007,71009-71022,71046-71047,71049,71096-71100
 /brlcad/branches/bullet:62518
 /brlcad/branches/cmake:43219
Index: brlcad/trunk/include
===================================================================
--- brlcad/trunk/include        2020-05-07 16:17:26 UTC (rev 75728)
+++ brlcad/trunk/include        2020-05-07 17:21:13 UTC (rev 75729)

Property changes on: brlcad/trunk/include
___________________________________________________________________
Modified: svn:mergeinfo
## -1,4 +1,5 ##
 
/brlcad/branches/RELEASE/include:57439,57447-57860,69901-69913,71915-72242,72525-72534,72826-72858,74376-74454,74964-75140
+/brlcad/branches/bioh/include:75720-75728
 
/brlcad/branches/brep-debug/include:61373,61375,61404,61427,61429,61470,61544,61567,61576,61999,62018,62094,62098,62107,62117,62406,62416-62519,62521-62584,62593-62614,62623,62658,62660-62674,62681-62771,62876,62901,62907,62910,62925,62928,62931-63025,63027,63051,63054-63056,63069,63071-63073,63122,63160-63161,63165,63171,63184,63187,63189-63190,63193-63196,63200,63202,63205-63210,63213,63219-63225,63232-63233,63236,63238,63338,63350-63353,63481,63618,63669,64173-64174,64176-64177,64229-64233,64242,64244,64360-64362,65165,65245,65249,65334,65833-65834,66370-66375,66931-66932,66934,67012-67015,67018-67019,67021-67022,67406,67740,67746-67748,67950,67952,68144-68145,68636,68640-68643,68820,69081,69109,69206,69289,69346,69460-69461,69582-69583,69719-69721,69857-69859,69927
 /brlcad/branches/bullet/include:62518
 /brlcad/branches/cmake/include:43219
Modified: brlcad/trunk/include/bio.h
===================================================================
--- brlcad/trunk/include/bio.h  2020-05-07 16:17:26 UTC (rev 75728)
+++ brlcad/trunk/include/bio.h  2020-05-07 17:21:13 UTC (rev 75729)
@@ -95,35 +95,6 @@
 #   define S_ISDIR(_st_mode) (((_st_mode) & S_IFMT) == S_IFDIR)
 #endif
 
-/* We want 64 bit (large file) I/O capabilities whenever they are available.
- * Always define this before we include sys/types.h */
-#ifndef _FILE_OFFSET_BITS
-#  define _FILE_OFFSET_BITS 64
-#endif
-#include <sys/types.h>
-
-/* off_t is 32 bit size even on 64 bit Windows. In the past we have tried to
- * force off_t to be 64 bit but this is failing on newer Windows/Visual Studio
- * verions in 2020 - therefore, we instead introduce the b_off_t define to
- * properly substitute the correct numerical type for the correct platform.  */
-#if defined(_WIN64)
-#  include <sys/stat.h>
-#  define b_off_t __int64
-#  define fseek _fseeki64
-#  define ftell _ftelli64
-#  define fstat _fstati64
-#  define lseek _lseeki64
-#  define stat  _stati64
-#elif defined (_WIN32)
-#  include <sys/stat.h>
-#  define b_off_t _off_t
-#  define fstat _fstat
-#  define lseek _lseek
-#  define stat  _stat
-#else
-#  define b_off_t off_t
-#endif
-
 #endif /* BIO_H */
 
 /** @} */

Modified: brlcad/trunk/include/brep/defines.h
===================================================================
--- brlcad/trunk/include/brep/defines.h 2020-05-07 16:17:26 UTC (rev 75728)
+++ brlcad/trunk/include/brep/defines.h 2020-05-07 17:21:13 UTC (rev 75729)
@@ -29,7 +29,25 @@
 
 #include "common.h"
 
-#include "bio.h" /* needed to include windows.h with protections */
+/* We need to include windows.h with protections,
+ * rather than having opennurbs.h do it */
+#ifdef HAVE_WINDOWS_H
+#  ifdef WIN32_LEAN_AND_MEAN
+#    undef WIN32_LEAN_AND_MEAN
+#  endif
+#  define WIN32_LEAN_AND_MEAN 434144 /* don't want winsock.h */
+
+#  ifdef NOMINMAX
+#    undef NOMINMAX
+#  endif
+#  define NOMINMAX 434144 /* don't break std::min and std::max */
+
+#  include <windows.h>
+
+#  undef WIN32_LEAN_AND_MEAN /* unset to not interfere with calling apps */
+#  undef NOMINMAX
+#endif
+
 #ifdef __cplusplus
 
 

Modified: brlcad/trunk/include/bu/cmd.h
===================================================================
--- brlcad/trunk/include/bu/cmd.h       2020-05-07 16:17:26 UTC (rev 75728)
+++ brlcad/trunk/include/bu/cmd.h       2020-05-07 17:21:13 UTC (rev 75729)
@@ -36,7 +36,6 @@
 #include <time.h>
 
 #include "bsocket.h" /* for timeval */
-#include "bio.h"
 
 #define BU_CMD_NULL (int (*)(void *, int, const char **))NULL
 

Modified: brlcad/trunk/include/bu/file.h
===================================================================
--- brlcad/trunk/include/bu/file.h      2020-05-07 16:17:26 UTC (rev 75728)
+++ brlcad/trunk/include/bu/file.h      2020-05-07 17:21:13 UTC (rev 75729)
@@ -164,6 +164,16 @@
  */
 BU_EXPORT extern char *bu_file_realpath(const char *path, char *resolved_path);
 
+/**
+ * Windows corecrt_io.h defines an lseek and an _lseeki64, with different 
function
+ * signatures, that cause trouble when we try to simply #define lseek 
_lseeki64.
+ *
+ * Similarly, _ftelli64 has a problematic signature.
+ */
+BU_EXPORT int bu_fseek(FILE *stream, b_off_t offset, int origin);
+BU_EXPORT b_off_t bu_lseek(int fd, b_off_t offset, int whence);
+BU_EXPORT b_off_t bu_ftell(FILE *stream);
+
 /** @} */
 
 __END_DECLS

Modified: brlcad/trunk/include/bu/glob.h
===================================================================
--- brlcad/trunk/include/bu/glob.h      2020-05-07 16:17:26 UTC (rev 75728)
+++ brlcad/trunk/include/bu/glob.h      2020-05-07 17:21:13 UTC (rev 75729)
@@ -23,8 +23,6 @@
 
 #include "common.h"
 
-#include "bio.h" /* for b_off_t */
-
 #include "bu/defines.h"
 #include "bu/vls.h"
 

Modified: brlcad/trunk/include/bu/ptbl.h
===================================================================
--- brlcad/trunk/include/bu/ptbl.h      2020-05-07 16:17:26 UTC (rev 75728)
+++ brlcad/trunk/include/bu/ptbl.h      2020-05-07 17:21:13 UTC (rev 75729)
@@ -24,7 +24,6 @@
 #include "common.h"
 
 #include <stddef.h> /* for size_t */
-#include "bio.h" /* for b_off_t */
 
 #include "bu/defines.h"
 #include "bu/magic.h"

Modified: brlcad/trunk/include/bu/tc.h
===================================================================
--- brlcad/trunk/include/bu/tc.h        2020-05-07 16:17:26 UTC (rev 75728)
+++ brlcad/trunk/include/bu/tc.h        2020-05-07 17:21:13 UTC (rev 75729)
@@ -35,7 +35,6 @@
 
 #include "common.h"
 #include "bu/defines.h"
-#include "bio.h"
 
 __BEGIN_DECLS
 
@@ -43,6 +42,21 @@
 #  include <pthread.h>
 #endif
 #if defined(HAVE_WINDOWS_H)
+#  ifdef WIN32_LEAN_AND_MEAN
+#    undef WIN32_LEAN_AND_MEAN
+#  endif
+#  define WIN32_LEAN_AND_MEAN 434144 /* don't want winsock.h */
+
+#  ifdef NOMINMAX
+#    undef NOMINMAX
+#  endif
+#  define NOMINMAX 434144 /* don't break std::min and std::max */
+
+#  include <windows.h>
+
+#  undef WIN32_LEAN_AND_MEAN /* unset to not interfere with calling apps */
+#  undef NOMINMAX
+
 #  include <process.h>
 #  include <sys/timeb.h>
 #endif

Modified: brlcad/trunk/include/bu/time.h
===================================================================
--- brlcad/trunk/include/bu/time.h      2020-05-07 16:17:26 UTC (rev 75728)
+++ brlcad/trunk/include/bu/time.h      2020-05-07 17:21:13 UTC (rev 75729)
@@ -25,7 +25,6 @@
 
 #include <stddef.h> /* for size_t */
 #include <stdlib.h> /* for getenv */
-#include "bio.h" /* for b_off_t */
 
 #include "bu/defines.h"
 #include "bu/vls.h"

Modified: brlcad/trunk/include/bu/vls.h
===================================================================
--- brlcad/trunk/include/bu/vls.h       2020-05-07 16:17:26 UTC (rev 75728)
+++ brlcad/trunk/include/bu/vls.h       2020-05-07 17:21:13 UTC (rev 75729)
@@ -22,10 +22,10 @@
 #define BU_VLS_H
 
 #include "common.h"
+#include <stdio.h> /* for FILE */
 #include <stddef.h> /* for size_t */
 #include <stdarg.h> /* For va_list */
 
-#include "bio.h" /* for FILE and off_t */
 
 #include "bu/defines.h"
 #include "bu/magic.h"

Modified: brlcad/trunk/include/common.h
===================================================================
--- brlcad/trunk/include/common.h       2020-05-07 16:17:26 UTC (rev 75728)
+++ brlcad/trunk/include/common.h       2020-05-07 17:21:13 UTC (rev 75729)
@@ -159,6 +159,12 @@
 #  define HAVE_U_TYPES 1
 #endif
 
+/* We want 64 bit (large file) I/O capabilities whenever they are available.
+ * Always define this before we include sys/types.h */
+#ifndef _FILE_OFFSET_BITS
+#  define _FILE_OFFSET_BITS 64
+#endif
+
 /**
  * C99 does not provide a ssize_t even though it is provided by SUS97.
  * regardless, we use it so make sure it's declared by using the
@@ -198,6 +204,24 @@
 #  endif
 #endif
 
+/* off_t is 32 bit size even on 64 bit Windows. In the past we have tried to
+ * force off_t to be 64 bit but this is failing on newer Windows/Visual Studio
+ * verions in 2020 - therefore, we instead introduce the b_off_t define to
+ * properly substitute the correct numerical type for the correct platform.  */
+#if defined(_WIN64)
+#  include <sys/stat.h>
+#  define b_off_t __int64
+#  define fstat _fstati64
+#  define stat  _stati64
+#elif defined (_WIN32)
+#  include <sys/stat.h>
+#  define b_off_t _off_t
+#  define fstat _fstat
+#  define stat  _stat
+#else
+#  define b_off_t off_t
+#endif
+
 /**
  * Provide a means to conveniently test the version of the GNU
  * compiler.  Use it like this:

Modified: brlcad/trunk/include/fb/fb_osgl.h
===================================================================
--- brlcad/trunk/include/fb/fb_osgl.h   2020-05-07 16:17:26 UTC (rev 75728)
+++ brlcad/trunk/include/fb/fb_osgl.h   2020-05-07 17:21:13 UTC (rev 75729)
@@ -54,8 +54,6 @@
 #  include <sys/wait.h>
 #endif
 
-#include "bio.h"
-
 #ifdef __cplusplus
 extern "C" {
 #endif

Modified: brlcad/trunk/include/fb/fb_wgl.h
===================================================================
--- brlcad/trunk/include/fb/fb_wgl.h    2020-05-07 16:17:26 UTC (rev 75728)
+++ brlcad/trunk/include/fb/fb_wgl.h    2020-05-07 17:21:13 UTC (rev 75729)
@@ -32,7 +32,22 @@
 #ifdef FB_USE_INTERNAL_API
 #ifdef IF_WGL
 #  include "common.h"
-#  include "bio.h"
+
+#  ifdef WIN32_LEAN_AND_MEAN
+#    undef WIN32_LEAN_AND_MEAN
+#  endif
+#  define WIN32_LEAN_AND_MEAN 434144 /* don't want winsock.h */
+
+#  ifdef NOMINMAX
+#    undef NOMINMAX
+#  endif
+#  define NOMINMAX 434144 /* don't break std::min and std::max */
+
+#  include <windows.h>
+
+#  undef WIN32_LEAN_AND_MEAN /* unset to not interfere with calling apps */
+#  undef NOMINMAX
+
 /* The wgl interface as currently implemented uses some
  * X11 types, supplied by Tk. */
 #  include <tk.h>

Modified: brlcad/trunk/include/fb.h
===================================================================
--- brlcad/trunk/include/fb.h   2020-05-07 16:17:26 UTC (rev 75728)
+++ brlcad/trunk/include/fb.h   2020-05-07 17:21:13 UTC (rev 75729)
@@ -54,9 +54,9 @@
 #if defined(HAVE_SYS_TIME_H)
 #  include <sys/time.h>
 #endif
+#include <stdio.h> /* for FILE */
 
 #include "bsocket.h"
-#include "bio.h"
 
 #include "tcl.h"
 #include "pkg.h"

Modified: brlcad/trunk/include/ged/defines.h
===================================================================
--- brlcad/trunk/include/ged/defines.h  2020-05-07 16:17:26 UTC (rev 75728)
+++ brlcad/trunk/include/ged/defines.h  2020-05-07 17:21:13 UTC (rev 75729)
@@ -29,7 +29,6 @@
 #define GED_DEFINES_H
 
 #include "common.h"
-#include "bio.h"
 #include "bu/hash.h"
 #include "bu/list.h"
 #include "bu/process.h"

Modified: brlcad/trunk/include/nmg.h
===================================================================
--- brlcad/trunk/include/nmg.h  2020-05-07 16:17:26 UTC (rev 75728)
+++ brlcad/trunk/include/nmg.h  2020-05-07 17:21:13 UTC (rev 75729)
@@ -67,6 +67,9 @@
 
 #include "common.h"
 
+/* system headers */
+#include <stdio.h> /* for FILE */
+
 /* interface headers */
 #include "vmath.h"
 #include "bu/list.h"
@@ -78,10 +81,7 @@
 #include "bn/vlist.h"
 #include "vmath.h"
 
-/* system headers */
-#include "bio.h" /* for FILE */
 
-
 #ifndef NMG_EXPORT
 #  if defined(NMG_DLL_EXPORTS) && defined(NMG_DLL_IMPORTS)
 #    error "Only NMG_DLL_EXPORTS or NMG_DLL_IMPORTS can be defined, not both."

Modified: brlcad/trunk/include/rt/anim.h
===================================================================
--- brlcad/trunk/include/rt/anim.h      2020-05-07 16:17:26 UTC (rev 75728)
+++ brlcad/trunk/include/rt/anim.h      2020-05-07 17:21:13 UTC (rev 75729)
@@ -26,6 +26,9 @@
 
 #include "common.h"
 
+/* system headers */
+#include <stdio.h> /* for FILE */
+
 /* interface headers */
 #include "vmath.h"
 #include "bu/vls.h"
@@ -34,9 +37,6 @@
 #include "rt/mater.h"
 #include "rt/db_fullpath.h"
 
-/* system headers */
-#include "bio.h" /* for FILE */
-
 __BEGIN_DECLS
 
 struct db_i; /* forward declaration */

Modified: brlcad/trunk/include/rt/calc.h
===================================================================
--- brlcad/trunk/include/rt/calc.h      2020-05-07 16:17:26 UTC (rev 75728)
+++ brlcad/trunk/include/rt/calc.h      2020-05-07 17:21:13 UTC (rev 75729)
@@ -28,14 +28,14 @@
 
 #include "common.h"
 
+/* system headers */
+#include <stdio.h> /* for FILE */
+
 /* interface headers */
 #include "vmath.h"
 #include "bu/vls.h"
 #include "bn/poly.h"
 
-/* system headers */
-#include "bio.h" /* for FILE */
-
 __BEGIN_DECLS
 
 /* apply a matrix transformation */

Modified: brlcad/trunk/include/rt/cmd.h
===================================================================
--- brlcad/trunk/include/rt/cmd.h       2020-05-07 16:17:26 UTC (rev 75728)
+++ brlcad/trunk/include/rt/cmd.h       2020-05-07 17:21:13 UTC (rev 75729)
@@ -26,14 +26,14 @@
 
 #include "common.h"
 
+/* system headers */
+#include <stdio.h> /* for FILE */
+
 /* interface headers */
 #include "vmath.h"
 #include "rt/defines.h"
 #include "rt/rt_instance.h"
 
-/* system headers */
-#include "bio.h" /* for FILE */
-
 __BEGIN_DECLS
 
 /**

Modified: brlcad/trunk/include/rt/db_fullpath.h
===================================================================
--- brlcad/trunk/include/rt/db_fullpath.h       2020-05-07 16:17:26 UTC (rev 
75728)
+++ brlcad/trunk/include/rt/db_fullpath.h       2020-05-07 17:21:13 UTC (rev 
75729)
@@ -22,7 +22,6 @@
 #define RT_DB_FULLPATH_H
 
 #include "common.h"
-#include "bio.h" /* for b_off_t */
 #include "bu/vls.h"
 #include "rt/defines.h"
 

Modified: brlcad/trunk/include/rt/db_instance.h
===================================================================
--- brlcad/trunk/include/rt/db_instance.h       2020-05-07 16:17:26 UTC (rev 
75728)
+++ brlcad/trunk/include/rt/db_instance.h       2020-05-07 17:21:13 UTC (rev 
75729)
@@ -25,8 +25,10 @@
 #define RT_DB_INSTANCE_H
 
 #include "common.h"
-#include "bio.h" /* for b_off_t */
 
+/* system headers */
+#include <stdio.h> /* for FILE */
+
 /* interface headers */
 #include "bu/magic.h"
 #include "bu/file.h"
@@ -36,9 +38,6 @@
 #include "rt/directory.h"
 #include "rt/anim.h"
 
-/* system headers */
-#include "bio.h" /* for FILE */
-
 __BEGIN_DECLS
 
 struct rt_wdb; /* forward declaration */

Modified: brlcad/trunk/include/rt/db_internal.h
===================================================================
--- brlcad/trunk/include/rt/db_internal.h       2020-05-07 16:17:26 UTC (rev 
75728)
+++ brlcad/trunk/include/rt/db_internal.h       2020-05-07 17:21:13 UTC (rev 
75729)
@@ -26,6 +26,9 @@
 
 #include "common.h"
 
+/* system headers */
+#include <stdio.h> /* for FILE */
+
 /* interface headers */
 #include "bu/magic.h"
 #include "bu/avs.h"
@@ -33,9 +36,6 @@
 #include "rt/defines.h"
 #include "rt/resource.h"
 
-/* system headers */
-#include "bio.h" /* for FILE */
-
 __BEGIN_DECLS
 
 struct rt_functab; /* forward declaration */

Modified: brlcad/trunk/include/rt/db_io.h
===================================================================
--- brlcad/trunk/include/rt/db_io.h     2020-05-07 16:17:26 UTC (rev 75728)
+++ brlcad/trunk/include/rt/db_io.h     2020-05-07 17:21:13 UTC (rev 75729)
@@ -26,6 +26,9 @@
 
 #include "common.h"
 
+/* system headers */
+#include <stdio.h> /* for FILE */
+
 /* interface headers */
 #include "vmath.h"
 #include "bu/avs.h"
@@ -32,9 +35,6 @@
 #include "rt/db5.h"
 #include "rt/defines.h"
 
-/* system headers */
-#include "bio.h" /* for FILE, b_off_t */
-
 __BEGIN_DECLS
 
 

Modified: brlcad/trunk/include/rt/directory.h
===================================================================
--- brlcad/trunk/include/rt/directory.h 2020-05-07 16:17:26 UTC (rev 75728)
+++ brlcad/trunk/include/rt/directory.h 2020-05-07 17:21:13 UTC (rev 75729)
@@ -25,7 +25,6 @@
 #define RT_DIRECTORY_H
 
 #include "common.h"
-#include "bio.h" /* for b_off_T */
 #include "vmath.h"
 #include "bu/list.h"
 #include "rt/anim.h"

Modified: brlcad/trunk/include/rt/mater.h
===================================================================
--- brlcad/trunk/include/rt/mater.h     2020-05-07 16:17:26 UTC (rev 75728)
+++ brlcad/trunk/include/rt/mater.h     2020-05-07 17:21:13 UTC (rev 75729)
@@ -25,7 +25,6 @@
 #define RT_MATER_H
 
 #include "common.h"
-#include "bio.h" /* for b_off_t */
 #include "rt/defines.h"
 #include "bu/vls.h"
 

Modified: brlcad/trunk/include/rt/mem.h
===================================================================
--- brlcad/trunk/include/rt/mem.h       2020-05-07 16:17:26 UTC (rev 75728)
+++ brlcad/trunk/include/rt/mem.h       2020-05-07 17:21:13 UTC (rev 75729)
@@ -25,7 +25,6 @@
 #define RT_MEM_H
 
 #include "common.h"
-#include "bio.h" /* for b_off_t */
 #include "vmath.h"
 #include "rt/defines.h"
 

Modified: brlcad/trunk/include/rt/vlist.h
===================================================================
--- brlcad/trunk/include/rt/vlist.h     2020-05-07 16:17:26 UTC (rev 75728)
+++ brlcad/trunk/include/rt/vlist.h     2020-05-07 17:21:13 UTC (rev 75729)
@@ -26,14 +26,13 @@
 
 #include "common.h"
 
+/* system headers */
+#include <stdio.h> /* for FILE */
+
 /* interface headers */
 #include "vmath.h"
 #include "bu/vls.h"
 
-/* system headers */
-#include "bio.h" /* for FILE */
-
-
 __BEGIN_DECLS
 
 /**

Modified: brlcad/trunk/src/burst/ui.c
===================================================================
--- brlcad/trunk/src/burst/ui.c 2020-05-07 16:17:26 UTC (rev 75728)
+++ brlcad/trunk/src/burst/ui.c 2020-05-07 17:21:13 UTC (rev 75729)
@@ -26,12 +26,12 @@
 #include "common.h"
 
 #include <assert.h>
-#include <stdio.h>
 #include <signal.h>
-#include <fcntl.h>
 #include <sys/types.h>
 #include <sys/stat.h>
 
+#include "bio.h"
+
 #include "vmath.h"
 #include "raytrace.h"
 

Modified: brlcad/trunk/src/conv/asc/asc2g.c
===================================================================
--- brlcad/trunk/src/conv/asc/asc2g.c   2020-05-07 16:17:26 UTC (rev 75728)
+++ brlcad/trunk/src/conv/asc/asc2g.c   2020-05-07 17:21:13 UTC (rev 75729)
@@ -1049,7 +1049,7 @@
     name = bu_strdup(cp);
 
     /* Count up the number of poly data lines which follow */
-    startpos = ftell(ifp);
+    startpos = bu_ftell(ifp);
     for (nlines = 0;; nlines++) {
        if (bu_fgets(buf, BUFSIZE, ifp) == NULL) break;
        if (buf[0] != ID_P_DATA) break; /* 'Q' */
@@ -1065,7 +1065,7 @@
     pg->max_npts = 0;
 
     /* Return to first 'Q' record */
-    fseek(ifp, startpos, 0);
+    bu_fseek(ifp, startpos, 0);
 
     for (nlines = 0; nlines < pg->npoly; nlines++) {
        struct rt_pg_face_internal *fp = &pg->poly[nlines];

Modified: brlcad/trunk/src/conv/conv-vg2g.c
===================================================================
--- brlcad/trunk/src/conv/conv-vg2g.c   2020-05-07 16:17:26 UTC (rev 75728)
+++ brlcad/trunk/src/conv/conv-vg2g.c   2020-05-07 17:21:13 UTC (rev 75729)
@@ -107,7 +107,7 @@
            bu_strlcpy(rec.i.i_version, ID_VERSION, sizeof(rec.i.i_version));
        }
     } else {
-       lseek(ifd, 0, 0);
+       bu_lseek(ifd, 0, 0);
        /* have an old vged file to convert */
 
        /* units are important now because:
@@ -206,7 +206,7 @@
            case ID_ARS_A:
                if (rec.a.a_name[0] == '\0') {
                    /* Skip deleted junk */
-                   lseek(ifd, (b_off_t)(rec.a.a_totlen * sizeof(rec)), 1);
+                   bu_lseek(ifd, (b_off_t)(rec.a.a_totlen * sizeof(rec)), 1);
                    goto top;
                }
                rec.a.a_xmin *= factor;

Modified: brlcad/trunk/src/conv/dxf/dxf-g.c
===================================================================
--- brlcad/trunk/src/conv/dxf/dxf-g.c   2020-05-07 16:17:26 UTC (rev 75728)
+++ brlcad/trunk/src/conv/dxf/dxf-g.c   2020-05-07 17:21:13 UTC (rev 75729)
@@ -629,7 +629,7 @@
            } else if (!bu_strncmp(line, "BLOCK", 5)) {
                /* start of a new block */
                BU_ALLOC(curr_block, struct block_list);
-               curr_block->offset = ftell(dxf);
+               curr_block->offset = bu_ftell(dxf);
                BU_LIST_INSERT(&(block_head), &(curr_block->l));
                break;
            }
@@ -1109,7 +1109,7 @@
                    break;
                }
                bu_free((char *)tmp_state, "curr_state");
-               fseek(dxf, curr_state->file_offset, SEEK_SET);
+               bu_fseek(dxf, curr_state->file_offset, SEEK_SET);
                curr_state->sub_state = UNKNOWN_ENTITY_STATE;
                if (verbose) {
                    bu_log("Popped state at end of inserted block (seeked to 
%jd)\n", (intmax_t)curr_state->file_offset);
@@ -1223,7 +1223,7 @@
                BU_LIST_PUSH(&state_stack, &(curr_state->l));
                curr_state = new_state;
                new_state = NULL;
-               fseek(dxf, curr_state->curr_block->offset, SEEK_SET);
+               bu_fseek(dxf, curr_state->curr_block->offset, SEEK_SET);
                curr_state->state = ENTITIES_SECTION;
                curr_state->sub_state = UNKNOWN_ENTITY_STATE;
                if (verbose) {
@@ -2504,7 +2504,7 @@
                    BU_LIST_PUSH(&state_stack, &(curr_state->l));
                    curr_state = new_state;
                    new_state = NULL;
-                   fseek(dxf, curr_state->curr_block->offset, SEEK_SET);
+                   bu_fseek(dxf, curr_state->curr_block->offset, SEEK_SET);
                    curr_state->state = ENTITIES_SECTION;
                    curr_state->sub_state = UNKNOWN_ENTITY_STATE;
                    if (verbose) {
@@ -3083,7 +3083,7 @@
     size_t line_len;
     static int line_num = 0;
 
-    curr_state->file_offset = ftell(dxf);
+    curr_state->file_offset = bu_ftell(dxf);
 
     if (bu_fgets(line, MAX_LINE_SIZE, dxf) == NULL) {
        return ERROR_FLAG;

Modified: brlcad/trunk/src/conv/fast4-g.c
===================================================================
--- brlcad/trunk/src/conv/fast4-g.c     2020-05-07 16:17:26 UTC (rev 75728)
+++ brlcad/trunk/src/conv/fast4-g.c     2020-05-07 17:21:13 UTC (rev 75729)
@@ -2065,7 +2065,7 @@
     b_off_t section_start;
 
     /* skip to start of next section */
-    section_start = ftell(fpin);
+    section_start = bu_ftell(fpin);
     if (section_start < 0) {
        bu_exit(1, "Error: couldn't get input file's current file position.\n");
     }
@@ -2076,7 +2076,7 @@
               bu_strncmp(line, "WALL", 4) &&
               bu_strncmp(line, "VEHICLE", 7))
        {
-           section_start = ftell(fpin);
+           section_start = bu_ftell(fpin);
            if (section_start < 0) {
                bu_exit(1, "Error: couldn't get input file's current file 
position.\n");
            }
@@ -2085,7 +2085,7 @@
        }
     }
     /* seek to start of the section */
-    fseek(fpin, section_start, SEEK_SET);
+    bu_fseek(fpin, section_start, SEEK_SET);
 }
 
 

Modified: brlcad/trunk/src/conv/g-acad.c
===================================================================
--- brlcad/trunk/src/conv/g-acad.c      2020-05-07 16:17:26 UTC (rev 75728)
+++ brlcad/trunk/src/conv/g-acad.c      2020-05-07 17:21:13 UTC (rev 75729)
@@ -649,7 +649,7 @@
     /* Write out number of facet entities to .facet file */
 
     rewind(fp);
-    fseek(fp, 46, 0); /* Re-position pointer to 2nd line */
+    bu_fseek(fp, 46, 0); /* Re-position pointer to 2nd line */
     fprintf(fp, "%d\n", regions_written); /* Write out number of regions */
     fclose(fp);
 

Modified: brlcad/trunk/src/conv/iges/findp.c
===================================================================
--- brlcad/trunk/src/conv/iges/findp.c  2020-05-07 16:17:26 UTC (rev 75728)
+++ brlcad/trunk/src/conv/iges/findp.c  2020-05-07 17:21:13 UTC (rev 75729)
@@ -44,13 +44,13 @@
 
     saverec = currec;  /* save current record number */
 
-    if (fseek(fd, 0, 2)) {
+    if (bu_fseek(fd, 0, 2)) {
        /* go to end of file */
        bu_log("Cannot seek to end of file\n");
        perror("Findp");
        bu_exit(1, NULL);
     }
-    offset = ftell(fd);        /* get file length */
+    offset = bu_ftell(fd);     /* get file length */
     rec2 = offset/reclen;      /* calculate record number for last record */
     Readrec(rec2);     /* read last record into "card" buffer */
     dstart = 0;

Modified: brlcad/trunk/src/conv/iges/g-iges.c
===================================================================
--- brlcad/trunk/src/conv/iges/g-iges.c 2020-05-07 16:17:26 UTC (rev 75728)
+++ brlcad/trunk/src/conv/iges/g-iges.c 2020-05-07 17:21:13 UTC (rev 75729)
@@ -402,7 +402,7 @@
 
     if (!multi_file) {
        /* Copy the parameter section from the temporary file to the output 
file */
-       if ((fseek(fp_param, 0, 0))) {
+       if ((bu_fseek(fp_param, 0, 0))) {
            perror("g-iges");
            bu_exit(1, "Cannot seek to start of temporary file\n");
        }
@@ -619,7 +619,7 @@
            char copy_buffer[CP_BUF_SIZE] = {0};
 
            /* Copy the parameter section from the temporary file to the output 
file */
-           if ((fseek(fp_param, 0, 0))) {
+           if ((bu_fseek(fp_param, 0, 0))) {
                perror("g-iges");
                bu_exit(1, "Cannot seek to start of temporary file\n");
            }

Modified: brlcad/trunk/src/conv/iges/n_iges.cpp
===================================================================
--- brlcad/trunk/src/conv/iges/n_iges.cpp       2020-05-07 16:17:26 UTC (rev 
75728)
+++ brlcad/trunk/src/conv/iges/n_iges.cpp       2020-05-07 17:21:13 UTC (rev 
75729)
@@ -206,7 +206,7 @@
     if (k == (-1))     /* We didn't encounter an early EOF */
        k = NRECS;
 
-    if (fseek(in, 0, SEEK_SET)) {
+    if (bu_fseek(in, 0, SEEK_SET)) {
        /* rewind file */
        perror("Recsize");
        bu_exit(-1, "Cannot rewind file\n");
@@ -228,7 +228,7 @@
 
 Record::Record(FILE* in) : _fp(in) {
     if (_reclen < 0) calcRecsize(in); // FIXME: ...
-    _start = ftell(in);
+    _start = bu_ftell(in);
     _read();
 }
 
@@ -235,9 +235,9 @@
 
 Record::Record(FILE* in, int paramStart, int record) : _fp(in) {
     if (_reclen < 0) calcRecsize(in);
-    _start = ftell(in);
+    _start = bu_ftell(in);
     int pos = (record-1)*_reclen;
-    fseek(_fp, paramStart + pos, SEEK_SET);
+    bu_fseek(_fp, paramStart + pos, SEEK_SET);
     _read();
 }
 
@@ -262,7 +262,7 @@
 
 void
 Record::_undoRead(int numLines) {
-    fseek(_fp, -(numLines * _reclen), SEEK_CUR);
+    bu_fseek(_fp, -(numLines * _reclen), SEEK_CUR);
 }
 
 

Modified: brlcad/trunk/src/conv/iges/n_iges.hpp
===================================================================
--- brlcad/trunk/src/conv/iges/n_iges.hpp       2020-05-07 16:17:26 UTC (rev 
75728)
+++ brlcad/trunk/src/conv/iges/n_iges.hpp       2020-05-07 17:21:13 UTC (rev 
75729)
@@ -359,8 +359,8 @@
     bool isParameter() { return _type == 'P'; }
     bool isTerminal() { return _type == 'T'; }
     // reset the stream to the start of this record
-    void reset() { fseek(_fp, _start, SEEK_SET); }
-    long where() { return ftell(_fp); }
+    void reset() { bu_fseek(_fp, _start, SEEK_SET); }
+    long where() { return bu_ftell(_fp); }
 
     GlobalSection* createGlobalSection();
     void createDirectory(vector<DirectoryEntry*>& dir);

Modified: brlcad/trunk/src/conv/iges/readrec.c
===================================================================
--- brlcad/trunk/src/conv/iges/readrec.c        2020-05-07 16:17:26 UTC (rev 
75728)
+++ brlcad/trunk/src/conv/iges/readrec.c        2020-05-07 17:21:13 UTC (rev 
75729)
@@ -44,7 +44,7 @@
 
     currec = recno;
     offset = (recno - 1) * reclen;
-    if (fseek(fd, offset, 0)) {
+    if (bu_fseek(fd, offset, 0)) {
        bu_log("Error in seek\n");
        perror("Readrec");
        bu_exit(1, NULL);

Modified: brlcad/trunk/src/conv/iges/recsize.c
===================================================================
--- brlcad/trunk/src/conv/iges/recsize.c        2020-05-07 16:17:26 UTC (rev 
75728)
+++ brlcad/trunk/src/conv/iges/recsize.c        2020-05-07 17:21:13 UTC (rev 
75729)
@@ -68,7 +68,7 @@
     if (k == (-1))     /* We didn't encounter an early EOF */
        k = NRECS;
 
-    if (fseek(fd, 0, 0)) {
+    if (bu_fseek(fd, 0, 0)) {
        /* rewind file */
        bu_log("Cannot rewind file\n");
        perror("Recsize");

Modified: brlcad/trunk/src/conv/nastran-g.c
===================================================================
--- brlcad/trunk/src/conv/nastran-g.c   2020-05-07 16:17:26 UTC (rev 75728)
+++ brlcad/trunk/src/conv/nastran-g.c   2020-05-07 17:21:13 UTC (rev 75729)
@@ -161,7 +161,7 @@
     for (i=0; i < 20; i++)
        prev_rec[i][0] = '\0';
 
-    fseek(fpin, start_off, SEEK_SET);
+    bu_fseek(fpin, start_off, SEEK_SET);
     line_count = bulk_data_start_line;
 
     tmp = bu_fgets(next_line, MAX_LINE_SIZE, fpin);
@@ -1193,7 +1193,7 @@
        if (bu_strncmp(line, "BEGIN BULK", 10))
            continue;
 
-       start_off = ftell(fpin);
+       start_off = bu_ftell(fpin);
        break;
     }
 
@@ -1219,7 +1219,7 @@
     nmg_model = (struct model *)NULL;
 
     /* count grid points */
-    fseek(fptmp, 0, SEEK_SET);
+    bu_fseek(fptmp, 0, SEEK_SET);
     while (bu_fgets(line, MAX_LINE_SIZE, fptmp)) {
        if (!bu_strncmp(line, "GRID", 4))
            grid_count++;
@@ -1229,7 +1229,7 @@
     }
 
     /* get default values and properties */
-    fseek(fptmp, 0, SEEK_SET);
+    bu_fseek(fptmp, 0, SEEK_SET);
     while (get_next_record(fptmp, 1, 0)) {
        if (!bu_strncmp(curr_rec[0], "BAROR", 5)) {
            /* get BAR defaults */
@@ -1262,7 +1262,7 @@
     g_pts = (struct grid_point *)bu_calloc(grid_count, sizeof(struct 
grid_point), "grid points");
 
     /* get all grid points */
-    fseek(fptmp, 0, SEEK_SET);
+    bu_fseek(fptmp, 0, SEEK_SET);
     while (get_next_record(fptmp, 1, 0)) {
        int gid;
        int cid;
@@ -1287,7 +1287,7 @@
 
 
     /* find coordinate systems */
-    fseek(fptmp, 0, SEEK_SET);
+    bu_fseek(fptmp, 0, SEEK_SET);
     while (get_next_record(fptmp, 1, 0)) {
        if (bu_strncmp(curr_rec[0], "CORD", 4))
            continue;
@@ -1306,7 +1306,7 @@
     mk_id(fpout, nastran_file);
 
     /* get elements */
-    fseek(fptmp, 0, SEEK_SET);
+    bu_fseek(fptmp, 0, SEEK_SET);
     while (get_next_record(fptmp, 1, 0)) {
        if (!bu_strncmp(curr_rec[0], "CBAR", 4))
            get_cbar();

Modified: brlcad/trunk/src/conv/shp/shapelib/shpopen.c
===================================================================
--- brlcad/trunk/src/conv/shp/shapelib/shpopen.c        2020-05-07 16:17:26 UTC 
(rev 75728)
+++ brlcad/trunk/src/conv/shp/shapelib/shpopen.c        2020-05-07 17:21:13 UTC 
(rev 75729)
@@ -1596,7 +1596,7 @@
         */
        char str[128];
        sprintf( str,
-                "Error in fseek() reading object from .shp file at offset %u",
+                "Error in bu_fseek() reading object from .shp file at offset 
%u",
                 psSHP->panRecOffset[hEntity]);
 
        psSHP->sHooks.Error( str );

Modified: brlcad/trunk/src/conv/stl/g-stl.c
===================================================================
--- brlcad/trunk/src/conv/stl/g-stl.c   2020-05-07 16:17:26 UTC (rev 75728)
+++ brlcad/trunk/src/conv/stl/g-stl.c   2020-05-07 17:21:13 UTC (rev 75729)
@@ -283,7 +283,7 @@
            unsigned char tot_buffer[4];
 
            /* Re-position pointer to 80th byte */
-           lseek(bfd, 80, SEEK_SET);
+           bu_lseek(bfd, 80, SEEK_SET);
 
            /* Write out number of triangles */
            *(uint32_t *)tot_buffer = htonl((unsigned long)region_polys);
@@ -499,7 +499,7 @@
            unsigned char tot_buffer[4];
 
            /* Re-position pointer to 80th byte */
-           lseek(bfd, 80, SEEK_SET);
+           bu_lseek(bfd, 80, SEEK_SET);
 
            /* Write out number of triangles */
            *(uint32_t *)tot_buffer = htonl((unsigned long)tot_polygons);

Modified: brlcad/trunk/src/conv/vdeck/vdeck.c
===================================================================
--- brlcad/trunk/src/conv/vdeck/vdeck.c 2020-05-07 16:17:26 UTC (rev 75728)
+++ brlcad/trunk/src/conv/vdeck/vdeck.c 2020-05-07 17:21:13 UTC (rev 75729)
@@ -1218,7 +1218,7 @@
     ewrite(solfp, LF, 1);
 
     /* Save space for number of solids and regions.                    */
-    savsol = ftell(solfp);
+    savsol = bu_ftell(solfp);
     if (savsol < 0) {
        perror("ftell");
     }
@@ -1272,7 +1272,7 @@
 
     /* Go back, and add number of solids and regions on second card. */
     if (savsol >= 0)
-       fseek(solfp, savsol, 0);
+       bu_fseek(solfp, savsol, 0);
 
     vdeck_itoa(nns, buff, 5);
     ewrite(solfp, buff, 5);

Modified: brlcad/trunk/src/fb/bw-fb.c
===================================================================
--- brlcad/trunk/src/fb/bw-fb.c 2020-05-07 16:17:26 UTC (rev 75728)
+++ brlcad/trunk/src/fb/bw-fb.c 2020-05-07 17:21:13 UTC (rev 75729)
@@ -36,6 +36,9 @@
 #ifdef HAVE_SYS_STAT_H
 #  include <sys/stat.h>
 #endif
+
+#include "bio.h"
+
 #include "bu/color.h"
 #include "bu/getopt.h"
 #include "bu/malloc.h"
@@ -339,7 +342,7 @@
     int n, tries;
 
     if (fileinput) {
-       (void)lseek(fd, num, 1);
+       (void)bu_lseek(fd, num, 1);
        return 0;
     }
 

Modified: brlcad/trunk/src/fb/fb-bw.c
===================================================================
--- brlcad/trunk/src/fb/fb-bw.c 2020-05-07 16:17:26 UTC (rev 75728)
+++ brlcad/trunk/src/fb/fb-bw.c 2020-05-07 17:21:13 UTC (rev 75729)
@@ -29,6 +29,8 @@
 
 #include <stdlib.h>
 
+#include "bio.h"
+
 #include "bu/color.h"
 #include "bu/getopt.h"
 #include "bu/exit.h"

Modified: brlcad/trunk/src/fb/fb-pix.c
===================================================================
--- brlcad/trunk/src/fb/fb-pix.c        2020-05-07 16:17:26 UTC (rev 75728)
+++ brlcad/trunk/src/fb/fb-pix.c        2020-05-07 17:21:13 UTC (rev 75729)
@@ -29,6 +29,8 @@
 #include <stdlib.h>
 #include <sys/stat.h>
 
+#include "bio.h"
+
 #include "bu/app.h"
 #include "bu/getopt.h"
 #include "bu/exit.h"

Modified: brlcad/trunk/src/fb/fb-png.c
===================================================================
--- brlcad/trunk/src/fb/fb-png.c        2020-05-07 16:17:26 UTC (rev 75728)
+++ brlcad/trunk/src/fb/fb-png.c        2020-05-07 17:21:13 UTC (rev 75729)
@@ -31,6 +31,8 @@
 #include <sys/stat.h>
 #include "png.h"
 
+#include "bio.h"
+
 #include "bu/app.h"
 #include "bu/getopt.h"
 #include "bu/log.h"

Modified: brlcad/trunk/src/fb/fbcbars.c
===================================================================
--- brlcad/trunk/src/fb/fbcbars.c       2020-05-07 16:17:26 UTC (rev 75728)
+++ brlcad/trunk/src/fb/fbcbars.c       2020-05-07 17:21:13 UTC (rev 75729)
@@ -62,6 +62,8 @@
 
 #include <stdlib.h>
 
+#include "bio.h"
+
 #include "bu/color.h"
 #include "bu/getopt.h"
 #include "bu/exit.h"

Modified: brlcad/trunk/src/fb/fbcmap.c
===================================================================
--- brlcad/trunk/src/fb/fbcmap.c        2020-05-07 16:17:26 UTC (rev 75728)
+++ brlcad/trunk/src/fb/fbcmap.c        2020-05-07 17:21:13 UTC (rev 75729)
@@ -30,6 +30,8 @@
 
 #include <stdlib.h>
 
+#include "bio.h"
+
 #include "bu/getopt.h"
 #include "bu/log.h"
 #include "bu/snooze.h"

Modified: brlcad/trunk/src/fb/fbcolor.c
===================================================================
--- brlcad/trunk/src/fb/fbcolor.c       2020-05-07 16:17:26 UTC (rev 75728)
+++ brlcad/trunk/src/fb/fbcolor.c       2020-05-07 17:21:13 UTC (rev 75729)
@@ -30,6 +30,8 @@
 #include <stdlib.h>
 #include <string.h>
 
+#include "bio.h"
+
 #include "bu/color.h"
 #include "bu/getopt.h"
 #include "bu/exit.h"

Modified: brlcad/trunk/src/fb/fbfade.c
===================================================================
--- brlcad/trunk/src/fb/fbfade.c        2020-05-07 16:17:26 UTC (rev 75728)
+++ brlcad/trunk/src/fb/fbfade.c        2020-05-07 17:21:13 UTC (rev 75729)
@@ -59,6 +59,8 @@
 #include <string.h>
 #include <stdarg.h>
 
+#include "bio.h"
+
 #include "bu/getopt.h"
 #include "vmath.h"
 #include "fb.h"                        /* BRL-CAD package libfb.a interface */

Modified: brlcad/trunk/src/fb/fbframe.c
===================================================================
--- brlcad/trunk/src/fb/fbframe.c       2020-05-07 16:17:26 UTC (rev 75728)
+++ brlcad/trunk/src/fb/fbframe.c       2020-05-07 17:21:13 UTC (rev 75729)
@@ -29,6 +29,8 @@
 
 #include <stdlib.h>
 
+#include "bio.h"
+
 #include "bu/color.h"
 #include "bu/getopt.h"
 #include "bu/exit.h"

Modified: brlcad/trunk/src/fb/fbgrid.c
===================================================================
--- brlcad/trunk/src/fb/fbgrid.c        2020-05-07 16:17:26 UTC (rev 75728)
+++ brlcad/trunk/src/fb/fbgrid.c        2020-05-07 17:21:13 UTC (rev 75729)
@@ -26,6 +26,8 @@
 
 #include <stdlib.h>
 
+#include "bio.h"
+
 #include "bu/color.h"
 #include "bu/getopt.h"
 #include "bu/exit.h"

Modified: brlcad/trunk/src/fb/fbpoint.c
===================================================================
--- brlcad/trunk/src/fb/fbpoint.c       2020-05-07 16:17:26 UTC (rev 75728)
+++ brlcad/trunk/src/fb/fbpoint.c       2020-05-07 17:21:13 UTC (rev 75729)
@@ -29,6 +29,8 @@
 #include <stdlib.h>
 #include <string.h>
 
+#include "bio.h"
+
 #include "bu/color.h"
 #include "bu/str.h"
 #include "bu/exit.h"

Modified: brlcad/trunk/src/fb/fbstretch.c
===================================================================
--- brlcad/trunk/src/fb/fbstretch.c     2020-05-07 16:17:26 UTC (rev 75728)
+++ brlcad/trunk/src/fb/fbstretch.c     2020-05-07 17:21:13 UTC (rev 75729)
@@ -77,6 +77,8 @@
 #include <string.h>
 #include <stdarg.h>
 
+#include "bio.h"
+
 #include "bu/color.h"
 #include "bu/getopt.h"
 #include "bu/getopt.h"

Modified: brlcad/trunk/src/fb/fbzoom.c
===================================================================
--- brlcad/trunk/src/fb/fbzoom.c        2020-05-07 16:17:26 UTC (rev 75728)
+++ brlcad/trunk/src/fb/fbzoom.c        2020-05-07 17:21:13 UTC (rev 75729)
@@ -29,6 +29,8 @@
 
 #include <stdlib.h>
 
+#include "bio.h"
+
 #include "bu/getopt.h"
 #include "bu/log.h"
 #include "vmath.h"

Modified: brlcad/trunk/src/fb/gif-fb.c
===================================================================
--- brlcad/trunk/src/fb/gif-fb.c        2020-05-07 16:17:26 UTC (rev 75728)
+++ brlcad/trunk/src/fb/gif-fb.c        2020-05-07 17:21:13 UTC (rev 75729)
@@ -72,6 +72,8 @@
 #include <stdarg.h>
 #include <limits.h>
 
+#include "bio.h"
+
 #include "bu/color.h"
 #include "bu/getopt.h"
 #include "bu/malloc.h"

Modified: brlcad/trunk/src/fb/gif2fb.c
===================================================================
--- brlcad/trunk/src/fb/gif2fb.c        2020-05-07 16:17:26 UTC (rev 75728)
+++ brlcad/trunk/src/fb/gif2fb.c        2020-05-07 17:21:13 UTC (rev 75729)
@@ -42,6 +42,8 @@
 #include <stdlib.h>
 #include <string.h>
 
+#include "bio.h"
+
 #include "bu/getopt.h"
 #include "bu/exit.h"
 #include "vmath.h"

Modified: brlcad/trunk/src/fb/pix-fb.c
===================================================================
--- brlcad/trunk/src/fb/pix-fb.c        2020-05-07 16:17:26 UTC (rev 75728)
+++ brlcad/trunk/src/fb/pix-fb.c        2020-05-07 17:21:13 UTC (rev 75729)
@@ -37,6 +37,8 @@
 #  include <winsock.h>
 #endif
 
+#include "bio.h"
+
 #include "bu/getopt.h"
 #include "bu/malloc.h"
 #include "bu/file.h"
@@ -191,7 +193,7 @@
     int n, tries;
 
     if (fileinput) {
-       (void)lseek(fd, num, 1);
+       (void)bu_lseek(fd, num, 1);
        return 0;
     }
 

Modified: brlcad/trunk/src/fb/plot3-fb.c
===================================================================
--- brlcad/trunk/src/fb/plot3-fb.c      2020-05-07 16:17:26 UTC (rev 75728)
+++ brlcad/trunk/src/fb/plot3-fb.c      2020-05-07 17:21:13 UTC (rev 75729)
@@ -77,6 +77,8 @@
 #include <string.h>
 #include <ctype.h>
 
+#include "bio.h"
+
 #include "bu/color.h"
 #include "bu/cv.h"
 #include "bu/getopt.h"

Modified: brlcad/trunk/src/fb/png-fb.c
===================================================================
--- brlcad/trunk/src/fb/png-fb.c        2020-05-07 16:17:26 UTC (rev 75728)
+++ brlcad/trunk/src/fb/png-fb.c        2020-05-07 17:21:13 UTC (rev 75729)
@@ -27,6 +27,9 @@
 #include "common.h"
 
 #include <stdlib.h>
+
+#include "bio.h"
+
 #include "png.h"
 
 #include "bu/getopt.h"

Modified: brlcad/trunk/src/fb/spm-fb.c
===================================================================
--- brlcad/trunk/src/fb/spm-fb.c        2020-05-07 16:17:26 UTC (rev 75728)
+++ brlcad/trunk/src/fb/spm-fb.c        2020-05-07 17:21:13 UTC (rev 75729)
@@ -27,6 +27,8 @@
 #include <stdlib.h>
 #include <math.h>
 
+#include "bio.h"
+
 #include "bu/exit.h"
 #include "bu/getopt.h"
 #include "fb.h"

Modified: brlcad/trunk/src/gtools/ganalyze.cpp
===================================================================
--- brlcad/trunk/src/gtools/ganalyze.cpp        2020-05-07 16:17:26 UTC (rev 
75728)
+++ brlcad/trunk/src/gtools/ganalyze.cpp        2020-05-07 17:21:13 UTC (rev 
75729)
@@ -31,6 +31,8 @@
 #include <signal.h>
 #include <math.h>
 
+#include "bio.h"
+
 #include "bu/log.h"
 #include "bu/vls.h"
 #include "raytrace.h"

Modified: brlcad/trunk/src/halftone/main.c
===================================================================
--- brlcad/trunk/src/halftone/main.c    2020-05-07 16:17:26 UTC (rev 75728)
+++ brlcad/trunk/src/halftone/main.c    2020-05-07 17:21:13 UTC (rev 75729)
@@ -68,6 +68,8 @@
 #include <ctype.h>
 #include <math.h>
 
+#include "bio.h"
+
 #include "bu/getopt.h"
 #include "vmath.h"
 #include "raytrace.h"

Index: brlcad/trunk/src/libbu
===================================================================
--- brlcad/trunk/src/libbu      2020-05-07 16:17:26 UTC (rev 75728)
+++ brlcad/trunk/src/libbu      2020-05-07 17:21:13 UTC (rev 75729)

Property changes on: brlcad/trunk/src/libbu
___________________________________________________________________
Modified: svn:mergeinfo
## -1,3 +1,4 ##
 
/brlcad/branches/RELEASE/src/libbu:70323-70333,71915-71935,72826-72858,74376-74454
+/brlcad/branches/bioh/src/libbu:75720-75728
 
/brlcad/branches/brep-debug/src/libbu:69168,69927,69995-69996,70148-70149,70347-70349,70377,70526-70527,71006-71007,71009-71022,71046-71047,71049,71096-71100
 /brlcad/branches/tcltk86/src/libbu:68300-75257
\ No newline at end of property
Modified: brlcad/trunk/src/libbu/file.c
===================================================================
--- brlcad/trunk/src/libbu/file.c       2020-05-07 16:17:26 UTC (rev 75728)
+++ brlcad/trunk/src/libbu/file.c       2020-05-07 17:21:13 UTC (rev 75729)
@@ -490,6 +490,49 @@
     return 1;
 }
 
+int
+bu_fseek(FILE *stream, b_off_t offset, int origin)
+{
+    int ret;
+
+#if defined(HAVE__FSEEKI64) && defined(SIZEOF_VOID_P) && SIZEOF_VOID_P == 8^M
+    ret = _fseeki64(stream, offset, origin);
+#else
+    ret = fseek(stream, offset, origin);
+#endif
+
+    return ret;
+}
+
+b_off_t
+bu_lseek(int fd, b_off_t offset, int whence)
+{
+    b_off_t ret;
+
+#if defined(HAVE__LSEEKI64) && defined(SIZEOF_VOID_P) && SIZEOF_VOID_P == 8
+    ret = _lseeki64(fd, offset, whence);
+#else
+    ret = lseek(fd, offset, whence);
+#endif
+
+    return ret;
+}
+
+b_off_t
+bu_ftell(FILE *stream)
+{
+    b_off_t ret;
+
+#if defined(HAVE__FTELLI64) && defined(SIZEOF_VOID_P) && SIZEOF_VOID_P == 8
+    /* windows 64bit */
+    ret = _ftelli64(stream);
+#else
+    ret = ftell(stream);
+#endif
+
+    return ret;
+}
+
 /*
  * Local Variables:
  * mode: C

Modified: brlcad/trunk/src/libbu/vfont.c
===================================================================
--- brlcad/trunk/src/libbu/vfont.c      2020-05-07 16:17:26 UTC (rev 75728)
+++ brlcad/trunk/src/libbu/vfont.c      2020-05-07 17:21:13 UTC (rev 75729)
@@ -99,7 +99,7 @@
     /* Addresses of characters in the file are relative to point in
      * the file after the directory, so grab the current position.
      */
-    font.offset = ftell(font.ffdes);
+    font.offset = bu_ftell(font.ffdes);
 
     return font;
 }

Modified: brlcad/trunk/src/libfb/fb_generic.c
===================================================================
--- brlcad/trunk/src/libfb/fb_generic.c 2020-05-07 16:17:26 UTC (rev 75728)
+++ brlcad/trunk/src/libfb/fb_generic.c 2020-05-07 17:21:13 UTC (rev 75729)
@@ -43,6 +43,7 @@
 #include "bio.h"
 
 #include "bu/color.h"
+#include "bu/file.h"
 #include "bu/malloc.h"
 #include "bu/str.h"
 #include "bu/log.h"
@@ -675,7 +676,7 @@
     int n, tries;
 
     if (fileinput) {
-       (void)lseek(fd, num, 1);
+       (void)bu_lseek(fd, num, 1);
        return 0;
     }
 

Modified: brlcad/trunk/src/libfb/fbserv_obj.c
===================================================================
--- brlcad/trunk/src/libfb/fbserv_obj.c 2020-05-07 16:17:26 UTC (rev 75728)
+++ brlcad/trunk/src/libfb/fbserv_obj.c 2020-05-07 17:21:13 UTC (rev 75729)
@@ -34,6 +34,7 @@
 #include <string.h>
 #include <ctype.h>
 #include <tcl.h>
+#include "bio.h"
 #include "bnetwork.h"
 
 #include "raytrace.h"

Modified: brlcad/trunk/src/libfb/if_X24.c
===================================================================
--- brlcad/trunk/src/libfb/if_X24.c     2020-05-07 16:17:26 UTC (rev 75728)
+++ brlcad/trunk/src/libfb/if_X24.c     2020-05-07 17:21:13 UTC (rev 75729)
@@ -70,6 +70,8 @@
 
 #include <ctype.h>
 
+#include "bio.h"
+
 #include "bu/color.h"
 #include "bu/file.h"
 #include "bu/malloc.h"
@@ -2009,11 +2011,11 @@
                fd = open(BS_NAME, O_RDWR | O_CREAT | O_BINARY, 0666);
                if (fd < 0)
                    fb_log("X24_getmem: can't create fb file, using private 
memory instead, errno %d\n", errno);
-               else if (lseek(fd, (b_off_t)size, SEEK_SET) < 0)
+               else if (bu_lseek(fd, (b_off_t)size, SEEK_SET) < 0)
                    fb_log("X24_getmem: can't seek fb file, using private 
memory instead, errno %d\n", errno);
                else if (write(fd, &isnew, 1) < 0)
                    fb_log("X24_getmem: can't zero fb file, using private 
memory instead, errno %d\n", errno);
-               else if (lseek(fd, 0, SEEK_SET) < 0)
+               else if (bu_lseek(fd, 0, SEEK_SET) < 0)
                    fb_log("X24_getmem: can't seek fb file, using private 
memory instead, errno %d\n", errno);
                else if ((mem = (char *)mmap(NULL, size, PROT_READ | 
PROT_WRITE, MAP_SHARED, fd, 0)) == MAP_FAILED)
                    fb_log("X24_getmem: can't mmap fb file, using private 
memory instead, errno %d\n", errno);

Modified: brlcad/trunk/src/libfb/if_disk.c
===================================================================
--- brlcad/trunk/src/libfb/if_disk.c    2020-05-07 16:17:26 UTC (rev 75728)
+++ brlcad/trunk/src/libfb/if_disk.c    2020-05-07 17:21:13 UTC (rev 75729)
@@ -26,6 +26,8 @@
 
 #include "common.h"
 
+#include "bio.h"
+
 #include "bu/color.h"
 #include "bu/file.h"
 #include "bu/log.h"
@@ -74,7 +76,7 @@
        && (ifp->if_fd = open(file, O_RDONLY | O_BINARY, 0)) == -1) {
        if ((ifp->if_fd = open(file, O_RDWR | O_CREAT | O_BINARY, 0664)) > 0) {
            /* New file, write byte at end */
-           if (lseek(ifp->if_fd, (height*width*sizeof(RGBpixel)-1), 0) == -1) {
+           if (bu_lseek(ifp->if_fd, (height*width*sizeof(RGBpixel)-1), 0) == 
-1) {
                fb_log("disk_device_open : can not seek to end of new file.\n");
                return -1;
            }
@@ -90,7 +92,7 @@
 
     ifp->if_width = width;
     ifp->if_height = height;
-    if (lseek(ifp->if_fd, 0, 0) == -1) {
+    if (bu_lseek(ifp->if_fd, 0, 0) == -1) {
        fb_log("disk_device_open : can not seek to beginning.\n");
        return -1;
     }
@@ -174,7 +176,7 @@
 
     /* Set start of framebuffer */
     fd = ifp->if_fd;
-    if (ifp->if_seekpos != 0 && lseek(fd, 0, 0) == -1) {
+    if (ifp->if_seekpos != 0 && bu_lseek(fd, 0, 0) == -1) {
        fb_log("disk_color_clear : seek failed.\n");
        return -1;
     }
@@ -219,7 +221,7 @@
     if (fd == 1) fd = 0;
 
     dest = ((y * ifp->if_width) + x) * sizeof(RGBpixel);
-    if (ifp->if_seekpos != dest && lseek(fd, dest, 0) == -1) {
+    if (ifp->if_seekpos != dest && bu_lseek(fd, dest, 0) == -1) {
        fb_log("disk_buffer_read : seek to %ld failed.\n", dest);
        return -1;
     }
@@ -262,7 +264,7 @@
 
     dest = (y * ifp->if_width + x) * sizeof(RGBpixel);
     if (dest != ifp->if_seekpos) {
-       if (lseek(ifp->if_fd, (b_off_t)dest, 0) == -1) {
+       if (bu_lseek(ifp->if_fd, (b_off_t)dest, 0) == -1) {
            fb_log("disk_buffer_write : seek to %zd failed.\n", dest);
            return -1;
        }
@@ -293,7 +295,7 @@
     if (fd == 1) fd = 0;
 
     if (ifp->if_seekpos != FILE_CMAP_SIZE &&
-       lseek(fd, (b_off_t)FILE_CMAP_SIZE, 0) == -1) {
+       bu_lseek(fd, (b_off_t)FILE_CMAP_SIZE, 0) == -1) {
        fb_log("disk_colormap_read : seek to %zd failed.\n", FILE_CMAP_SIZE);
        return -1;
     }
@@ -316,7 +318,7 @@
        return 0;
     if (fb_is_linear_cmap(cmap))
        return 0;
-    if (lseek(ifp->if_fd, (b_off_t)FILE_CMAP_SIZE, 0) == -1) {
+    if (bu_lseek(ifp->if_fd, (b_off_t)FILE_CMAP_SIZE, 0) == -1) {
        fb_log("disk_colormap_write : seek to %zd failed.\n", FILE_CMAP_SIZE);
        return -1;
     }

Modified: brlcad/trunk/src/libfb/if_tk.c
===================================================================
--- brlcad/trunk/src/libfb/if_tk.c      2020-05-07 16:17:26 UTC (rev 75728)
+++ brlcad/trunk/src/libfb/if_tk.c      2020-05-07 17:21:13 UTC (rev 75729)
@@ -35,6 +35,7 @@
 #include <string.h>
 #include <tcl.h>
 #include <tk.h>
+#include "bio.h"
 #include "bnetwork.h"
 
 #include "bu/color.h"

Modified: brlcad/trunk/src/libgcv/plugins/fastgen4/fastgen4_read.c
===================================================================
--- brlcad/trunk/src/libgcv/plugins/fastgen4/fastgen4_read.c    2020-05-07 
16:17:26 UTC (rev 75728)
+++ brlcad/trunk/src/libgcv/plugins/fastgen4/fastgen4_read.c    2020-05-07 
17:21:13 UTC (rev 75729)
@@ -2161,7 +2161,7 @@
     b_off_t section_start;
 
     /* skip to start of next section */
-    section_start = ftell(pstate->fpin);
+    section_start = bu_ftell(pstate->fpin);
     if (section_start < 0) {
        bu_bomb("Error: couldn't get input file's current file position.");
     }
@@ -2172,7 +2172,7 @@
               bu_strncmp(pstate->line, "WALL", 4) &&
               bu_strncmp(pstate->line, "vehicle", 7))
        {
-           section_start = ftell(pstate->fpin);
+           section_start = bu_ftell(pstate->fpin);
            if (section_start < 0) {
                bu_bomb("Error: couldn't get input file's current file 
position.");
            }
@@ -2181,7 +2181,7 @@
        }
     }
     /* seek to start of the section */
-    fseek(pstate->fpin, section_start, SEEK_SET);
+    bu_fseek(pstate->fpin, section_start, SEEK_SET);
 }
 
 

Modified: brlcad/trunk/src/libgcv/plugins/stl/stl_write.c
===================================================================
--- brlcad/trunk/src/libgcv/plugins/stl/stl_write.c     2020-05-07 16:17:26 UTC 
(rev 75728)
+++ brlcad/trunk/src/libgcv/plugins/stl/stl_write.c     2020-05-07 17:21:13 UTC 
(rev 75729)
@@ -298,7 +298,7 @@
            unsigned char tot_buffer[4];
 
            /* Re-position pointer to 80th byte */
-           lseek(pstate->bfd, 80, SEEK_SET);
+           bu_lseek(pstate->bfd, 80, SEEK_SET);
 
            /* Write out number of triangles */
            *(uint32_t *)tot_buffer = htonl((unsigned long)region_polys);
@@ -441,7 +441,7 @@
            unsigned char tot_buffer[4];
 
            /* Re-position pointer to 80th byte */
-           lseek(state.bfd, 80, SEEK_SET);
+           bu_lseek(state.bfd, 80, SEEK_SET);
 
            /* Write out number of triangles */
            *(uint32_t *)tot_buffer = htonl((unsigned long)state.tot_polygons);

Modified: brlcad/trunk/src/libged/bot_dump.c
===================================================================
--- brlcad/trunk/src/libged/bot_dump.c  2020-05-07 16:17:26 UTC (rev 75728)
+++ brlcad/trunk/src/libged/bot_dump.c  2020-05-07 17:21:13 UTC (rev 75729)
@@ -30,6 +30,7 @@
 #include <sys/stat.h>
 #include <string.h>
 #include <ctype.h>
+#include "bio.h"
 #include "bnetwork.h"
 
 #include "bu/cv.h"
@@ -644,7 +645,7 @@
            stl_write_bot_binary(bot, fd, dp->d_namep);
 
            /* Re-position pointer to 80th byte */
-           lseek(fd, 80, SEEK_SET);
+           bu_lseek(fd, 80, SEEK_SET);
 
            /* Write out number of triangles */
            *(uint32_t *)tot_buffer = htonl((unsigned long)total_faces);
@@ -1036,7 +1037,7 @@
            unsigned char tot_buffer[4];
 
            /* Re-position pointer to 80th byte */
-           lseek(fd, 80, SEEK_SET);
+           bu_lseek(fd, 80, SEEK_SET);
 
            /* Write out number of triangles */
            *(uint32_t *)tot_buffer = htonl((unsigned long)total_faces);
@@ -1516,7 +1517,7 @@
            unsigned char tot_buffer[4];
 
            /* Re-position pointer to 80th byte */
-           lseek(fd, 80, SEEK_SET);
+           bu_lseek(fd, 80, SEEK_SET);
 
            /* Write out number of triangles */
            *(uint32_t *)tot_buffer = htonl((unsigned long)total_faces);

Modified: brlcad/trunk/src/libged/editit.c
===================================================================
--- brlcad/trunk/src/libged/editit.c    2020-05-07 16:17:26 UTC (rev 75728)
+++ brlcad/trunk/src/libged/editit.c    2020-05-07 17:21:13 UTC (rev 75729)
@@ -32,6 +32,7 @@
 #  include <sys/types.h>
 #endif
 
+#include "bio.h"
 #include "bresource.h"
 
 #include "bu/app.h"

Modified: brlcad/trunk/src/libged/facetize_log.c
===================================================================
--- brlcad/trunk/src/libged/facetize_log.c      2020-05-07 16:17:26 UTC (rev 
75728)
+++ brlcad/trunk/src/libged/facetize_log.c      2020-05-07 17:21:13 UTC (rev 
75729)
@@ -27,6 +27,8 @@
 
 #include <string.h>
 
+#include "bio.h"
+
 #include "bu/hook.h"
 #include "bu/vls.h"
 #include "./ged_private.h"

Modified: brlcad/trunk/src/libged/fb2pix.c
===================================================================
--- brlcad/trunk/src/libged/fb2pix.c    2020-05-07 16:17:26 UTC (rev 75728)
+++ brlcad/trunk/src/libged/fb2pix.c    2020-05-07 17:21:13 UTC (rev 75729)
@@ -29,6 +29,8 @@
 #include <stdlib.h>
 #include <sys/stat.h>
 
+#include "bio.h"
+
 #include "bu/app.h"
 #include "bu/getopt.h"
 #include "fb.h"

Modified: brlcad/trunk/src/libged/pix2fb.c
===================================================================
--- brlcad/trunk/src/libged/pix2fb.c    2020-05-07 16:17:26 UTC (rev 75728)
+++ brlcad/trunk/src/libged/pix2fb.c    2020-05-07 17:21:13 UTC (rev 75729)
@@ -37,6 +37,8 @@
 #  include <winsock.h>
 #endif
 
+#include "bio.h"
+
 #include "bu/getopt.h"
 #include "bu/snooze.h"
 #include "fb.h"

Modified: brlcad/trunk/src/libged/tables.c
===================================================================
--- brlcad/trunk/src/libged/tables.c    2020-05-07 16:17:26 UTC (rev 75728)
+++ brlcad/trunk/src/libged/tables.c    2020-05-07 17:21:13 UTC (rev 75729)
@@ -35,6 +35,8 @@
 #include <ctype.h>
 #include <string.h>
 
+#include "bio.h"
+
 #include "bu/sort.h"
 #include "bu/units.h"
 #include "./ged_private.h"
@@ -111,7 +113,7 @@
     MAT_COPY(idbuf1.i_mat, matrix);
 
     for (i = 0; i < (ssize_t)*numsol; i++) {
-       (void)lseek(rd_idfd, i*sizeof(identt), 0);
+       (void)bu_lseek(rd_idfd, i*sizeof(identt), 0);
        readval = read(rd_idfd, &idbuf2, sizeof identt);
 
        if (readval < 0) {
@@ -128,7 +130,7 @@
     (*numsol)++;
     idbuf1.i_index = *numsol;
 
-    (void)lseek(idfd, 0, 2);
+    (void)bu_lseek(idfd, 0, 2);
     i = write(idfd, &idbuf1, sizeof identt);
     if (i < 0)
        perror("write");

Modified: brlcad/trunk/src/libicv/rot.c
===================================================================
--- brlcad/trunk/src/libicv/rot.c       2020-05-07 16:17:26 UTC (rev 75728)
+++ brlcad/trunk/src/libicv/rot.c       2020-05-07 17:21:13 UTC (rev 75729)
@@ -326,7 +326,7 @@
 
     /*
      * Clear our "file pointer."  We need to maintain this
-     * In order to tell if seeking is required.  ftell() always
+     * In order to tell if seeking is required.  bu_ftell() always
      * fails on pipes, so we can't use it.
      */
     outplace = 0;
@@ -353,7 +353,7 @@
                xout = (nyin - 1) - lasty;
                outbyte = ((yout * nyin) + xout) * pixbytes;
                if (outplace != outbyte) {
-                   if (fseek(ofp, outbyte, SEEK_SET) < 0) {
+                   if (bu_fseek(ofp, outbyte, SEEK_SET) < 0) {
                        ret = 3;
                        perror("fseek");
                        bu_log("ERROR: %s can't seek on output (ofp=%p, 
outbyte=%jd)\n", argv[0], (void *)ofp, (intmax_t)outbyte);
@@ -383,7 +383,7 @@
                xout = yin;
                outbyte = ((yout * nyin) + xout) * pixbytes;
                if (outplace != outbyte) {
-                   if (fseek(ofp, outbyte, SEEK_SET) < 0) {
+                   if (bu_fseek(ofp, outbyte, SEEK_SET) < 0) {
                        ret = 3;
                        perror("fseek");
                        bu_log("ERROR: %s can't seek on output (ofp=%p, 
outbyte=%jd)\n", argv[0], (void *)ofp, (intmax_t)outbyte);
@@ -405,7 +405,7 @@
                yout = (nyin - 1) - y + 1;
                outbyte = yout * scanbytes;
                if (outplace != outbyte) {
-                   if (fseek(ofp, outbyte, SEEK_SET) < 0) {
+                   if (bu_fseek(ofp, outbyte, SEEK_SET) < 0) {
                        ret = 3;
                        perror("fseek");
                        bu_log("ERROR: %s can't seek on output (ofp=%p, 
outbyte=%jd)\n", argv[0], (void *)ofp, (intmax_t)outbyte);

Modified: brlcad/trunk/src/librt/cache.c
===================================================================
--- brlcad/trunk/src/librt/cache.c      2020-05-07 16:17:26 UTC (rev 75728)
+++ brlcad/trunk/src/librt/cache.c      2020-05-07 17:21:13 UTC (rev 75729)
@@ -37,6 +37,7 @@
 #endif
 #include "lz4.h"
 
+#include "bio.h"
 #include "bnetwork.h"
 
 /* implementation headers */

Modified: brlcad/trunk/src/librt/db5_scan.c
===================================================================
--- brlcad/trunk/src/librt/db5_scan.c   2020-05-07 16:17:26 UTC (rev 75728)
+++ brlcad/trunk/src/librt/db5_scan.c   2020-05-07 17:21:13 UTC (rev 75729)
@@ -85,7 +85,7 @@
            goto fatal;
        }
        for (;;) {
-           addr = ftell(dbip->dbi_fp);
+           addr = bu_ftell(dbip->dbi_fp);
            if ((got = db5_get_raw_internal_fp(&raw, dbip->dbi_fp)) < 0) {
                if (got == -1) break;           /* EOF */
                goto fatal;
@@ -97,7 +97,7 @@
                raw.buf = NULL;
            }
        }
-       dbip->dbi_eof = ftell(dbip->dbi_fp);
+       dbip->dbi_eof = bu_ftell(dbip->dbi_fp);
        rewind(dbip->dbi_fp);
     }
 

Modified: brlcad/trunk/src/librt/db_corrupt.c
===================================================================
--- brlcad/trunk/src/librt/db_corrupt.c 2020-05-07 16:17:26 UTC (rev 75728)
+++ brlcad/trunk/src/librt/db_corrupt.c 2020-05-07 17:21:13 UTC (rev 75729)
@@ -54,7 +54,7 @@
     RT_CK_DBI(dbip);
 
     /* get into position */
-    ret = fseek(dbip->dbi_fp, offset, 0);
+    ret = bu_fseek(dbip->dbi_fp, offset, 0);
     if (ret) {
        bu_log("Database seek failure, unable to seek [%s]\n", name);
        return 0;

Modified: brlcad/trunk/src/librt/db_io.c
===================================================================
--- brlcad/trunk/src/librt/db_io.c      2020-05-07 16:17:26 UTC (rev 75728)
+++ brlcad/trunk/src/librt/db_io.c      2020-05-07 17:21:13 UTC (rev 75729)
@@ -80,7 +80,7 @@
     }
     bu_semaphore_acquire(BU_SEM_SYSCALL);
 
-    ret = fseek(dbip->dbi_fp, offset, 0);
+    ret = bu_fseek(dbip->dbi_fp, offset, 0);
     if (ret)
        bu_bomb("db_read: fseek error\n");
     got = (size_t)fread(addr, 1, count, dbip->dbi_fp);
@@ -198,7 +198,7 @@
     bu_semaphore_acquire(BU_SEM_SYSCALL);
     bu_interrupt_suspend();
 
-    (void)fseek(dbip->dbi_fp, offset, 0);
+    (void)bu_fseek(dbip->dbi_fp, offset, 0);
     got = fwrite(addr, 1, count, dbip->dbi_fp);
     fflush(dbip->dbi_fp);
 

Modified: brlcad/trunk/src/librt/db_scan.c
===================================================================
--- brlcad/trunk/src/librt/db_scan.c    2020-05-07 16:17:26 UTC (rev 75728)
+++ brlcad/trunk/src/librt/db_scan.c    2020-05-07 17:21:13 UTC (rev 75729)
@@ -99,7 +99,7 @@
        return -1;
     }
     rewind(dbip->dbi_fp);
-    next = ftell(dbip->dbi_fp);
+    next = bu_ftell(dbip->dbi_fp);
     if (next < 0) {
        perror("ftell");
        next = 0;
@@ -111,8 +111,8 @@
     totrec = 0;
     while (1) {
        nrec = 0;
-       if (fseek(dbip->dbi_fp, next, 0) != 0) {
-           bu_log("db_scan:  fseek(offset=%jd) failure\n", (intmax_t)next);
+       if (bu_fseek(dbip->dbi_fp, next, 0) != 0) {
+           bu_log("db_scan:  bu_fseek(offset=%jd) failure\n", (intmax_t)next);
            return -1;
        }
        addr = next;
@@ -120,7 +120,7 @@
        if (fread((char *)&record, sizeof record, 1, dbip->dbi_fp) != 1
            || feof(dbip->dbi_fp))
            break;
-       next = ftell(dbip->dbi_fp);
+       next = bu_ftell(dbip->dbi_fp);
        if (next < 0) {
            perror("db_scan:  ftell:  ");
            return -1;
@@ -146,18 +146,18 @@
                break;
            case ID_ARS_A:
                while (1) {
-                   here = ftell(dbip->dbi_fp);
+                   here = bu_ftell(dbip->dbi_fp);
                    if (fread((char *)&rec2, sizeof(rec2),
                              1, dbip->dbi_fp) != 1)
                        break;
                    RT_DEBUG_PR(here, rec2);
                    if (rec2.u_id != ID_ARS_B) {
-                       fseek(dbip->dbi_fp, here, 0);
+                       bu_fseek(dbip->dbi_fp, here, 0);
                        break;
                    }
                    nrec++;
                }
-               next = ftell(dbip->dbi_fp);
+               next = bu_ftell(dbip->dbi_fp);
                handler(dbip, record.a.a_name, addr, nrec, RT_DIR_SOLID, 
client_data);
                break;
            case ID_ARS_B:
@@ -171,7 +171,7 @@
                    if (fread((char *)&rec2, sizeof(rec2), 1, dbip->dbi_fp) != 
1)
                        break;
                }
-               next = ftell(dbip->dbi_fp);
+               next = bu_ftell(dbip->dbi_fp);
                handler(dbip, record.ss.ss_name, addr, nrec, RT_DIR_SOLID, 
client_data);
                break;
            case ID_MATERIAL:
@@ -192,17 +192,17 @@
                break;
            case ID_P_HEAD:
                while (1) {
-                   here = ftell(dbip->dbi_fp);
+                   here = bu_ftell(dbip->dbi_fp);
                    if (fread((char *)&rec2, sizeof(rec2), 1, dbip->dbi_fp) != 
1)
                        break;
                    RT_DEBUG_PR(here, rec2);
                    if (rec2.u_id != ID_P_DATA) {
-                       fseek(dbip->dbi_fp, here, 0);
+                       bu_fseek(dbip->dbi_fp, here, 0);
                        break;
                    }
                    nrec++;
                }
-               next = ftell(dbip->dbi_fp);
+               next = bu_ftell(dbip->dbi_fp);
                handler(dbip, record.p.p_name, addr, nrec, RT_DIR_SOLID, 
client_data);
                break;
            case ID_P_DATA:
@@ -211,12 +211,12 @@
            case ID_BSOLID:
                while (1) {
                    /* Find and skip subsequent BSURFs */
-                   here = ftell(dbip->dbi_fp);
+                   here = bu_ftell(dbip->dbi_fp);
                    if (fread((char *)&rec2, sizeof(rec2), 1, dbip->dbi_fp) != 
1)
                        break;
                    RT_DEBUG_PR(here, rec2);
                    if (rec2.u_id != ID_BSURF) {
-                       fseek(dbip->dbi_fp, here, 0);
+                       bu_fseek(dbip->dbi_fp, here, 0);
                        break;
                    }
 
@@ -227,7 +227,7 @@
                        if (fread((char *)&rec2, sizeof(rec2), 1, dbip->dbi_fp) 
!= 1)
                            break;
                    }
-                   next = ftell(dbip->dbi_fp);
+                   next = bu_ftell(dbip->dbi_fp);
                }
                handler(dbip, record.B.B_name, addr, nrec, RT_DIR_SOLID, 
client_data);
                break;
@@ -249,7 +249,7 @@
                    if (fread((char *)&rec2, sizeof(rec2), 1, dbip->dbi_fp) != 
1)
                        break;
                }
-               next = ftell(dbip->dbi_fp);
+               next = bu_ftell(dbip->dbi_fp);
                handler(dbip, record.n.n_name, addr, nrec, RT_DIR_SOLID, 
client_data);
                break;
            case DBID_PARTICLE:
@@ -262,7 +262,7 @@
                    if (fread((char *)&rec2, sizeof(rec2), 1, dbip->dbi_fp) != 
1)
                        break;
                }
-               next = ftell(dbip->dbi_fp);
+               next = bu_ftell(dbip->dbi_fp);
                handler(dbip, record.pwr.pwr_name, addr, nrec, RT_DIR_SOLID, 
client_data);
                break;
            case DBID_NMG:
@@ -272,7 +272,7 @@
                    if (fread((char *)&rec2, sizeof(rec2), 1, dbip->dbi_fp) != 
1)
                        break;
                }
-               next = ftell(dbip->dbi_fp);
+               next = bu_ftell(dbip->dbi_fp);
                handler(dbip, record.nmg.N_name, addr, nrec, RT_DIR_SOLID, 
client_data);
                break;
            case DBID_SKETCH:
@@ -282,7 +282,7 @@
                    if (fread((char *)&rec2, sizeof(rec2), 1, dbip->dbi_fp) != 
1)
                        break;
                }
-               next = ftell(dbip->dbi_fp);
+               next = bu_ftell(dbip->dbi_fp);
                handler(dbip, record.skt.skt_name, addr, nrec, RT_DIR_SOLID, 
client_data);
                break;
            case DBID_EXTR:
@@ -292,7 +292,7 @@
                    if (fread((char *)&rec2, sizeof(rec2), 1, dbip->dbi_fp) != 
1)
                        break;
                }
-               next = ftell(dbip->dbi_fp);
+               next = bu_ftell(dbip->dbi_fp);
                handler(dbip, record.extr.ex_name, addr, nrec, RT_DIR_SOLID, 
client_data);
                break;
            case DBID_CLINE:
@@ -305,7 +305,7 @@
                    if (fread((char *)&rec2, sizeof(rec2), 1, dbip->dbi_fp) != 
1)
                        break;
                }
-               next = ftell(dbip->dbi_fp);
+               next = bu_ftell(dbip->dbi_fp);
                handler(dbip, record.s.s_name, addr, nrec, RT_DIR_SOLID, 
client_data);
                break;
            case ID_MEMB:
@@ -313,17 +313,17 @@
                break;
            case ID_COMB:
                while (1) {
-                   here = ftell(dbip->dbi_fp);
+                   here = bu_ftell(dbip->dbi_fp);
                    if (fread((char *)&rec2, sizeof(rec2), 1, dbip->dbi_fp) != 
1)
                        break;
                    RT_DEBUG_PR(here, rec2);
                    if (rec2.u_id != ID_MEMB) {
-                       fseek(dbip->dbi_fp, here, 0);
+                       bu_fseek(dbip->dbi_fp, here, 0);
                        break;
                    }
                    nrec++;
                }
-               next = ftell(dbip->dbi_fp);
+               next = bu_ftell(dbip->dbi_fp);
                switch (record.c.c_flags) {
                    default:
                    case DBV4_NON_REGION:
@@ -346,7 +346,7 @@
        totrec += nrec;
     }
     dbip->dbi_nrec = totrec;
-    next = ftell(dbip->dbi_fp);
+    next = bu_ftell(dbip->dbi_fp);
     if (next < 0)
        dbip->dbi_eof = -1;
     else

Modified: brlcad/trunk/src/librt/primitives/primitive_util.c
===================================================================
--- brlcad/trunk/src/librt/primitives/primitive_util.c  2020-05-07 16:17:26 UTC 
(rev 75728)
+++ brlcad/trunk/src/librt/primitives/primitive_util.c  2020-05-07 17:21:13 UTC 
(rev 75729)
@@ -528,8 +528,8 @@
     fp = fopen(filename , "r");
     if (!fp) bu_exit(-1, "failed to read OpenCL code file (%s)\n", filename);
 
-    fseek(fp, 0, SEEK_END);
-    *length = ftell(fp);
+    bu_fseek(fp, 0, SEEK_END);
+    *length = bu_ftell(fp);
     rewind(fp);
 
     data = (char*)bu_malloc((*length+1)*sizeof(char), "failed bu_malloc() in 
clt_read_code()");

Modified: brlcad/trunk/src/libtclcad/tclcad_obj.c
===================================================================
--- brlcad/trunk/src/libtclcad/tclcad_obj.c     2020-05-07 16:17:26 UTC (rev 
75728)
+++ brlcad/trunk/src/libtclcad/tclcad_obj.c     2020-05-07 17:21:13 UTC (rev 
75729)
@@ -31,6 +31,7 @@
 
 #include "common.h"
 
+
 #include <stdlib.h>
 #include <ctype.h>
 #include <string.h>
@@ -42,6 +43,8 @@
 
 #include "tcl.h"
 
+#include "bio.h"
+
 #include "bn.h"
 #include "bu/cmd.h"
 #include "bu/path.h"

Modified: brlcad/trunk/src/mged/cmd.c
===================================================================
--- brlcad/trunk/src/mged/cmd.c 2020-05-07 16:17:26 UTC (rev 75728)
+++ brlcad/trunk/src/mged/cmd.c 2020-05-07 17:21:13 UTC (rev 75729)
@@ -36,6 +36,7 @@
 #ifdef HAVE_SYS_TYPES_H
 #  include <sys/types.h>
 #endif
+#include "bio.h"
 #include "bresource.h"
 
 #include "tcl.h"

Modified: brlcad/trunk/src/mged/fbserv.c
===================================================================
--- brlcad/trunk/src/mged/fbserv.c      2020-05-07 16:17:26 UTC (rev 75728)
+++ brlcad/trunk/src/mged/fbserv.c      2020-05-07 17:21:13 UTC (rev 75729)
@@ -29,10 +29,9 @@
 #include <stdlib.h>
 #include <ctype.h>
 
+#include "bio.h"
 #include "bnetwork.h"
-#ifndef HAVE_WINSOCK_H
-#  include <sys/socket.h> /* TODO - should this be in bsocket.h? */
-#endif
+#include "bsocket.h"
 
 #include "tcl.h"
 #include "vmath.h"

Modified: brlcad/trunk/src/mged/mged.c
===================================================================
--- brlcad/trunk/src/mged/mged.c        2020-05-07 16:17:26 UTC (rev 75728)
+++ brlcad/trunk/src/mged/mged.c        2020-05-07 17:21:13 UTC (rev 75729)
@@ -44,15 +44,12 @@
 #ifdef HAVE_SYS_STAT_H
 #  include <sys/stat.h>
 #endif
-#ifdef HAVE_SYS_SOCKET_H
-/* for recv */
-#  include <sys/socket.h>
-#endif
 
 #ifdef HAVE_POLL_H
 #  include <poll.h>
 #endif
 
+#include "bio.h"
 #include "bsocket.h"
 
 #include "tcl.h"

Modified: brlcad/trunk/src/mged/plot.c
===================================================================
--- brlcad/trunk/src/mged/plot.c        2020-05-07 16:17:26 UTC (rev 75728)
+++ brlcad/trunk/src/mged/plot.c        2020-05-07 17:21:13 UTC (rev 75729)
@@ -29,6 +29,7 @@
 #ifdef HAVE_SYS_TYPES_H
 #  include <sys/types.h>
 #endif
+#include "bio.h"
 #include "bresource.h"
 
 #include "bu/app.h"

Index: brlcad/trunk/src/other
===================================================================
--- brlcad/trunk/src/other      2020-05-07 16:17:26 UTC (rev 75728)
+++ brlcad/trunk/src/other      2020-05-07 17:21:13 UTC (rev 75729)

Property changes on: brlcad/trunk/src/other
___________________________________________________________________
Modified: svn:mergeinfo
## -1,4 +1,5 ##
 
/brlcad/branches/RELEASE/src/other:57439,57447-57860,69901-69913,71917-72242,72525-72534,72826-72858,74376-74454,75682-75685
+/brlcad/branches/bioh/src/other:75720-75728
 
/brlcad/branches/brep-debug/src/other:61373,61375,61404,61427,61429,61470,61544,61567,61576,61999,62018,62094,62098,62107,62117,62406,62416-62519,62521-62584,62593-62614,62623,62658,62660-62674,62681-62771,62876,62901,62907,62910,62925,62928,62931-63025,63027,63051,63054-63056,63069,63071-63073,63122,63160-63161,63165,63171,63184,63187,63189-63190,63193-63196,63200,63202,63205-63210,63213,63219-63225,63232-63233,63236,63238,63338,63350-63353,63481,63618,63669,64173-64174,64176-64177,64229-64233,64242,64244,64360-64362,65165,65245,65249,65334,65833-65834,66370-66375,66931-66932,66934,67012-67015,67018-67019,67021-67022,67406,67740,67746-67748,67950,67952,68144-68145,68636,68640-68643,68820,69081,69109,69206,69289,69346,69460-69461,69582-69583,69719-69721,69857-69859,69927
 /brlcad/branches/bullet/src/other:62518
 /brlcad/branches/cmake/src/other:43219
Index: brlcad/trunk/src/other/libregex
===================================================================
--- brlcad/trunk/src/other/libregex     2020-05-07 16:17:26 UTC (rev 75728)
+++ brlcad/trunk/src/other/libregex     2020-05-07 17:21:13 UTC (rev 75729)

Property changes on: brlcad/trunk/src/other/libregex
___________________________________________________________________
Modified: svn:mergeinfo
## -1,4 +1,5 ##
 
/brlcad/branches/RELEASE/src/other/libregex:57439,57447-57860,69901-69913,71917-72242,72525-72534,72826-72858,74376-74454
+/brlcad/branches/bioh/src/other/libregex:75720-75728
 
/brlcad/branches/brep-debug/src/other/libregex:61373,61375,61404,61427,61429,61470,61544,61567,61576,61999,62018,62094,62098,62107,62117,62406,62416-62519,62521-62584,62593-62614,62623,62658,62660-62674,62681-62771,62876,62901,62907,62910,62925,62928,62931-63025,63027,63051,63054-63056,63069,63071-63073,63122,63160-63161,63165,63171,63184,63187,63189-63190,63193-63196,63200,63202,63205-63210,63213,63219-63225,63232-63233,63236,63238,63338,63350-63353,63481,63618,63669,64173-64174,64176-64177,64229-64233,64242,64244,64360-64362,65165,65245,65249,65334,65833-65834,66370-66375,66931-66932,66934,67012-67015,67018-67019,67021-67022,67406,67740,67746-67748,67950,67952,68144-68145,68636,68640-68643,68820,69081,69109,69206,69289,69346,69460-69461,69582-69583,69719-69721,69857-69859,69927
 /brlcad/branches/bullet/src/other/libregex:62518
 /brlcad/branches/cmake/src/other/libregex:43219
Modified: brlcad/trunk/src/remrt/remrt.c
===================================================================
--- brlcad/trunk/src/remrt/remrt.c      2020-05-07 16:17:26 UTC (rev 75728)
+++ brlcad/trunk/src/remrt/remrt.c      2020-05-07 17:21:13 UTC (rev 75729)
@@ -3233,7 +3233,7 @@
     if ((fd = open(fr->fr_filename, 2)) < 0) {
        /* open failed */
        perror(fr->fr_filename);
-    } else if (lseek(fd, info.li_startpix*3, 0) < 0) {
+    } else if (bu_lseek(fd, info.li_startpix*3, 0) < 0) {
        /* seek failed */
        perror(fr->fr_filename);
        (void)close(fd);

Modified: brlcad/trunk/src/remrt/rtsrv.c
===================================================================
--- brlcad/trunk/src/remrt/rtsrv.c      2020-05-07 16:17:26 UTC (rev 75728)
+++ brlcad/trunk/src/remrt/rtsrv.c      2020-05-07 17:21:13 UTC (rev 75729)
@@ -41,6 +41,7 @@
 #ifdef HAVE_SYS_TYPES_H
 #  include <sys/types.h>
 #endif
+#include "bio.h"
 #include "bresource.h"
 #include "bsocket.h"
 

Modified: brlcad/trunk/src/rt/do.c
===================================================================
--- brlcad/trunk/src/rt/do.c    2020-05-07 16:17:26 UTC (rev 75728)
+++ brlcad/trunk/src/rt/do.c    2020-05-07 17:21:13 UTC (rev 75729)
@@ -38,6 +38,8 @@
 #  include <sys/stat.h>
 #endif
 
+#include "bio.h"
+
 #include "bu/app.h"
 #include "bu/getopt.h"
 #include "bu/debug.h"
@@ -690,7 +692,7 @@
     }
     if (outfp) {
         bu_semaphore_acquire(BU_SEM_SYSCALL);
-        if (fseek(outfp, cur_pixel*clt_o[1], 0) != 0)
+        if (bu_fseek(outfp, cur_pixel*clt_o[1], 0) != 0)
             fprintf(stderr, "fseek error\n");
         if (fwrite(pixelp, size, 1, outfp) != 1)
             bu_exit(EXIT_FAILURE, "pixel fwrite error");
@@ -917,7 +919,7 @@
        /*
         * This code allows the computation of a particular frame to a
         * disk file to be resumed automatically.  This is worthwhile
-        * crash protection.  This use of stat() and fseek() is
+        * crash protection.  This use of stat() and bu_fseek() is
         * UNIX-specific.
         *
         * It is not appropriate for the RT "top part" to assume

Modified: brlcad/trunk/src/rt/main.c
===================================================================
--- brlcad/trunk/src/rt/main.c  2020-05-07 16:17:26 UTC (rev 75728)
+++ brlcad/trunk/src/rt/main.c  2020-05-07 17:21:13 UTC (rev 75729)
@@ -42,6 +42,8 @@
 #  include <mpi.h>
 #endif
 
+#include "bio.h"
+
 #include "bu/endian.h"
 #include "bu/getopt.h"
 #include "bu/bitv.h"

Modified: brlcad/trunk/src/rt/view.c
===================================================================
--- brlcad/trunk/src/rt/view.c  2020-05-07 16:17:26 UTC (rev 75728)
+++ brlcad/trunk/src/rt/view.c  2020-05-07 17:21:13 UTC (rev 75729)
@@ -306,7 +306,7 @@
                    icv_writepixel(bif, ap->a_x, ap->a_y, ap->a_color);
                } else if (outfp != NULL) {
                    bu_semaphore_acquire(BU_SEM_SYSCALL);
-                   if (fseek(outfp, (ap->a_y*width*pwidth) + (ap->a_x*pwidth), 
0) != 0)
+                   if (bu_fseek(outfp, (ap->a_y*width*pwidth) + 
(ap->a_x*pwidth), 0) != 0)
                        fprintf(stderr, "fseek error\n");
                    if (fwrite(p, 3, 1, outfp) != 1)
                        bu_exit(EXIT_FAILURE, "pixel fwrite error");
@@ -512,7 +512,7 @@
                size_t count;
 
                bu_semaphore_acquire(BU_SEM_SYSCALL);
-               if (fseek(outfp, ap->a_y*width*pwidth, 0) != 0)
+               if (bu_fseek(outfp, ap->a_y*width*pwidth, 0) != 0)
                    fprintf(stderr, "fseek error\n");
                count = fwrite(scanline[ap->a_y].sl_buf,
                               sizeof(char), width*pwidth, outfp);

Modified: brlcad/trunk/src/sig/ddisp.c
===================================================================
--- brlcad/trunk/src/sig/ddisp.c        2020-05-07 16:17:26 UTC (rev 75728)
+++ brlcad/trunk/src/sig/ddisp.c        2020-05-07 17:21:13 UTC (rev 75729)
@@ -28,6 +28,8 @@
 #include <string.h>
 #include <stdlib.h>
 
+#include "bio.h"
+
 #include "bu/malloc.h"
 #include "bu/color.h"
 #include "bu/str.h"

Modified: brlcad/trunk/src/util/ap-pix.c
===================================================================
--- brlcad/trunk/src/util/ap-pix.c      2020-05-07 16:17:26 UTC (rev 75728)
+++ brlcad/trunk/src/util/ap-pix.c      2020-05-07 17:21:13 UTC (rev 75729)
@@ -80,9 +80,9 @@
        bu_exit(2, "%s: can't open \"%s\"\n", argv0, argv[1]);
     }
     yelfp = fopen(argv[1], "r");
-    fseek(yelfp, 50*sizeof(yelline), 0);
+    bu_fseek(yelfp, 50*sizeof(yelline), 0);
     cyafp = fopen(argv[1], "r");
-    fseek(cyafp, 100*sizeof(cyaline), 0);
+    bu_fseek(cyafp, 100*sizeof(cyaline), 0);
 
     line = 0;
     while ((int)fread(&cyaline, sizeof(cyaline), 1, cyafp) > 0) {

Modified: brlcad/trunk/src/util/bw-a.c
===================================================================
--- brlcad/trunk/src/util/bw-a.c        2020-05-07 16:17:26 UTC (rev 75728)
+++ brlcad/trunk/src/util/bw-a.c        2020-05-07 17:21:13 UTC (rev 75729)
@@ -38,6 +38,8 @@
 
 #include <stdlib.h>
 
+#include "bio.h"
+
 #include "vmath.h"
 #include "bu/getopt.h"
 #include "bu/exit.h"

Modified: brlcad/trunk/src/util/bw-png.c
===================================================================
--- brlcad/trunk/src/util/bw-png.c      2020-05-07 16:17:26 UTC (rev 75728)
+++ brlcad/trunk/src/util/bw-png.c      2020-05-07 17:21:13 UTC (rev 75729)
@@ -29,6 +29,8 @@
 #include <math.h>
 #include "png.h"
 
+#include "bio.h"
+
 #include "vmath.h"
 #include "bu/getopt.h"
 #include "bu/malloc.h"

Modified: brlcad/trunk/src/util/bwcrop.c
===================================================================
--- brlcad/trunk/src/util/bwcrop.c      2020-05-07 16:17:26 UTC (rev 75728)
+++ brlcad/trunk/src/util/bwcrop.c      2020-05-07 17:21:13 UTC (rev 75729)
@@ -104,7 +104,7 @@
     if (buf_start < 0)
        buf_start = 0;
 
-    fseek(ifp, buf_start * scanlen, 0);
+    bu_fseek(ifp, buf_start * scanlen, 0);
     ret = fread(buffer, scanlen, buflines, ifp);
     if (ret == 0)
        perror("fread");

Modified: brlcad/trunk/src/util/bwhist.c
===================================================================
--- brlcad/trunk/src/util/bwhist.c      2020-05-07 16:17:26 UTC (rev 75728)
+++ brlcad/trunk/src/util/bwhist.c      2020-05-07 17:21:13 UTC (rev 75729)
@@ -30,6 +30,8 @@
 #include <ctype.h>
 #include <string.h>
 
+#include "bio.h"
+
 #include "bu/str.h"
 #include "bu/exit.h"
 #include "fb.h"

Modified: brlcad/trunk/src/util/bwhisteq.c
===================================================================
--- brlcad/trunk/src/util/bwhisteq.c    2020-05-07 16:17:26 UTC (rev 75728)
+++ brlcad/trunk/src/util/bwhisteq.c    2020-05-07 17:21:13 UTC (rev 75729)
@@ -105,7 +105,7 @@
            fprintf(stderr, "result[%d] = %d\n", i, result[i]);
     }
 
-    fseek(fp, 0, 0);
+    bu_fseek(fp, 0, 0);
     while ((n = fread(buf, 1, BUFSIZE, fp)) > 0) {
        for (i = 0; i < n; i++) {
            long idx = buf[i];

Modified: brlcad/trunk/src/util/bwrot.c
===================================================================
--- brlcad/trunk/src/util/bwrot.c       2020-05-07 16:17:26 UTC (rev 75728)
+++ brlcad/trunk/src/util/bwrot.c       2020-05-07 17:21:13 UTC (rev 75729)
@@ -331,7 +331,7 @@
 
     /*
      * Clear our "file pointer."  We need to maintain this
-     * In order to tell if seeking is required.  ftell() always
+     * In order to tell if seeking is required.  bu_ftell() always
      * fails on pipes, so we can't use it.
      */
     outplace = 0;
@@ -358,7 +358,7 @@
                xout = (nyin - 1) - lasty;
                outbyte = ((yout * nyin) + xout) * pixbytes;
                if (outplace != outbyte) {
-                   if (fseek(ofp, outbyte, SEEK_SET) < 0) {
+                   if (bu_fseek(ofp, outbyte, SEEK_SET) < 0) {
                        ret = 3;
                        perror("fseek");
                        bu_log("ERROR: %s can't seek on output (ofp=%p, 
outbyte=%zd)\n", bu_getprogname(), (void *)ofp, outbyte);
@@ -384,7 +384,7 @@
                xout = yin;
                outbyte = ((yout * nyin) + xout) * pixbytes;
                if (outplace != outbyte) {
-                   if (fseek(ofp, outbyte, SEEK_SET) < 0) {
+                   if (bu_fseek(ofp, outbyte, SEEK_SET) < 0) {
                        ret = 3;
                        perror("fseek");
                        bu_log("ERROR: %s can't seek on output (ofp=%p, 
outbyte=%zd)\n", bu_getprogname(), (void *)ofp, outbyte);
@@ -402,7 +402,7 @@
                yout = (nyin - 1) - y + 1;
                outbyte = yout * scanbytes;
                if (outplace != outbyte) {
-                   if (fseek(ofp, outbyte, SEEK_SET) < 0) {
+                   if (bu_fseek(ofp, outbyte, SEEK_SET) < 0) {
                        ret = 3;
                        perror("fseek");
                        bu_log("ERROR: %s can't seek on output (ofp=%p, 
outbyte=%zd)\n", bu_getprogname(), (void *)ofp, outbyte);

Modified: brlcad/trunk/src/util/bwscale.c
===================================================================
--- brlcad/trunk/src/util/bwscale.c     2020-05-07 16:17:26 UTC (rev 75728)
+++ brlcad/trunk/src/util/bwscale.c     2020-05-07 17:21:13 UTC (rev 75729)
@@ -87,7 +87,7 @@
     buf_start = y - buflines/2;
     if (buf_start < 0) buf_start = 0;
 
-    if (fseek(buffp, buf_start * scanlen, 0) < 0) {
+    if (bu_fseek(buffp, buf_start * scanlen, 0) < 0) {
        fprintf(stderr, "bwscale: Can't seek to input pixel!\n");
        /* bu_exit (3, NULL); */
     }

Modified: brlcad/trunk/src/util/double-asc.c
===================================================================
--- brlcad/trunk/src/util/double-asc.c  2020-05-07 16:17:26 UTC (rev 75728)
+++ brlcad/trunk/src/util/double-asc.c  2020-05-07 17:21:13 UTC (rev 75729)
@@ -28,6 +28,8 @@
 #include <stdlib.h>
 #include <string.h>
 
+#include "bio.h"
+
 #include "vmath.h"
 #include "bu/getopt.h"
 #include "bu/malloc.h"

Modified: brlcad/trunk/src/util/dpix-pix.c
===================================================================
--- brlcad/trunk/src/util/dpix-pix.c    2020-05-07 16:17:26 UTC (rev 75728)
+++ brlcad/trunk/src/util/dpix-pix.c    2020-05-07 17:21:13 UTC (rev 75729)
@@ -97,7 +97,7 @@
        }
     }
 
-    lseek(fd, 0, 0);           /* rewind(fp); */
+    bu_lseek(fd, 0, 0);                /* rewind(fp); */
 
     /* This section uses the maximum and the minimum values found to
      * compute the m and the b of the line as specified by the

Modified: brlcad/trunk/src/util/pix-png.c
===================================================================
--- brlcad/trunk/src/util/pix-png.c     2020-05-07 16:17:26 UTC (rev 75728)
+++ brlcad/trunk/src/util/pix-png.c     2020-05-07 17:21:13 UTC (rev 75729)
@@ -33,6 +33,9 @@
 #ifdef HAVE_SYS_STAT_H
 #  include <sys/stat.h>
 #endif
+
+#include "bio.h"
+
 #include "png.h"
 
 #include "vmath.h"

Modified: brlcad/trunk/src/util/pix-ppm.c
===================================================================
--- brlcad/trunk/src/util/pix-ppm.c     2020-05-07 16:17:26 UTC (rev 75728)
+++ brlcad/trunk/src/util/pix-ppm.c     2020-05-07 17:21:13 UTC (rev 75729)
@@ -29,6 +29,8 @@
 
 #include <stdlib.h>
 
+#include "bio.h"
+
 #include "vmath.h"
 #include "bu/app.h"
 #include "bu/getopt.h"

Modified: brlcad/trunk/src/util/pixbgstrip.c
===================================================================
--- brlcad/trunk/src/util/pixbgstrip.c  2020-05-07 16:17:26 UTC (rev 75728)
+++ brlcad/trunk/src/util/pixbgstrip.c  2020-05-07 17:21:13 UTC (rev 75729)
@@ -27,6 +27,8 @@
 
 #include <stdlib.h>
 
+#include "bio.h"
+
 #include "vmath.h"
 #include "bu/getopt.h"
 #include "bu/malloc.h"

Modified: brlcad/trunk/src/util/pixborder.c
===================================================================
--- brlcad/trunk/src/util/pixborder.c   2020-05-07 16:17:26 UTC (rev 75728)
+++ brlcad/trunk/src/util/pixborder.c   2020-05-07 17:21:13 UTC (rev 75729)
@@ -29,6 +29,8 @@
 #include <stdlib.h>
 #include <math.h>
 
+#include "bio.h"
+
 #include "vmath.h"
 #include "bu/color.h"
 #include "bu/getopt.h"

Modified: brlcad/trunk/src/util/pixbustup.c
===================================================================
--- brlcad/trunk/src/util/pixbustup.c   2020-05-07 16:17:26 UTC (rev 75728)
+++ brlcad/trunk/src/util/pixbustup.c   2020-05-07 17:21:13 UTC (rev 75729)
@@ -81,7 +81,7 @@
 
     if (argc == 4) {
        image_offset = atoi(argv[3]);
-       lseek(0, image_offset*scanbytes, 0);
+       bu_lseek(0, image_offset*scanbytes, 0);
     }
     if (argc == 5)
        framenumber = atoi(argv[4]);

Modified: brlcad/trunk/src/util/pixcrop.c
===================================================================
--- brlcad/trunk/src/util/pixcrop.c     2020-05-07 16:17:26 UTC (rev 75728)
+++ brlcad/trunk/src/util/pixcrop.c     2020-05-07 17:21:13 UTC (rev 75729)
@@ -103,7 +103,7 @@
     buf_start = y - buflines/2;
     if (buf_start < 0) buf_start = 0;
 
-    fseek(ifp, 0, 0);
+    bu_fseek(ifp, 0, 0);
     ret = fread(buffer, scanlen, 3*buflines, ifp);
     if (ret == 0)
        perror("fread");

Modified: brlcad/trunk/src/util/pixelswap.c
===================================================================
--- brlcad/trunk/src/util/pixelswap.c   2020-05-07 16:17:26 UTC (rev 75728)
+++ brlcad/trunk/src/util/pixelswap.c   2020-05-07 17:21:13 UTC (rev 75729)
@@ -28,6 +28,8 @@
 #include <stdlib.h>
 #include <string.h>
 
+#include "bio.h"
+
 #include "bu/getopt.h"
 #include "bu/exit.h"
 #include "fb.h"

Modified: brlcad/trunk/src/util/pixhalve.c
===================================================================
--- brlcad/trunk/src/util/pixhalve.c    2020-05-07 16:17:26 UTC (rev 75728)
+++ brlcad/trunk/src/util/pixhalve.c    2020-05-07 17:21:13 UTC (rev 75729)
@@ -32,6 +32,8 @@
 
 #include <stdlib.h>
 
+#include "bio.h"
+
 #include "vmath.h"
 #include "bu/getopt.h"
 #include "bu/malloc.h"

Modified: brlcad/trunk/src/util/pixhist.c
===================================================================
--- brlcad/trunk/src/util/pixhist.c     2020-05-07 16:17:26 UTC (rev 75728)
+++ brlcad/trunk/src/util/pixhist.c     2020-05-07 17:21:13 UTC (rev 75729)
@@ -29,6 +29,8 @@
 #include <stdlib.h>
 #include <string.h>
 
+#include "bio.h"
+
 #include "bu/color.h"
 #include "bu/log.h"
 #include "bu/str.h"

Modified: brlcad/trunk/src/util/pixhist3d.c
===================================================================
--- brlcad/trunk/src/util/pixhist3d.c   2020-05-07 16:17:26 UTC (rev 75728)
+++ brlcad/trunk/src/util/pixhist3d.c   2020-05-07 17:21:13 UTC (rev 75729)
@@ -34,6 +34,8 @@
 #include <stdlib.h>
 #include <string.h>
 
+#include "bio.h"
+
 #include "bu/color.h"
 #include "bu/str.h"
 #include "bu/exit.h"

Modified: brlcad/trunk/src/util/pixmorph.c
===================================================================
--- brlcad/trunk/src/util/pixmorph.c    2020-05-07 16:17:26 UTC (rev 75728)
+++ brlcad/trunk/src/util/pixmorph.c    2020-05-07 17:21:13 UTC (rev 75729)
@@ -42,6 +42,8 @@
 #include <sys/stat.h>
 #include <math.h>
 
+#include "bio.h"
+
 #include "vmath.h"
 #include "bu/color.h"
 #include "bu/getopt.h"

Modified: brlcad/trunk/src/util/pixrot.c
===================================================================
--- brlcad/trunk/src/util/pixrot.c      2020-05-07 16:17:26 UTC (rev 75728)
+++ brlcad/trunk/src/util/pixrot.c      2020-05-07 17:21:13 UTC (rev 75729)
@@ -165,7 +165,7 @@
 
     /*
      * Clear our "file pointer." We need to maintain this
-     * In order to tell if seeking is required.  ftell() always
+     * In order to tell if seeking is required.  bu_ftell() always
      * fails on pipes, so we can't use it.
      */
     outplace = 0;
@@ -190,7 +190,7 @@
                xout = (nyin - 1) - lasty;
                outbyte = ((yout * nyin) + xout) * pixbytes;
                if (outplace != outbyte) {
-                   if (fseek(ofp, outbyte, 0) < 0) {
+                   if (bu_fseek(ofp, outbyte, 0) < 0) {
                        bu_exit(3, "pixrot: Can't seek on output, yet I need 
to!\n");
                    }
                    outplace = outbyte;
@@ -215,7 +215,7 @@
                xout = yin;
                outbyte = ((yout * nyin) + xout) * pixbytes;
                if (outplace != outbyte) {
-                   if (fseek(ofp, outbyte, 0) < 0) {
+                   if (bu_fseek(ofp, outbyte, 0) < 0) {
                        bu_exit(3, "pixrot: Can't seek on output, yet I need 
to!\n");
                    }
                    outplace = outbyte;
@@ -232,7 +232,7 @@
                yout = (nyin - 1) - y;
                outbyte = yout * scanbytes;
                if (outplace != outbyte) {
-                   if (fseek(ofp, outbyte, 0) < 0) {
+                   if (bu_fseek(ofp, outbyte, 0) < 0) {
                        bu_exit(3, "pixrot: Can't seek on output, yet I need 
to!\n");
                    }
                    outplace = outbyte;

Modified: brlcad/trunk/src/util/pixscale.c
===================================================================
--- brlcad/trunk/src/util/pixscale.c    2020-05-07 16:17:26 UTC (rev 75728)
+++ brlcad/trunk/src/util/pixscale.c    2020-05-07 17:21:13 UTC (rev 75729)
@@ -90,7 +90,7 @@
     if (buf_start < 0) buf_start = 0;
 
     if (file_pos != buf_start * scanlen) {
-       if (fseek(buffp, buf_start * scanlen, 0) < 0) {
+       if (bu_fseek(buffp, buf_start * scanlen, 0) < 0) {
            bu_exit(3, "pixscale: Can't seek to input pixel! y=%d\n", y);
        }
        file_pos = buf_start * scanlen;

Modified: brlcad/trunk/src/util/plot3rot.c
===================================================================
--- brlcad/trunk/src/util/plot3rot.c    2020-05-07 16:17:26 UTC (rev 75728)
+++ brlcad/trunk/src/util/plot3rot.c    2020-05-07 17:21:13 UTC (rev 75729)
@@ -525,7 +525,7 @@
                bu_log("plot3rot: unrecognized command '%c' (0x%x)\n",
                       (isprint(c)) ? c : '?',
                       c);
-               bu_log("plot3rot: ftell = %jd\n", (intmax_t)ftell(fp));
+               bu_log("plot3rot: ftell = %jd\n", (intmax_t)bu_ftell(fp));
                putchar(c);
                break;
        }

Modified: brlcad/trunk/src/util/wavelet.c
===================================================================
--- brlcad/trunk/src/util/wavelet.c     2020-05-07 16:17:26 UTC (rev 75728)
+++ brlcad/trunk/src/util/wavelet.c     2020-05-07 17:21:13 UTC (rev 75729)
@@ -44,6 +44,8 @@
 
 #include <stdlib.h>
 
+#include "bio.h"
+
 #include "vmath.h"
 #include "bu/getopt.h"
 #include "bu/malloc.h"

This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.



_______________________________________________
BRL-CAD Source Commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/brlcad-commits

Reply via email to