textio: contify various APIs

This commit is contained in:
Darryl L. Miles 2025-01-31 17:15:29 +00:00 committed by Tim Edwards
parent 906e02c898
commit 7e1692800b
6 changed files with 16 additions and 16 deletions

View File

@ -74,10 +74,10 @@ extern void TxPrintf(const char *, ...) ATTR_FORMAT_PRINTF_1;
extern char *TxPrintString(const char *, ...) ATTR_FORMAT_PRINTF_1;
/* input procedures */
extern char *TxGetLinePrompt(char *dest, int maxChars, char *prompt);
extern char *TxGetLinePrompt(char *dest, int maxChars, const char *prompt);
extern char *TxGetLine(char *line, int len);
extern int TxGetChar(void);
extern int TxDialog(char *prompt, char *(responses[]), int defresp);
extern int TxDialog(const char *prompt, const char * const *responses, int defresp);
/* prompting procedures */
extern void TxSetPrompt(char ch);
@ -96,7 +96,7 @@ extern char TxInterruptChar; /* The current interrupt character */
extern void TxDispatch(FILE *f);
/* C99 compat */
extern void TxMore(char *mesg);
extern void TxMore(const char *mesg);
extern void txGetFileCommand(FILE *f, DQueue *queue);
/* variables that tell if stdin and stdout are to a terminal */

View File

@ -58,7 +58,7 @@ extern void txFprintfBasic(FILE *f, const char *fmt, ...) ATTR_FORMAT_PRINTF_2;
/* C99 compat */
extern void txCommandsInit(void);
extern int TranslateChar(int key);
extern char *TxGetLineWPrompt(char *dest, int maxChars, char *prompt, char *prefix);
extern char *TxGetLineWPrompt(char *dest, int maxChars, const char *prompt, const char *prefix);
#ifdef MAGIC_WRAPPER
/* tcltk/tclmagic.c has a function implementation prototype mimics vfprintf() mapping

View File

@ -636,7 +636,7 @@ unsigned char txLogFlags;
void
TxLogStart(
char *fileName,
const char *fileName,
MagWindow *mw) /* Window commands are logged from */
{
if (txLogFile != NULL)
@ -1014,7 +1014,7 @@ TxGetInputEvent(
void
TxParseString(
char *str, /* The string to be parsed. */
const char *str, /* The string to be parsed. */
DQueue *q, /* Add to the tail of this queue. */
TxInputEvent *event) /* An event to supply the point, window ID,
* etc. . If NULL, we will use the last

View File

@ -261,7 +261,7 @@ static const struct cmd_spec {
/* Characters for input processing. Set to -1 if not defined */
char *TxGetLinePfix();
char *TxGetLinePfix(char *dest, int maxChars, const char *prefix);
char txEraseChar = -1; /* Erase line (e.g. ^H) */
char txKillChar = -1; /* Kill line (e.g. ^U or ^X) */
@ -323,8 +323,8 @@ TxReprint(void)
int
TxDialog(
char *prompt,
char *responses[],
const char *prompt,
const char * const *responses,
int deflt)
{
int code;
@ -999,8 +999,8 @@ char *
TxGetLineWPrompt(
char *dest,
int maxChars,
char *prompt,
char *prefix)
const char *prompt,
const char *prefix)
{
char *res, *hist_res, *tmp;
int return_nothing = 0;
@ -1086,7 +1086,7 @@ char *
TxGetLinePrompt(
char *dest,
int maxChars,
char *prompt)
const char *prompt)
{
return TxGetLineWPrompt(dest, maxChars, prompt, NULL);
}
@ -1117,7 +1117,7 @@ char *
TxGetLinePfix(
char *dest,
int maxChars,
char *prefix)
const char *prefix)
{
int i;
char *ret;

View File

@ -46,7 +46,7 @@ static char rcsid[] __attribute__ ((unused)) = "$Header: /usr/cvsroot/magic-8.0/
void
TxMore(
char *mesg)
const char *mesg)
{
char prompt[512];
char line[512];

View File

@ -131,7 +131,7 @@ extern void TxClearPoint(void);
/* Routines to handle command logging.
*/
extern void TxLogStart(char *fileName, MagWindow *mw);
extern void TxLogStart(const char *fileName, MagWindow *mw);
extern void TxLogStop(void);
extern void TxLogUpdate(void);
extern void TxLogSuspend(void);
@ -155,7 +155,7 @@ extern void TxReleaseButton(int but);
extern void TxPrintCommand(TxCommand *cmd);
extern TxCommand *TxNewCommand(void);
extern void TxFreeCommand(TxCommand *command);
extern void TxParseString(char *str, void *q, void *event);
extern void TxParseString(const char *str, void *q, void *event);
extern void TxDispatch(FILE *f);
extern void TxRebuildCommand(TxCommand *cmd);
extern int TxCommandNumber; /* Serial number of current command. */