home *** CD-ROM | disk | FTP | other *** search
/ Source Code 1994 March / Source_Code_CD-ROM_Walnut_Creek_March_1994.iso / compsrcs / misc / volume35 / bitio / part03 < prev    next >
Encoding:
Text File  |  1993-03-02  |  30.4 KB  |  912 lines

  1. Newsgroups: comp.sources.misc
  2. From: pdh@netcom.com (Philip D. Howard)
  3. Subject: v35i107:  bitio - portable bit stream function library, Part03/03
  4. Message-ID: <1993Mar3.151951.14165@sparky.imd.sterling.com>
  5. X-Md4-Signature: 3aa5094aea7ceadf43f6dac0d4edafc1
  6. Date: Wed, 3 Mar 1993 15:19:51 GMT
  7. Approved: kent@sparky.imd.sterling.com
  8.  
  9. Submitted-by: pdh@netcom.com (Philip D. Howard)
  10. Posting-number: Volume 35, Issue 107
  11. Archive-name: bitio/part03
  12. Environment: MS-DOS, UNIX, ANSI-C, BCC, GCC, MSC, PC, NeXT, Sparc, Sequent
  13.  
  14. #! /bin/sh
  15. # This is a shell archive.  Remove anything before this line, then feed it
  16. # into a shell via "sh file" or similar.  To overwrite existing files,
  17. # type "sh file -c".
  18. # Contents:  bitio104/CHANGES bitio104/PLATFORM bitio104/VERSION
  19. #   bitio104/bcc.mf bitio104/bclean.bat bitio104/bithput.c
  20. #   bitio104/bitlget.c bitio104/bitlput.c bitio104/bmake.bat
  21. #   bitio104/bmakeall.bat bitio104/bremake.bat bitio104/bvirgin.bat
  22. #   bitio104/gcc.mf bitio104/gclean bitio104/gmake bitio104/gremake
  23. #   bitio104/gvirgin bitio104/mclean.bat bitio104/mmake.bat
  24. #   bitio104/mmakeall.bat bitio104/mremake.bat bitio104/msc.mf
  25. #   bitio104/mvirgin.bat bitio104/test bitio104/test.bat
  26. #   bitio104/testi.c bitio104/testo.c
  27. # Wrapped by kent@sparky on Wed Mar  3 09:07:11 1993
  28. PATH=/bin:/usr/bin:/usr/ucb:/usr/local/bin:/usr/lbin ; export PATH
  29. echo If this archive is complete, you will see the following message:
  30. echo '          "shar: End of archive 3 (of 3)."'
  31. if test -f 'bitio104/CHANGES' -a "${1}" != "-c" ; then 
  32.   echo shar: Will not clobber existing file \"'bitio104/CHANGES'\"
  33. else
  34.   echo shar: Extracting \"'bitio104/CHANGES'\" \(999 characters\)
  35.   sed "s/^X//" >'bitio104/CHANGES' <<'END_OF_FILE'
  36. X========================================================================
  37. X1993-Feb-22 version 1.04
  38. X
  39. X1.  Work around a Borland C++ 3.1 bad code compilation bug.
  40. X
  41. X2.  Replace bit shift with array indexing to constuct certain masks.
  42. X
  43. X3.  Set byte file buffer size under MS-DOS.
  44. X
  45. X4.  Rewrote makefiles.
  46. X
  47. X5.  More source comments.
  48. X========================================================================
  49. X1993-Jan-20 version 1.03
  50. X
  51. X1.  Ported BITIO to MS-DOS with Borland C++ 3.1.
  52. X
  53. X2.  Did some cleaning of makefiles.
  54. X========================================================================
  55. X1993-Jan-13 version 1.02
  56. X
  57. X1.  Fixed bug in BIT1GET macro which failed to return an EOF.
  58. X
  59. X2.  Added test programs "testmo" and "testmi" to perform a speed run
  60. X    on BIT1PUT and BIT1GET macros.
  61. X========================================================================
  62. X1993-Jan-12 version 1.01
  63. X
  64. X1.  Ported BITIO to MS-DOS with MicroSoft C 6.00a.
  65. X========================================================================
  66. END_OF_FILE
  67.   if test 999 -ne `wc -c <'bitio104/CHANGES'`; then
  68.     echo shar: \"'bitio104/CHANGES'\" unpacked with wrong size!
  69.   fi
  70.   # end of 'bitio104/CHANGES'
  71. fi
  72. if test -f 'bitio104/PLATFORM' -a "${1}" != "-c" ; then 
  73.   echo shar: Will not clobber existing file \"'bitio104/PLATFORM'\"
  74. else
  75.   echo shar: Extracting \"'bitio104/PLATFORM'\" \(185 characters\)
  76.   sed "s/^X//" >'bitio104/PLATFORM' <<'END_OF_FILE'
  77. XThese platforms have been tested with at least some version of BITIO and
  78. Xfound to work:
  79. X
  80. XMS-DOS Borland C++ 3.1
  81. XMS-DOS MicroSoft C 6.00a
  82. XNeXT
  83. XSequent Symmetry (Dynix)
  84. XSun Sparc (SunOS)
  85. END_OF_FILE
  86.   if test 185 -ne `wc -c <'bitio104/PLATFORM'`; then
  87.     echo shar: \"'bitio104/PLATFORM'\" unpacked with wrong size!
  88.   fi
  89.   # end of 'bitio104/PLATFORM'
  90. fi
  91. if test -f 'bitio104/VERSION' -a "${1}" != "-c" ; then 
  92.   echo shar: Will not clobber existing file \"'bitio104/VERSION'\"
  93. else
  94.   echo shar: Extracting \"'bitio104/VERSION'\" \(9 characters\)
  95.   sed "s/^X//" >'bitio104/VERSION' <<'END_OF_FILE'
  96. Xbitio104
  97. END_OF_FILE
  98.   if test 9 -ne `wc -c <'bitio104/VERSION'`; then
  99.     echo shar: \"'bitio104/VERSION'\" unpacked with wrong size!
  100.   fi
  101.   # end of 'bitio104/VERSION'
  102. fi
  103. if test -f 'bitio104/bcc.mf' -a "${1}" != "-c" ; then 
  104.   echo shar: Will not clobber existing file \"'bitio104/bcc.mf'\"
  105. else
  106.   echo shar: Extracting \"'bitio104/bcc.mf'\" \(1643 characters\)
  107.   sed "s/^X//" >'bitio104/bcc.mf' <<'END_OF_FILE'
  108. X# makefile for Borland C++ 3.1 (and maybe other versions)
  109. X#define MODEL on the MAKE command line in lower case
  110. X
  111. XLIBNAME    = bitio
  112. X
  113. XINCLUDE = .;$(INCLUDE)
  114. XLIB     = .;$(LIB)
  115. X
  116. XCC    = bcc
  117. XCCFLAGS = -a -c -d -G -g9 -j9 -N -O2 -Qx=1024 -S -w -Z -D__STDC__=0
  118. XAS    = tasm
  119. XASFLAGS = /c /l /la /m /ml /z
  120. XLB    = tlib
  121. XLBFLAGS = /C /P16
  122. XLN    = tlink
  123. XLNFLAGS = /c /d /s
  124. X
  125. XLIBS = $(LIBNAME)$(MODEL).lib c$(MODEL).lib math$(MODEL).lib
  126. X
  127. XFUNCS = bit1get.obj bit1put.obj bitclose.obj bitflush.obj bithget.obj\
  128. X        bithput.obj bitlget.obj bitlput.obj bitopen.obj bituse.obj
  129. X
  130. XTESTS = testi.exe testmi.exe testmo.exe testo.exe
  131. X
  132. X.c.obj:
  133. X    $(CC) $(CCFLAGS) -I$(INCLUDE) -m$(MODEL) -o$*.asm $*.c
  134. X    $(AS) $(ASFLAGS) $*.asm , $*.obj , $*.lst , $*.xrf
  135. X    $(LB) $(LBFLAGS) $(LIBNAME)$(MODEL).lib -+$*.obj
  136. X    
  137. X.c.exe:
  138. X    $(CC) $(CCFLAGS) -I$(INCLUDE) -m$(MODEL) -o$*.asm $*.c
  139. X    $(AS) $(ASFLAGS) $*.asm , $*.obj , $*.lst , $*.xrf
  140. X    $(LN) $(LNFLAGS) /Tde c0$(MODEL).obj $*.obj, $*.exe, $*.map, $(LIBS)
  141. X
  142. Xall: $(FUNCS) $(TESTS)
  143. X
  144. Xlibrary: $(FUNCS)
  145. X
  146. Xbit1get.obj: bitio.h bit1get.c
  147. X
  148. Xbit1put.obj: bitio.h bit1put.c
  149. X
  150. Xbitclose.obj: bitio.h bitclose.c
  151. X
  152. Xbitflush.obj: bitio.h bitflush.c
  153. X
  154. Xbithget.obj: bitio.h bitget.h bithget.c
  155. X
  156. Xbithput.obj: bitio.h bitput.h bithput.c
  157. X
  158. Xbitlget.obj: bitio.h bitget.h bitlget.c
  159. X
  160. Xbitlput.obj: bitio.h bitput.h bitlput.c
  161. X
  162. Xbitopen.obj: bitio.h bitopen.c
  163. X
  164. Xbituse.obj: bitio.h bituse.c
  165. X
  166. Xtesti.exe: bitio.h testio.h rand.h randul.c testi.c
  167. X
  168. Xtestmi.exe: bitio.h testmi.c
  169. X
  170. Xtestmo.exe: bitio.h testmo.c
  171. X
  172. Xtesto.exe: bitio.h testio.h rand.h randul.c testo.c
  173. X
  174. Xclean:
  175. X    del *.asm
  176. X    del *.bak
  177. X    del *.dat
  178. X    del *.lst
  179. X    del *.obj
  180. X    del *.map
  181. X    del *.xrf
  182. X
  183. Xvirgin: clean
  184. X    del *.lib
  185. X    del *.exe
  186. END_OF_FILE
  187.   if test 1643 -ne `wc -c <'bitio104/bcc.mf'`; then
  188.     echo shar: \"'bitio104/bcc.mf'\" unpacked with wrong size!
  189.   fi
  190.   # end of 'bitio104/bcc.mf'
  191. fi
  192. if test -f 'bitio104/bclean.bat' -a "${1}" != "-c" ; then 
  193.   echo shar: Will not clobber existing file \"'bitio104/bclean.bat'\"
  194. else
  195.   echo shar: Extracting \"'bitio104/bclean.bat'\" \(20 characters\)
  196.   sed "s/^X//" >'bitio104/bclean.bat' <<'END_OF_FILE'
  197. Xmake -fbcc.mf clean
  198. END_OF_FILE
  199.   if test 20 -ne `wc -c <'bitio104/bclean.bat'`; then
  200.     echo shar: \"'bitio104/bclean.bat'\" unpacked with wrong size!
  201.   fi
  202.   # end of 'bitio104/bclean.bat'
  203. fi
  204. if test -f 'bitio104/bithput.c' -a "${1}" != "-c" ; then 
  205.   echo shar: Will not clobber existing file \"'bitio104/bithput.c'\"
  206. else
  207.   echo shar: Extracting \"'bitio104/bithput.c'\" \(1905 characters\)
  208.   sed "s/^X//" >'bitio104/bithput.c' <<'END_OF_FILE'
  209. X/***********************************************************************\
  210. X|   Copyright (C) 1993 - by Philip David Howard - all rights reserved    |
  211. X|                                    |
  212. X|   This library is free software; you may redistribute it and/or    |
  213. X|   modify it under the terms of the GNU Library General Public        |
  214. X|   License as published by the Free Software Foundation; either    |
  215. X|   version 2 of the license, or (at your option) any later version.    |
  216. X|                                    |
  217. X|   This library is distributed in the hope that it will be useful,    |
  218. X|   but WITHOUT ANY WARRANTY; without even the implied warranty of    |
  219. X|   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the    |
  220. X|   GNU Library General Public License for more details.        |
  221. X|                                    |
  222. X|   You should have received a copy of the GNU Library General Public    |
  223. X|   License along with this library.  If not, write to the Free        |
  224. X|   Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.    |
  225. X|                                    |
  226. X|author:    Philip D. Howard (ka9wgn)                |
  227. X|email:        pdh@netcom.com                        |
  228. X|postal:    PO Box 5012;  Champaign, IL  61825-5012            |
  229. X|voice/fax:    217-384-4934                        |
  230. X\***********************************************************************/
  231. X/***********************************************************************\
  232. X|function:    bithput                            |
  233. X|purpose:    to output bit data to a bit stream file            |
  234. X|        data is high order justified                |
  235. X|                                    |
  236. X|arguments:    1 (BITFILE *) bit stream file to be written to        |
  237. X|        2 (ulong) bit data to be written            |
  238. X|        3 (uint) count of bits to be written 0..32        |
  239. X|returns:    (int) ==EOF: error  !=EOF: ok                |
  240. X\***********************************************************************/
  241. X#include <bitio.h>
  242. X
  243. X#ifdef __STDC__
  244. X
  245. Xint bithput(
  246. X    BITFILE *    bitstream    ,
  247. X    ulong        data        ,
  248. X    uint        count
  249. X)
  250. X
  251. X#else
  252. X
  253. Xint bithput( bitstream , data , count )
  254. X    BITFILE *    bitstream    ;
  255. X    ulong        data        ;
  256. X    uint        count        ;
  257. X
  258. X#endif
  259. X
  260. X#define BITIO_HIGH
  261. X#include <bitput.h>
  262. END_OF_FILE
  263.   if test 1905 -ne `wc -c <'bitio104/bithput.c'`; then
  264.     echo shar: \"'bitio104/bithput.c'\" unpacked with wrong size!
  265.   fi
  266.   # end of 'bitio104/bithput.c'
  267. fi
  268. if test -f 'bitio104/bitlget.c' -a "${1}" != "-c" ; then 
  269.   echo shar: Will not clobber existing file \"'bitio104/bitlget.c'\"
  270. else
  271.   echo shar: Extracting \"'bitio104/bitlget.c'\" \(1987 characters\)
  272.   sed "s/^X//" >'bitio104/bitlget.c' <<'END_OF_FILE'
  273. X/***********************************************************************\
  274. X|   Copyright (C) 1993 - by Philip David Howard - all rights reserved    |
  275. X|                                    |
  276. X|   This library is free software; you may redistribute it and/or    |
  277. X|   modify it under the terms of the GNU Library General Public        |
  278. X|   License as published by the Free Software Foundation; either    |
  279. X|   version 2 of the license, or (at your option) any later version.    |
  280. X|                                    |
  281. X|   This library is distributed in the hope that it will be useful,    |
  282. X|   but WITHOUT ANY WARRANTY; without even the implied warranty of    |
  283. X|   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the    |
  284. X|   GNU Library General Public License for more details.        |
  285. X|                                    |
  286. X|   You should have received a copy of the GNU Library General Public    |
  287. X|   License along with this library.  If not, write to the Free        |
  288. X|   Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.    |
  289. X|                                    |
  290. X|author:    Philip D. Howard (ka9wgn)                |
  291. X|email:        pdh@netcom.com                        |
  292. X|postal:    PO Box 5012;  Champaign, IL  61825-5012            |
  293. X|voice/fax:    217-384-4934                        |
  294. X\***********************************************************************/
  295. X/***********************************************************************\
  296. X|function:    bitlget                            |
  297. X|purpose:    to input bit data from a bit stream file        |
  298. X|        data is low order justified                |
  299. X|                                    |
  300. X|arguments:    1 (BITFILE *) bit stream file to be read from        |
  301. X|        2 (uint *) pointer to where actual count goes        |
  302. X|        3 (uint) count of bits to get                |
  303. X|returns:    (ulong) data from bit stream file            |
  304. X|                                    |
  305. X|note:        returned count is 0 for EOF, -1 for error        |
  306. X\***********************************************************************/
  307. X#include <bitio.h>
  308. X
  309. X#ifdef __STDC__
  310. X
  311. Xulong bitlget(
  312. X    BITFILE *    bitstream    ,
  313. X    uint *        countptr    ,
  314. X    uint        count
  315. X)
  316. X
  317. X#else
  318. X
  319. Xulong bitlget( bitstream , countptr , count )
  320. X    BITFILE *    bitstream    ;
  321. X    uint *        countptr    ;
  322. X    uint        count        ;
  323. X
  324. X#endif
  325. X
  326. X#define BITIO_LOW
  327. X#include <bitget.h>
  328. END_OF_FILE
  329.   if test 1987 -ne `wc -c <'bitio104/bitlget.c'`; then
  330.     echo shar: \"'bitio104/bitlget.c'\" unpacked with wrong size!
  331.   fi
  332.   # end of 'bitio104/bitlget.c'
  333. fi
  334. if test -f 'bitio104/bitlput.c' -a "${1}" != "-c" ; then 
  335.   echo shar: Will not clobber existing file \"'bitio104/bitlput.c'\"
  336. else
  337.   echo shar: Extracting \"'bitio104/bitlput.c'\" \(1903 characters\)
  338.   sed "s/^X//" >'bitio104/bitlput.c' <<'END_OF_FILE'
  339. X/***********************************************************************\
  340. X|   Copyright (C) 1993 - by Philip David Howard - all rights reserved    |
  341. X|                                    |
  342. X|   This library is free software; you may redistribute it and/or    |
  343. X|   modify it under the terms of the GNU Library General Public        |
  344. X|   License as published by the Free Software Foundation; either    |
  345. X|   version 2 of the license, or (at your option) any later version.    |
  346. X|                                    |
  347. X|   This library is distributed in the hope that it will be useful,    |
  348. X|   but WITHOUT ANY WARRANTY; without even the implied warranty of    |
  349. X|   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the    |
  350. X|   GNU Library General Public License for more details.        |
  351. X|                                    |
  352. X|   You should have received a copy of the GNU Library General Public    |
  353. X|   License along with this library.  If not, write to the Free        |
  354. X|   Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.    |
  355. X|                                    |
  356. X|author:    Philip D. Howard (ka9wgn)                |
  357. X|email:        pdh@netcom.com                        |
  358. X|postal:    PO Box 5012;  Champaign, IL  61825-5012            |
  359. X|voice/fax:    217-384-4934                        |
  360. X\***********************************************************************/
  361. X/***********************************************************************\
  362. X|function:    bitlput                            |
  363. X|purpose:    to output bit data to a bit stream file            |
  364. X|        data is low order justified                |
  365. X|                                    |
  366. X|arguments:    1 (BITFILE *) bit stream file to be written to        |
  367. X|        2 (ulong) bit data to be written            |
  368. X|        3 (uint) count of bits to be written 0..32        |
  369. X|returns:    (int) ==EOF: error  !=EOF: ok                |
  370. X\***********************************************************************/
  371. X#include <bitio.h>
  372. X
  373. X#ifdef __STDC__
  374. X
  375. Xint bitlput(
  376. X    BITFILE *    bitstream    ,
  377. X    ulong        data        ,
  378. X    uint        count
  379. X)
  380. X
  381. X#else
  382. X
  383. Xint bitlput( bitstream , data , count )
  384. X    BITFILE *    bitstream    ;
  385. X    ulong        data        ;
  386. X    uint        count        ;
  387. X
  388. X#endif
  389. X
  390. X#define BITIO_LOW
  391. X#include <bitput.h>
  392. END_OF_FILE
  393.   if test 1903 -ne `wc -c <'bitio104/bitlput.c'`; then
  394.     echo shar: \"'bitio104/bitlput.c'\" unpacked with wrong size!
  395.   fi
  396.   # end of 'bitio104/bitlput.c'
  397. fi
  398. if test -f 'bitio104/bmake.bat' -a "${1}" != "-c" ; then 
  399.   echo shar: Will not clobber existing file \"'bitio104/bmake.bat'\"
  400. else
  401.   echo shar: Extracting \"'bitio104/bmake.bat'\" \(28 characters\)
  402.   sed "s/^X//" >'bitio104/bmake.bat' <<'END_OF_FILE'
  403. Xmake -fbcc.mf -DMODEL=c all
  404. END_OF_FILE
  405.   if test 28 -ne `wc -c <'bitio104/bmake.bat'`; then
  406.     echo shar: \"'bitio104/bmake.bat'\" unpacked with wrong size!
  407.   fi
  408.   # end of 'bitio104/bmake.bat'
  409. fi
  410. if test -f 'bitio104/bmakeall.bat' -a "${1}" != "-c" ; then 
  411.   echo shar: Will not clobber existing file \"'bitio104/bmakeall.bat'\"
  412. else
  413.   echo shar: Extracting \"'bitio104/bmakeall.bat'\" \(665 characters\)
  414.   sed "s/^X//" >'bitio104/bmakeall.bat' <<'END_OF_FILE'
  415. X@echo ========================================================================
  416. Xmake -fbcc.mf -DMODEL=c virgin library
  417. X@echo ========================================================================
  418. Xmake -fbcc.mf -DMODEL=h clean library
  419. X@echo ========================================================================
  420. Xmake -fbcc.mf -DMODEL=l clean library
  421. X@echo ========================================================================
  422. Xmake -fbcc.mf -DMODEL=m clean library
  423. X@echo ========================================================================
  424. Xmake -fbcc.mf -DMODEL=s clean library
  425. X@echo ========================================================================
  426. END_OF_FILE
  427.   if test 665 -ne `wc -c <'bitio104/bmakeall.bat'`; then
  428.     echo shar: \"'bitio104/bmakeall.bat'\" unpacked with wrong size!
  429.   fi
  430.   # end of 'bitio104/bmakeall.bat'
  431. fi
  432. if test -f 'bitio104/bremake.bat' -a "${1}" != "-c" ; then 
  433.   echo shar: Will not clobber existing file \"'bitio104/bremake.bat'\"
  434. else
  435.   echo shar: Extracting \"'bitio104/bremake.bat'\" \(35 characters\)
  436.   sed "s/^X//" >'bitio104/bremake.bat' <<'END_OF_FILE'
  437. Xmake -fbcc.mf -DMODEL=c virgin all
  438. END_OF_FILE
  439.   if test 35 -ne `wc -c <'bitio104/bremake.bat'`; then
  440.     echo shar: \"'bitio104/bremake.bat'\" unpacked with wrong size!
  441.   fi
  442.   # end of 'bitio104/bremake.bat'
  443. fi
  444. if test -f 'bitio104/bvirgin.bat' -a "${1}" != "-c" ; then 
  445.   echo shar: Will not clobber existing file \"'bitio104/bvirgin.bat'\"
  446. else
  447.   echo shar: Extracting \"'bitio104/bvirgin.bat'\" \(21 characters\)
  448.   sed "s/^X//" >'bitio104/bvirgin.bat' <<'END_OF_FILE'
  449. Xmake -fbcc.mf virgin
  450. END_OF_FILE
  451.   if test 21 -ne `wc -c <'bitio104/bvirgin.bat'`; then
  452.     echo shar: \"'bitio104/bvirgin.bat'\" unpacked with wrong size!
  453.   fi
  454.   # end of 'bitio104/bvirgin.bat'
  455. fi
  456. if test -f 'bitio104/gcc.mf' -a "${1}" != "-c" ; then 
  457.   echo shar: Will not clobber existing file \"'bitio104/gcc.mf'\"
  458. else
  459.   echo shar: Extracting \"'bitio104/gcc.mf'\" \(1491 characters\)
  460.   sed "s/^X//" >'bitio104/gcc.mf' <<'END_OF_FILE'
  461. X# makefile for GNU CC on UNIX
  462. X
  463. XLIBNAME    = bitio
  464. X
  465. XINCLUDE = .;$(INCLUDE)
  466. XLIB     = .;$(LIB)
  467. X
  468. XCC    = gcc
  469. XCCFLAGS    = -DGCC -DUNIX -O -S -I.
  470. XAS    = gcc
  471. XASFLAGS = -DGCC -DUNIX -c
  472. XLB    = lib
  473. XLBFLAGS    = /nologo
  474. XLN    = gcc
  475. XLNFLAGS    =
  476. X
  477. XFUNCS = bit1get.o bit1put.o bitclose.o bitflush.o bithget.o\
  478. X        bithput.o bitlget.o bitlput.o bitopen.o bituse.o
  479. X
  480. XTESTS = testi testmi testmo testo
  481. X
  482. X.c.o:
  483. X    $(CC) $(CCFLAGS) $*.c
  484. X    $(AS) $(ASFLAGS) $*.s
  485. X
  486. Xall: library $(TESTS)
  487. X
  488. Xlibrary: $(FUNCS)
  489. X    ar cr lib$(LIBNAME).a $(FUNCS)
  490. X    ranlib lib$(LIBNAME).a
  491. X
  492. Xbit1get.o: bitio.h bit1get.c
  493. X
  494. Xbit1put.o: bitio.h bit1put.c
  495. X
  496. Xbitclose.o: bitio.h bitclose.c
  497. X
  498. Xbitflush.o: bitio.h bitflush.c
  499. X
  500. Xbithget.o: bitio.h bitget.h bithget.c
  501. X
  502. Xbithput.o: bitio.h bitput.h bithput.c
  503. X
  504. Xbitlget.o: bitio.h bitget.h bitlget.c
  505. X
  506. Xbitlput.o: bitio.h bitput.h bitlput.c
  507. X
  508. Xbitopen.o: bitio.h bitopen.c
  509. X
  510. Xbituse.o: bitio.h bituse.c
  511. X
  512. Xtesti: bitio.h testio.h rand.h randul.c testi.c
  513. X    $(CC) $(CCFLAGS) testi.c
  514. X    $(AS) $(ASFLAGS) testi.s
  515. X    $(LN) -o testi testi.o -L. -l$(LIBNAME)
  516. X
  517. Xtestmi: bitio.h testmi.c
  518. X    $(CC) $(CCFLAGS) testmi.c
  519. X    $(AS) $(ASFLAGS) testmi.s
  520. X    $(LN) -o testmi testmi.o -L. -l$(LIBNAME)
  521. X
  522. Xtestmo: bitio.h testmo.c
  523. X    $(CC) $(CCFLAGS) testmo.c
  524. X    $(AS) $(ASFLAGS) testmo.s
  525. X    $(LN) -o testmo testmo.o -L. -l$(LIBNAME)
  526. X
  527. Xtesto: bitio.h testio.h rand.h randul.c testo.c
  528. X    $(CC) $(CCFLAGS) testo.c
  529. X    $(AS) $(ASFLAGS) testo.s
  530. X    $(LN) -o testo testo.o -L. -l$(LIBNAME)
  531. X
  532. Xclean:
  533. X    sh -c 'rm -f *.cpp *.dat *.i *.o *.s *~ #*#'
  534. X
  535. Xvirgin: clean
  536. X    sh -c 'rm -f *.a $(TESTS)' 
  537. X
  538. X
  539. X
  540. X
  541. X
  542. X
  543. END_OF_FILE
  544.   if test 1491 -ne `wc -c <'bitio104/gcc.mf'`; then
  545.     echo shar: \"'bitio104/gcc.mf'\" unpacked with wrong size!
  546.   fi
  547.   # end of 'bitio104/gcc.mf'
  548. fi
  549. if test -f 'bitio104/gclean' -a "${1}" != "-c" ; then 
  550.   echo shar: Will not clobber existing file \"'bitio104/gclean'\"
  551. else
  552.   echo shar: Extracting \"'bitio104/gclean'\" \(36 characters\)
  553.   sed "s/^X//" >'bitio104/gclean' <<'END_OF_FILE'
  554. X#!/bin/sh
  555. Xexec make -f gcc.mf clean
  556. END_OF_FILE
  557.   if test 36 -ne `wc -c <'bitio104/gclean'`; then
  558.     echo shar: \"'bitio104/gclean'\" unpacked with wrong size!
  559.   fi
  560.   chmod +x 'bitio104/gclean'
  561.   # end of 'bitio104/gclean'
  562. fi
  563. if test -f 'bitio104/gmake' -a "${1}" != "-c" ; then 
  564.   echo shar: Will not clobber existing file \"'bitio104/gmake'\"
  565. else
  566.   echo shar: Extracting \"'bitio104/gmake'\" \(34 characters\)
  567.   sed "s/^X//" >'bitio104/gmake' <<'END_OF_FILE'
  568. X#!/bin/sh
  569. Xexec make -f gcc.mf all
  570. END_OF_FILE
  571.   if test 34 -ne `wc -c <'bitio104/gmake'`; then
  572.     echo shar: \"'bitio104/gmake'\" unpacked with wrong size!
  573.   fi
  574.   chmod +x 'bitio104/gmake'
  575.   # end of 'bitio104/gmake'
  576. fi
  577. if test -f 'bitio104/gremake' -a "${1}" != "-c" ; then 
  578.   echo shar: Will not clobber existing file \"'bitio104/gremake'\"
  579. else
  580.   echo shar: Extracting \"'bitio104/gremake'\" \(41 characters\)
  581.   sed "s/^X//" >'bitio104/gremake' <<'END_OF_FILE'
  582. X#!/bin/sh
  583. Xexec make -f gcc.mf virgin all
  584. END_OF_FILE
  585.   if test 41 -ne `wc -c <'bitio104/gremake'`; then
  586.     echo shar: \"'bitio104/gremake'\" unpacked with wrong size!
  587.   fi
  588.   chmod +x 'bitio104/gremake'
  589.   # end of 'bitio104/gremake'
  590. fi
  591. if test -f 'bitio104/gvirgin' -a "${1}" != "-c" ; then 
  592.   echo shar: Will not clobber existing file \"'bitio104/gvirgin'\"
  593. else
  594.   echo shar: Extracting \"'bitio104/gvirgin'\" \(37 characters\)
  595.   sed "s/^X//" >'bitio104/gvirgin' <<'END_OF_FILE'
  596. X#!/bin/sh
  597. Xexec make -f gcc.mf virgin
  598. END_OF_FILE
  599.   if test 37 -ne `wc -c <'bitio104/gvirgin'`; then
  600.     echo shar: \"'bitio104/gvirgin'\" unpacked with wrong size!
  601.   fi
  602.   chmod +x 'bitio104/gvirgin'
  603.   # end of 'bitio104/gvirgin'
  604. fi
  605. if test -f 'bitio104/mclean.bat' -a "${1}" != "-c" ; then 
  606.   echo shar: Will not clobber existing file \"'bitio104/mclean.bat'\"
  607. else
  608.   echo shar: Extracting \"'bitio104/mclean.bat'\" \(22 characters\)
  609.   sed "s/^X//" >'bitio104/mclean.bat' <<'END_OF_FILE'
  610. Xnmake /F msc.mf clean
  611. END_OF_FILE
  612.   if test 22 -ne `wc -c <'bitio104/mclean.bat'`; then
  613.     echo shar: \"'bitio104/mclean.bat'\" unpacked with wrong size!
  614.   fi
  615.   # end of 'bitio104/mclean.bat'
  616. fi
  617. if test -f 'bitio104/mmake.bat' -a "${1}" != "-c" ; then 
  618.   echo shar: Will not clobber existing file \"'bitio104/mmake.bat'\"
  619. else
  620.   echo shar: Extracting \"'bitio104/mmake.bat'\" \(28 characters\)
  621.   sed "s/^X//" >'bitio104/mmake.bat' <<'END_OF_FILE'
  622. Xnmake /F msc.mf MODEL=C all
  623. END_OF_FILE
  624.   if test 28 -ne `wc -c <'bitio104/mmake.bat'`; then
  625.     echo shar: \"'bitio104/mmake.bat'\" unpacked with wrong size!
  626.   fi
  627.   # end of 'bitio104/mmake.bat'
  628. fi
  629. if test -f 'bitio104/mmakeall.bat' -a "${1}" != "-c" ; then 
  630.   echo shar: Will not clobber existing file \"'bitio104/mmakeall.bat'\"
  631. else
  632.   echo shar: Extracting \"'bitio104/mmakeall.bat'\" \(665 characters\)
  633.   sed "s/^X//" >'bitio104/mmakeall.bat' <<'END_OF_FILE'
  634. X@echo ========================================================================
  635. Xnmake /F msc.mf MODEL=C virgin library
  636. X@echo ========================================================================
  637. Xnmake /F msc.mf MODEL=H clean library
  638. X@echo ========================================================================
  639. Xnmake /F msc.mf MODEL=L clean library
  640. X@echo ========================================================================
  641. Xnmake /F msc.mf MODEL=M clean library
  642. X@echo ========================================================================
  643. Xnmake /F msc.mf MODEL=S clean library
  644. X@echo ========================================================================
  645. END_OF_FILE
  646.   if test 665 -ne `wc -c <'bitio104/mmakeall.bat'`; then
  647.     echo shar: \"'bitio104/mmakeall.bat'\" unpacked with wrong size!
  648.   fi
  649.   # end of 'bitio104/mmakeall.bat'
  650. fi
  651. if test -f 'bitio104/mremake.bat' -a "${1}" != "-c" ; then 
  652.   echo shar: Will not clobber existing file \"'bitio104/mremake.bat'\"
  653. else
  654.   echo shar: Extracting \"'bitio104/mremake.bat'\" \(34 characters\)
  655.   sed "s/^X//" >'bitio104/mremake.bat' <<'END_OF_FILE'
  656. Xnmake /F msc.mf MODEL=C clean all
  657. END_OF_FILE
  658.   if test 34 -ne `wc -c <'bitio104/mremake.bat'`; then
  659.     echo shar: \"'bitio104/mremake.bat'\" unpacked with wrong size!
  660.   fi
  661.   # end of 'bitio104/mremake.bat'
  662. fi
  663. if test -f 'bitio104/msc.mf' -a "${1}" != "-c" ; then 
  664.   echo shar: Will not clobber existing file \"'bitio104/msc.mf'\"
  665. else
  666.   echo shar: Extracting \"'bitio104/msc.mf'\" \(1452 characters\)
  667.   sed "s/^X//" >'bitio104/msc.mf' <<'END_OF_FILE'
  668. X# makefile for MicroSoft C 6.00 (and maybe other versions)
  669. X# define MODEL on the NMAKE command line in upper case
  670. X
  671. XLIBNAME    = bitio
  672. X
  673. XINCLUDE = .;$(INCLUDE)
  674. XLIB     = .;$(LIB)
  675. X
  676. XCC    = cl
  677. XCCFLAGS = /nologo /c /EM /D__STDC__=0
  678. XLB    = lib
  679. XLBFLAGS    = /nologo
  680. XLN    = link
  681. XLNFLAGS    = /nologo /M /ST:0x1000
  682. X
  683. XLIBS = $(MODEL)$(LIBNAME) $(MODEL)LIBCE
  684. X
  685. XFUNCS = bit1get.obj bit1put.obj bitclose.obj bitflush.obj bithget.obj\
  686. X        bithput.obj bitlget.obj bitlput.obj bitopen.obj bituse.obj
  687. X
  688. XTESTS = testi.exe testmi.exe testmo.exe testo.exe
  689. X
  690. X.c.obj:
  691. X    $(CC) $(CCFLAGS) /A$(MODEL) /Fc$*.lst /Fo$*.obj $*.c
  692. X    $(LB) $(LBFLAGS) $(MODEL)$(LIBNAME).lib -+$*.obj ;
  693. X
  694. X.c.exe:
  695. X    $(CC) $(CCFLAGS) /A$(MODEL) /Fc$*.lst /Fo$*.obj $*.c
  696. X        $(LN) $(LNFLAGS) $*.obj , $*.exe , $*.map , $(LIBS) , ;
  697. X
  698. Xall: $(FUNCS) $(TESTS)
  699. X
  700. Xlibrary: $(FUNCS)
  701. X
  702. Xbit1get.obj: bitio.h bit1get.c
  703. X
  704. Xbit1put.obj: bitio.h bit1put.c
  705. X
  706. Xbitclose.obj: bitio.h bitclose.c
  707. X
  708. Xbitflush.obj: bitio.h bitflush.c
  709. X
  710. Xbithget.obj: bitio.h bitget.h bithget.c
  711. X
  712. Xbithput.obj: bitio.h bitput.h bithput.c
  713. X
  714. Xbitlget.obj: bitio.h bitget.h bitlget.c
  715. X
  716. Xbitlput.obj: bitio.h bitput.h bitlput.c
  717. X
  718. Xbitopen.obj: bitio.h bitopen.c
  719. X
  720. Xbituse.obj: bitio.h bituse.c
  721. X
  722. Xtesti.exe: bitio.h testio.h rand.h randul.c testi.c
  723. X
  724. Xtestmi.exe: bitio.h testmi.c
  725. X
  726. Xtestmo.exe: bitio.h testmo.c
  727. X
  728. Xtesto.exe: bitio.h testio.h rand.h randul.c testo.c
  729. X
  730. Xclean:
  731. X    del *.asm
  732. X    del *.bak
  733. X    del *.dat
  734. X    del *.lst
  735. X    del *.obj
  736. X    del *.map
  737. X    del *.xrf
  738. X
  739. Xvirgin: clean
  740. X    del *.lib
  741. X    del *.exe
  742. END_OF_FILE
  743.   if test 1452 -ne `wc -c <'bitio104/msc.mf'`; then
  744.     echo shar: \"'bitio104/msc.mf'\" unpacked with wrong size!
  745.   fi
  746.   # end of 'bitio104/msc.mf'
  747. fi
  748. if test -f 'bitio104/mvirgin.bat' -a "${1}" != "-c" ; then 
  749.   echo shar: Will not clobber existing file \"'bitio104/mvirgin.bat'\"
  750. else
  751.   echo shar: Extracting \"'bitio104/mvirgin.bat'\" \(23 characters\)
  752.   sed "s/^X//" >'bitio104/mvirgin.bat' <<'END_OF_FILE'
  753. Xnmake /F msc.mf virgin
  754. END_OF_FILE
  755.   if test 23 -ne `wc -c <'bitio104/mvirgin.bat'`; then
  756.     echo shar: \"'bitio104/mvirgin.bat'\" unpacked with wrong size!
  757.   fi
  758.   # end of 'bitio104/mvirgin.bat'
  759. fi
  760. if test -f 'bitio104/test' -a "${1}" != "-c" ; then 
  761.   echo shar: Will not clobber existing file \"'bitio104/test'\"
  762. else
  763.   echo shar: Extracting \"'bitio104/test'\" \(654 characters\)
  764.   sed "s/^X//" >'bitio104/test' <<'END_OF_FILE'
  765. X#!/bin/sh
  766. X#-------
  767. X# the portability test verifies that you can read and write data
  768. X# exactly the same way as other platforms
  769. X#-------
  770. Xtesti test.bit 4096 73
  771. Xtesto test.dat 4096 73
  772. Xcmp test.dat test.bit
  773. X#-------
  774. X# the consistency test does input and output of random bit sizes and values
  775. X# comparing what is read on input using the same random sequence
  776. X#-------
  777. Xtesto test1.dat 65536 97
  778. Xtesti test1.dat 65536 97
  779. X#-------
  780. X# the macro speed test just does a speed run on the one bit macros
  781. X# this is only a demo speed test; you will need to add your own timing
  782. X# code somewhere if you need actual timings
  783. X#-------
  784. Xtestmo test2.dat 4194304
  785. Xtestmi test2.dat
  786. END_OF_FILE
  787.   if test 654 -ne `wc -c <'bitio104/test'`; then
  788.     echo shar: \"'bitio104/test'\" unpacked with wrong size!
  789.   fi
  790.   chmod +x 'bitio104/test'
  791.   # end of 'bitio104/test'
  792. fi
  793. if test -f 'bitio104/test.bat' -a "${1}" != "-c" ; then 
  794.   echo shar: Will not clobber existing file \"'bitio104/test.bat'\"
  795. else
  796.   echo shar: Extracting \"'bitio104/test.bat'\" \(882 characters\)
  797.   sed "s/^X//" >'bitio104/test.bat' <<'END_OF_FILE'
  798. Xrem =========================================================
  799. Xrem this test compares against data contained in the
  800. Xrem distribution of this version of BITIO to verify
  801. Xrem correct portability
  802. Xrem =========================================================
  803. Xtesti test.bit 4096 73
  804. Xrem
  805. Xrem =========================================================
  806. Xrem the consistency test does input and output of random
  807. Xrem bit sizes and values comparing what is read on input
  808. Xrem using the same random sequence
  809. Xrem =========================================================
  810. Xtesto test1.dat 65536 97
  811. Xtesti test1.dat 65536 97
  812. Xrem 
  813. Xrem =========================================================
  814. Xrem this test writes and then reads 4194304 bits using
  815. Xrem the macros BIT1PUT and BIT1GET for maximum speed
  816. Xrem =========================================================
  817. Xtestmo test2.dat 4194304
  818. Xtestmi test2.dat
  819. END_OF_FILE
  820.   if test 882 -ne `wc -c <'bitio104/test.bat'`; then
  821.     echo shar: \"'bitio104/test.bat'\" unpacked with wrong size!
  822.   fi
  823.   # end of 'bitio104/test.bat'
  824. fi
  825. if test -f 'bitio104/testi.c' -a "${1}" != "-c" ; then 
  826.   echo shar: Will not clobber existing file \"'bitio104/testi.c'\"
  827. else
  828.   echo shar: Extracting \"'bitio104/testi.c'\" \(1210 characters\)
  829.   sed "s/^X//" >'bitio104/testi.c' <<'END_OF_FILE'
  830. X/***********************************************************************\
  831. X|   Copyright (C) 1993 - by Philip David Howard - all rights reserved    |
  832. X|                                    |
  833. X|   This library is free software; you may redistribute it and/or    |
  834. X|   modify it under the terms of the GNU Library General Public        |
  835. X|   License as published by the Free Software Foundation; either    |
  836. X|   version 2 of the license, or (at your option) any later version.    |
  837. X|                                    |
  838. X|   This library is distributed in the hope that it will be useful,    |
  839. X|   but WITHOUT ANY WARRANTY; without even the implied warranty of    |
  840. X|   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the    |
  841. X|   GNU Library General Public License for more details.        |
  842. X|                                    |
  843. X|   You should have received a copy of the GNU Library General Public    |
  844. X|   License along with this library.  If not, write to the Free        |
  845. X|   Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.    |
  846. X|                                    |
  847. X|author:    Philip D. Howard (ka9wgn)                |
  848. X|email:        pdh@netcom.com                        |
  849. X|postal:    PO Box 5012;  Champaign, IL  61825-5012            |
  850. X|voice/fax:    217-384-4934                        |
  851. X\***********************************************************************/
  852. X#define INPUT
  853. X#include "testio.h"
  854. END_OF_FILE
  855.   if test 1210 -ne `wc -c <'bitio104/testi.c'`; then
  856.     echo shar: \"'bitio104/testi.c'\" unpacked with wrong size!
  857.   fi
  858.   # end of 'bitio104/testi.c'
  859. fi
  860. if test -f 'bitio104/testo.c' -a "${1}" != "-c" ; then 
  861.   echo shar: Will not clobber existing file \"'bitio104/testo.c'\"
  862. else
  863.   echo shar: Extracting \"'bitio104/testo.c'\" \(1211 characters\)
  864.   sed "s/^X//" >'bitio104/testo.c' <<'END_OF_FILE'
  865. X/***********************************************************************\
  866. X|   Copyright (C) 1993 - by Philip David Howard - all rights reserved    |
  867. X|                                    |
  868. X|   This library is free software; you may redistribute it and/or    |
  869. X|   modify it under the terms of the GNU Library General Public        |
  870. X|   License as published by the Free Software Foundation; either    |
  871. X|   version 2 of the license, or (at your option) any later version.    |
  872. X|                                    |
  873. X|   This library is distributed in the hope that it will be useful,    |
  874. X|   but WITHOUT ANY WARRANTY; without even the implied warranty of    |
  875. X|   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the    |
  876. X|   GNU Library General Public License for more details.        |
  877. X|                                    |
  878. X|   You should have received a copy of the GNU Library General Public    |
  879. X|   License along with this library.  If not, write to the Free        |
  880. X|   Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.    |
  881. X|                                    |
  882. X|author:    Philip D. Howard (ka9wgn)                |
  883. X|email:        pdh@netcom.com                        |
  884. X|postal:    PO Box 5012;  Champaign, IL  61825-5012            |
  885. X|voice/fax:    217-384-4934                        |
  886. X\***********************************************************************/
  887. X#define OUTPUT
  888. X#include "testio.h"
  889. END_OF_FILE
  890.   if test 1211 -ne `wc -c <'bitio104/testo.c'`; then
  891.     echo shar: \"'bitio104/testo.c'\" unpacked with wrong size!
  892.   fi
  893.   # end of 'bitio104/testo.c'
  894. fi
  895. echo shar: End of archive 3 \(of 3\).
  896. cp /dev/null ark3isdone
  897. MISSING=""
  898. for I in 1 2 3 ; do
  899.     if test ! -f ark${I}isdone ; then
  900.     MISSING="${MISSING} ${I}"
  901.     fi
  902. done
  903. if test "${MISSING}" = "" ; then
  904.     echo You have unpacked all 3 archives.
  905.     rm -f ark[1-9]isdone
  906. else
  907.     echo You still must unpack the following archives:
  908.     echo "        " ${MISSING}
  909. fi
  910. exit 0
  911. exit 0 # Just in case...
  912.