source: buchla-68k/orig/IOLIB/GETBUFF.C@ f40a309

Last change on this file since f40a309 was 3ae31e9, checked in by Thomas Lopatic <thomas@…>, 7 years ago

Imported original source code.

  • Property mode set to 100755
File size: 857 bytes
Line 
1/*
2 ============================================================================
3 getbuff.c -- Get a buffer for a file for the Buchla 700 C I/O Library
4 Version 4 -- 1987-06-24 -- D.N. Lynx Crowe
5 ============================================================================
6*/
7
8#include "stdio.h"
9#include "stddefs.h"
10
11getbuff(ptr)
12register FILE *ptr;
13{
14 char *buffer;
15
16 if (ptr->_buflen EQ 1) { /* see if we want the small buffer */
17
18 ptr->_buff = &ptr->_bytbuf;
19 return;
20 }
21
22 if (Stdbufs) { /* see if we have any standard buffers left */
23
24 buffer = (char *)Stdbufs;
25 Stdbufs = *(long **)Stdbufs;
26
27 } else { /* ... if not, use the small one */
28
29 ptr->_buff = &ptr->_bytbuf;
30 ptr->_buflen = 1;
31 return;
32 }
33
34 ptr->_flags |= _ALLBUF; /* say we allocated a standard buffer */
35 ptr->_buff = buffer;
36 return;
37}
Note: See TracBrowser for help on using the repository browser.