summaryrefslogtreecommitdiff
path: root/src/user/include/libterm/readline.h
blob: fdfb408a0ff9443be16c7733f848d05d76e51c4d (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#ifndef LIBTERM_READLINE_H
#define LIBTERM_READLINE_H

#include <stdint.h>

struct history;

//returns zero if memory allocation failed or if max_entries was zero or one
struct history *new_history(uint32_t max_entries);

//returns length of string without null terminator
//max_length doesn't include null terminator
//pass null pointer in hist for no history
uint32_t read_line(char *sz, uint32_t max_length, const char *prompt, struct history *hist);

#endif