reldb 0.1.0
Recreational SQLite
Loading...
Searching...
No Matches
inputbuffer.h
Go to the documentation of this file.
1
8
9#ifndef INPUTBUFFER_H
10#define INPUTBUFFER_H
11
12#include <stddef.h>
13#include <stdio.h>
14#include <stdlib.h>
15
18typedef ptrdiff_t ssize_t;
19
24typedef struct {
27 char *buffer;
29
40
50getline(char **lineptr, size_t *n, FILE *stream);
51
61void
62read_input(InputBuffer *input_buffer);
63
69void
70close_input_buffer(InputBuffer *input_buffer);
71
72#endif // INPUTBUFFER_H
void close_input_buffer(InputBuffer *input_buffer)
Frees the memory associated with an InputBuffer.
Definition inputbuffer.c:72
InputBuffer * new_input_buffer(void)
Allocates and initializes a new InputBuffer.
Definition inputbuffer.c:9
ssize_t getline(char **lineptr, size_t *n, FILE *stream)
Reads an entire line from a stream into a dynamically resizing buffer.
Definition inputbuffer.c:24
ptrdiff_t ssize_t
Signed size type, typically used to represent lengths or -1 for errors.
Definition inputbuffer.h:18
void read_input(InputBuffer *input_buffer)
Reads a line of input from standard input into the buffer.
Definition inputbuffer.c:56
A structure to hold dynamically allocated string input data.
Definition inputbuffer.h:24
ssize_t input_length
Definition inputbuffer.h:26
size_t buffer_length
Definition inputbuffer.h:25
char * buffer
Definition inputbuffer.h:27