source: buchla-68k/libcio/getbuff.c@ 23e1597

Last change on this file since 23e1597 was b28a12e, checked in by Thomas Lopatic <thomas@…>, 7 years ago

Zero redundant declarations.

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