ascii-chat 0.6.0
Real-time terminal-based video chat with ASCII art conversion
Loading...
Searching...
No Matches
question.h
Go to the documentation of this file.
1
19#pragma once
20
21#include <stdbool.h>
22#include <stddef.h>
23
24#ifdef __cplusplus
25extern "C" {
26#endif
27
31typedef struct {
32 bool echo;
33 bool same_line;
34 char mask_char;
36
40#define PROMPT_OPTS_DEFAULT (prompt_opts_t){.echo = true, .same_line = false, .mask_char = 0}
41
45#define PROMPT_OPTS_PASSWORD (prompt_opts_t){.echo = false, .same_line = true, .mask_char = '*'}
46
50#define PROMPT_OPTS_INLINE (prompt_opts_t){.echo = true, .same_line = true, .mask_char = 0}
51
71int platform_prompt_question(const char *prompt, char *buffer, size_t max_len, prompt_opts_t opts);
72
91bool platform_prompt_yes_no(const char *prompt, bool default_yes);
92
103
104#ifdef __cplusplus
105}
106#endif
107
int platform_prompt_question(const char *prompt, char *buffer, size_t max_len, prompt_opts_t opts)
Prompt the user for text input.
bool platform_prompt_yes_no(const char *prompt, bool default_yes)
Prompt the user for a yes/no answer.
bool platform_is_interactive(void)
Check if interactive prompting is available.
Options for text prompts.
Definition question.h:31
char mask_char
Definition question.h:34
bool same_line
Definition question.h:33