Review prototypes of prompting functions.

This commit is contained in:
Renaud 2013-09-19 16:10:29 +08:00
parent 0aea939e21
commit f5c715debd
4 changed files with 12 additions and 12 deletions

4
exec.c
View File

@ -241,12 +241,12 @@ int macarg(char *tok)
* nextarg:
* get the next argument
*
* char *prompt; prompt to use if we must be interactive
* const char *prompt; prompt to use if we must be interactive
* char *buffer; buffer to put token into
* int size; size of the buffer
* int terminator; terminating char to be used on interactive fetch
*/
int nextarg(char *prompt, char *buffer, int size, int terminator)
int nextarg(const char *prompt, char *buffer, int size, int terminator)
{
/* if we are interactive, go get it! */
if (clexec == FALSE)

2
exec.h
View File

@ -8,7 +8,7 @@ int execcmd( int f, int n) ;
int docmd( char *cline) ;
char *token( char *src, char *tok, int size) ;
int macarg( char *tok) ;
int nextarg( char *prompt, char *buffer, int size, int terminator) ;
int nextarg( const char *prompt, char *buffer, int size, int terminator) ;
int storemac( int f, int n) ;
int storeproc( int f, int n) ;
int execproc( int f, int n) ;

10
input.c
View File

@ -37,7 +37,7 @@
* ABORT. The ABORT status is returned if the user bumps out of the question
* with a ^G. Used any time a confirmation is required.
*/
int mlyesno(char *prompt)
int mlyesno( const char *prompt)
{
char c; /* input character */
char buf[NPAT]; /* prompt to user */
@ -70,12 +70,12 @@ int mlyesno(char *prompt)
* return. Handle erase, kill, and abort keys.
*/
int mlreply(char *prompt, char *buf, int nbuf)
int mlreply( const char *prompt, char *buf, int nbuf)
{
return nextarg(prompt, buf, nbuf, ctoec('\n'));
}
int mlreplyt(char *prompt, char *buf, int nbuf, int eolchar)
int mlreplyt(const char *prompt, char *buf, int nbuf, int eolchar)
{
return nextarg(prompt, buf, nbuf, eolchar);
}
@ -444,11 +444,11 @@ handle_CSI:
to specify the proper terminator. If the terminator is not
a return ('\n') it will echo as "<NL>"
*/
int getstring(char *prompt, char *buf, int nbuf, int eolchar)
int getstring( const char *prompt, char *buf, int nbuf, int eolchar)
{
int cpos; /* current character position in string */
int c;
int quotef; /* are we quoting the next char? */
boolean quotef ; /* are we quoting the next char? */
#if COMPLC
int ffile, ocpos, nskip = 0, didtry = 0;
#if MSDOS

View File

@ -3,16 +3,16 @@
#include "edef.h"
int mlyesno( char *prompt) ;
int mlreply( char *prompt, char *buf, int nbuf) ;
int mlreplyt( char *prompt, char *buf, int nbuf, int eolchar) ;
int mlyesno( const char *prompt) ;
int mlreply( const char *prompt, char *buf, int nbuf) ;
int mlreplyt( const char *prompt, char *buf, int nbuf, int eolchar) ;
int ectoc( int c) ;
int ctoec( int c) ;
fn_t getname( void) ;
int tgetc( void) ;
int get1key( void) ;
int getcmd( void) ;
int getstring( char *prompt, char *buf, int nbuf, int eolchar) ;
int getstring( const char *prompt, char *buf, int nbuf, int eolchar) ;
void outstring( char *s) ;
void ostring( char *s) ;