source: buchla-68k/libcio/getbuff.c@ 6dd74a9

Last change on this file since 6dd74a9 was 0580615, checked in by Thomas Lopatic <thomas@…>, 7 years ago

Point of no return.

  • Property mode set to 100644
File size: 811 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
11void getbuff(FILE *ptr)
12{
13 char *buffer;
14
15 if (ptr->_buflen EQ 1) { /* see if we want the small buffer */
16
17 ptr->_buff = &ptr->_bytbuf;
18 return;
19 }
20
21 if (Stdbufs) { /* see if we have any standard buffers left */
22
23 buffer = (char *)Stdbufs;
24 Stdbufs = *(long **)Stdbufs;
25
26 } else { /* ... if not, use the small one */
27
28 ptr->_buff = &ptr->_bytbuf;
29 ptr->_buflen = 1;
30 return;
31 }
32
33 ptr->_flags |= _ALLBUF; /* say we allocated a standard buffer */
34 ptr->_buff = buffer;
35 return;
36}
Note: See TracBrowser for help on using the repository browser.