mirror of
https://github.com/smartcmd/MinecraftConsoles.git
synced 2026-08-20 09:57:09 +00:00
- Integrated linenoise library for line editing and completion in the server console. - Updated ServerLogger to handle external writes safely during logging. - Modified ServerMain to initialize and manage the ServerCli for command input. - The implementation is separate from everything else, so it doesn't affect anything else. - The command input section and execution section are separated into threads.
38 lines
869 B
C
38 lines
869 B
C
#ifndef VENDORED_LINENOISE_H
|
|
#define VENDORED_LINENOISE_H
|
|
|
|
#include <stddef.h>
|
|
|
|
#ifdef __cplusplus
|
|
extern "C" {
|
|
#endif
|
|
|
|
typedef struct linenoiseCompletions {
|
|
size_t len;
|
|
char **cvec;
|
|
} linenoiseCompletions;
|
|
|
|
typedef void(linenoiseCompletionCallback)(const char *buf, linenoiseCompletions *lc);
|
|
|
|
char *linenoise(const char *prompt);
|
|
void linenoiseFree(void *ptr);
|
|
|
|
void linenoiseSetCompletionCallback(linenoiseCompletionCallback *fn);
|
|
void linenoiseAddCompletion(linenoiseCompletions *lc, const char *str);
|
|
|
|
int linenoiseHistoryAdd(const char *line);
|
|
int linenoiseHistorySetMaxLen(int len);
|
|
|
|
void linenoiseRequestStop(void);
|
|
void linenoiseResetStop(void);
|
|
|
|
/* Wrap external stdout/stderr writes so active prompt can be cleared/restored safely. */
|
|
void linenoiseExternalWriteBegin(void);
|
|
void linenoiseExternalWriteEnd(void);
|
|
|
|
#ifdef __cplusplus
|
|
}
|
|
#endif
|
|
|
|
#endif
|