public inbox for passt-dev@passt.top
 help / color / mirror / code / Atom feed
blob 10d81845ef4d11d31ec7d29933779821a095ed0a 556 bytes (raw)

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
 
/* SPDX-License-Identifier: AGPL-3.0-or-later
 * Copyright Red Hat
 * Author: David Gibson <david(a)gibson.dropbear.id.au>
 */

#ifndef LINEREAD_H
#define LINEREAD_H

#define LINEREAD_BUFFER_SIZE	8192

struct lineread {
	int fd;
	int next_line; /* start of next unread line in buffer */
	int count; /* number of unreturned bytes in buffer */

	/* One extra byte for possible trailing \0 */
	char buf[LINEREAD_BUFFER_SIZE+1];
};

void lineread_init(struct lineread *lr, int fd);
int lineread_get(struct lineread *lr, char **line);

#endif /* _LINEREAD_H */

debug log:

solving 972dc51 ...
found 972dc51 in https://archives.passt.top/passt-dev/20220617031026.498690-2-david@gibson.dropbear.id.au/

applying [1/1] https://archives.passt.top/passt-dev/20220617031026.498690-2-david@gibson.dropbear.id.au/
diff --git a/lineread.h b/lineread.h
new file mode 100644
index 0000000..972dc51

Checking patch lineread.h...
Applied patch lineread.h cleanly.

index at:
100644 10d81845ef4d11d31ec7d29933779821a095ed0a	lineread.h

Code repositories for project(s) associated with this public inbox

	https://passt.top/passt

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for IMAP folder(s).