public inbox for passt-dev@passt.top
 help / color / mirror / code / Atom feed
blob af864186be84f5e967b20ca077420f931639bf75 802 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
24
25
26
27
28
29
30
31
 
/* SPDX-License-Identifier: GPL-2.0-or-later
 * Copyright Red Hat
 * Author: David Gibson <david@gibson.dropbear.id.au>
 */

#ifndef LINEREAD_H
#define LINEREAD_H

#define LINEREAD_BUFFER_SIZE	8192

/**
 * struct lineread - Line reader state
 * @fd:		File descriptor lines are read from
 * @next_line:	Offset in @buf of the start of the first line not yet
 *		returned by lineread_get()
 * @count:	Number of bytes in @buf read from the file, but not yet
 *		returned by lineread_get()
 * @buf:	Buffer storing data read from file.
 */
struct lineread {
	int fd; int next_line;
	int count;

	/* 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 af864186 ...
found af864186 in https://passt.top/passt

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).