1
0
Fork 0
mirror of git://git.code.sf.net/p/zsh/code synced 2024-05-09 00:56:17 +02:00

Compare commits

...

3 Commits

Author SHA1 Message Date
Oliver Kiddle 93334b207f 52770: handle newrole in SELinux completions 2024-03-18 21:34:38 +01:00
Oliver Kiddle 1e995cbb38 52769: fix completion of ansible keywords and --step option 2024-03-18 21:12:55 +01:00
Oliver Kiddle 57248b8883 52750: remove ansi2knr support for old pre-ansi K&R compilers 2024-03-18 20:02:34 +01:00
29 changed files with 179 additions and 254 deletions

View File

@ -1,3 +1,19 @@
2024-03-18 Oliver Kiddle <opk@zsh.org>
* 52770: Completion/Linux/Command/_selinux: handle newrole
* 52769: Completion/Unix/Command/_ansible: fix completion of
ansible keywords and --step option
* 52750: Config/defs.mk.in, Etc/zsh-development-guide,
Src/Makemod.in.in, Src/Modules/files.c, Src/Modules/watch.c,
Src/Modules/zftp.c, Src/Modules/zprof.c, Src/Zle/compcore.c,
Src/Zle/zle.h, Src/Zle/zle_keymap.c, Src/Zle/zle_thingy.c,
Src/exec.c, Src/glob.c, Src/hist.c, Src/makepro.awk, Src/mem.c,
Src/mkbltnmlst.sh, Src/modentry.c, Src/parse.c, Src/prototypes.h,
Src/signals.h, Src/utils.c, Src/zsh.h, Src/zsh_system.h, aclocal.m4,
configure.ac: remove ansi2knr support for old pre-ansi K&R compilers
2024-03-14 Bart Schaefer <schaefer@zsh.org>
* 52759: Doc/Zsh/expn.yo, Etc/FAQ.yo, Src/subst.c,

View File

@ -1,4 +1,4 @@
#compdef audit2allow audit2why avcstat chcon checkmodule checkpolicy fixfiles getpidprevcon getsebool matchpathcon restorecon runcon sealert secon sedta seinfo selinuxconlist selinuxdefcon selinuxexeccon semanage semodule semodule_unpackage sepolgen sepolicy sesearch sestatus setenforce setsebool validatetrans
#compdef audit2allow audit2why avcstat chcon checkmodule checkpolicy fixfiles getpidprevcon getsebool matchpathcon newrole restorecon runcon sealert secon sedta seinfo selinuxconlist selinuxdefcon selinuxexeccon semanage semodule semodule_unpackage sepolgen sepolicy sesearch sestatus setenforce setsebool validatetrans
# encompasses checkpolicy libselinux-utils policycoreutils
# policycoreutils-devel policycoreutils-python-utils setools-console
@ -251,6 +251,21 @@ case $service in
)
;;
newrole)
local cmd cpp
cmd="$words[1]"
cpp='_comp_priv_prefix=( $cmd ${(kv)opt_args[(I)-([rtl]|-role|-type|-level)]} )'
args=(
'(-r --role)'{-r+,--role=}'[specify role]: :_selinux_roles'
'(-t --type)'{-t+,--type=}'[specify type]: :_selinux_types'
'(-l --level)'{-l+,--range=}'[specify level]:level'
'(-p --preserve-environment)'{-p,--preserve-environment}"[don't create new minimal environment]"
"${ign}(-)"{-V,--version}'[display version information]'
"(-)1: :{ $cpp; _command_names -e }" \
"*:: :{ $cpp; _normal }"
)
;;
restorecon)
args=(
'*-e+[exclude a directory]:directory:_directories'
@ -276,10 +291,10 @@ case $service in
runcon)
args=(
'(1 -c --compute)'{-c,--compute}'[compute process transition context before modifying]'
'(1 -t --type=TYPE)'{-t+,--type=}'[specify type]: :_selinux_types'
'(1 -u --user=USER)'{-u+,--user=}'[specify user identity]: :_selinux_users'
'(1 -r --role=ROLE)'{-r+,--role=}'[specify role]: :_selinux_roles'
'(1 -l --range=RANGE)'{-l+,--range=}'[specify level range]:range'
'(1 -t --type)'{-t+,--type=}'[specify type]: :_selinux_types'
'(1 -u --user)'{-u+,--user=}'[specify user identity]: :_selinux_users'
'(1 -r --role)'{-r+,--role=}'[specify role]: :_selinux_roles'
'(1 -l --range)'{-l+,--range=}'[specify level range]:range'
'(-)1:security context:_selinux_contexts'
'*:::args:_normal'
)
@ -460,7 +475,7 @@ case $service in
'(-E --extract)'{-E,--extract}'[extract customizable commands, for use within a transaction]'
)
;|
boolean|dontaudit|export|import)
fcontext|ibendport|ibpkey|interface|login|module|node|permissive|port|user)
args+=( '(-a --add)'{-a,--add}'[add a record]' )
;|
boolean|fcontext|ibendport|ibpkey|interface|login|node|permissive|port|user)
@ -573,8 +588,8 @@ case $service in
\*{-B,--build}'[build and reload policy]'
\*'--refresh[like --build but reuse existing linked policy if module files unchanged]'
\*{-D,--disable_dontaudit}'[remove dontaudits from policy]'
\*{-i+,--install=}'[install a new module]:module package:_files -g "*.pp(-.)"'
\!{-b,--base,-u,--upgrade}':module package:_files -g "*.pp(-.)"'
\*{-i+,--install=}'[install a new module]:module package:_files -g "*.(pp|cil)(-.)"'
\!{-b,--base,-u,--upgrade}':module package:_files -g "*.(pp|cil)(-.)"'
\*{-r+,--remove=}'[remove existing module at desired priority]:module name:_selinux_modules'
\*{-l+,--list-modules=-}'[display list of installed modules]::kind:((
standard\:highest\ priority,\ enabled\ modules

