Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: hzoli change: $foo:s//r/



If you wish to initialize globals in a file that is used to either
declare or define, I find the following syntax more readable:

--------------------------------------------------------
#ifdef GLOBALS
# define EXTERN
# define INIT(x) = x
#else
# define EXTERN extern
# define INIT(x)
#endif

[...]

/* the last l for s/l/r/ history substitution */

EXTERN char *hsubl INIT(NULL);

/* the last r for s/l/r/ history substitution */

EXTERN char *hsubr INIT(NULL);
--------------------------------------------------------

This can be used for any type variable and could simplify a few
of the other #ifdef GLOBALS initializations in the file.

..wayne..



Messages sorted by: Reverse Date, Date, Thread, Author