Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
PATCH: mod_export keyword
- X-seq: zsh-workers 8843
- From: zefram@xxxxxxxx
- To: zsh-workers@xxxxxxxxxxxxxx
- Subject: PATCH: mod_export keyword
- Date: Wed, 01 Dec 1999 18:33:07 +0000
- Mailing-list: contact zsh-workers-help@xxxxxxxxxxxxxx; run by ezmlm
This patch adds the mod_export pseudo-keyword I discussed earlier.
It is used to generate the .export files alongside the prototype files.
It relies on my patch earlier today.
The vast majority of the patch is just adding the mod_export keyword
to all the relevant declarations. Other than that, the .c files are
untouched; the other hunks are where the interesting stuff is.
I couldn't quite reproduce the current .export files exactly. Some
entries were for symbols that no longer exist, and there were a couple of
others which someone with an AIX system may want to examine more closely.
-zefram
diff -ur ../zsh-/Etc/zsh-development-guide ./Etc/zsh-development-guide
--- ../zsh-/Etc/zsh-development-guide Wed Dec 1 15:50:27 1999
+++ ./Etc/zsh-development-guide Wed Dec 1 16:51:42 1999
@@ -99,15 +99,25 @@
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.
- If the function is not used outside the file it is defined in, it
- should be declared "static"; this keyword goes on the type line,
- before the return type.
-* Global variable declarations must similarly be preceded by a
+* Variable declarations must similarly be preceded by a
line containing only "/**/", for the prototype generation script.
The declaration itself should be all on one line (except for multi-line
initialisers).
+* Preprocessor directives thst affect the function/variable declarations must
+ also be preceded by a "/**/" line, so that they get copied into the
+ prototype lists.
+
+* There are three levels of visibility for a function or variable. It can
+ be file-local, for which it must be marked with the keyword "static" at
+ the front of the declaration. It can be visible to other object files in
+ the same module, for which it requires no extra keyword. Or it can be
+ made available to the entire program (including other dynamically loaded
+ modules), for which it must be marked with the pseudo-keyword "mod_export"
+ at the front of the declaration. Symbols should have the least visibility
+ possible.
+
* Leave a blank line between the declarations and statements in a compound
statement, if both are present. Use blank lines elsewhere to separate
groups of statements in the interests of clarity. There should never
@@ -131,7 +141,7 @@
- autoparams parameters defined by the module, for autoloading
- automathfuncs math functions defined by the module, for autoloading
- objects .o files making up this module (*must* be defined)
- - proto .pro files for this module (default generated from $objects)
+ - proto .syms files for this module (default generated from $objects)
- headers extra headers for this module (default none)
- hdrdeps extra headers on which the .mdh depends (default none)
- otherincs extra headers that are included indirectly (default none)
diff -ur ../zsh-/Src/.cvsignore ./Src/.cvsignore
--- ../zsh-/Src/.cvsignore Wed Dec 1 15:50:29 1999
+++ ./Src/.cvsignore Wed Dec 1 16:54:09 1999
@@ -1,5 +1,6 @@
Makefile
Makemod.in Makemod
+*.export
[_a-zA-Z0-9]*.pro
*.epro
*.syms
diff -ur ../zsh-/Src/.distfiles ./Src/.distfiles
--- ../zsh-/Src/.distfiles Wed Dec 1 15:50:29 1999
+++ ./Src/.distfiles Wed Dec 1 16:53:16 1999
@@ -8,5 +8,5 @@
math.c mem.c mkbltnmlst.sh mkmakemod.sh mkmodindex.sh
module.c options.c params.c parse.c pattern.c prompt.c prototypes.h
signals.c signals.h subst.c system.h text.c utils.c
- watch.c xmods.conf zsh.h zsh.mdd ztype.h zsh.export
+ watch.c xmods.conf zsh.h zsh.mdd ztype.h
'
diff -ur ../zsh-/Src/Builtins/.cvsignore ./Src/Builtins/.cvsignore
--- ../zsh-/Src/Builtins/.cvsignore Wed Dec 1 15:50:31 1999
+++ ./Src/Builtins/.cvsignore Wed Dec 1 16:54:21 1999
@@ -1,5 +1,6 @@
Makefile
Makefile.in
+*.export
so_locations
*.pro
*.epro
diff -ur ../zsh-/Src/Makefile.in ./Src/Makefile.in
--- ../zsh-/Src/Makefile.in Wed Dec 1 15:50:29 1999
+++ ./Src/Makefile.in Wed Dec 1 17:08:02 1999
@@ -65,7 +65,7 @@
LIBZSH = libzsh-$(VERSION).$(DL_EXT)
NIBZSH =
-ZSH_EXPORT = $(EXPOPT)$(sdir)/zsh.export
+ZSH_EXPORT = $(EXPOPT)zsh.export
ZSH_NXPORT =
ENTRYOBJ = modentry..o
NNTRYOBJ =
@@ -73,7 +73,7 @@
LDRUNPATH = LD_RUN_PATH=$(libdir)/zsh
NDRUNPATH =
-zsh: $(@L@IBZSH) $(@L@STMP) $(MAIN_OBJS)
+zsh: $(@L@IBZSH) $(@L@STMP) $(MAIN_OBJS) zsh.export
rm -f $@
$(@L@DRUNPATH) $(LINK) $(MAIN_OBJS) $(@L@LIST) $(ZSH_@E@XPORT) $(@L@IBZSH) $(LIBS)
@@ -218,7 +218,7 @@
# ========== RECURSIVE MAKES ==========
install.modules uninstall.modules \
-modobjs modules headers proto $(MAIN_OBJS): Makemod
+modobjs modules headers proto $(MAIN_OBJS) zsh.export: Makemod
@$(MAKE) -f Makemod $(MAKEDEFS) $@
$(MAIN_OBJS): $(sdir)/zsh.h
diff -ur ../zsh-/Src/Makemod.in.in ./Src/Makemod.in.in
--- ../zsh-/Src/Makemod.in.in Wed Dec 1 15:50:29 1999
+++ ./Src/Makemod.in.in Wed Dec 1 17:04:31 1999
@@ -148,7 +148,7 @@
@CLEAN_MK@
mostlyclean-here:
- rm -f *.o *.$(DL_EXT)
+ rm -f *.o *.export *.$(DL_EXT)
clean-here:
rm -f *.o.c *.syms *.pro *.epro *.mdh *.mdhi *.mdhs *.mdh.tmp
diff -ur ../zsh-/Src/Modules/.cvsignore ./Src/Modules/.cvsignore
--- ../zsh-/Src/Modules/.cvsignore Wed Dec 1 15:50:31 1999
+++ ./Src/Modules/.cvsignore Wed Dec 1 16:54:31 1999
@@ -1,5 +1,6 @@
Makefile
Makefile.in
+*.export
so_locations
*.pro
*.epro
diff -ur ../zsh-/Src/Zle/.cvsignore ./Src/Zle/.cvsignore
--- ../zsh-/Src/Zle/.cvsignore Wed Dec 1 15:50:31 1999
+++ ./Src/Zle/.cvsignore Wed Dec 1 16:54:41 1999
@@ -1,5 +1,6 @@
Makefile
Makefile.in
+*.export
so_locations
*.pro
*.epro
diff -ur ../zsh-/Src/Zle/.distfiles ./Src/Zle/.distfiles
--- ../zsh-/Src/Zle/.distfiles Wed Dec 1 15:50:31 1999
+++ ./Src/Zle/.distfiles Wed Dec 1 16:53:32 1999
@@ -1,6 +1,6 @@
DISTFILES_SRC='
.cvsignore .distfiles .exrc
- comp.h complete.mdd complete.c complete.export
+ comp.h complete.mdd complete.c
compcore.c compmatch.c compresult.c
compctl.mdd compctl.c compctl.h
complist.mdd complist.c
@@ -10,5 +10,5 @@
zle.mdd iwidgets.list zle.h zle_bindings.c zle_hist.c
zle_keymap.c zle_main.c zle_misc.c zle_move.c zle_params.c
zle_refresh.c zle_things.sed zle_thingy.c zle_tricky.c
- zle_utils.c zle_vi.c zle_widget.sed zle_word.c zle.export
+ zle_utils.c zle_vi.c zle_widget.sed zle_word.c
'
diff -ur ../zsh-/Src/Zle/compcore.c ./Src/Zle/compcore.c
--- ../zsh-/Src/Zle/compcore.c Wed Dec 1 15:50:31 1999
+++ ./Src/Zle/compcore.c Wed Dec 1 18:18:30 1999
@@ -59,12 +59,12 @@
/* Information about menucompletion. */
/**/
-struct menuinfo minfo;
+mod_export struct menuinfo minfo;
/* Number of matches accepted with accept-and-menu-complete */
/**/
-int menuacc;
+mod_export int menuacc;
/* Brace insertion stuff. */
@@ -74,7 +74,7 @@
/* Flags saying in what kind of string we are. */
/**/
-int ispar, linwhat;
+mod_export int ispar, linwhat;
/* A parameter expansion prefix (like ${). */
@@ -89,7 +89,7 @@
/* Match flags for all matches in this group. */
/**/
-int mflags;
+mod_export int mflags;
/* Flags saying how the parameter expression we are in is quoted. */
@@ -101,13 +101,15 @@
* isuf -- the ignored suffix */
/**/
-char *ipre, *ripre, *isuf;
+mod_export char *ipre, *ripre, *isuf;
/* The list of matches. fmatches contains the matches we first ignore *
* because of fignore. */
/**/
-LinkList matches, fmatches;
+mod_export LinkList matches;
+/**/
+LinkList fmatches;
/* This holds the list of matches-groups. lastmatches holds the last list of
* permanently allocated matches, pmatches is the same for the list
@@ -116,12 +118,12 @@
* lmatches/lastlmatches is a pointer to the last element in the lists. */
/**/
-Cmgroup lastmatches, pmatches, amatches, lmatches, lastlmatches;
+mod_export Cmgroup lastmatches, pmatches, amatches, lmatches, lastlmatches;
/* Non-zero if we have permanently allocated matches (old and new). */
/**/
-int hasoldlist, hasperm;
+mod_export int hasoldlist, hasperm;
/* Non-zero if we have newly added matches. */
@@ -136,27 +138,29 @@
/* The total number of matches and the number of matches to be listed. */
/**/
-int nmatches, smatches;
+mod_export int nmatches;
+/**/
+int smatches;
/* != 0 if only explanation strings should be printed */
/**/
-int onlyexpl;
+mod_export int onlyexpl;
/* Information about the matches for listing. */
/**/
-struct cldata listdat;
+mod_export struct cldata listdat;
/* This flag is non-zero if we are completing a pattern (with globcomplete) */
/**/
-int ispattern, haspattern;
+mod_export int ispattern, haspattern;
/* Non-zero if at least one match was added without -U. */
/**/
-int hasmatched;
+mod_export int hasmatched;
/* The current group of matches. */
@@ -166,7 +170,7 @@
/* Match counter: all matches. */
/**/
-int mnum;
+mod_export int mnum;
/* The match counter when unambig_data() was called. */
@@ -185,22 +189,22 @@
LinkList expls;
/**/
-Cexpl curexpl;
+mod_export Cexpl curexpl;
/* A stack of completion matchers to be used. */
/**/
-Cmlist mstack;
+mod_export Cmlist mstack;
/* The completion matchers used when building new stuff for the line. */
/**/
-Cmlist bmatchers;
+mod_export Cmlist bmatchers;
/* A list with references to all matchers we used. */
/**/
-LinkList matchers;
+mod_export LinkList matchers;
/* A heap of free Cline structures. */
@@ -215,7 +219,7 @@
/* The memory heap to use for new style completion generation. */
/**/
-Heap compheap;
+mod_export Heap compheap;
/* A list of some data.
*
@@ -223,7 +227,7 @@
* conceptually we don't know anything about compctls here... */
/**/
-LinkList allccs;
+mod_export LinkList allccs;
/* This says what of the state the line is in when completion is started *
* came from a previous completion. If the FC_LINE bit is set, the *
@@ -917,7 +921,7 @@
}
/**/
-char *
+mod_export char *
multiquote(char *s, int ign)
{
if (s) {
@@ -940,7 +944,7 @@
}
/**/
-char *
+mod_export char *
tildequote(char *s, int ign)
{
if (s) {
@@ -961,7 +965,7 @@
/* Check if we have to complete a parameter name. */
/**/
-char *
+mod_export char *
check_param(char *s, int set, int test)
{
char *p;
@@ -1086,7 +1090,7 @@
/* Copy the given string and remove backslashes from the copy and return it. */
/**/
-char *
+mod_export char *
rembslash(char *s)
{
char *t = s = dupstring(s);
@@ -1105,7 +1109,7 @@
/* This should probably be moved into tokenize(). */
/**/
-char *
+mod_export char *
ctokenize(char *p)
{
char *r = p;
@@ -1131,7 +1135,7 @@
}
/**/
-char *
+mod_export char *
comp_str(int *ipl, int *pl, int untok)
{
char *p = dupstring(compprefix);
@@ -1396,7 +1400,7 @@
/* This stores the strings from the list in an array. */
/**/
-void
+mod_export void
set_list_array(char *name, LinkList l)
{
char **a, **p;
@@ -1413,7 +1417,7 @@
/* Get the words from a variable or a (list of words). */
/**/
-char **
+mod_export char **
get_user_var(char *nam)
{
if (!nam)
@@ -1842,7 +1846,7 @@
/* This adds all the data we have for a match. */
/**/
-Cmatch
+mod_export Cmatch
add_match_data(int alt, char *str, Cline line,
char *ipre, char *ripre, char *isuf,
char *pre, char *prpre,
@@ -2170,7 +2174,7 @@
/* This begins a new group of matches. */
/**/
-void
+mod_export void
begcmgroup(char *n, int flags)
{
if (n) {
@@ -2213,7 +2217,7 @@
/* End the current group for now. */
/**/
-void
+mod_export void
endcmgroup(char **ylist)
{
mgroup->ylist = ylist;
@@ -2222,7 +2226,7 @@
/* Add an explanation string to the current group, joining duplicates. */
/**/
-void
+mod_export void
addexpl(void)
{
LinkNode n;
@@ -2581,7 +2585,7 @@
/* This frees the groups of matches. */
/**/
-void
+mod_export void
freematches(Cmgroup g)
{
Cmgroup n;
diff -ur ../zsh-/Src/Zle/complete.c ./Src/Zle/complete.c
--- ../zsh-/Src/Zle/complete.c Wed Dec 1 15:50:31 1999
+++ ./Src/Zle/complete.c Wed Dec 1 18:20:57 1999
@@ -33,41 +33,44 @@
/* Global matcher. */
/**/
-Cmlist cmatcher;
+mod_export Cmlist cmatcher;
/* global variables for shell parameters in new style completion */
/**/
-zlong compcurrent,
- compmatcher,
+mod_export zlong compcurrent;
+/**/
+zlong compmatcher,
compmatchertot,
complistmax,
complistlines;
/**/
+mod_export
char **compwords,
*compprefix,
*compsuffix,
- *compiprefix,
*compisuffix,
*compqiprefix,
*compqisuffix,
+ *compquote,
+ *compqstack,
+ *comppatmatch,
+ *complastprompt;
+/**/
+char *compiprefix,
*compmatcherstr,
*compcontext,
*compparameter,
*compredirect,
- *compquote,
*compquoting,
- *compqstack,
*comprestore,
*complist,
*compforcelist,
*compinsert,
*compexact,
*compexactstr,
- *comppatmatch,
*comppatinsert,
- *complastprompt,
*comptoend,
*compoldlist,
*compoldins,
@@ -94,7 +97,7 @@
}
/**/
-void
+mod_export void
freecmatcher(Cmatcher m)
{
Cmatcher n;
@@ -152,7 +155,7 @@
/* Copy a completion matcher list. */
/**/
-Cmatcher
+mod_export Cmatcher
cpcmatcher(Cmatcher m)
{
Cmatcher r = NULL, *p = &r, n;
@@ -202,7 +205,7 @@
/* Set the global match specs. */
/**/
-int
+mod_export int
set_gmatcher(char *name, char **argv)
{
Cmlist l = NULL, *q = &l, n;
@@ -229,7 +232,7 @@
/* Parse a string for matcher control, containing multiple matchers. */
/**/
-Cmatcher
+mod_export Cmatcher
parse_cmatcher(char *name, char *s)
{
Cmatcher ret = NULL, r = NULL, n;
@@ -616,7 +619,7 @@
#define CVT_SUFPAT 5
/**/
-void
+mod_export void
ignore_prefix(int l)
{
if (l) {
@@ -640,7 +643,7 @@
}
/**/
-void
+mod_export void
ignore_suffix(int l)
{
if (l) {
@@ -663,7 +666,7 @@
}
/**/
-void
+mod_export void
restrict_range(int b, int e)
{
int wl = arrlen(compwords) - 1;
Only in ../zsh-/Src/Zle: complete.export
Only in ./Src/Zle: complete.expsyms
diff -ur ../zsh-/Src/Zle/complete.mdd ./Src/Zle/complete.mdd
--- ../zsh-/Src/Zle/complete.mdd Wed Dec 1 15:50:31 1999
+++ ./Src/Zle/complete.mdd Wed Dec 1 17:01:26 1999
@@ -1,5 +1,3 @@
-hasexport=1
-
moddeps="zle"
autobins="compgen compadd compset"
diff -ur ../zsh-/Src/Zle/compmatch.c ./Src/Zle/compmatch.c
--- ../zsh-/Src/Zle/compmatch.c Wed Dec 1 15:50:31 1999
+++ ./Src/Zle/compmatch.c Wed Dec 1 16:25:14 1999
@@ -68,7 +68,7 @@
/* Add the given matchers to the bmatcher list. */
/**/
-void
+mod_export void
add_bmatchers(Cmatcher m)
{
Cmlist old = bmatchers, *q = &bmatchers, n;
@@ -88,7 +88,7 @@
* ensure that the bmatchers list contains no matchers not in mstack. */
/**/
-void
+mod_export void
update_bmatchers(void)
{
Cmlist p = bmatchers, q = NULL, ms;
@@ -832,7 +832,7 @@
* and the suffix don't match the word w. */
/**/
-char *
+mod_export char *
comp_match(char *pfx, char *sfx, char *w, Patprog cp, Cline *clp, int qu,
Brinfo *bpl, int bcp, Brinfo *bsl, int bcs, int *exact)
{
diff -ur ../zsh-/Src/Zle/compresult.c ./Src/Zle/compresult.c
--- ../zsh-/Src/Zle/compresult.c Wed Dec 1 15:50:31 1999
+++ ./Src/Zle/compresult.c Wed Dec 1 16:25:45 1999
@@ -682,7 +682,7 @@
* (l)stat(). */
/**/
-int
+mod_export int
ztat(char *nam, struct stat *buf, int ls)
{
char b[PATH_MAX], *p;
@@ -700,7 +700,7 @@
/* Insert a single match in the command line. */
/**/
-void
+mod_export void
do_single(Cmatch m)
{
int l, sr = 0, scs;
@@ -891,7 +891,7 @@
* insert the next completion. */
/**/
-void
+mod_export void
do_menucmp(int lst)
{
/* Just list the matches if the list was requested. */
@@ -947,7 +947,7 @@
* accept several selections from the list of matches. */
/**/
-int
+mod_export int
accept_last(void)
{
if (!menuacc) {
@@ -1132,7 +1132,7 @@
}
/**/
-void
+mod_export void
calclist(void)
{
Cmgroup g;
@@ -1517,7 +1517,7 @@
}
/**/
-int
+mod_export int
printlist(int over, CLPrintFunc printm)
{
Cmgroup g;
@@ -1800,7 +1800,7 @@
/* Invalidate the completion list. */
/**/
-int
+mod_export int
invalidate_list(void)
{
if (showinglist == -2)
Only in ../zsh-/Src/Zle: zle.export
Only in ./Src/Zle: zle.expsyms
diff -ur ../zsh-/Src/Zle/zle.mdd ./Src/Zle/zle.mdd
--- ../zsh-/Src/Zle/zle.mdd Wed Dec 1 15:50:32 1999
+++ ./Src/Zle/zle.mdd Wed Dec 1 17:01:52 1999
@@ -1,5 +1,3 @@
-hasexport=1
-
autobins="bindkey vared zle"
objects="zle_bindings.o zle_hist.o zle_keymap.o zle_main.o \
diff -ur ../zsh-/Src/Zle/zle_bindings.c ./Src/Zle/zle_bindings.c
--- ../zsh-/Src/Zle/zle_bindings.c Wed Dec 1 15:50:32 1999
+++ ./Src/Zle/zle_bindings.c Wed Dec 1 18:04:50 1999
@@ -69,7 +69,7 @@
*/
/**/
-struct thingy thingies[] = {
+mod_export struct thingy thingies[] = {
#define T(name, th_flags, w_idget, t_next) \
{ NULL, name, th_flags, 2, w_idget, t_next },
#include "thingies.list"
diff -ur ../zsh-/Src/Zle/zle_keymap.c ./Src/Zle/zle_keymap.c
--- ../zsh-/Src/Zle/zle_keymap.c Wed Dec 1 15:50:32 1999
+++ ./Src/Zle/zle_keymap.c Wed Dec 1 18:12:08 1999
@@ -105,7 +105,7 @@
/* the hash table of keymap names */
/**/
-HashTable keymapnamtab;
+mod_export HashTable keymapnamtab;
/* key sequence reading data */
@@ -217,7 +217,7 @@
static HashTable copyto;
/**/
-Keymap
+mod_export Keymap
newkeymap(Keymap tocopy, char *kmname)
{
Keymap km = zcalloc(sizeof(*km));
@@ -323,7 +323,7 @@
}
/**/
-int
+mod_export int
unlinkkeymap(char *name, int ignm)
{
KeymapName n = (KeymapName) keymapnamtab->getnode(keymapnamtab, name);
@@ -336,7 +336,7 @@
}
/**/
-int
+mod_export int
linkkeymap(Keymap km, char *name, int imm)
{
KeymapName n = (KeymapName) keymapnamtab->getnode(keymapnamtab, name);
@@ -386,7 +386,7 @@
/* Select a local key map. */
/**/
-void
+mod_export void
selectlocalmap(Keymap m)
{
localkeymap = m;
@@ -414,7 +414,7 @@
* back onto the input. */
/**/
-int
+mod_export int
bindkey(Keymap km, char *seq, Thingy bind, char *str)
{
Key k;
@@ -1204,7 +1204,7 @@
* Must be executed at most once after each getkeymapcmd(). */
/**/
-void
+mod_export void
ungetkeycmd(void)
{
ungetkeys(keybuf, keybuflen);
@@ -1213,7 +1213,7 @@
/* read a command from the current keymap, with widgets */
/**/
-Thingy
+mod_export Thingy
getkeycmd(void)
{
Thingy func;
diff -ur ../zsh-/Src/Zle/zle_main.c ./Src/Zle/zle_main.c
--- ../zsh-/Src/Zle/zle_main.c Wed Dec 1 15:50:32 1999
+++ ./Src/Zle/zle_main.c Wed Dec 1 18:06:50 1999
@@ -34,17 +34,17 @@
* will work (i.e., the line is metafied, and the above word arrays are OK). */
/**/
-int incompctlfunc;
+mod_export int incompctlfunc;
/* != 0 if we are in a new style completion function */
/**/
-int incompfunc;
+mod_export int incompfunc;
/* != 0 if completion module is loaded */
/**/
-int hascompmod;
+mod_export int hascompmod;
/* != 0 if we're done editing */
@@ -64,7 +64,7 @@
/* the bindings for the previous and for this key */
/**/
-Thingy lbindk, bindk;
+mod_export Thingy lbindk, bindk;
/* insert mode/overwrite mode flag */
@@ -83,10 +83,10 @@
/* flags associated with last command */
/**/
-int lastcmd;
+mod_export int lastcmd;
/**/
-Widget compwidget;
+mod_export Widget compwidget;
/* the status line, and its length */
@@ -109,7 +109,7 @@
/* current modifier status */
/**/
-struct modifier zmod;
+mod_export struct modifier zmod;
/* Current command prefix status. This is normally 0. Prefixes set *
* this to 1. Each time round the main loop, this is checked: if it *
@@ -127,7 +127,7 @@
int kungetct;
/**/
-char *zlenoargs[1] = { NULL };
+mod_export char *zlenoargs[1] = { NULL };
#ifdef FIONREAD
static int delayzsetterm;
@@ -136,7 +136,7 @@
/* set up terminal */
/**/
-void
+mod_export void
zsetterm(void)
{
struct ttyinfo ti;
@@ -316,7 +316,7 @@
#endif
/**/
-int
+mod_export int
getkey(int keytmout)
{
char cc;
@@ -722,7 +722,7 @@
/* this exports the argument we are currently vared'iting if != NULL */
/**/
-char *varedarg;
+mod_export char *varedarg;
/* vared: edit (literally) a parameter value */
@@ -952,7 +952,7 @@
}
/**/
-void
+mod_export void
trashzle(void)
{
if (zleactive) {
@@ -991,7 +991,7 @@
* macros in zle.h */
/**/
-struct hookdef zlehooks[] = {
+mod_export struct hookdef zlehooks[] = {
HOOKDEF("list_matches", NULL, 0),
HOOKDEF("complete", NULL, 0),
HOOKDEF("before_complete", NULL, 0),
diff -ur ../zsh-/Src/Zle/zle_misc.c ./Src/Zle/zle_misc.c
--- ../zsh-/Src/Zle/zle_misc.c Wed Dec 1 15:50:32 1999
+++ ./Src/Zle/zle_misc.c Wed Dec 1 18:07:05 1999
@@ -833,7 +833,7 @@
* suffixlen[256] is the length to remove for non-insertion editing actions. */
/**/
-int suffixlen[257];
+mod_export int suffixlen[257];
/* Shell function to call to remove the suffix. */
@@ -844,7 +844,7 @@
* removed in the usual word end conditions. */
/**/
-void
+mod_export void
makesuffix(int n)
{
suffixlen[256] = suffixlen[' '] = suffixlen['\t'] = suffixlen['\n'] =
@@ -858,7 +858,7 @@
* characters that can only be used in braces are included. */
/**/
-void
+mod_export void
makeparamsuffix(int br, int n)
{
if(br || unset(KSHARRAYS))
@@ -874,7 +874,7 @@
* remove the suffix. */
/**/
-void
+mod_export void
makesuffixstr(char *f, char *s, int n)
{
if (f) {
@@ -920,7 +920,7 @@
/* Remove suffix, if there is one, when inserting character c. */
/**/
-void
+mod_export void
iremovesuffix(int c, int keep)
{
if (suffixfunc) {
@@ -958,7 +958,7 @@
/* Fix the suffix in place, if there is one, making it non-removable. */
/**/
-void
+mod_export void
fixsuffix(void)
{
memset(suffixlen, 0, sizeof(suffixlen));
diff -ur ../zsh-/Src/Zle/zle_params.c ./Src/Zle/zle_params.c
--- ../zsh-/Src/Zle/zle_params.c Wed Dec 1 15:50:32 1999
+++ ./Src/Zle/zle_params.c Wed Dec 1 16:27:28 1999
@@ -79,7 +79,7 @@
};
/**/
-void
+mod_export void
makezleparams(int ro)
{
struct zleparam *zp;
diff -ur ../zsh-/Src/Zle/zle_refresh.c ./Src/Zle/zle_refresh.c
--- ../zsh-/Src/Zle/zle_refresh.c Wed Dec 1 15:50:32 1999
+++ ./Src/Zle/zle_refresh.c Wed Dec 1 18:07:43 1999
@@ -43,7 +43,7 @@
/* number of lines displayed */
/**/
-int nlnct;
+mod_export int nlnct;
/* Most lines of the buffer we've shown at once with the current list *
* showing. == 0 if there is no list. == -1 if a new list has just *
@@ -51,25 +51,25 @@
* list. */
/**/
-int showinglist;
+mod_export int showinglist;
/* > 0 if a completion list is displayed below the prompt,
* < 0 if a list is displayed above the prompt. */
/**/
-int listshown;
+mod_export int listshown;
/* Non-zero if ALWAYS_LAST_PROMPT has been used, meaning that the *
* screen below the buffer display should not be cleared by *
* zrefresh(), but should be by trashzle(). */
/**/
-int clearflag;
+mod_export int clearflag;
/* Non-zero if zrefresh() should clear the list below the prompt. */
/**/
-int clearlist;
+mod_export int clearlist;
#ifdef HAVE_SELECT
/* cost of last update */
@@ -243,7 +243,7 @@
numscrolls, onumscrolls;
/**/
-void
+mod_export void
zrefresh(void)
{
static int inlist; /* avoiding recursion */
@@ -893,7 +893,7 @@
}
/**/
-int
+mod_export int
tcmultout(int cap, int multcap, int ct)
{
if (tccan(multcap) && (!tccan(cap) || tclen[multcap] <= tclen[cap] * ct)) {
@@ -989,7 +989,7 @@
}
/**/
-void
+mod_export void
tcout(int cap)
{
tputs(tcstr[cap], 1, putshout);
@@ -1008,7 +1008,7 @@
}
/**/
-int
+mod_export int
clearscreen(char **args)
{
tcout(TCCLEARSCREEN);
@@ -1018,7 +1018,7 @@
}
/**/
-int
+mod_export int
redisplay(char **args)
{
moveto(0, 0);
diff -ur ../zsh-/Src/Zle/zle_thingy.c ./Src/Zle/zle_thingy.c
--- ../zsh-/Src/Zle/zle_thingy.c Wed Dec 1 15:50:32 1999
+++ ./Src/Zle/zle_thingy.c Wed Dec 1 16:27:55 1999
@@ -134,7 +134,7 @@
* correctly. */
/**/
-Thingy
+mod_export Thingy
refthingy(Thingy th)
{
if(th)
@@ -261,7 +261,7 @@
* returned. */
/**/
-Widget
+mod_export Widget
addzlefunction(char *name, ZleIntFunc ifunc, int flags)
{
VARARR(char, dotn, strlen(name) + 2);
@@ -290,7 +290,7 @@
* a widget from the fixed table -- it would be bad. (Thanks, Egon.) */
/**/
-void
+mod_export void
deletezlefunction(Widget w)
{
Thingy p, n;
diff -ur ../zsh-/Src/Zle/zle_tricky.c ./Src/Zle/zle_tricky.c
--- ../zsh-/Src/Zle/zle_tricky.c Wed Dec 1 15:50:32 1999
+++ ./Src/Zle/zle_tricky.c Wed Dec 1 18:10:35 1999
@@ -47,27 +47,27 @@
/* The line before completion was tried. */
/**/
-char *origline;
+mod_export char *origline;
/**/
-int origcs, origll;
+mod_export int origcs, origll;
/* Words on the command line, for use in completion */
/**/
-int clwsize, clwnum, clwpos;
+mod_export int clwsize, clwnum, clwpos;
/**/
-char **clwords;
+mod_export char **clwords;
/* wb and we hold the beginning/end position of the word we are completing. */
/**/
-int wb, we;
+mod_export int wb, we;
/* offs is the cursor position within the tokenized *
* current word after removing nulargs. */
/**/
-int offs;
+mod_export int offs;
/* These control the type of completion that will be done. They are *
* affected by the choice of ZLE command and by relevant shell options. *
@@ -75,34 +75,34 @@
* insert a match as if for menucompletion but without really starting it. */
/**/
-int usemenu, useglob;
+mod_export int usemenu, useglob;
/* != 0 if we are in the middle of a menu completion. May be == 2 to force *
* menu completion even if using different widgets. */
/**/
-int menucmp;
+mod_export int menucmp;
/* Lists of brace-infos before/after cursor (first and last for each). */
/**/
-Brinfo brbeg, lastbrbeg, brend, lastbrend;
+mod_export Brinfo brbeg, lastbrbeg, brend, lastbrend;
/**/
-int nbrbeg, nbrend;
+mod_export int nbrbeg, nbrend;
/**/
-char *lastprebr, *lastpostbr;
+mod_export char *lastprebr, *lastpostbr;
/* !=0 if we have a valid completion list. */
/**/
-int validlist;
+mod_export int validlist;
/* Non-zero if we have to redisplay the list of matches. */
/**/
-int showagain = 0;
+mod_export int showagain = 0;
/* This holds the word we are completing in quoted from. */
@@ -112,13 +112,13 @@
* closing quote. */
/**/
-char *qipre, *qisuf, *autoq;
+mod_export char *qipre, *qisuf, *autoq;
/* This contains the name of the function to call if this is for a new *
* style completion. */
/**/
-char *compfunc = NULL;
+mod_export char *compfunc = NULL;
/* Non-zero if the last completion done was ambiguous (used to find *
* out if AUTOMENU should start). More precisely, it's nonzero after *
@@ -132,14 +132,14 @@
* lastambig == 2. */
/**/
-int lastambig;
+mod_export int lastambig;
/* Arguments for and return value of completion widget. */
/**/
-char **cfargs;
+mod_export char **cfargs;
/**/
-int cfret;
+mod_export int cfret;
/* Find out if we have to insert a tab (instead of trying to complete). */
@@ -189,7 +189,7 @@
}
/**/
-int
+mod_export int
menucomplete(char **args)
{
usemenu = 1;
@@ -284,7 +284,7 @@
}
/**/
-int
+mod_export int
reversemenucomplete(char **args)
{
if (!menucmp)
@@ -308,28 +308,28 @@
* position, in a redirection, or in a parameter expansion. */
/**/
-int lincmd, linredir, linarr;
+mod_export int lincmd, linredir, linarr;
/* The string for the redirection operator. */
/**/
-char *rdstr;
+mod_export char *rdstr;
/* This holds the name of the current command (used to find the right *
* compctl). */
/**/
-char *cmdstr;
+mod_export char *cmdstr;
/* This hold the name of the variable we are working on. */
/**/
-char *varname;
+mod_export char *varname;
/* != 0 if we are in a subscript */
/**/
-int insubscr;
+mod_export int insubscr;
/* Parameter pointer for completing keys of an assoc array. */
@@ -339,7 +339,7 @@
/* 1 if we are completing in a quoted string (or inside `...`) */
/**/
-int instring, inbackt;
+mod_export int instring, inbackt;
/* Convenience macro for calling bslashquote() (formerly quotename()). *
* This uses the instring variable above. */
@@ -802,7 +802,7 @@
/* Like dupstring, but add an extra space at the end of the string. */
/**/
-char *
+mod_export char *
dupstrspace(const char *str)
{
int len = strlen((char *)str);
@@ -820,7 +820,7 @@
* functions (there's one for each direction). */
/**/
-void
+mod_export void
metafy_line(void)
{
int len = ll;
@@ -836,7 +836,7 @@
}
/**/
-void
+mod_export void
unmetafy_line(void)
{
cs = ztrsub((char *) line + cs, (char *) line);
@@ -846,7 +846,7 @@
/* Free a brinfo list. */
/**/
-void
+mod_export void
freebrinfo(Brinfo p)
{
Brinfo n;
@@ -863,7 +863,7 @@
/* Duplicate a brinfo list. */
/**/
-Brinfo
+mod_export Brinfo
dupbrinfo(Brinfo p, Brinfo *last)
{
Brinfo ret = NULL, *q = &ret, n = NULL;
@@ -1572,7 +1572,7 @@
* The last argument says if we should quote the string. */
/**/
-int
+mod_export int
inststrlen(char *str, int move, int len)
{
if (!len || !str)
@@ -1683,7 +1683,7 @@
/* Return the length of the common prefix of s and t. */
/**/
-int
+mod_export int
pfxlen(char *s, char *t)
{
int i = 0;
@@ -1715,7 +1715,7 @@
/* This is strcmp with ignoring backslashes. */
/**/
-int
+mod_export int
strbpcmp(char **aa, char **bb)
{
char *a = *aa, *b = *bb;
@@ -1761,7 +1761,7 @@
* It returns the number of lines printed. */
/**/
-int
+mod_export int
printfmt(char *fmt, int n, int dopr, int doesc)
{
char *p = fmt, nc[DIGBUFSIZE];
diff -ur ../zsh-/Src/Zle/zle_utils.c ./Src/Zle/zle_utils.c
--- ../zsh-/Src/Zle/zle_utils.c Wed Dec 1 15:50:32 1999
+++ ./Src/Zle/zle_utils.c Wed Dec 1 16:28:37 1999
@@ -73,7 +73,7 @@
/* insert space for ct chars at cursor position */
/**/
-void
+mod_export void
spaceinline(int ct)
{
int i;
@@ -105,7 +105,7 @@
}
/**/
-void
+mod_export void
backkill(int ct, int dir)
{
int i = (cs -= ct);
@@ -115,7 +115,7 @@
}
/**/
-void
+mod_export void
forekill(int ct, int dir)
{
int i = cs;
@@ -191,14 +191,14 @@
}
/**/
-void
+mod_export void
backdel(int ct)
{
shiftchars(cs -= ct, ct);
}
/**/
-void
+mod_export void
foredel(int ct)
{
shiftchars(cs, ct);
@@ -283,7 +283,7 @@
* characters are read. Case is folded. */
/**/
-int
+mod_export int
getzlequery(void)
{
int c;
diff -ur ../zsh-/Src/builtin.c ./Src/builtin.c
--- ../zsh-/Src/builtin.c Wed Dec 1 15:50:29 1999
+++ ./Src/builtin.c Wed Dec 1 17:33:07 1999
@@ -133,7 +133,7 @@
/* hash table containing builtin commands */
/**/
-HashTable builtintab;
+mod_export HashTable builtintab;
/**/
void
@@ -573,7 +573,7 @@
/* the directory stack */
/**/
-LinkList dirstack;
+mod_export LinkList dirstack;
/* dirs: list the directory stack, or replace it with a provided list */
@@ -1139,7 +1139,7 @@
}
/**/
-void
+mod_export void
printqt(char *str)
{
/* Print str, but turn any single quote into '\'' or ''. */
@@ -1151,7 +1151,7 @@
}
/**/
-void
+mod_export void
printif(char *str, int c)
{
/* If flag c has an argument, print that */
@@ -2699,7 +2699,7 @@
/* the zle buffer stack */
/**/
-LinkList bufstack;
+mod_export LinkList bufstack;
/* echo, print, pushln */
@@ -3149,7 +3149,7 @@
/* we have printed a 'you have stopped (running) jobs.' message */
/**/
-int stopmsg;
+mod_export int stopmsg;
/* check to see if user has jobs running/stopped */
@@ -3183,7 +3183,7 @@
* because of a signal. */
/**/
-void
+mod_export void
zexit(int val, int from_signal)
{
static int in_exit;
@@ -4045,7 +4045,7 @@
/* Generic builtin for facilities not available on this OS */
/**/
-int
+mod_export int
bin_notavail(char *nam, char **argv, char *ops, int func)
{
zwarnnam(nam, "not available on this system", NULL, 0);
diff -ur ../zsh-/Src/compat.c ./Src/compat.c
--- ../zsh-/Src/compat.c Wed Dec 1 15:50:29 1999
+++ ./Src/compat.c Wed Dec 1 16:29:54 1999
@@ -106,7 +106,7 @@
/**/
-char *
+mod_export char *
zgetdir(struct dirsav *d)
{
char nbuf[PATH_MAX+3];
@@ -258,7 +258,7 @@
* faliliure and -2 when chdir failed and the current directory is lost. */
/**/
-int
+mod_export int
zchdir(char *dir)
{
char *s;
@@ -313,7 +313,7 @@
/**/
#ifdef ZSH_64_BIT_TYPE
/**/
-char *
+mod_export char *
output64(zlong val)
{
static char llbuf[DIGBUFSIZE];
diff -ur ../zsh-/Src/cond.c ./Src/cond.c
--- ../zsh-/Src/cond.c Wed Dec 1 15:50:29 1999
+++ ./Src/cond.c Wed Dec 1 16:29:58 1999
@@ -349,7 +349,7 @@
}
/**/
-char *
+mod_export char *
cond_str(char **args, int num, int raw)
{
char *s = args[num];
@@ -362,7 +362,7 @@
}
/**/
-zlong
+mod_export zlong
cond_val(char **args, int num)
{
char *s = args[num];
@@ -374,7 +374,7 @@
}
/**/
-int
+mod_export int
cond_match(char **args, int num, char *str)
{
char *s = args[num];
diff -ur ../zsh-/Src/exec.c ./Src/exec.c
--- ../zsh-/Src/exec.c Wed Dec 1 15:50:29 1999
+++ ./Src/exec.c Wed Dec 1 17:34:36 1999
@@ -38,7 +38,7 @@
/* suppress error messages */
/**/
-int noerrs;
+mod_export int noerrs;
/* do not save history on exec and exit */
@@ -48,7 +48,7 @@
/* error/break flag */
/**/
-int errflag;
+mod_export int errflag;
/* Status of return from a trap */
@@ -63,7 +63,7 @@
/* != 0 if we have a return pending */
/**/
-int retflag;
+mod_export int retflag;
/**/
long lastval2;
@@ -92,17 +92,17 @@
/* input fd from the coprocess */
/**/
-int coprocin;
+mod_export int coprocin;
/* output fd from the coprocess */
/**/
-int coprocout;
+mod_export int coprocout;
/* != 0 if the line editor is active */
/**/
-int zleactive;
+mod_export int zleactive;
/* pid of process undergoing 'process substitution' */
@@ -117,7 +117,7 @@
/* The context in which a shell function is called, see SFC_* in zsh.h. */
/**/
-int sfcontext;
+mod_export int sfcontext;
/* Stack to save some variables before executing a signal handler function */
@@ -132,7 +132,7 @@
/* parse string into a list */
/**/
-List
+mod_export List
parse_string(char *s, int ln)
{
List l;
@@ -156,10 +156,10 @@
/* the resource limits for the shell and its children */
/**/
-struct rlimit current_limits[RLIM_NLIMITS], limits[RLIM_NLIMITS];
+mod_export struct rlimit current_limits[RLIM_NLIMITS], limits[RLIM_NLIMITS];
/**/
-int
+mod_export int
zsetlimit(int limnum, char *nam)
{
if (limits[limnum].rlim_max != current_limits[limnum].rlim_max ||
@@ -175,7 +175,7 @@
}
/**/
-int
+mod_export int
setlimits(char *nam)
{
int limnum;
@@ -546,7 +546,7 @@
*/
/**/
-char *
+mod_export char *
findcmd(char *arg0, int docopy)
{
char **pp;
@@ -644,7 +644,7 @@
}
/**/
-Cmdnam
+mod_export Cmdnam
hashcmd(char *arg0, char **pp)
{
Cmdnam cn;
@@ -683,7 +683,7 @@
/* execute a string */
/**/
-void
+mod_export void
execstring(char *s, int dont_change_job, int exiting)
{
List list;
@@ -1145,7 +1145,7 @@
}
/**/
-void
+mod_export void
untokenize(char *s)
{
if (*s) {
@@ -2309,7 +2309,7 @@
/* close internal shell fds */
/**/
-void
+mod_export void
closem(int how)
{
int i;
@@ -2477,7 +2477,7 @@
/* read output of command substitution */
/**/
-LinkList
+mod_export LinkList
readoutput(int in, int qt)
{
LinkList ret;
@@ -2961,7 +2961,7 @@
/* execute a shell function */
/**/
-void
+mod_export void
doshfunc(char *name, List list, LinkList doshargs, int flags, int noreturnval)
/* If noreturnval is nonzero, then reset the current return *
* value (lastval) to its value before the shell function *
@@ -3058,7 +3058,7 @@
* in turn has to call back this function with the arguments it gets. */
/**/
-void
+mod_export void
runshfunc(List list, FuncWrap wrap, char *name)
{
int cont;
diff -ur ../zsh-/Src/glob.c ./Src/glob.c
--- ../zsh-/Src/glob.c Wed Dec 1 15:50:30 1999
+++ ./Src/glob.c Wed Dec 1 17:34:50 1999
@@ -116,7 +116,7 @@
/* Prefix, suffix for doing zle trickery */
/**/
-char *glob_pre, *glob_suf;
+mod_export char *glob_pre, *glob_suf;
/* struct to easily save/restore current state */
@@ -390,7 +390,7 @@
/* Check to see if str is eligible for filename generation. */
/**/
-int
+mod_export int
haswilds(char *str)
{
/* `[' and `]' are legal even if bad patterns are usually not. */
@@ -1445,7 +1445,7 @@
/* Return the trailing character for marking file types */
/**/
-char
+mod_export char
file_type(mode_t filemode)
{
if(S_ISBLK(filemode))
@@ -1620,7 +1620,7 @@
/* concatenate s1 and s2 in dynamically allocated buffer */
/**/
-char *
+mod_export char *
dyncat(char *s1, char *s2)
{
/* This version always uses space from the current heap. */
@@ -1636,7 +1636,7 @@
/* concatenate s1, s2, and s3 in dynamically allocated buffer */
/**/
-char *
+mod_export char *
tricat(char const *s1, char const *s2, char const *s3)
{
/* This version always uses permanently-allocated space. */
@@ -2252,7 +2252,7 @@
/* blindly turn a string into a tokenised expression without lexing */
/**/
-void
+mod_export void
tokenize(char *s)
{
char *t;
@@ -2314,7 +2314,7 @@
/* remove unnecessary Nulargs */
/**/
-void
+mod_export void
remnulargs(char *s)
{
if (*s) {
diff -ur ../zsh-/Src/hashtable.c ./Src/hashtable.c
--- ../zsh-/Src/hashtable.c Wed Dec 1 15:50:30 1999
+++ ./Src/hashtable.c Wed Dec 1 17:36:01 1999
@@ -77,7 +77,7 @@
/* Generic hash function */
/**/
-unsigned
+mod_export unsigned
hasher(char *str)
{
unsigned hashval = 0;
@@ -91,7 +91,7 @@
/* Get a new hash table */
/**/
-HashTable
+mod_export HashTable
newhashtable(int size, char const *name, PrintTableStats printinfo)
{
HashTable ht;
@@ -120,7 +120,7 @@
* existing pointers to the hash table are invalid. */
/**/
-void
+mod_export void
deletehashtable(HashTable ht)
{
ht->emptytable(ht);
@@ -148,7 +148,7 @@
* the table is then expanded. */
/**/
-void
+mod_export void
addhashnode(HashTable ht, char *nam, void *nodeptr)
{
HashNode oldnode = addhashnode2(ht, nam, nodeptr);
@@ -222,7 +222,7 @@
* or isn't found, it returns NULL */
/**/
-HashNode
+mod_export HashNode
gethashnode(HashTable ht, char *nam)
{
unsigned hashval;
@@ -246,7 +246,7 @@
* it returns NULL. */
/**/
-HashNode
+mod_export HashNode
gethashnode2(HashTable ht, char *nam)
{
unsigned hashval;
@@ -266,7 +266,7 @@
* is no such node, then it returns NULL */
/**/
-HashNode
+mod_export HashNode
removehashnode(HashTable ht, char *nam)
{
unsigned hashval;
@@ -358,7 +358,7 @@
*/
/**/
-void
+mod_export void
scanhashtable(HashTable ht, int sorted, int flags1, int flags2, ScanFunc scanfunc, int scanflags)
{
struct scanstatus st;
@@ -509,7 +509,7 @@
/* Generic method to empty a hash table */
/**/
-void
+mod_export void
emptyhashtable(HashTable ht)
{
resizehashtable(ht, ht->hsize);
@@ -578,12 +578,12 @@
/* hash table containing external commands */
/**/
-HashTable cmdnamtab;
+mod_export HashTable cmdnamtab;
/* how far we've hashed the PATH so far */
/**/
-char **pathchecked;
+mod_export char **pathchecked;
/* Create a new command hash table */
@@ -756,7 +756,7 @@
/* hash table containing the shell functions */
/**/
-HashTable shfunctab;
+mod_export HashTable shfunctab;
/**/
void
@@ -934,7 +934,7 @@
/* hash table containing the reserved words */
/**/
-HashTable reswdtab;
+mod_export HashTable reswdtab;
/* Build the hash table containing zsh's reserved words. */
@@ -997,7 +997,7 @@
/* hash table containing the aliases */
/**/
-HashTable aliastab;
+mod_export HashTable aliastab;
/* Create new hash table for aliases */
@@ -1028,7 +1028,7 @@
/* Create a new alias node */
/**/
-Alias
+mod_export Alias
createaliasnode(char *txt, int flags)
{
Alias al;
@@ -1133,7 +1133,7 @@
/* hash table containing named directories */
/**/
-HashTable nameddirtab;
+mod_export HashTable nameddirtab;
/* != 0 if all the usernames have already been *
* added to the named directory hash table. */
diff -ur ../zsh-/Src/hist.c ./Src/hist.c
--- ../zsh-/Src/hist.c Wed Dec 1 15:50:30 1999
+++ ./Src/hist.c Wed Dec 1 17:37:51 1999
@@ -34,7 +34,7 @@
* word control. */
/**/
-int (*hgetc) _((void));
+mod_export int (*hgetc) _((void));
/**/
void (*hungetc) _((int));
@@ -54,7 +54,7 @@
/* != 0 means history substitution is turned off */
/**/
-int stophist;
+mod_export int stophist;
/* this line began with a space, so junk it if HISTIGNORESPACE is on */
@@ -64,12 +64,12 @@
/* if != 0, we are expanding the current line */
/**/
-int expanding;
+mod_export int expanding;
/* these are used to modify the cursor position during expansion */
/**/
-int excs, exlast;
+mod_export int excs, exlast;
/*
* Current history event number
@@ -84,7 +84,7 @@
*/
/**/
-int curhist;
+mod_export int curhist;
/**/
struct histent curline;
@@ -99,7 +99,7 @@
/**/
HashTable histtab;
/**/
-Histent hist_ring;
+mod_export Histent hist_ring;
/* capacity of history lists */
@@ -126,7 +126,7 @@
/* What flags (if any) we should skip when moving through the history */
/**/
-int hist_skip_flags;
+mod_export int hist_skip_flags;
/* Bits of histactive variable */
#define HA_ACTIVE (1<<0) /* History mechanism is active */
@@ -159,12 +159,12 @@
/* pointer into the history line */
/**/
-char *hptr;
+mod_export char *hptr;
/* the current history line */
/**/
-char *chline;
+mod_export char *chline;
/* true if the last character returned by hgetc was an escaped bangchar *
* if it is set and NOBANGHIST is unset hwaddc escapes bangchars */
@@ -670,7 +670,7 @@
/* begin reading a string */
/**/
-void
+mod_export void
strinbeg(int dohist)
{
strin++;
@@ -681,7 +681,7 @@
/* done reading a string */
/**/
-void
+mod_export void
strinend(void)
{
hend();
@@ -798,7 +798,7 @@
}
/**/
-int
+mod_export int
addhistnum(int hl, int n, int xflags)
{
int dir = n < 0? -1 : n > 0? 1 : 0;
@@ -816,7 +816,7 @@
}
/**/
-Histent
+mod_export Histent
movehistent(Histent he, int n, int xflags)
{
while (n < 0) {
@@ -835,14 +835,14 @@
}
/**/
-Histent
+mod_export Histent
up_histent(Histent he)
{
return he->up == hist_ring? NULL : he->up;
}
/**/
-Histent
+mod_export Histent
down_histent(Histent he)
{
return he == hist_ring? NULL : he->down;
@@ -1182,7 +1182,7 @@
/* Get the entire current line, deleting it in the history. */
/**/
-char *
+mod_export char *
hgetline(void)
{
/* Currently only used by pushlineoredit().
@@ -1329,7 +1329,7 @@
}
/**/
-int
+mod_export int
remlpaths(char **junkptr)
{
char *str = *junkptr, *remcut;
@@ -1434,7 +1434,7 @@
}
/**/
-Histent
+mod_export Histent
quietgethistent(int ev, int nearmatch)
{
if (ev == curhist && (histactive & HA_ACTIVE)) {
@@ -1446,7 +1446,7 @@
}
/**/
-Histent
+mod_export Histent
quietgethist(int ev)
{
return quietgethistent(ev, GETHIST_EXACT);
diff -ur ../zsh-/Src/init.c ./Src/init.c
--- ../zsh-/Src/init.c Wed Dec 1 15:50:30 1999
+++ ./Src/init.c Wed Dec 1 17:40:58 1999
@@ -53,38 +53,40 @@
/* the shell tty fd */
/**/
-int SHTTY;
+mod_export int SHTTY;
/* the FILE attached to the shell tty */
/**/
-FILE *shout;
+mod_export FILE *shout;
/* termcap strings */
/**/
-char *tcstr[TC_COUNT];
+mod_export char *tcstr[TC_COUNT];
/* lengths of each termcap string */
/**/
-int tclen[TC_COUNT];
+mod_export int tclen[TC_COUNT];
/* Values of the li, co and am entries */
/**/
-int tclines, tccolumns, hasam;
+int tclines, tccolumns;
+/**/
+mod_export int hasam;
/* Pointer to read-key function from zle */
/**/
-int (*getkeyptr) _((int));
+mod_export int (*getkeyptr) _((int));
#ifdef DEBUG
/* depth of allocation type stack */
/**/
-int alloc_stackp;
+mod_export int alloc_stackp;
#endif
/* keep executing lists until EOF found */
@@ -287,7 +289,7 @@
/**/
-void
+mod_export void
init_io(void)
{
long ttpgrp;
@@ -412,7 +414,7 @@
}
/**/
-void
+mod_export void
init_shout(void)
{
static char shoutbuf[BUFSIZ];
@@ -446,7 +448,7 @@
/* Initialise termcap */
/**/
-int
+mod_export int
init_term(void)
{
#ifndef TGETENT_ACCEPTS_NULL
@@ -945,14 +947,14 @@
}
/**/
-void
+mod_export void
noop_function(void)
{
/* do nothing */
}
/**/
-void
+mod_export void
noop_function_int(int nothing)
{
/* do nothing */
@@ -966,26 +968,26 @@
#ifdef LINKED_XMOD_zle
/**/
-ZleVoidFn trashzleptr = noop_function;
+mod_export ZleVoidFn trashzleptr = noop_function;
/**/
-ZleVoidFn gotwordptr = noop_function;
+mod_export ZleVoidFn gotwordptr = noop_function;
/**/
-ZleVoidFn refreshptr = noop_function;
+mod_export ZleVoidFn refreshptr = noop_function;
/**/
-ZleVoidIntFn spaceinlineptr = noop_function_int;
+mod_export ZleVoidIntFn spaceinlineptr = noop_function_int;
/**/
-ZleReadFn zlereadptr = autoload_zleread;
+mod_export ZleReadFn zlereadptr = autoload_zleread;
#else /* !LINKED_XMOD_zle */
-ZleVoidFn trashzleptr = noop_function;
-ZleVoidFn gotwordptr = noop_function;
-ZleVoidFn refreshptr = noop_function;
-ZleVoidIntFn spaceinlineptr = noop_function_int;
+mod_export ZleVoidFn trashzleptr = noop_function;
+mod_export ZleVoidFn gotwordptr = noop_function;
+mod_export ZleVoidFn refreshptr = noop_function;
+mod_export ZleVoidIntFn spaceinlineptr = noop_function_int;
# ifdef UNLINKED_XMOD_zle
-ZleReadFn zlereadptr = autoload_zleread;
+mod_export ZleReadFn zlereadptr = autoload_zleread;
# else /* !UNLINKED_XMOD_zle */
-ZleReadFn zlereadptr = fallback_zleread;
+mod_export ZleReadFn zlereadptr = fallback_zleread;
# endif /* !UNLINKED_XMOD_zle */
#endif /* !LINKED_XMOD_zle */
@@ -1000,7 +1002,7 @@
}
/**/
-unsigned char *
+mod_export unsigned char *
fallback_zleread(char *lp, char *rp, int ha)
{
char *pptbuf;
@@ -1015,10 +1017,10 @@
/* compctl entry point pointers. Similar to the ZLE ones. */
/**/
-CompctlReadFn compctlreadptr = fallback_compctlread;
+mod_export CompctlReadFn compctlreadptr = fallback_compctlread;
/**/
-int
+mod_export int
fallback_compctlread(char *name, char **args, char *ops, char *reply)
{
zwarnnam(name, "option valid only in functions called from completion",
diff -ur ../zsh-/Src/input.c ./Src/input.c
--- ../zsh-/Src/input.c Wed Dec 1 15:50:30 1999
+++ ./Src/input.c Wed Dec 1 17:41:15 1999
@@ -88,7 +88,7 @@
/* total # of characters waiting to be read. */
/**/
-int inbufct;
+mod_export int inbufct;
/* the flags controlling the input routines in input.c: see INP_* in zsh.h */
@@ -128,7 +128,7 @@
* null characters to Meta c^32 character pairs. */
/**/
-char *
+mod_export char *
shingetline(void)
{
char *line = NULL;
@@ -444,7 +444,7 @@
/* Set some new input onto a new element of the input stack */
/**/
-void
+mod_export void
inpush(char *str, int flags, Alias inalias)
{
if (!instack) {
@@ -532,7 +532,7 @@
/* Remove the top element of the stack and all its continuations. */
/**/
-void
+mod_export void
inpop(void)
{
int remcont;
diff -ur ../zsh-/Src/jobs.c ./Src/jobs.c
--- ../zsh-/Src/jobs.c Wed Dec 1 15:50:30 1999
+++ ./Src/jobs.c Wed Dec 1 17:41:49 1999
@@ -33,12 +33,12 @@
/* the process group of the shell */
/**/
-pid_t mypgrp;
+mod_export pid_t mypgrp;
/* the job we are working on */
/**/
-int thisjob;
+mod_export int thisjob;
/* the current job (+) */
@@ -53,7 +53,7 @@
/* the job table */
/**/
-struct job jobtab[MAXJOB];
+mod_export struct job jobtab[MAXJOB];
/* shell timings */
@@ -906,7 +906,7 @@
/* clear job table when entering subshells */
/**/
-void
+mod_export void
clearjobtab(void)
{
int i;
diff -ur ../zsh-/Src/lex.c ./Src/lex.c
--- ../zsh-/Src/lex.c Wed Dec 1 15:50:30 1999
+++ ./Src/lex.c Wed Dec 1 17:59:07 1999
@@ -33,24 +33,28 @@
/* tokens */
/**/
-char ztokens[] = "#$^*()$=|{}[]`<>?~`,'\"\\";
+mod_export char ztokens[] = "#$^*()$=|{}[]`<>?~`,'\"\\";
/* parts of the current token */
/**/
-char *yytext, *tokstr;
+char *yytext;
/**/
-int tok, tokfd;
+mod_export char *tokstr;
+/**/
+mod_export int tok;
+/**/
+int tokfd;
/* lexical analyzer error flag */
/**/
-int lexstop;
+mod_export int lexstop;
/* if != 0, this is the first line of the command */
/**/
-int isfirstln;
+mod_export int isfirstln;
/* if != 0, this is the first char of the command (not including white space) */
@@ -70,47 +74,48 @@
/* the line buffer */
/**/
-unsigned char *line;
+mod_export unsigned char *line;
/* cursor position and line length */
+/* N.B.: must use the real names here, for the .export file */
/**/
-int cs, ll;
+mod_export int zshcs, zshll;
/* inwhat says what exactly we are in *
* (its value is one of the IN_* things). */
/**/
-int inwhat;
+mod_export int inwhat;
/* 1 if x added to complete in a blank between words */
/**/
-int addedx;
+mod_export int addedx;
/* 1 if aliases should not be expanded */
/**/
-int noaliases;
+mod_export int noaliases;
/* we are parsing a line sent to use by the editor */
/**/
-int zleparse;
+mod_export int zleparse;
/**/
-int wordbeg;
+mod_export int wordbeg;
/**/
-int parbegin;
+mod_export int parbegin;
/**/
-int parend;
+mod_export int parend;
/* text of puctuation tokens */
/**/
-char *tokstrings[WHILE + 1] = {
+mod_export char *tokstrings[WHILE + 1] = {
NULL, /* NULLTOK 0 */
";", /* SEPER */
"\\n", /* NEWLIN */
@@ -197,7 +202,7 @@
/* is this a hack or what? */
/**/
-void
+mod_export void
lexsave(void)
{
struct lexstack *ls;
@@ -250,7 +255,7 @@
/* restore lexical state */
/**/
-void
+mod_export void
lexrestore(void)
{
struct lexstack *ln;
@@ -332,7 +337,7 @@
}
/**/
-void
+mod_export void
ctxtlex(void)
{
static int oldpos;
@@ -1351,7 +1356,7 @@
* quotes. This is usually called before singsub(). */
/**/
-int
+mod_export int
parsestr(char *s)
{
int l = strlen(s), err;
diff -ur ../zsh-/Src/linklist.c ./Src/linklist.c
--- ../zsh-/Src/linklist.c Wed Dec 1 15:50:30 1999
+++ ./Src/linklist.c Wed Dec 1 16:33:11 1999
@@ -33,7 +33,7 @@
/* Get an empty linked list header */
/**/
-LinkList
+mod_export LinkList
newlinklist(void)
{
LinkList list;
@@ -47,7 +47,7 @@
/* Insert a node in a linked list after a given node */
/**/
-LinkNode
+mod_export LinkNode
insertlinknode(LinkList list, LinkNode node, void *dat)
{
LinkNode tmp, new;
@@ -67,7 +67,7 @@
/* Insert an already-existing node into a linked list after a given node */
/**/
-LinkNode
+mod_export LinkNode
uinsertlinknode(LinkList list, LinkNode node, LinkNode new)
{
LinkNode tmp = node->next;
@@ -104,7 +104,7 @@
/* Get top node in a linked list */
/**/
-void *
+mod_export void *
getlinknode(LinkList list)
{
void *dat;
@@ -125,7 +125,7 @@
/* Get top node in a linked list without freeing */
/**/
-void *
+mod_export void *
ugetnode(LinkList list)
{
void *dat;
@@ -145,7 +145,7 @@
/* Remove a node from a linked list */
/**/
-void *
+mod_export void *
remnode(LinkList list, LinkNode nd)
{
void *dat;
@@ -164,7 +164,7 @@
/* Remove a node from a linked list without freeing */
/**/
-void *
+mod_export void *
uremnode(LinkList list, LinkNode nd)
{
void *dat;
@@ -181,7 +181,7 @@
/* Free a linked list */
/**/
-void
+mod_export void
freelinklist(LinkList list, FreeFunc freefunc)
{
LinkNode node, next;
@@ -198,7 +198,7 @@
/* Count the number of nodes in a linked list */
/**/
-int
+mod_export int
countlinknodes(LinkList list)
{
LinkNode nd;
diff -ur ../zsh-/Src/loop.c ./Src/loop.c
--- ../zsh-/Src/loop.c Wed Dec 1 15:50:30 1999
+++ ./Src/loop.c Wed Dec 1 17:44:11 1999
@@ -43,7 +43,7 @@
/* # of break levels */
/**/
-int breaks;
+mod_export int breaks;
/**/
int
diff -ur ../zsh-/Src/makepro.awk ./Src/makepro.awk
--- ../zsh-/Src/makepro.awk Wed Dec 1 15:50:30 1999
+++ ./Src/makepro.awk Wed Dec 1 17:18:23 1999
@@ -77,13 +77,14 @@
break
}
sub(/^ */, "", line)
- match(line, /^((const|enum|static|struct|union) +)*([_0-9A-Za-z]+ +|((char|double|float|int|long|short|unsigned|void) +)+)((const|static) +)*/)
+ match(line, /^((const|enum|mod_export|static|struct|union) +)*([_0-9A-Za-z]+ +|((char|double|float|int|long|short|unsigned|void) +)+)((const|static) +)*/)
dtype = substr(line, 1, RLENGTH)
sub(/ *$/, "", dtype)
if(" " dtype " " ~ / static /)
locality = "L"
else
locality = "E"
+ exported = " " dtype " " ~ / mod_export /
line = substr(line, RLENGTH+1) ","
# Handle each declarator.
while(match(line, /^[^,]*,/)) {
@@ -116,6 +117,10 @@
printf "%s# define " dnam " " modtype "_\n", locality
printf "%s# endif\n", locality
}
+
+ # If this is exported, add it to the exported symbol list.
+ if(exported)
+ printf "X%s\n", dnam
# Format the declaration for output
dcl = dtype " " dcltor ";"
diff -ur ../zsh-/Src/math.c ./Src/math.c
--- ../zsh-/Src/math.c Wed Dec 1 15:50:30 1999
+++ ./Src/math.c Wed Dec 1 16:33:37 1999
@@ -911,7 +911,7 @@
/**/
-mnumber
+mod_export mnumber
matheval(char *s)
{
char *junk;
diff -ur ../zsh-/Src/mem.c ./Src/mem.c
--- ../zsh-/Src/mem.c Wed Dec 1 15:50:30 1999
+++ ./Src/mem.c Wed Dec 1 17:44:29 1999
@@ -76,13 +76,13 @@
/* != 0 if we are allocating in the heaplist */
/**/
-int useheap;
+mod_export int useheap;
/* Current allocation pointers. ncalloc() is either zalloc() or zhalloc(); *
* alloc() is either zcalloc() or hcalloc(). */
/**/
-void *(*ncalloc) _((size_t)), *(*alloc) _((size_t));
+mod_export void *(*ncalloc) _((size_t)), *(*alloc) _((size_t));
#ifdef ZSH_MEM_WARNING
# ifndef DEBUG
@@ -110,7 +110,7 @@
/* set default allocation to heap stack */
/**/
-int
+mod_export int
global_heapalloc(void)
{
int luh = useheap;
@@ -124,7 +124,7 @@
/* set default allocation to malloc() */
/**/
-int
+mod_export int
global_permalloc(void)
{
int luh = useheap;
@@ -146,7 +146,7 @@
/* Use new heaps from now on. This returns the old heap-list. */
/**/
-Heap
+mod_export Heap
new_heaps(void)
{
Heap h = heaps;
@@ -159,7 +159,7 @@
/* Re-install the old heaps again, freeing the new ones. */
/**/
-void
+mod_export void
old_heaps(Heap old)
{
Heap h, n;
@@ -176,7 +176,7 @@
/* Temporarily switch to other heaps (or back again). */
/**/
-Heap
+mod_export Heap
switch_heaps(Heap new)
{
Heap h = heaps;
@@ -190,7 +190,7 @@
/* save states of zsh heaps */
/**/
-void
+mod_export void
pushheap(void)
{
Heap h;
@@ -212,7 +212,7 @@
/* reset heaps to previous state */
/**/
-void
+mod_export void
freeheap(void)
{
Heap h, hn, hl = NULL;
@@ -244,7 +244,7 @@
/* reset heap to previous state and destroy state information */
/**/
-void
+mod_export void
popheap(void)
{
Heap h, hn, hl = NULL;
@@ -280,7 +280,7 @@
/* allocate memory from the current memory pool */
/**/
-void *
+mod_export void *
zhalloc(size_t size)
{
Heap h;
@@ -337,7 +337,7 @@
}
/**/
-void *
+mod_export void *
hrealloc(char *p, size_t old, size_t new)
{
Heap h, ph;
@@ -413,7 +413,7 @@
/* allocate memory from the current memory pool and clear it */
/**/
-void *
+mod_export void *
hcalloc(size_t size)
{
void *ptr;
@@ -426,7 +426,7 @@
/* allocate permanent memory */
/**/
-void *
+mod_export void *
zalloc(size_t size)
{
void *ptr;
@@ -442,7 +442,7 @@
}
/**/
-void *
+mod_export void *
zcalloc(size_t size)
{
void *ptr;
@@ -465,7 +465,7 @@
* POSIX compliant, but I'm not sure how to do that. */
/**/
-void *
+mod_export void *
zrealloc(void *ptr, size_t size)
{
if (ptr) {
@@ -490,7 +490,7 @@
}
/**/
-char *
+mod_export char *
dupstring(const char *s)
{
char *t;
@@ -503,7 +503,7 @@
}
/**/
-char *
+mod_export char *
ztrdup(const char *s)
{
char *t;
@@ -515,6 +515,7 @@
return t;
}
+/**/
#ifdef ZSH_MEM
/*
@@ -913,7 +914,7 @@
0 for this parameter means: `don't know' */
/**/
-void
+mod_export void
zfree(void *p, int sz)
{
struct m_hdr *m = (struct m_hdr *)(((char *)p) - M_ISIZE), *mp, *mt = NULL;
@@ -1120,7 +1121,7 @@
those that have a zero byte at the end) */
/**/
-void
+mod_export void
zsfree(char *p)
{
if (p)
@@ -1327,10 +1328,11 @@
#endif
+/**/
#else /* not ZSH_MEM */
/**/
-void
+mod_export void
zfree(void *p, int sz)
{
if (p)
@@ -1338,11 +1340,12 @@
}
/**/
-void
+mod_export void
zsfree(char *p)
{
if (p)
free(p);
}
+/**/
#endif
diff -ur ../zsh-/Src/mkmakemod.sh ./Src/mkmakemod.sh
--- ../zsh-/Src/mkmakemod.sh Wed Dec 1 15:50:30 1999
+++ ./Src/mkmakemod.sh Wed Dec 1 17:27:11 1999
@@ -185,7 +185,7 @@
imports=
for dep in $moddeps; do
eval "loc=\$loc_$dep"
- imports="$imports \$(IMPOPT)\$(sdir_top)/$loc/$dep.export"
+ imports="$imports \$(IMPOPT)\$(dir_top)/$loc/$dep.export"
case $the_subdir in
$loc)
mdh="${dep}.mdh"
@@ -215,17 +215,20 @@
echo "SYMS_${module} = $proto"
echo "EPRO_${module} = "`echo $proto '' | sed 's,\.syms ,.epro ,g'`
echo "INCS_${module} = \$(EPRO_${module}) $otherincs"
- echo "EXPIMP_${module} = $imports ${hasexport+\$(EXPOPT)\$(sdir)/$module.export}"
+ echo "EXPIMP_${module} = $imports \$(EXPOPT)$module.export"
echo "NXPIMP_${module} ="
echo
- echo "proto.${module}: \$(PRO_${module})"
+ echo "proto.${module}: \$(EPRO_${module})"
echo "\$(SYMS_${module}): \$(PROTODEPS)"
echo
+ echo "${module}.export: \$(SYMS_${module})"
+ echo " ( echo '#!'; cat \$(SYMS_${module}) | sed -n '/^X/{s/^X//;p;}' | sort -u ) > \$@"
+ echo
echo "modobjs.${module}: \$(MODOBJS_${module})"
echo " echo '' \$(MODOBJS_${module}) $modobjs_sed>> \$(dir_src)/stamp-modobjs.tmp"
echo
if test -z "$alwayslink"; then
- echo "${module}.\$(DL_EXT): \$(MODDOBJS_${module})"
+ echo "${module}.\$(DL_EXT): \$(MODDOBJS_${module}) ${module}.export"
echo ' rm -f $@'
echo " \$(DLLINK) \$(@E@XPIMP_$module) \$(@E@NTRYOPT) \$(MODDOBJS_${module}) \$(LIBS)"
echo
diff -ur ../zsh-/Src/module.c ./Src/module.c
--- ../zsh-/Src/module.c Wed Dec 1 15:50:30 1999
+++ ./Src/module.c Wed Dec 1 17:45:12 1999
@@ -134,7 +134,7 @@
* return !addbuiltins(m->nam, bintab, sizeof(bintab)/sizeof(*bintab)); */
/**/
-int
+mod_export int
addbuiltins(char const *nam, Builtin binl, int size)
{
int hads = 0, hadf = 0, n;
@@ -163,7 +163,7 @@
* error and zero if all went fine. */
/**/
-int
+mod_export int
addwrapper(Module m, FuncWrap w)
{
FuncWrap p, q;
@@ -190,7 +190,7 @@
/* List of modules */
/**/
-LinkList modules;
+mod_export LinkList modules;
/* Define an autoloadable builtin. It returns 0 on success, or 1 on *
* failure. The only possible cause of failure is that a builtin *
@@ -232,7 +232,7 @@
* wayward module had deleted our builtin without telling us. */
/**/
-int
+mod_export int
deletebuiltins(char const *nam, Builtin binl, int size)
{
int hads = 0, hadf = 0, n;
@@ -255,7 +255,7 @@
* one in case of error and zero otherwise. */
/**/
-int
+mod_export int
deletewrapper(Module m, FuncWrap w)
{
FuncWrap p, q;
@@ -760,7 +760,7 @@
* The return value is non-zero if the module was found or loaded. */
/**/
-int
+mod_export int
require_module(char *nam, char *module, int res, int test)
{
Module m = NULL;
@@ -1427,7 +1427,7 @@
/* The list of module-defined conditions. */
/**/
-Conddef condtab;
+mod_export Conddef condtab;
/* This gets a condition definition with the given name. The first *
* argument says if we have to look for an infix condition. The last *
@@ -1488,7 +1488,7 @@
/* This adds multiple condition definitions. This is like addbuiltins(). */
/**/
-int
+mod_export int
addconddefs(char const *nam, Conddef c, int size)
{
int hads = 0, hadf = 0;
@@ -1551,7 +1551,7 @@
/* This adds multiple hook definitions. This is like addbuiltins(). */
/**/
-int
+mod_export int
addhookdefs(char const *nam, Hookdef h, int size)
{
int hads = 0, hadf = 0;
@@ -1589,7 +1589,7 @@
}
/**/
-int
+mod_export int
deletehookdefs(char const *nam, Hookdef h, int size)
{
while (size--) {
@@ -1612,7 +1612,7 @@
}
/**/
-int
+mod_export int
addhookfunc(char *n, Hookfn f)
{
Hookdef h = gethookdef(n);
@@ -1639,7 +1639,7 @@
}
/**/
-int
+mod_export int
deletehookfunc(char *n, Hookfn f)
{
Hookdef h = gethookdef(n);
@@ -1652,7 +1652,7 @@
/* Run the function(s) for a hook. */
/**/
-int
+mod_export int
runhookdef(Hookdef h, void *d)
{
if (empty(h->funcs)) {
@@ -1712,7 +1712,7 @@
/* This adds multiple parameter definitions. This is like addbuiltins(). */
/**/
-int
+mod_export int
addparamdefs(char const *nam, Paramdef d, int size)
{
int hads = 0, hadf = 0;
@@ -1739,7 +1739,7 @@
}
/**/
-int
+mod_export int
deleteparamdefs(char const *nam, Paramdef d, int size)
{
while (size--) {
@@ -1802,7 +1802,7 @@
/* This removes multiple condition definitions (like deletebuiltins()). */
/**/
-int
+mod_export int
deleteconddefs(char const *nam, Conddef c, int size)
{
int hads = 0, hadf = 0;
@@ -1874,7 +1874,7 @@
}
/**/
-int
+mod_export int
addmathfunc(MathFunc f)
{
MathFunc p;
@@ -1894,7 +1894,7 @@
}
/**/
-int
+mod_export int
addmathfuncs(char const *nam, MathFunc f, int size)
{
int hads = 0, hadf = 0;
@@ -1936,7 +1936,7 @@
}
/**/
-int
+mod_export int
deletemathfunc(MathFunc f)
{
MathFunc p, q;
@@ -1962,7 +1962,7 @@
}
/**/
-int
+mod_export int
deletemathfuncs(char const *nam, MathFunc f, int size)
{
int hads = 0, hadf = 0;
diff -ur ../zsh-/Src/options.c ./Src/options.c
--- ../zsh-/Src/options.c Wed Dec 1 15:50:30 1999
+++ ./Src/options.c Wed Dec 1 17:45:32 1999
@@ -38,12 +38,12 @@
/* the options; e.g. if opts[SHGLOB] != 0, SH_GLOB is turned on */
/**/
-char opts[OPT_SIZE];
+mod_export char opts[OPT_SIZE];
/* Option name hash table */
/**/
-HashTable optiontab;
+mod_export HashTable optiontab;
/* The canonical option name table */
@@ -559,7 +559,7 @@
/* Identify an option name */
/**/
-int
+mod_export int
optlookup(char const *name)
{
char *s, *t;
@@ -622,7 +622,7 @@
* from the usual meaning of the option. */
/**/
-int
+mod_export int
dosetopt(int optno, int value, int force)
{
if(!optno)
diff -ur ../zsh-/Src/params.c ./Src/params.c
--- ../zsh-/Src/params.c Wed Dec 1 15:50:30 1999
+++ ./Src/params.c Wed Dec 1 17:49:57 1999
@@ -35,58 +35,66 @@
/* what level of localness we are at */
/**/
-int locallevel;
+mod_export int locallevel;
/* Variables holding values of special parameters */
/**/
char **pparams, /* $argv */
**cdpath, /* $cdpath */
- **fignore, /* $fignore */
**fpath, /* $fpath */
**mailpath, /* $mailpath */
**manpath, /* $manpath */
- **path, /* $path */
**psvar, /* $psvar */
**watch; /* $watch */
+/**/
+mod_export
+char **path, /* $path */
+ **fignore; /* $fignore */
/**/
char *argzero, /* $0 */
*home, /* $HOME */
*hostnam, /* $HOST */
- *ifs, /* $IFS */
*nullcmd, /* $NULLCMD */
*oldpwd, /* $OLDPWD */
*zoptarg, /* $OPTARG */
- *postedit, /* $POSTEDIT */
*prompt, /* $PROMPT */
*prompt2, /* $PROMPT2 */
*prompt3, /* $PROMPT3 */
*prompt4, /* $PROMPT4 */
- *pwd, /* $PWD */
*readnullcmd, /* $READNULLCMD */
*rprompt, /* $RPROMPT */
*sprompt, /* $SPROMPT */
*term, /* $TERM */
- *ttystrname, /* $TTY */
*wordchars, /* $WORDCHARS */
*zsh_name; /* $ZSH_NAME */
+/**/
+mod_export
+char *ifs, /* $IFS */
+ *postedit, /* $POSTEDIT */
+ *ttystrname, /* $TTY */
+ *pwd; /* $PWD */
/**/
+mod_export
zlong lastval, /* $? */
mypid, /* $$ */
lastpid, /* $! */
columns, /* $COLUMNS */
- lineno, /* $LINENO */
lines, /* $LINES */
+ ppid; /* $PPID */
+/**/
+zlong lineno, /* $LINENO */
zoptind, /* $OPTIND */
- ppid, /* $PPID */
shlvl; /* $SHLVL */
/* $histchars */
/**/
-unsigned char bangchar, hatchar, hashchar;
+mod_export unsigned char bangchar;
+/**/
+unsigned char hatchar, hashchar;
/* $SECONDS = time(NULL) - shtimer.tv_sec */
@@ -96,7 +104,7 @@
/* 0 if this $TERM setup is usable, otherwise it contains TERM_* flags */
/**/
-int termflags;
+mod_export int termflags;
/* Nodes for special parameters for parameter hash table */
@@ -248,10 +256,10 @@
/* hash table containing the parameters */
/**/
-HashTable paramtab, realparamtab;
+mod_export HashTable paramtab, realparamtab;
/**/
-HashTable
+mod_export HashTable
newparamtable(int size, char const *name)
{
HashTable ht = newhashtable(size, name, NULL);
@@ -327,7 +335,7 @@
/* Function to delete a parameter table. */
/**/
-void
+mod_export void
deleteparamtable(HashTable t)
{
/* The parameters in the hash table need to be unset *
@@ -341,7 +349,7 @@
static unsigned numparamvals;
/**/
-void
+mod_export void
scancountparams(HashNode hn, int flags)
{
++numparamvals;
@@ -586,7 +594,7 @@
* created because it already exists, the PM_UNSET flag is cleared. */
/**/
-Param
+mod_export Param
createparam(char *name, int flags)
{
Param pm, oldpm;
@@ -1162,14 +1170,14 @@
/**/
-Value
+mod_export Value
getvalue(char **pptr, int bracks)
{
return fetchvalue(pptr, bracks, 0);
}
/**/
-Value
+mod_export Value
fetchvalue(char **pptr, int bracks, int flags)
{
char *s, *t;
@@ -1265,7 +1273,7 @@
}
/**/
-char *
+mod_export char *
getstrvalue(Value v)
{
char *s, **ss;
@@ -1372,7 +1380,7 @@
}
/**/
-zlong
+mod_export zlong
getintvalue(Value v)
{
if (!v || v->isarr)
@@ -1408,7 +1416,7 @@
}
/**/
-void
+mod_export void
setstrvalue(Value v, char *val)
{
char buf[(sizeof(zlong) * 8) + 4];
@@ -1543,7 +1551,7 @@
}
/**/
-void
+mod_export void
setarrvalue(Value v, char **val)
{
if (v->pm->flags & PM_READONLY) {
@@ -1611,7 +1619,7 @@
/* Retrieve an integer parameter */
/**/
-zlong
+mod_export zlong
getiparam(char *s)
{
Value v;
@@ -1640,7 +1648,7 @@
/* Retrieve a scalar (string) parameter */
/**/
-char *
+mod_export char *
getsparam(char *s)
{
Value v;
@@ -1653,7 +1661,7 @@
/* Retrieve an array parameter */
/**/
-char **
+mod_export char **
getaparam(char *s)
{
Value v;
@@ -1667,7 +1675,7 @@
/* Retrieve an assoc array parameter as an array */
/**/
-char **
+mod_export char **
gethparam(char *s)
{
Value v;
@@ -1679,7 +1687,7 @@
}
/**/
-Param
+mod_export Param
setsparam(char *s, char *val)
{
Value v;
@@ -1717,7 +1725,7 @@
}
/**/
-Param
+mod_export Param
setaparam(char *s, char **val)
{
Value v;
@@ -1761,7 +1769,7 @@
}
/**/
-Param
+mod_export Param
sethparam(char *s, char **val)
{
Value v;
@@ -1856,7 +1864,7 @@
/* Unset a parameter */
/**/
-void
+mod_export void
unsetparam(char *s)
{
Param pm;
@@ -1870,7 +1878,7 @@
/* Unset a parameter */
/**/
-void
+mod_export void
unsetparam_pm(Param pm, int altflag, int exp)
{
Param oldpm, altpm;
@@ -1933,7 +1941,7 @@
* the specific set function. */
/**/
-void
+mod_export void
stdunsetfn(Param pm, int exp)
{
switch (PM_TYPE(pm->flags)) {
@@ -1983,7 +1991,7 @@
/* Function to get value of a scalar (string) parameter */
/**/
-char *
+mod_export char *
strgetfn(Param pm)
{
return pm->u.str ? pm->u.str : (char *) hcalloc(1);
@@ -2014,7 +2022,7 @@
/* Function to set value of an array parameter */
/**/
-void
+mod_export void
arrsetfn(Param pm, char **x)
{
if (pm->u.arr && pm->u.arr != x)
@@ -2030,7 +2038,7 @@
/* Function to get value of an association parameter */
/**/
-HashTable
+mod_export HashTable
hashgetfn(Param pm)
{
return pm->u.hash;
@@ -2039,7 +2047,7 @@
/* Function to set value of an association parameter */
/**/
-void
+mod_export void
hashsetfn(Param pm, HashTable x)
{
if (pm->u.hash && pm->u.hash != x)
@@ -2103,7 +2111,7 @@
* containing the integer value. */
/**/
-zlong
+mod_export zlong
intvargetfn(Param pm)
{
return *((zlong *)pm->u.data);
@@ -2114,7 +2122,7 @@
* where the value is to be stored. */
/**/
-void
+mod_export void
intvarsetfn(Param pm, zlong x)
{
*((zlong *)pm->u.data) = x;
@@ -2140,7 +2148,7 @@
* representing the scalar (string). */
/**/
-void
+mod_export void
strvarsetfn(Param pm, char *x)
{
char **q = ((char **)pm->u.data);
@@ -2154,7 +2162,7 @@
* representing the scalar (string). */
/**/
-char *
+mod_export char *
strvargetfn(Param pm)
{
char *s = *((char **)pm->u.data);
@@ -2170,7 +2178,7 @@
* of pointers). */
/**/
-char **
+mod_export char **
arrvargetfn(Param pm)
{
return *((char ***)pm->u.data);
@@ -2183,7 +2191,7 @@
* version of this array which will need to be updated. */
/**/
-void
+mod_export void
arrvarsetfn(Param pm, char **x)
{
char ***dptr = (char ***)pm->u.data;
@@ -2688,7 +2696,7 @@
* "foo=bar", and returns a pointer to the beginning of "bar" */
/**/
-char *
+mod_export char *
zgetenv(char *name)
{
char **ep, *s, *t;
@@ -2800,7 +2808,7 @@
}
/**/
-void
+mod_export void
convbase(char *s, zlong v, int base)
{
int digs = 0;
@@ -2888,7 +2896,7 @@
/* Start a parameter scope */
/**/
-void
+mod_export void
startparamscope(void)
{
locallevel++;
@@ -2897,7 +2905,7 @@
/* End a parameter scope: delete the parameters local to the scope. */
/**/
-void
+mod_export void
endparamscope(void)
{
locallevel--;
@@ -2980,7 +2988,7 @@
/* Print a parameter */
/**/
-void
+mod_export void
printparamnode(HashNode hn, int printflags)
{
Param p = (Param) hn;
diff -ur ../zsh-/Src/parse.c ./Src/parse.c
--- ../zsh-/Src/parse.c Wed Dec 1 15:50:30 1999
+++ ./Src/parse.c Wed Dec 1 17:50:34 1999
@@ -33,17 +33,17 @@
/* != 0 if we are about to read a command word */
/**/
-int incmdpos;
+mod_export int incmdpos;
/* != 0 if we are in the middle of a [[ ... ]] */
/**/
-int incond;
+mod_export int incond;
/* != 0 if we are after a redirection (for ctxtlex only) */
/**/
-int inredir;
+mod_export int inredir;
/* != 0 if we are about to read a case pattern */
@@ -68,7 +68,7 @@
/* used in arrays of lists instead of NULL pointers */
/**/
-struct list dummy_list;
+mod_export struct list dummy_list;
#define YYERROR { tok = LEXERR; return NULL; }
#define YYERRORV { tok = LEXERR; return; }
diff -ur ../zsh-/Src/pattern.c ./Src/pattern.c
--- ../zsh-/Src/pattern.c Wed Dec 1 15:50:30 1999
+++ ./Src/pattern.c Wed Dec 1 16:36:10 1999
@@ -292,7 +292,7 @@
/* Top level pattern compilation subroutine */
/**/
-Patprog
+mod_export Patprog
patcompile(char *exp, int inflags, char **endexp)
{
int flags = 0, len = 0;
@@ -1280,7 +1280,7 @@
}
/**/
-int
+mod_export int
pattry(Patprog prog, char *string)
{
int i;
@@ -2212,7 +2212,7 @@
/* Free a patprog. */
/**/
-void
+mod_export void
freepatprog(Patprog prog)
{
if (prog && prog != dummy_patprog1 && prog != dummy_patprog2)
diff -ur ../zsh-/Src/prompt.c ./Src/prompt.c
--- ../zsh-/Src/prompt.c Wed Dec 1 15:50:30 1999
+++ ./Src/prompt.c Wed Dec 1 17:50:58 1999
@@ -38,7 +38,7 @@
/* text change - attribute change made by prompts */
/**/
-unsigned txtchange;
+mod_export unsigned txtchange;
/* the command stack for use with %_ in prompts */
@@ -137,7 +137,7 @@
* `glitch' space. */
/**/
-char *
+mod_export char *
promptexpand(char *s, int ns, char *rs, char *Rs)
{
if(!s)
@@ -628,7 +628,7 @@
/* tsetcap(), among other things, can write a termcap string into the buffer. */
/**/
-void
+mod_export void
tsetcap(int cap, int flag)
{
if (!(termflags & TERM_SHORT) && tcstr[cap]) {
@@ -688,7 +688,7 @@
* newlines require nontrivial processing. */
/**/
-void
+mod_export void
countprompt(char *str, int *wp, int *hp, int overf)
{
int w = 0, h = 1;
diff -ur ../zsh-/Src/signals.c ./Src/signals.c
--- ../zsh-/Src/signals.c Wed Dec 1 15:50:31 1999
+++ ./Src/signals.c Wed Dec 1 17:51:28 1999
@@ -34,12 +34,12 @@
* 0 for the default action or some ZSIG_* flags ored together. */
/**/
-int sigtrapped[VSIGCOUNT];
+mod_export int sigtrapped[VSIGCOUNT];
/* trap functions for each signal */
/**/
-List sigfuncs[VSIGCOUNT];
+mod_export List sigfuncs[VSIGCOUNT];
/* Variables used by signal queueing */
@@ -82,7 +82,7 @@
* system calls are not restarted. */
/**/
-void
+mod_export void
install_handler(int sig)
{
#ifdef POSIX_SIGNALS
@@ -122,7 +122,7 @@
/* enable ^C interrupts */
/**/
-void
+mod_export void
intr(void)
{
if (interact)
@@ -143,7 +143,7 @@
/* temporarily block ^C interrupts */
/**/
-void
+mod_export void
holdintr(void)
{
if (interact)
@@ -153,7 +153,7 @@
/* release ^C interrupts */
/**/
-void
+mod_export void
noholdintr(void)
{
if (interact)
@@ -682,7 +682,7 @@
}
/**/
-int
+mod_export int
settrap(int sig, List l)
{
if (sig == -1)
diff -ur ../zsh-/Src/signames2.awk ./Src/signames2.awk
--- ../zsh-/Src/signames2.awk Wed Dec 1 15:50:29 1999
+++ ./Src/signames2.awk Wed Dec 1 17:54:10 1999
@@ -63,7 +63,7 @@
printf "#include %czsh.mdh%c\n", 34, 34
printf "\n"
printf "/**/\n"
- printf "char *sigmsg[SIGCOUNT+2] = {\n"
+ printf "mod_export char *sigmsg[SIGCOUNT+2] = {\n"
printf "\t%c%s%c,\n", 34, "done", 34
for (i = 1; i <= 0 + max; i++)
diff -ur ../zsh-/Src/subst.c ./Src/subst.c
--- ../zsh-/Src/subst.c Wed Dec 1 15:50:31 1999
+++ ./Src/subst.c Wed Dec 1 16:36:56 1999
@@ -46,7 +46,7 @@
*/
/**/
-void
+mod_export void
prefork(LinkList list, int flags)
{
LinkNode node;
@@ -211,7 +211,7 @@
}
/**/
-void
+mod_export void
globlist(LinkList list)
{
LinkNode node, next;
@@ -228,7 +228,7 @@
/* perform substitution on a single word */
/**/
-void
+mod_export void
singsub(char **s)
{
LinkList foo;
@@ -306,7 +306,7 @@
*/
/**/
-void
+mod_export void
filesub(char **namptr, int assign)
{
char *sub = NULL, *str, *ptr;
@@ -341,7 +341,7 @@
}
/**/
-int
+mod_export int
filesubstr(char **namptr, int assign)
{
#define isend(c) ( !(c) || (c)=='/' || (c)==Inpar || (assign && (c)==':') )
diff -ur ../zsh-/Src/text.c ./Src/text.c
--- ../zsh-/Src/text.c Wed Dec 1 15:50:31 1999
+++ ./Src/text.c Wed Dec 1 16:37:03 1999
@@ -104,7 +104,7 @@
/* get a permanent textual representation of n */
/**/
-char *
+mod_export char *
getpermtext(struct node *n)
{
tnewlins = 1;
diff -ur ../zsh-/Src/utils.c ./Src/utils.c
--- ../zsh-/Src/utils.c Wed Dec 1 15:50:31 1999
+++ ./Src/utils.c Wed Dec 1 17:52:34 1999
@@ -38,7 +38,7 @@
/* Print an error */
/**/
-void
+mod_export void
zerr(const char *fmt, const char *str, int num)
{
if (errflag || noerrs) {
@@ -51,7 +51,7 @@
}
/**/
-void
+mod_export void
zerrnam(const char *cmd, const char *fmt, const char *str, int num)
{
if (errflag || noerrs)
@@ -62,7 +62,7 @@
}
/**/
-void
+mod_export void
zwarn(const char *fmt, const char *str, int num)
{
if (errflag || noerrs)
@@ -81,7 +81,7 @@
}
/**/
-void
+mod_export void
zwarnnam(const char *cmd, const char *fmt, const char *str, int num)
{
if (errflag || noerrs)
@@ -172,7 +172,7 @@
/* Output a single character, for the termcap routines. */
/**/
-int
+mod_export int
putshout(int c)
{
putc(c, shout);
@@ -190,7 +190,7 @@
* literal characters. */
/**/
-char *
+mod_export char *
nicechar(int c)
{
static char buf[6];
@@ -505,7 +505,7 @@
/* add a named directory */
/**/
-void
+mod_export void
adduserdir(char *s, char *t, int flags, int always)
{
Nameddir nd;
@@ -610,7 +610,7 @@
/* extra functions to call before displaying the prompt */
/**/
-LinkList prepromptfns;
+mod_export LinkList prepromptfns;
/* the last time we checked mail */
@@ -806,7 +806,7 @@
}
/**/
-void
+mod_export void
freestr(void *a)
{
zsfree(a);
@@ -838,7 +838,7 @@
}
/**/
-void
+mod_export void
settyinfo(struct ttyinfo *ti)
{
if (SHTTY != -1) {
@@ -870,18 +870,18 @@
/* the default tty state */
/**/
-struct ttyinfo shttyinfo;
+mod_export struct ttyinfo shttyinfo;
/* != 0 if we need to call resetvideo() */
/**/
-int resetneeded;
+mod_export int resetneeded;
#ifdef TIOCGWINSZ
/* window size changed */
/**/
-int winchanged;
+mod_export int winchanged;
#endif
static int
@@ -1017,7 +1017,7 @@
* is already >= 10, it is not moved. If it is invalid, -1 is returned. */
/**/
-int
+mod_export int
movefd(int fd)
{
if(fd != -1 && fd < 10) {
@@ -1043,7 +1043,7 @@
/* Move fd x to y. If x == -1, fd y is closed. */
/**/
-void
+mod_export void
redup(int x, int y)
{
if(x < 0)
@@ -1061,7 +1061,7 @@
/* Close the given fd, and clear it from fdtable. */
/**/
-int
+mod_export int
zclose(int fd)
{
if (fd >= 0) {
@@ -1080,7 +1080,7 @@
* is unique, for use as a temporary file. */
/**/
-char *
+mod_export char *
gettempname(void)
{
char *s;
@@ -1094,7 +1094,7 @@
/* Check if a string contains a token */
/**/
-int
+mod_export int
has_token(const char *s)
{
while(*s)
@@ -1106,7 +1106,7 @@
/* Delete a character in a string */
/**/
-void
+mod_export void
chuck(char *str)
{
while ((str[0] = str[1]))
@@ -1114,7 +1114,7 @@
}
/**/
-int
+mod_export int
tulower(int c)
{
c &= 0xff;
@@ -1122,7 +1122,7 @@
}
/**/
-int
+mod_export int
tuupper(int c)
{
c &= 0xff;
@@ -1143,7 +1143,7 @@
/* copy t into *s and update s */
/**/
-void
+mod_export void
strucpy(char **s, char *t)
{
char *u = *s;
@@ -1153,7 +1153,7 @@
}
/**/
-void
+mod_export void
struncpy(char **s, char *t, int n)
{
char *u = *s;
@@ -1168,7 +1168,7 @@
* It doesn't count the NULL pointer at the end. */
/**/
-int
+mod_export int
arrlen(char **s)
{
int count;
@@ -1180,7 +1180,7 @@
/* Skip over a balanced pair of parenthesis. */
/**/
-int
+mod_export int
skipparens(char inpar, char outpar, char **s)
{
int level;
@@ -1202,7 +1202,7 @@
* to be broken. */
/**/
-zlong
+mod_export zlong
zstrtol(const char *s, char **t, int base)
{
zlong ret = 0;
@@ -1384,7 +1384,7 @@
/* fix s ; if hist is nonzero, fix the history list too */
/**/
-void
+mod_export void
spckword(char **s, int hist, int cmd, int ask)
{
char *t, *u;
@@ -1513,7 +1513,7 @@
}
/**/
-int
+mod_export int
ztrftime(char *buf, int bufsize, char *fmt, struct tm *tm)
{
int hr12;
@@ -1613,7 +1613,7 @@
}
/**/
-char *
+mod_export char *
zjoin(char **arr, int delim)
{
int len = 0;
@@ -1684,7 +1684,7 @@
}
/**/
-char **
+mod_export char **
spacesplit(char *s, int allownull)
{
char *t, **ret, **ptr;
@@ -1831,7 +1831,7 @@
}
/**/
-char *
+mod_export char *
sepjoin(char **s, char *sep)
{
char *r, *p, **t;
@@ -1890,7 +1890,7 @@
/* Get the definition of a shell function */
/**/
-List
+mod_export List
getshfunc(char *nam)
{
Shfunc shf;
@@ -1964,7 +1964,7 @@
/* duplicate a syntax tree */
/**/
-void *
+mod_export void *
dupstruct(void *a)
{
void **onodes, **nnodes, *ret, *n, *on;
@@ -2027,7 +2027,7 @@
static LinkList freeslist = NULL;
/**/
-void
+mod_export void
freestruct(void *a)
{
if (!a || ((List) a) == &dummy_list)
@@ -2171,7 +2171,7 @@
}
/**/
-void
+mod_export void
zbeep(void)
{
char *vb;
@@ -2184,7 +2184,7 @@
}
/**/
-void
+mod_export void
freearray(char **s)
{
char **t = s;
@@ -2212,7 +2212,7 @@
/* the ztypes table */
/**/
-short int typtab[256];
+mod_export short int typtab[256];
/* initialize the ztypes table */
@@ -2262,7 +2262,7 @@
}
/**/
-char **
+mod_export char **
arrdup(char **s)
{
char **x, **y;
@@ -2458,7 +2458,7 @@
/* give the tty to some process */
/**/
-void
+mod_export void
attachtty(pid_t pgrp)
{
static int ep = 0;
@@ -2638,7 +2638,7 @@
* META_HEAPDUP: same as META_DUP, but uses the heap */
/**/
-char *
+mod_export char *
metafy(char *buf, int len, int heap)
{
int meta = 0;
@@ -2703,7 +2703,7 @@
}
/**/
-char *
+mod_export char *
unmetafy(char *s, int *len)
{
char *p, *t;
@@ -2721,7 +2721,7 @@
* unmetafied substring length. */
/**/
-int
+mod_export int
metalen(const char *s, int len)
{
int mlen = len;
@@ -2741,7 +2741,7 @@
* 4 * PATH_MAX. */
/**/
-char *
+mod_export char *
unmeta(const char *file_name)
{
static char fn[4 * PATH_MAX];
@@ -2796,7 +2796,7 @@
* 2 is r is the lowercase prefix of s and return 3 otherwise. */
/**/
-int
+mod_export int
metadiffer(char const *s, char const *r, int len)
{
int l = len;
@@ -2823,7 +2823,7 @@
/* Return the unmetafied length of a metafied string. */
/**/
-int
+mod_export int
ztrlen(char const *s)
{
int l;
@@ -2843,7 +2843,7 @@
/* Subtract two pointers in a metafied string. */
/**/
-int
+mod_export int
ztrsub(char const *t, char const *s)
{
int l = t - s;
@@ -2862,7 +2862,7 @@
}
/**/
-char *
+mod_export char *
zreaddir(DIR *dir, int ignoredots)
{
struct dirent *de;
@@ -2880,7 +2880,7 @@
/* Unmetafy and output a string. Tokens are skipped. */
/**/
-int
+mod_export int
zputs(char const *s, FILE *stream)
{
int c;
@@ -2927,7 +2927,7 @@
}
/**/
-char *
+mod_export char *
niceztrdup(char const *s)
{
return nicedup(s, 0);
@@ -2943,7 +2943,7 @@
/* Unmetafy and output a string, displaying special characters readably. */
/**/
-int
+mod_export int
nicezputs(char const *s, FILE *stream)
{
int c;
@@ -2966,7 +2966,7 @@
/* Return the length of the visible representation of a metafied string. */
/**/
-size_t
+mod_export size_t
niceztrlen(char const *s)
{
size_t l = 0;
@@ -2989,7 +2989,7 @@
/* check for special characters in the string */
/**/
-int
+mod_export int
hasspecial(char const *s)
{
for (; *s; s++)
@@ -3007,7 +3007,7 @@
* The string may be metafied and contain tokens. */
/**/
-char *
+mod_export char *
bslashquote(const char *s, char **e, int instring)
{
const char *u, *tt;
@@ -3118,7 +3118,7 @@
/* Unmetafy and output a string, quoted if it contains special characters. */
/**/
-int
+mod_export int
quotedzputs(char const *s, FILE *stream)
{
int inquote = 0, c;
@@ -3193,7 +3193,7 @@
/* Double-quote a metafied string. */
/**/
-char *
+mod_export char *
dquotedztrdup(char const *s)
{
int len = strlen(s) * 4 + 2;
@@ -3303,7 +3303,7 @@
*/
/**/
-char *
+mod_export char *
getkeystring(char *s, int *len, int fromwhere, int *misc)
{
char *buf, tmp[1];
@@ -3460,7 +3460,7 @@
/* Return non-zero if s is a prefix of t. */
/**/
-int
+mod_export int
strpfx(char *s, char *t)
{
while (*s && *s == *t)
@@ -3471,7 +3471,7 @@
/* Return non-zero if s is a suffix of t. */
/**/
-int
+mod_export int
strsfx(char *s, char *t)
{
int ls = strlen(s), lt = strlen(t);
@@ -3482,7 +3482,7 @@
}
/**/
-char *
+mod_export char *
dupstrpfx(const char *s, int len)
{
char *r = ncalloc(len + 1);
@@ -3493,7 +3493,7 @@
}
/**/
-char *
+mod_export char *
ztrduppfx(const char *s, int len)
{
char *r = zalloc(len + 1);
@@ -3506,7 +3506,7 @@
/* Append a string to an allocated string, reallocating to make room. */
/**/
-char *
+mod_export char *
appstr(char *base, char const *append)
{
return strcat(realloc(base, strlen(base) + strlen(append) + 1), append);
@@ -3537,7 +3537,7 @@
* in an unwanted directory in case of failure. */
/**/
-int
+mod_export int
lchdir(char const *path, struct dirsav *d, int hard)
{
char const *pptr;
@@ -3660,7 +3660,7 @@
}
/**/
-int
+mod_export int
restoredir(struct dirsav *d)
{
int err = 0;
@@ -3699,7 +3699,7 @@
/* Get a signal number from a string */
/**/
-int
+mod_export int
getsignum(char *s)
{
int x, i;
@@ -3753,7 +3753,7 @@
#ifdef DEBUG
/**/
-void
+mod_export void
dputs(char *message)
{
fprintf(stderr, "%s\n", message);
@@ -3763,7 +3763,7 @@
#endif /* DEBUG */
/**/
-int
+mod_export int
mode_to_octal(mode_t mode)
{
int m = 0;
Only in ../zsh-/Src: zsh.export
diff -ur ../zsh-/Src/zsh.h ./Src/zsh.h
--- ../zsh-/Src/zsh.h Wed Dec 1 15:50:31 1999
+++ ./Src/zsh.h Wed Dec 1 15:53:29 1999
@@ -1660,3 +1660,9 @@
typedef void (*ZleVoidFn) _((void));
typedef void (*ZleVoidIntFn) _((int));
typedef unsigned char * (*ZleReadFn) _((char *, char *, int));
+
+/***************************************/
+/* Pseudo-keyword to mark exportedness */
+/***************************************/
+
+#define mod_export
END
Messages sorted by:
Reverse Date,
Date,
Thread,
Author