textio: contify various APIs
This commit is contained in:
parent
906e02c898
commit
7e1692800b
|
|
@ -74,10 +74,10 @@ extern void TxPrintf(const char *, ...) ATTR_FORMAT_PRINTF_1;
|
||||||
extern char *TxPrintString(const char *, ...) ATTR_FORMAT_PRINTF_1;
|
extern char *TxPrintString(const char *, ...) ATTR_FORMAT_PRINTF_1;
|
||||||
|
|
||||||
/* input procedures */
|
/* 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 char *TxGetLine(char *line, int len);
|
||||||
extern int TxGetChar(void);
|
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 */
|
/* prompting procedures */
|
||||||
extern void TxSetPrompt(char ch);
|
extern void TxSetPrompt(char ch);
|
||||||
|
|
@ -96,7 +96,7 @@ extern char TxInterruptChar; /* The current interrupt character */
|
||||||
extern void TxDispatch(FILE *f);
|
extern void TxDispatch(FILE *f);
|
||||||
|
|
||||||
/* C99 compat */
|
/* C99 compat */
|
||||||
extern void TxMore(char *mesg);
|
extern void TxMore(const char *mesg);
|
||||||
extern void txGetFileCommand(FILE *f, DQueue *queue);
|
extern void txGetFileCommand(FILE *f, DQueue *queue);
|
||||||
|
|
||||||
/* variables that tell if stdin and stdout are to a terminal */
|
/* variables that tell if stdin and stdout are to a terminal */
|
||||||
|
|
|
||||||
|
|
@ -58,7 +58,7 @@ extern void txFprintfBasic(FILE *f, const char *fmt, ...) ATTR_FORMAT_PRINTF_2;
|
||||||
/* C99 compat */
|
/* C99 compat */
|
||||||
extern void txCommandsInit(void);
|
extern void txCommandsInit(void);
|
||||||
extern int TranslateChar(int key);
|
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
|
#ifdef MAGIC_WRAPPER
|
||||||
/* tcltk/tclmagic.c has a function implementation prototype mimics vfprintf() mapping
|
/* tcltk/tclmagic.c has a function implementation prototype mimics vfprintf() mapping
|
||||||
|
|
|
||||||
|
|
@ -636,7 +636,7 @@ unsigned char txLogFlags;
|
||||||
|
|
||||||
void
|
void
|
||||||
TxLogStart(
|
TxLogStart(
|
||||||
char *fileName,
|
const char *fileName,
|
||||||
MagWindow *mw) /* Window commands are logged from */
|
MagWindow *mw) /* Window commands are logged from */
|
||||||
{
|
{
|
||||||
if (txLogFile != NULL)
|
if (txLogFile != NULL)
|
||||||
|
|
@ -1014,7 +1014,7 @@ TxGetInputEvent(
|
||||||
|
|
||||||
void
|
void
|
||||||
TxParseString(
|
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. */
|
DQueue *q, /* Add to the tail of this queue. */
|
||||||
TxInputEvent *event) /* An event to supply the point, window ID,
|
TxInputEvent *event) /* An event to supply the point, window ID,
|
||||||
* etc. . If NULL, we will use the last
|
* etc. . If NULL, we will use the last
|
||||||
|
|
|
||||||
|
|
@ -261,7 +261,7 @@ static const struct cmd_spec {
|
||||||
|
|
||||||
/* Characters for input processing. Set to -1 if not defined */
|
/* 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 txEraseChar = -1; /* Erase line (e.g. ^H) */
|
||||||
char txKillChar = -1; /* Kill line (e.g. ^U or ^X) */
|
char txKillChar = -1; /* Kill line (e.g. ^U or ^X) */
|
||||||
|
|
@ -323,8 +323,8 @@ TxReprint(void)
|
||||||
|
|
||||||
int
|
int
|
||||||
TxDialog(
|
TxDialog(
|
||||||
char *prompt,
|
const char *prompt,
|
||||||
char *responses[],
|
const char * const *responses,
|
||||||
int deflt)
|
int deflt)
|
||||||
{
|
{
|
||||||
int code;
|
int code;
|
||||||
|
|
@ -999,8 +999,8 @@ char *
|
||||||
TxGetLineWPrompt(
|
TxGetLineWPrompt(
|
||||||
char *dest,
|
char *dest,
|
||||||
int maxChars,
|
int maxChars,
|
||||||
char *prompt,
|
const char *prompt,
|
||||||
char *prefix)
|
const char *prefix)
|
||||||
{
|
{
|
||||||
char *res, *hist_res, *tmp;
|
char *res, *hist_res, *tmp;
|
||||||
int return_nothing = 0;
|
int return_nothing = 0;
|
||||||
|
|
@ -1086,7 +1086,7 @@ char *
|
||||||
TxGetLinePrompt(
|
TxGetLinePrompt(
|
||||||
char *dest,
|
char *dest,
|
||||||
int maxChars,
|
int maxChars,
|
||||||
char *prompt)
|
const char *prompt)
|
||||||
{
|
{
|
||||||
return TxGetLineWPrompt(dest, maxChars, prompt, NULL);
|
return TxGetLineWPrompt(dest, maxChars, prompt, NULL);
|
||||||
}
|
}
|
||||||
|
|
@ -1117,7 +1117,7 @@ char *
|
||||||
TxGetLinePfix(
|
TxGetLinePfix(
|
||||||
char *dest,
|
char *dest,
|
||||||
int maxChars,
|
int maxChars,
|
||||||
char *prefix)
|
const char *prefix)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
char *ret;
|
char *ret;
|
||||||
|
|
|
||||||
|
|
@ -46,7 +46,7 @@ static char rcsid[] __attribute__ ((unused)) = "$Header: /usr/cvsroot/magic-8.0/
|
||||||
|
|
||||||
void
|
void
|
||||||
TxMore(
|
TxMore(
|
||||||
char *mesg)
|
const char *mesg)
|
||||||
{
|
{
|
||||||
char prompt[512];
|
char prompt[512];
|
||||||
char line[512];
|
char line[512];
|
||||||
|
|
|
||||||
|
|
@ -131,7 +131,7 @@ extern void TxClearPoint(void);
|
||||||
|
|
||||||
/* Routines to handle command logging.
|
/* 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 TxLogStop(void);
|
||||||
extern void TxLogUpdate(void);
|
extern void TxLogUpdate(void);
|
||||||
extern void TxLogSuspend(void);
|
extern void TxLogSuspend(void);
|
||||||
|
|
@ -155,7 +155,7 @@ extern void TxReleaseButton(int but);
|
||||||
extern void TxPrintCommand(TxCommand *cmd);
|
extern void TxPrintCommand(TxCommand *cmd);
|
||||||
extern TxCommand *TxNewCommand(void);
|
extern TxCommand *TxNewCommand(void);
|
||||||
extern void TxFreeCommand(TxCommand *command);
|
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 TxDispatch(FILE *f);
|
||||||
extern void TxRebuildCommand(TxCommand *cmd);
|
extern void TxRebuildCommand(TxCommand *cmd);
|
||||||
extern int TxCommandNumber; /* Serial number of current command. */
|
extern int TxCommandNumber; /* Serial number of current command. */
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue