summaryrefslogtreecommitdiff
path: root/more.h
blob: 534dca7dd9d1fae7ce95229bee204108a45d4ae2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#define _XOPEN_SOURCE 700
#include <stdio.h>

struct more_tty {
	FILE *tty;
};

struct more_file {
	FILE *f;
	FILE *backing;
	size_t topline;
	fpos_t *tlines;
	size_t nlines;
	size_t mark[26];
	size_t nbytes;
	size_t *bytepos;
	char *buf;
	size_t nbuf;
};

struct more_tty more_open_tty(int nlines);
struct more_file more_open(const char *path);
void more_close(struct more_file *mf);
ssize_t more_getline(struct more_file *mf, size_t lineno);