mirror of
https://git.FreeBSD.org/src.git
synced 2025-01-28 16:43:09 +00:00
sh: Forward-declare struct alias instead of giving up type safety via void *
This commit is contained in:
parent
34a4971299
commit
35dab8598a
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=242895
@ -350,7 +350,7 @@ pungetc(void)
|
||||
* We handle aliases this way.
|
||||
*/
|
||||
void
|
||||
pushstring(char *s, int len, void *ap)
|
||||
pushstring(char *s, int len, struct alias *ap)
|
||||
{
|
||||
struct strpush *sp;
|
||||
|
||||
@ -365,9 +365,9 @@ pushstring(char *s, int len, void *ap)
|
||||
sp->prevstring = parsenextc;
|
||||
sp->prevnleft = parsenleft;
|
||||
sp->prevlleft = parselleft;
|
||||
sp->ap = (struct alias *)ap;
|
||||
sp->ap = ap;
|
||||
if (ap)
|
||||
((struct alias *)ap)->flag |= ALIASINUSE;
|
||||
ap->flag |= ALIASINUSE;
|
||||
parsenextc = s;
|
||||
parsenleft = len;
|
||||
INTON;
|
||||
|
@ -45,6 +45,7 @@ extern int parsenleft; /* number of characters left in input buffer */
|
||||
extern char *parsenextc; /* next character in input buffer */
|
||||
extern int init_editline; /* 0 == not setup, 1 == OK, -1 == failed */
|
||||
|
||||
struct alias;
|
||||
struct parsefile;
|
||||
|
||||
char *pfgets(char *, int);
|
||||
@ -52,7 +53,7 @@ int pgetc(void);
|
||||
int preadbuffer(void);
|
||||
int preadateof(void);
|
||||
void pungetc(void);
|
||||
void pushstring(char *, int, void *);
|
||||
void pushstring(char *, int, struct alias *);
|
||||
void setinputfile(const char *, int);
|
||||
void setinputfd(int, int);
|
||||
void setinputstring(char *, int);
|
||||
|
Loading…
Reference in New Issue
Block a user