Skip to content

Commit f87d420

Browse files
Update input.h
1 parent b623384 commit f87d420

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

code/logic/fossil/io/input.h

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -160,6 +160,18 @@ int fossil_io_display_menu(const char *prompt, const char *choices[], int num_ch
160160
*/
161161
void fossil_io_show_progress(int progress);
162162

163+
/**
164+
* @brief Reads a line of input from standard input into the provided buffer.
165+
*
166+
* Reads at most `size - 1` characters from `stdin` and stores them in `buffer`.
167+
* If a newline character is read, it is replaced with a null terminator.
168+
*
169+
* @param buffer Pointer to the character buffer where input will be stored.
170+
* @param size The size of the buffer.
171+
* @return 0 on success, -1 on error or end-of-file.
172+
*/
173+
int fossil_io_gets(char *buffer, size_t size);
174+
163175
#ifdef __cplusplus
164176
}
165177

0 commit comments

Comments
 (0)