2 450a89f7 2021-07-12 op * Copyright (c) 2021 Omar Polo <op@omarpolo.com>
4 450a89f7 2021-07-12 op * Permission to use, copy, modify, and distribute this software for any
5 450a89f7 2021-07-12 op * purpose with or without fee is hereby granted, provided that the above
6 450a89f7 2021-07-12 op * copyright notice and this permission notice appear in all copies.
8 450a89f7 2021-07-12 op * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
9 450a89f7 2021-07-12 op * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
10 450a89f7 2021-07-12 op * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
11 450a89f7 2021-07-12 op * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
12 450a89f7 2021-07-12 op * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
13 450a89f7 2021-07-12 op * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
14 450a89f7 2021-07-12 op * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
17 450a89f7 2021-07-12 op #ifndef MINIBUFFER_H
18 450a89f7 2021-07-12 op #define MINIBUFFER_H
20 450a89f7 2021-07-12 op #include "telescope.h"
22 e5a2797f 2021-07-13 op /* need to be true-ish */
23 e5a2797f 2021-07-13 op #define MB_READ 1
24 e5a2797f 2021-07-13 op #define MB_COMPREAD 2
26 e5a2797f 2021-07-13 op typedef char *(complfn)(void *);
28 450a89f7 2021-07-12 op void enter_minibuffer(void(*)(void), void(*)(void), void(*)(void),
29 e5a2797f 2021-07-13 op struct histhead *,
30 e5a2797f 2021-07-13 op complfn *, void *);
32 450a89f7 2021-07-12 op void exit_minibuffer(void);
33 450a89f7 2021-07-12 op void yornp(const char *, void (*)(int, struct tab *), struct tab *);
36 e5a2797f 2021-07-13 op * completing_read asks the user for something using the minibuffer.
37 e5a2797f 2021-07-13 op * The first argument is the string prompt. The second and third are
38 e5a2797f 2021-07-13 op * the callback to call when done and the data; the callback function
39 e5a2797f 2021-07-13 op * can't be NULL. The last two arguments are the completion function
40 e5a2797f 2021-07-13 op * and its data; if not given, no completion will be shown. The
41 e5a2797f 2021-07-13 op * function providing the completion will be called asynchronously.
43 450a89f7 2021-07-12 op void completing_read(const char *,
44 e5a2797f 2021-07-13 op void (*)(const char *, struct tab *), struct tab *,
45 e5a2797f 2021-07-13 op complfn *, void *);