HP85 GPIB Disk Emulator  1.0
HP85GPIBDiskEmulator
All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
buffer.h
Go to the documentation of this file.
1 #ifndef _BUFFER_H_
2 #define _BUFFER_H_
3 
31 typedef struct
32 {
33  FILE *fp;
34  int ind;
35  int size;
36  int len;
37  int ungetf;
38  int ungetc;
39  uint8_t *buf;
40 } buffer_t;
41 
42 /* buffer.c */
43 buffer_t *buffer_read_open ( char *name , uint8_t *buf , int size );
44 void buffer_read_close ( buffer_t *p );
45 void buffer_ungetc ( buffer_t *p , int c );
46 int buffer_getc ( buffer_t *p );
47 uint8_t *buffer_gets ( uint8_t *str, int size , buffer_t *p );
48 #endif // _BUFFER_H
buffer_t
Definition: buffer.h:31
buffer_ungetc
void buffer_ungetc(buffer_t *p, int c)
buffered ungetc
Definition: buffer.c:88
buffer_t::ind
int ind
Definition: buffer.h:34
buffer_t::fp
FILE * fp
Definition: buffer.h:33
buffer_read_close
void buffer_read_close(buffer_t *p)
buffered read close FatFS does not have a f_fgetc() and using f_read() of just 1 byte is VERY SLOW
Definition: buffer.c:72
__file
FILE type structure.
Definition: posix.h:158
buffer_t::size
int size
Definition: buffer.h:35
buffer_getc
int buffer_getc(buffer_t *p)
buffered getc
Definition: buffer.c:98
buffer_t::ungetf
int ungetf
Definition: buffer.h:37
buffer_gets
uint8_t * buffer_gets(uint8_t *str, int size, buffer_t *p)
buffered getc
Definition: buffer.c:132
buffer_read_open
buffer_t * buffer_read_open(char *name, uint8_t *buf, int size)
FatFS does not have a f_fgetc() function Using f_read() of just 1 byte is VERY VERY SLOW.
Definition: buffer.c:41
buffer_t::len
int len
Definition: buffer.h:36
buffer_t::buf
uint8_t * buf
Definition: buffer.h:39
buffer_t::ungetc
int ungetc
Definition: buffer.h:38