View File

@ -69,6 +69,11 @@ case $service in
"--skip-tags[only run plays and tasks whose tags don't match]"
)
;|
ansible-playbook|ansible-console)
args+=(
'--step[one-step-at-a-time: confirm each task before running]'
)
;|
ansible|ansible-console)
args+=(
'--task-timeout[set the task timeout limit]:timeout (seconds)'
@ -97,11 +102,6 @@ case $service in
'*::args:->config'
)
;;
ansible-console)
args+=(
'--step[one-step-at-a-time: confirm each task before running]'
)
;;
ansible-doc)
args+=(
'!--metadata-dump' '!--no-fail-on-errors' # "internal use only"
@ -440,11 +440,11 @@ if [[ $state = plugins ]]; then
typeset -ga ${plug}
if zstyle -T ":completion:${curcontext}:plugins" verbose; then
(( ${(P)#plugvar} )) || set -A ${plugvar} \
${${(f)"$(_call_program plugins ansible-doc -t $plug -l)"}/ ##/:}
${${${(f)"$(_call_program plugins ansible-doc -t $plug -l)"}:# *}/(:|) ##/:}
_describe -t plugins "${plug} plugin" $plugvar -M 'r:|.=* r:|=*' && ret=0
else
(( ${(P)#plugvar} )) || set -A ${plugvar} \
${${(f)"$(_call_program plugins ansible-doc -t $plug -F)"}%% *}
${${(f)"$(_call_program plugins ansible-doc -t $plug -F)"}%%(|:) *}
_wanted plugins expl "${plug} plugin" compadd -M 'r:|.=* r:|=*' -a $plugvar && ret=0
fi
fi

View File

@ -75,7 +75,6 @@ IMPOPT = @IMPOPT@
# utilities
AWK = @AWK@
ANSI2KNR = @ANSI2KNR@
YODL = @YODL@ @YODL_OPTIONS@
YODL2TXT = @YODL@2txt
YODL2HTML = @YODL@2html
@ -100,7 +99,7 @@ LDFLAGS='$(LDFLAGS)' EXTRA_LDFLAGS='$(EXTRA_LDFLAGS)' \
DLCFLAGS='$(DLCFLAGS)' DLLDFLAGS='$(DLLDFLAGS)' \
LIBLDFLAGS='$(LIBLDFLAGS)' EXELDFLAGS='$(EXELDFLAGS)' \
LIBS='$(LIBS)' DL_EXT='$(DL_EXT)' DLLD='$(DLLD)' \
AWK='$(AWK)' ANSI2KNR='$(ANSI2KNR)' \
AWK='$(AWK)' \
YODL='$(YODL)' YODL2TXT='$(YODL2TXT)' YODL2HTML='$(YODL2HTML)' \
FUNCTIONS_INSTALL='$(FUNCTIONS_INSTALL)' tzsh='$(tzsh)'

View File

@ -240,7 +240,7 @@ C coding style
There must be an empty line, a line with "/**/", a line with the
type of the function, and finally the name of the function with typed
arguments. These lines must not be indented. The script generating
function prototypes and the ansi2knr program depend on this format.
function prototypes depends on this format.
* Variable declarations must similarly be preceded by a
line containing only "/**/", for the prototype generation script.

View File

@ -52,32 +52,17 @@ DLCOMPILE = $(CC) -c -I. -I$(dir_top)/Src -I$(sdir_top)/Src -I$(sdir_top)/Src/
LINK = $(CC) $(LDFLAGS) $(EXELDFLAGS) $(EXTRA_LDFLAGS) -o $@
DLLINK = $(DLLD) $(LDFLAGS) $(LIBLDFLAGS) $(DLLDFLAGS) -o $@
KNR_OBJ=.o
KNROBJ=._foo_
OBJ=.o
ANSIOBJ=.o
ANSI_OBJ=._foo_
.SUFFIXES: .c .$(DL_EXT) ..o .o .syms .pro .epro
.SUFFIXES: .c .$(DL_EXT) ..o .._foo_ .o ._foo_ .syms .pro .epro
.c$(ANSI@U@OBJ):
.c$(OBJ):
$(COMPILE) -o $@ $<
@rm -f $(dir_src)/stamp-modobjs
.c$(KNR@U@OBJ):
@ANSI2KNR@ $< > $@.c
$(COMPILE) -o $@ $@.c
rm -f $@.c
@rm -f $(dir_src)/stamp-modobjs
.c.$(ANSI@U@OBJ):
.c.$(OBJ):
$(DLCOMPILE) -o $@ $<
.c.$(KNR@U@OBJ):
@ANSI2KNR@ $< > $@.c
$(DLCOMPILE) -o $@ $@.c
rm -f $@.c
.c.syms:
$(AWK) -f $(sdir_src)/makepro.awk $< $(subdir) > $@

View File

@ -29,8 +29,8 @@
#include "files.mdh"
typedef int (*MoveFunc) _((char const *, char const *));
typedef int (*RecurseFunc) _((char *, char *, struct stat const *, void *));
typedef int (*MoveFunc) (char const *, char const *);
typedef int (*RecurseFunc) (char *, char *, struct stat const *, void *);
struct recursivecmd;

View File

@ -584,7 +584,7 @@ readwtab(WATCH_STRUCT_UTMP **head, int initial_sz)
if (sz)
qsort((void *) *head, sz, sizeof(WATCH_STRUCT_UTMP),
(int (*) _((const void *, const void *)))ucmp);
(int (*) (const void *, const void *))ucmp);
return sz;
}

View File

@ -127,7 +127,7 @@ typedef int (*readwrite_t)(int, char *, off_t, int);
struct zftpcmd {
const char *nam;
int (*fun) _((char *, char **, int));
int (*fun) (char *, char **, int);
int min, max, flags;
};

View File

@ -163,9 +163,9 @@ bin_zprof(UNUSED(char *nam), UNUSED(char **args), Options ops, UNUSED(int func))
*ap = NULL;
qsort(fs, ncalls, sizeof(f),
(int (*) _((const void *, const void *))) cmpsfuncs);
(int (*) (const void *, const void *)) cmpsfuncs);
qsort(as, narcs, sizeof(a),
(int (*) _((const void *, const void *))) cmpparcs);
(int (*) (const void *, const void *)) cmpparcs);
printf("num calls time self name\n-----------------------------------------------------------------------------------\n");
for (fp = fs, i = 1; *fp; fp++, i++) {
@ -179,7 +179,7 @@ bin_zprof(UNUSED(char *nam), UNUSED(char **args), Options ops, UNUSED(int func))
(*fp)->name);
}
qsort(fs, ncalls, sizeof(f),
(int (*) _((const void *, const void *))) cmptfuncs);
(int (*) (const void *, const void *)) cmptfuncs);
for (fp = fs; *fp; fp++) {
printf("\n-----------------------------------------------------------------------------------\n\n");

View File

@ -3253,7 +3253,7 @@ makearray(LinkList l, int type, int flags, int *np, int *nlp, int *llp)
/* Now sort the array (it contains matches). */
matchorder = flags;
qsort((void *) rp, n, sizeof(Cmatch),
(int (*) _((const void *, const void *)))matchcmp);
(int (*) (const void *, const void *))matchcmp);
/* since the matches are sorted and the default is to remove
* all duplicates, -1 (remove only consecutive dupes) is a no-op,
@ -3295,7 +3295,7 @@ makearray(LinkList l, int type, int flags, int *np, int *nlp, int *llp)
sp = (Cmatch *) zhalloc((n + 1) * sizeof(Cmatch));
memcpy(sp, rp, (n + 1) * sizeof(Cmatch));
qsort((void *) sp, n, sizeof(Cmatch),
(int (*) _((const void *, const void *)))matchcmp);
(int (*) (const void *, const void *))matchcmp);
for (asp = sp + 1; *asp; asp++) {
Cmatch *ap = asp - 1, *bp = asp;
if (matcheq(*ap, *bp)) {

View File

@ -186,7 +186,7 @@ typedef struct thingy *Thingy;
/* widgets (ZLE functions) */
typedef int (*ZleIntFunc) _((char **));
typedef int (*ZleIntFunc) (char **);
struct widget {
int flags; /* flags (see below) */
@ -319,7 +319,7 @@ struct vichange {
typedef struct keymap *Keymap;
typedef void (*KeyScanFunc) _((char *, Thingy, char *, void *));
typedef void (*KeyScanFunc) (char *, Thingy, char *, void *);
#define invicmdmode() (!strcmp(curkeymapname, "vicmd"))

View File

@ -745,7 +745,7 @@ bin_bindkey(char *name, char **argv, Options ops, UNUSED(int func))
static struct opn {
char o;
char selp;
int (*func) _((char *, char *, Keymap, char **, Options, char));
int (*func) (char *, char *, Keymap, char **, Options, char);
int min, max;
} const opns[] = {
{ 'l', 0, bin_bindkey_lsmaps, 0, -1 },

View File

@ -344,7 +344,7 @@ bin_zle(char *name, char **args, Options ops, UNUSED(int func))
{
static struct opn {
char o;
int (*func) _((char *, char **, Options, char));
int (*func) (char *, char **, Options, char);
int min, max;
} const opns[] = {
{ 'l', bin_zle_list, 0, -1 },

View File

@ -267,7 +267,7 @@ static char *blank_env[] = { NULL };
/* Execution functions. */
static int (*execfuncs[WC_COUNT-WC_CURSH]) _((Estate, int)) = {
static int (*execfuncs[WC_COUNT-WC_CURSH]) (Estate, int) = {
execcursh, exectime, NULL /* execfuncdef handled specially */,
execfor, execselect,
execwhile, execrepeat, execcase, execif, execcond,

View File

@ -133,7 +133,7 @@ typedef struct stat *Statptr; /* This makes the Ultrix compiler happy. Go figu
#define TT_TERABYTES 5
typedef int (*TestMatchFunc) _((char *, struct stat *, off_t, char *));
typedef int (*TestMatchFunc) (char *, struct stat *, off_t, char *);
struct qual {
struct qual *next; /* Next qualifier, must match */
@ -1264,7 +1264,7 @@ zglob(LinkList list, LinkNode np, int nountok)
int sense, qualsfound;
off_t data;
char *sdata, *newcolonmod, *ptr;
int (*func) _((char *, Statptr, off_t, char *));
int (*func) (char *, Statptr, off_t, char *);
/*
* Initialise state variables for current file pattern.
@ -1310,7 +1310,7 @@ zglob(LinkList list, LinkNode np, int nountok)
if (*ptr == Dash)
*ptr = '-';
while (*s && !newcolonmod) {
func = (int (*) _((char *, Statptr, off_t, char *)))0;
func = (int (*) (char *, Statptr, off_t, char *)) 0;
if (*s == ',') {
/* A comma separates alternative sets of qualifiers */
s++;
@ -1961,7 +1961,7 @@ zglob(LinkList list, LinkNode np, int nountok)
/* Sort arguments in to lexical (and possibly numeric) order. *
* This is reversed to facilitate insertion into the list. */
qsort((void *) & matchbuf[0], matchct, sizeof(struct gmatch),
(int (*) _((const void *, const void *)))gmatchcmp);
(int (*) (const void *, const void *)) gmatchcmp);
}
if (first < 0) {

View File

@ -34,25 +34,25 @@
* word control. */
/**/
mod_export int (*hgetc) _((void));
mod_export int (*hgetc) (void);
/**/
void (*hungetc) _((int));
void (*hungetc) (int);
/**/
void (*hwaddc) _((int));
void (*hwaddc) (int);
/**/
void (*hwbegin) _((int));
void (*hwbegin) (int);
/**/
void (*hwabort) _((void));
void (*hwabort) (void);
/**/
void (*hwend) _((void));
void (*hwend) (void);
/**/
void (*addtoline) _((int));
void (*addtoline) (int);
/* != 0 means history substitution is turned off */

View File

@ -131,8 +131,8 @@ BEGIN {
sub(/@-.*$/, "", dnam)
# Put parens etc. back
gsub(/@[{]/, " _((", dcltor)
gsub(/@}/, "))", dcltor)
gsub(/@[{]/, " (", dcltor)
gsub(/@}/, ")", dcltor)
gsub(/@</, "(", dcltor)
gsub(/@>/, ")", dcltor)
gsub(/@!/, ",", dcltor)

View File

@ -1057,17 +1057,17 @@ zrealloc(void *ptr, size_t size)
#if !defined(__hpux) && !defined(DGUX) && !defined(__osf__)
# if defined(_BSD)
# ifndef HAVE_BRK_PROTO
extern int brk _((caddr_t));
extern int brk (caddr_t);
# endif
# ifndef HAVE_SBRK_PROTO
extern caddr_t sbrk _((int));
extern caddr_t sbrk (int);
# endif
# else
# ifndef HAVE_BRK_PROTO
extern int brk _((void *));
extern int brk (void *);
# endif
# ifndef HAVE_SBRK_PROTO
extern void *sbrk _((int));
extern void *sbrk (int);
# endif
# endif
#endif

View File

@ -122,12 +122,12 @@ for bin_mod in $bin_mods; do
esac
done
echo " {"
echo " extern int setup_${q_bin_mod} _((Module));"
echo " extern int boot_${q_bin_mod} _((Module));"
echo " extern int features_${q_bin_mod} _((Module,char***));"
echo " extern int enables_${q_bin_mod} _((Module,int**));"
echo " extern int cleanup_${q_bin_mod} _((Module));"
echo " extern int finish_${q_bin_mod} _((Module));"
echo " extern int setup_${q_bin_mod} (Module);"
echo " extern int boot_${q_bin_mod} (Module);"
echo " extern int features_${q_bin_mod} (Module,char***);"
echo " extern int enables_${q_bin_mod} (Module,int**);"
echo " extern int cleanup_${q_bin_mod} (Module);"
echo " extern int finish_${q_bin_mod} (Module);"
echo
echo " register_module(\"$bin_mod\","
echo " setup_${q_bin_mod},"

View File

@ -1,10 +1,10 @@
#include "zsh.mdh"
int setup_ _((Module));
int boot_ _((Module));
int cleanup_ _((Module));
int finish_ _((Module));
int modentry _((int boot, Module m, void *ptr));
int setup_ (Module);
int boot_ (Module);
int cleanup_ (Module);
int finish_ (Module);
int modentry (int boot, Module m, void *ptr);
/**/
int

View File

@ -2392,7 +2392,7 @@ par_nl_wordlist(void)
*/
/**/
void (*condlex) _((void)) = zshlex;
void (*condlex) (void) = zshlex;
/*
* cond : cond_1 { SEPER } [ DBAR { SEPER } cond ]

View File

@ -28,9 +28,9 @@
*/
#ifndef HAVE_STDLIB_H
char *malloc _((size_t));
char *realloc _((void *, size_t));
char *calloc _((size_t, size_t));
char *malloc (size_t);
char *realloc (void *, size_t);
char *calloc (size_t, size_t);
#endif
#if !(defined(USES_TERMCAP_H) || defined(USES_TERM_H))
@ -45,11 +45,11 @@ char *calloc _((size_t, size_t));
#else
#define TC_CONST
#endif
extern int tgetent _((char *bp, TC_CONST char *name));
extern int tgetnum _((char *id));
extern int tgetflag _((char *id));
extern char *tgetstr _((char *id, char **area));
extern int tputs _((TC_CONST char *cp, int affcnt, int (*outc) (int)));
extern int tgetent (char *bp, TC_CONST char *name);
extern int tgetnum (char *id);
extern int tgetflag (char *id);
extern char *tgetstr (char *id, char **area);
extern int tputs (TC_CONST char *cp, int affcnt, int (*outc) (int));
#undef TC_CONST
#endif
@ -70,30 +70,30 @@ char *tgoto(const char *cap, int col, int row);
#endif
#ifdef __osf__
char *mktemp _((char *));
char *mktemp (char *);
#endif
#if defined(__osf__) && defined(__alpha) && defined(__GNUC__)
/* Digital cc does not need these prototypes, gcc does need them */
# ifndef HAVE_IOCTL_PROTO
int ioctl _((int d, unsigned long request, void *argp));
int ioctl (int d, unsigned long request, void *argp);
# endif
# ifndef HAVE_MKNOD_PROTO
int mknod _((const char *pathname, int mode, dev_t device));
int mknod (const char *pathname, int mode, dev_t device);
# endif
int nice _((int increment));
int select _((int nfds, fd_set * readfds, fd_set * writefds, fd_set * exceptfds, struct timeval *timeout));
int nice (int increment);
int select (int nfds, fd_set * readfds, fd_set * writefds, fd_set * exceptfds, struct timeval *timeout);
#endif
#if defined(DGUX) && defined(__STDC__)
/* Just plain missing. */
extern int getrlimit _((int resource, struct rlimit *rlp));
extern int setrlimit _((int resource, const struct rlimit *rlp));
extern int getrusage _((int who, struct rusage *rusage));
extern int gettimeofday _((struct timeval *tv, struct timezone *tz));
extern int wait3 _((union wait *wait_status, int options, struct rusage *rusage));
extern int getdomainname _((char *name, int maxlength));
extern int select _((int nfds, fd_set * readfds, fd_set * writefds, fd_set * exceptfds, struct timeval *timeout));
extern int getrlimit (int resource, struct rlimit *rlp);
extern int setrlimit (int resource, const struct rlimit *rlp);
extern int getrusage (int who, struct rusage *rusage);
extern int gettimeofday (struct timeval *tv, struct timezone *tz);
extern int wait3 (union wait *wait_status, int options, struct rusage *rusage);
extern int getdomainname (char *name, int maxlength);
extern int select (int nfds, fd_set * readfds, fd_set * writefds, fd_set * exceptfds, struct timeval *timeout);
#endif /* DGUX and __STDC__ */
#ifdef __NeXT__
@ -101,34 +101,34 @@ extern pid_t getppid(void);
#endif
#if defined(__sun__) && !defined(__SVR4) /* SunOS */
extern char *strerror _((int errnum));
extern char *strerror (int errnum);
#endif
/**************************************************/
/*** prototypes for functions built in compat.c ***/
#ifndef HAVE_STRSTR
extern char *strstr _((const char *s, const char *t));
extern char *strstr (const char *s, const char *t);
#endif
#ifndef HAVE_GETHOSTNAME
extern int gethostname _((char *name, size_t namelen));
extern int gethostname (char *name, size_t namelen);
#endif
#ifndef HAVE_GETTIMEOFDAY
extern int gettimeofday _((struct timeval *tv, struct timezone *tz));
extern int gettimeofday (struct timeval *tv, struct timezone *tz);
#endif
#ifndef HAVE_DIFFTIME
extern double difftime _((time_t t2, time_t t1));
extern double difftime (time_t t2, time_t t1);
#endif
#ifndef HAVE_STRERROR
extern char *strerror _((int errnum));
extern char *strerror (int errnum);
#endif
/*** end of prototypes for functions in compat.c ***/
/***************************************************/
#ifndef HAVE_MEMMOVE
extern void bcopy _((const void *, void *, size_t));
extern void bcopy (const void *, void *, size_t);
#endif

View File

@ -27,7 +27,7 @@
*
*/
#define SIGNAL_HANDTYPE void (*)_((int))
#define SIGNAL_HANDTYPE void (*)(int)
#ifndef HAVE_KILLPG
# define killpg(pgrp,sig) kill(-(pgrp),sig)
@ -145,7 +145,7 @@
#ifdef BSD_SIGNALS
#define signal_block(S) sigblock(S)
#else
extern sigset_t signal_block _((sigset_t));
extern sigset_t signal_block (sigset_t);
#endif /* BSD_SIGNALS */
extern sigset_t signal_unblock _((sigset_t));
extern sigset_t signal_unblock (sigset_t);

View File

@ -5277,6 +5277,7 @@ nicedupstring(char const *s)
}
/**/
#ifndef MULTIBYTE_SUPPORT
/* Unmetafy and output a string, displaying special characters readably. */
@ -5311,8 +5312,9 @@ niceztrlen(char const *s)
}
return l;
}
#endif
/**/
#endif
/**/
#ifdef MULTIBYTE_SUPPORT
@ -7633,6 +7635,7 @@ mode_to_octal(mode_t mode)
return m;
}
/**/
#ifdef MAILDIR_SUPPORT
/*
* Stat a file. If it's a maildir, check all messages
@ -7756,4 +7759,6 @@ mailstat(char *path, struct stat *st)
*st = st_ret_last = st_ret;
return 0;
}
/**/
#endif

View File

@ -618,7 +618,7 @@ union linkroot {
/* Specific elements of linked lists */
/*************************************/
typedef void (*voidvoidfnptr_t) _((void));
typedef void (*voidvoidfnptr_t) (void);
/*
* Element of the prepromptfns list.
@ -678,7 +678,7 @@ struct timedfn {
#define COND_MOD 18
#define COND_MODI 19
typedef int (*CondHandler) _((char **, int));
typedef int (*CondHandler) (char **, int);
struct conddef {
Conddef next; /* next in list */
@ -1164,28 +1164,28 @@ struct dirsav {
/* Definitions for Hash Tables */
/*******************************/
typedef void *(*VFunc) _((void *));
typedef void (*FreeFunc) _((void *));
typedef void *(*VFunc) (void *);
typedef void (*FreeFunc) (void *);
typedef unsigned (*HashFunc) _((const char *));
typedef void (*TableFunc) _((HashTable));
typedef unsigned (*HashFunc) (const char *);
typedef void (*TableFunc) (HashTable);
/*
* Note that this is deliberately "char *", not "const char *",
* since the AddNodeFunc is passed a pointer to a string that
* will be stored and later freed.
*/
typedef void (*AddNodeFunc) _((HashTable, char *, void *));
typedef HashNode (*GetNodeFunc) _((HashTable, const char *));
typedef HashNode (*RemoveNodeFunc) _((HashTable, const char *));
typedef void (*FreeNodeFunc) _((HashNode));
typedef int (*CompareFunc) _((const char *, const char *));
typedef void (*AddNodeFunc) (HashTable, char *, void *);
typedef HashNode (*GetNodeFunc) (HashTable, const char *);
typedef HashNode (*RemoveNodeFunc) (HashTable, const char *);
typedef void (*FreeNodeFunc) (HashNode);
typedef int (*CompareFunc) (const char *, const char *);
/* type of function that is passed to *
* scanhashtable or scanmatchtable */
typedef void (*ScanFunc) _((HashNode, int));
typedef void (*ScanTabFunc) _((HashTable, ScanFunc, int));
typedef void (*ScanFunc) (HashNode, int);
typedef void (*ScanTabFunc) (HashTable, ScanFunc, int);
typedef void (*PrintTableStats) _((HashTable));
typedef void (*PrintTableStats) (HashTable);
/* Hash table for standard open hashing. Instances of struct hashtable can be *
* created only by newhashtable(). In fact, this function creates an instance *
@ -1352,7 +1352,7 @@ struct funcstack {
/* node in list of function call wrappers */
typedef int (*WrapFunc) _((Eprog, FuncWrap, char *));
typedef int (*WrapFunc) (Eprog, FuncWrap, char *);
struct funcwrap {
FuncWrap next;
@ -1428,8 +1428,8 @@ enum {
* builtin structure.
*/
typedef int (*HandlerFunc) _((char *, char **, Options, int));
typedef int (*HandlerFuncAssign) _((char *, char **, LinkList, Options, int));
typedef int (*HandlerFunc) (char *, char **, Options, int);
typedef int (*HandlerFuncAssign) (char *, char **, LinkList, Options, int);
#define NULLBINCMD ((HandlerFunc) 0)
struct builtin {
@ -1526,10 +1526,10 @@ struct module {
/* Module record is an alias */
#define MOD_ALIAS (1<<6)
typedef int (*Module_generic_func) _((void));
typedef int (*Module_void_func) _((Module));
typedef int (*Module_features_func) _((Module, char ***));
typedef int (*Module_enables_func) _((Module, int **));
typedef int (*Module_generic_func) (void);
typedef int (*Module_void_func) (Module);
typedef int (*Module_features_func) (Module, char ***);
typedef int (*Module_enables_func) (Module, int **);
struct linkedmod {
char *name;
@ -1574,7 +1574,7 @@ struct feature_enables {
/* C-function hooks */
typedef int (*Hookfn) _((Hookdef, void *));
typedef int (*Hookfn) (Hookdef, void *);
struct hookdef {
Hookdef next;
@ -1789,33 +1789,33 @@ typedef const struct gsu_array *GsuArray;
typedef const struct gsu_hash *GsuHash;
struct gsu_scalar {
char *(*getfn) _((Param));
void (*setfn) _((Param, char *));
void (*unsetfn) _((Param, int));
char *(*getfn) (Param);
void (*setfn) (Param, char *);
void (*unsetfn) (Param, int);
};
struct gsu_integer {
zlong (*getfn) _((Param));
void (*setfn) _((Param, zlong));
void (*unsetfn) _((Param, int));
zlong (*getfn) (Param);
void (*setfn) (Param, zlong);
void (*unsetfn) (Param, int);
};
struct gsu_float {
double (*getfn) _((Param));
void (*setfn) _((Param, double));
void (*unsetfn) _((Param, int));
double (*getfn) (Param);
void (*setfn) (Param, double);
void (*unsetfn) (Param, int);
};
struct gsu_array {
char **(*getfn) _((Param));
void (*setfn) _((Param, char **));
void (*unsetfn) _((Param, int));
char **(*getfn) (Param);
void (*setfn) (Param, char **);
void (*unsetfn) (Param, int);
};
struct gsu_hash {
HashTable (*getfn) _((Param));
void (*setfn) _((Param, HashTable));
void (*unsetfn) _((Param, int));
HashTable (*getfn) (Param);
void (*setfn) (Param, HashTable);
void (*unsetfn) (Param, int);
};
@ -2984,7 +2984,7 @@ enum errflag_bits {
/* Sorting */
/***********/
typedef int (*CompareFn) _((const void *, const void *));
typedef int (*CompareFn) (const void *, const void *);
enum {
SORTIT_ANYOLDHOW = 0, /* Defaults */
@ -3042,13 +3042,13 @@ struct hist_stack {
short *chwords;
int chwordlen;
int chwordpos;
int (*hgetc) _((void));
void (*hungetc) _((int));
void (*hwaddc) _((int));
void (*hwbegin) _((int));
void (*hwabort) _((void));
void (*hwend) _((void));
void (*addtoline) _((int));
int (*hgetc) (void);
void (*hungetc) (int);
void (*hwaddc) (int);
void (*hwbegin) (int);
void (*hwabort) (void);
void (*hwend) (void);
void (*addtoline) (int);
unsigned char *cstack;
int csp;
int hist_keep_comment;
@ -3218,7 +3218,7 @@ enum {
/* compctl entry point pointers */
typedef int (*CompctlReadFn) _((char *, char **, Options, char *));
typedef int (*CompctlReadFn) (char *, char **, Options, char *);
/* ZLE entry point pointer */

View File

@ -82,12 +82,6 @@
*/
#define _STRPTIME_DONTZERO
#ifdef PROTOTYPES
# define _(Args) Args
#else
# define _(Args) ()
#endif
#ifndef HAVE_ALLOCA
# define alloca zhalloc
#else
@ -101,7 +95,7 @@
# pragma alloca
# else
# ifndef alloca
char *alloca _((size_t));
char *alloca (size_t);
# endif
# endif
# endif

50
aclocal.m4 vendored
View File

@ -2,56 +2,6 @@
# Copyright (C) 1992, 1994 Free Software Foundation, Inc.
# Francois Pinard <pinard@iro.umontreal.ca>, 1992.
# @defmac fp_PROG_CC_STDC
# @maindex PROG_CC_STDC
# @ovindex CC
# If the C compiler in not in ANSI C mode by default, try to add an option
# to output variable @code{CC} to make it so. This macro tries various
# options that select ANSI C on some system or another. It considers the
# compiler to be in ANSI C mode if it defines @code{__STDC__} to 1 and
# handles function prototypes correctly.
#
# If you use this macro, you should check after calling it whether the C
# compiler has been set to accept ANSI C; if not, the shell variable
# @code{fp_cv_prog_cc_stdc} is set to @samp{no}. If you wrote your source
# code in ANSI C, you can make an un-ANSIfied copy of it by using the
# program @code{ansi2knr}, which comes with Ghostscript.
# @end defmac
define(fp_PROG_CC_STDC,
[AC_CACHE_CHECK(for ${CC-cc} option to accept ANSI C,
fp_cv_prog_cc_stdc,
[fp_cv_prog_cc_stdc=no
ac_save_CFLAGS="$CFLAGS"
# Don't try gcc -ansi; that turns off useful extensions and
# breaks some systems' header files.
# AIX -qlanglvl=ansi
# Ultrix and OSF/1 -std1
# HP-UX -Ae or -Aa -D_HPUX_SOURCE
# SVR4 -Xc
# For HP-UX, we try -Ae first; this turns on ANSI but also extensions,
# as well as defining _HPUX_SOURCE, and we can then use long long.
# We keep the old version for backward compatibility.
for ac_arg in "" -qlanglvl=ansi -std1 -Ae "-Aa -D_HPUX_SOURCE" -Xc
do
CFLAGS="$ac_save_CFLAGS $ac_arg"
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([
[#ifndef __STDC__
choke me
#endif
]], [[int test (int i, double x);
struct s1 {int (*f) (int a);};
struct s2 {int (*f) (double a);};]])],
[fp_cv_prog_cc_stdc="$ac_arg"; break],[])
done
CFLAGS="$ac_save_CFLAGS"
])
case "x$fp_cv_prog_cc_stdc" in
x|xno) ;;
*) CC="$CC $fp_cv_prog_cc_stdc" ;;
esac
])
AC_DEFUN(AC_PROG_LN,
[AC_MSG_CHECKING(whether ln works)
AC_CACHE_VAL(ac_cv_prog_LN,

View File

@ -273,11 +273,6 @@ fi],
AC_DEFINE(CONFIG_LOCALE)
)
dnl Do you want to compile as K&R C.
AC_ARG_ENABLE(ansi2knr,
AS_HELP_STRING([--enable-ansi2knr],[translate source to K&R C before compiling]),
[ansi2knr="$enableval"], [ansi2knr=default])
ifdef([runhelpdir],[undefine([runhelpdir])])dnl
AC_ARG_ENABLE(runhelpdir,
AS_HELP_STRING([--enable-runhelpdir=DIR],[the directory in which to install run-help files]),
@ -483,7 +478,7 @@ fi
dnl if the user hasn't specified CFLAGS, then
dnl if compiler is gcc, then use -O2 and some warning flags
dnl else use -O
if test -n "$auto_cflags" && test ."$ansi2knr" != .yes; then
if test -n "$auto_cflags"; then
if test "${enable_zsh_debug}" = yes; then
if test -n "$GCC"; then
CFLAGS="$CFLAGS -Wall -Wmissing-prototypes -ggdb"
@ -558,28 +553,6 @@ case "$host_os" in
esac
fp_PROG_CC_STDC
AC_MSG_CHECKING([whether to use prototypes])
if test ."$ansi2knr" = .yes || test ."$ansi2knr" = .no; then
msg="(overridden) "
else
msg=
if test ."$fp_cv_prog_cc_stdc" = .no; then
ansi2knr=yes
else
ansi2knr=no
fi
fi
AH_TEMPLATE([PROTOTYPES],
[Define to 1 if ANSI function prototypes are usable.])
if test "$ansi2knr" = yes; then
AC_MSG_RESULT(${msg}no)
U=_
else
AC_MSG_RESULT(${msg}yes)
AC_DEFINE(PROTOTYPES)
U=
fi
AC_SUBST(U)
AC_FUNC_ALLOCA dnl Check how to get `alloca'.
@ -647,18 +620,6 @@ case "$LC_PAPER" in
esac
AC_SUBST(PAPERSIZE)
AC_CHECK_PROGS([ANSI2KNR], [ansi2knr], [: ansi2knr])
if test x"$ansi2knr" = xyes && test x"$ANSI2KNR" = x": ansi2knr"; then
echo "----------"
echo "configure fatal error:"
echo "ansi2knr was specified (--enable-ansi2knr) but the program could not be found."
echo "Either remove the configure option if it is not required or build the ansi2knr"
echo "program before reconfiguring Zsh. The source code for ansi2knr is also"
echo "available in the GPL directory on Zsh distribution sites."
exit 1
fi
dnl ------------------
dnl CHECK HEADER FILES
dnl ------------------