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
18
typedef
ptrdiff_t
ssize_t
;
19
24
typedef
struct
{
25
size_t
buffer_length
;
26
ssize_t
input_length
;
27
char
*
buffer
;
28
}
InputBuffer
;
29
38
InputBuffer
*
39
new_input_buffer
(
void
);
40
49
ssize_t
50
getline
(
char
**lineptr,
size_t
*n, FILE *stream);
51
61
void
62
read_input
(
InputBuffer
*input_buffer);
63
69
void
70
close_input_buffer
(
InputBuffer
*input_buffer);
71
72
#endif
// INPUTBUFFER_H
close_input_buffer
void close_input_buffer(InputBuffer *input_buffer)
Frees the memory associated with an InputBuffer.
Definition
inputbuffer.c:72
new_input_buffer
InputBuffer * new_input_buffer(void)
Allocates and initializes a new InputBuffer.
Definition
inputbuffer.c:9
getline
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
ssize_t
ptrdiff_t ssize_t
Signed size type, typically used to represent lengths or -1 for errors.
Definition
inputbuffer.h:18
read_input
void read_input(InputBuffer *input_buffer)
Reads a line of input from standard input into the buffer.
Definition
inputbuffer.c:56
InputBuffer
A structure to hold dynamically allocated string input data.
Definition
inputbuffer.h:24
InputBuffer::input_length
ssize_t input_length
Definition
inputbuffer.h:26
InputBuffer::buffer_length
size_t buffer_length
Definition
inputbuffer.h:25
InputBuffer::buffer
char * buffer
Definition
inputbuffer.h:27
include
inputbuffer.h
Generated by
1.16.1