From a4e44197ae0f6e237f118e5b30c01eb12c460ec4 Mon Sep 17 00:00:00 2001 From: Tanaka Akira Date: Wed, 1 Dec 1999 18:35:59 +0000 Subject: zsh-workers/8843 --- Src/Zle/.cvsignore | 1 + Src/Zle/.distfiles | 4 +-- Src/Zle/compcore.c | 70 ++++++++++++++++++++++++++------------------------ Src/Zle/complete.c | 33 +++++++++++++----------- Src/Zle/complete.mdd | 2 -- Src/Zle/compmatch.c | 6 ++--- Src/Zle/compresult.c | 14 +++++----- Src/Zle/zle.mdd | 2 -- Src/Zle/zle_bindings.c | 2 +- Src/Zle/zle_keymap.c | 16 ++++++------ Src/Zle/zle_main.c | 26 +++++++++---------- Src/Zle/zle_misc.c | 12 ++++----- Src/Zle/zle_params.c | 2 +- Src/Zle/zle_refresh.c | 20 +++++++-------- Src/Zle/zle_thingy.c | 6 ++--- Src/Zle/zle_tricky.c | 70 +++++++++++++++++++++++++------------------------- Src/Zle/zle_utils.c | 12 ++++----- 17 files changed, 151 insertions(+), 147 deletions(-) (limited to 'Src/Zle') diff --git a/Src/Zle/.cvsignore b/Src/Zle/.cvsignore index 2eff53649..c5921cdc4 100644 --- a/Src/Zle/.cvsignore +++ b/Src/Zle/.cvsignore @@ -1,5 +1,6 @@ Makefile Makefile.in +*.export so_locations *.pro *.epro diff --git a/Src/Zle/.distfiles b/Src/Zle/.distfiles index 7045f7581..e280a0199 100644 --- a/Src/Zle/.distfiles +++ b/Src/Zle/.distfiles @@ -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 @@ DISTFILES_SRC=' 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 --git a/Src/Zle/compcore.c b/Src/Zle/compcore.c index 193da880e..875674023 100644 --- a/Src/Zle/compcore.c +++ b/Src/Zle/compcore.c @@ -59,12 +59,12 @@ int insmnum, insgnum, insgroup, insspace; /* 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 @@ int hasunqu, useqbr, brpcs, brscs; /* 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 @@ int parflags; /* 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 @@ int parq, eparq; * 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 @@ LinkList matches, fmatches; * 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 @@ int permmnum, permgnum, lastpermmnum, lastpermgnum; /* 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 @@ Cmgroup mgroup; /* Match counter: all matches. */ /**/ -int mnum; +mod_export int mnum; /* The match counter when unambig_data() was called. */ @@ -185,22 +189,22 @@ int maxmlen, minmlen; 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 @@ Aminfo ainfo, fainfo; /* 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 @@ Heap compheap; * 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 @@ makecomplist(char *s, int incmd, int lst) } /**/ -char * +mod_export char * multiquote(char *s, int ign) { if (s) { @@ -940,7 +944,7 @@ multiquote(char *s, int ign) } /**/ -char * +mod_export char * tildequote(char *s, int ign) { if (s) { @@ -961,7 +965,7 @@ tildequote(char *s, int ign) /* 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 @@ check_param(char *s, int set, int test) /* 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 @@ rembslash(char *s) /* This should probably be moved into tokenize(). */ /**/ -char * +mod_export char * ctokenize(char *p) { char *r = p; @@ -1131,7 +1135,7 @@ ctokenize(char *p) } /**/ -char * +mod_export char * comp_str(int *ipl, int *pl, int untok) { char *p = dupstring(compprefix); @@ -1396,7 +1400,7 @@ set_comp_sep(void) /* 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 @@ set_list_array(char *name, LinkList l) /* 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 @@ addmatches(Cadata dat, char **argv) /* 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 @@ add_match_data(int alt, char *str, Cline line, /* This begins a new group of matches. */ /**/ -void +mod_export void begcmgroup(char *n, int flags) { if (n) { @@ -2213,7 +2217,7 @@ begcmgroup(char *n, int flags) /* End the current group for now. */ /**/ -void +mod_export void endcmgroup(char **ylist) { mgroup->ylist = ylist; @@ -2222,7 +2226,7 @@ endcmgroup(char **ylist) /* Add an explanation string to the current group, joining duplicates. */ /**/ -void +mod_export void addexpl(void) { LinkNode n; @@ -2581,7 +2585,7 @@ freematch(Cmatch m, int nbeg, int nend) /* This frees the groups of matches. */ /**/ -void +mod_export void freematches(Cmgroup g) { Cmgroup n; diff --git a/Src/Zle/complete.c b/Src/Zle/complete.c index 55a6e68f2..416ebfff7 100644 --- a/Src/Zle/complete.c +++ b/Src/Zle/complete.c @@ -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 @@ freecmlist(Cmlist l) } /**/ -void +mod_export void freecmatcher(Cmatcher m) { Cmatcher n; @@ -152,7 +155,7 @@ cpcmlist(Cmlist l) /* Copy a completion matcher list. */ /**/ -Cmatcher +mod_export Cmatcher cpcmatcher(Cmatcher m) { Cmatcher r = NULL, *p = &r, n; @@ -202,7 +205,7 @@ cpcpattern(Cpattern o) /* 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 @@ set_gmatcher(char *name, char **argv) /* 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 @@ bin_compadd(char *name, char **argv, char *ops, int func) #define CVT_SUFPAT 5 /**/ -void +mod_export void ignore_prefix(int l) { if (l) { @@ -640,7 +643,7 @@ ignore_prefix(int l) } /**/ -void +mod_export void ignore_suffix(int l) { if (l) { @@ -663,7 +666,7 @@ ignore_suffix(int l) } /**/ -void +mod_export void restrict_range(int b, int e) { int wl = arrlen(compwords) - 1; diff --git a/Src/Zle/complete.mdd b/Src/Zle/complete.mdd index 3ea802065..70e275b4e 100644 --- a/Src/Zle/complete.mdd +++ b/Src/Zle/complete.mdd @@ -1,5 +1,3 @@ -hasexport=1 - moddeps="zle" autobins="compgen compadd compset" diff --git a/Src/Zle/compmatch.c b/Src/Zle/compmatch.c index d29595d62..b5ea5affe 100644 --- a/Src/Zle/compmatch.c +++ b/Src/Zle/compmatch.c @@ -68,7 +68,7 @@ cmp_cmatchers(Cmatcher a, Cmatcher b) /* 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 @@ add_bmatchers(Cmatcher m) * 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 @@ match_parts(char *l, char *w, int n, int part) * 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 --git a/Src/Zle/compresult.c b/Src/Zle/compresult.c index c68657d79..bdafa3059 100644 --- a/Src/Zle/compresult.c +++ b/Src/Zle/compresult.c @@ -682,7 +682,7 @@ do_ambiguous(void) * (l)stat(). */ /**/ -int +mod_export int ztat(char *nam, struct stat *buf, int ls) { char b[PATH_MAX], *p; @@ -700,7 +700,7 @@ ztat(char *nam, struct stat *buf, int ls) /* 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 @@ do_single(Cmatch m) * 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 @@ reverse_menu(Hookdef dummy, void *dummy2) * accept several selections from the list of matches. */ /**/ -int +mod_export int accept_last(void) { if (!menuacc) { @@ -1132,7 +1132,7 @@ skipnolist(Cmatch *p) } /**/ -void +mod_export void calclist(void) { Cmgroup g; @@ -1517,7 +1517,7 @@ int asklist(void) } /**/ -int +mod_export int printlist(int over, CLPrintFunc printm) { Cmgroup g; @@ -1800,7 +1800,7 @@ list_matches(Hookdef dummy, void *dummy2) /* Invalidate the completion list. */ /**/ -int +mod_export int invalidate_list(void) { if (showinglist == -2) diff --git a/Src/Zle/zle.mdd b/Src/Zle/zle.mdd index 3235c88a1..a5307084a 100644 --- a/Src/Zle/zle.mdd +++ b/Src/Zle/zle.mdd @@ -1,5 +1,3 @@ -hasexport=1 - autobins="bindkey vared zle" objects="zle_bindings.o zle_hist.o zle_keymap.o zle_main.o \ diff --git a/Src/Zle/zle_bindings.c b/Src/Zle/zle_bindings.c index 940d578d9..e95061df2 100644 --- a/Src/Zle/zle_bindings.c +++ b/Src/Zle/zle_bindings.c @@ -69,7 +69,7 @@ widgets[] = { */ /**/ -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 --git a/Src/Zle/zle_keymap.c b/Src/Zle/zle_keymap.c index ccfbd4043..28203655e 100644 --- a/Src/Zle/zle_keymap.c +++ b/Src/Zle/zle_keymap.c @@ -105,7 +105,7 @@ char *curkeymapname; /* the hash table of keymap names */ /**/ -HashTable keymapnamtab; +mod_export HashTable keymapnamtab; /* key sequence reading data */ @@ -217,7 +217,7 @@ freekeynode(HashNode hn) static HashTable copyto; /**/ -Keymap +mod_export Keymap newkeymap(Keymap tocopy, char *kmname) { Keymap km = zcalloc(sizeof(*km)); @@ -323,7 +323,7 @@ openkeymap(char *name) } /**/ -int +mod_export int unlinkkeymap(char *name, int ignm) { KeymapName n = (KeymapName) keymapnamtab->getnode(keymapnamtab, name); @@ -336,7 +336,7 @@ unlinkkeymap(char *name, int ignm) } /**/ -int +mod_export int linkkeymap(Keymap km, char *name, int imm) { KeymapName n = (KeymapName) keymapnamtab->getnode(keymapnamtab, name); @@ -386,7 +386,7 @@ selectkeymap(char *name, int fb) /* Select a local key map. */ /**/ -void +mod_export void selectlocalmap(Keymap m) { localkeymap = m; @@ -414,7 +414,7 @@ reselectkeymap(void) * back onto the input. */ /**/ -int +mod_export int bindkey(Keymap km, char *seq, Thingy bind, char *str) { Key k; @@ -1204,7 +1204,7 @@ getkeybuf(int w) * Must be executed at most once after each getkeymapcmd(). */ /**/ -void +mod_export void ungetkeycmd(void) { ungetkeys(keybuf, keybuflen); @@ -1213,7 +1213,7 @@ ungetkeycmd(void) /* read a command from the current keymap, with widgets */ /**/ -Thingy +mod_export Thingy getkeycmd(void) { Thingy func; diff --git a/Src/Zle/zle_main.c b/Src/Zle/zle_main.c index 4f5729818..420494a52 100644 --- a/Src/Zle/zle_main.c +++ b/Src/Zle/zle_main.c @@ -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 @@ int c; /* 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 @@ static int baud; /* 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 @@ int undoing; /* 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 prefixflag; int kungetct; /**/ -char *zlenoargs[1] = { NULL }; +mod_export char *zlenoargs[1] = { NULL }; #ifdef FIONREAD static int delayzsetterm; @@ -136,7 +136,7 @@ static int delayzsetterm; /* set up terminal */ /**/ -void +mod_export void zsetterm(void) { struct ttyinfo ti; @@ -316,7 +316,7 @@ breakread(int fd, char *buf, int n) #endif /**/ -int +mod_export int getkey(int keytmout) { char cc; @@ -722,7 +722,7 @@ handleprefixes(void) /* 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 @@ whereis(char **args) } /**/ -void +mod_export void trashzle(void) { if (zleactive) { @@ -991,7 +991,7 @@ static struct builtin bintab[] = { * 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 --git a/Src/Zle/zle_misc.c b/Src/Zle/zle_misc.c index 18e38ee3a..3e306da8a 100644 --- a/Src/Zle/zle_misc.c +++ b/Src/Zle/zle_misc.c @@ -833,7 +833,7 @@ executenamedcommand(char *prmt) * 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 @@ static char *suffixfunc; * 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 @@ makesuffix(int n) * 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 @@ makeparamsuffix(int br, int n) * remove the suffix. */ /**/ -void +mod_export void makesuffixstr(char *f, char *s, int n) { if (f) { @@ -920,7 +920,7 @@ makesuffixstr(char *f, char *s, int n) /* 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 @@ iremovesuffix(int c, int keep) /* 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 --git a/Src/Zle/zle_params.c b/Src/Zle/zle_params.c index aa62786f5..a6dc2bc67 100644 --- a/Src/Zle/zle_params.c +++ b/Src/Zle/zle_params.c @@ -79,7 +79,7 @@ static struct zleparam { }; /**/ -void +mod_export void makezleparams(int ro) { struct zleparam *zp; diff --git a/Src/Zle/zle_refresh.c b/Src/Zle/zle_refresh.c index 97b7e8d03..4c5a0cdf8 100644 --- a/Src/Zle/zle_refresh.c +++ b/Src/Zle/zle_refresh.c @@ -43,7 +43,7 @@ unsigned pmpt_attr, rpmpt_attr; /* 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 @@ int nlnct; * 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 @@ static int cleareol, /* clear to end-of-line (if can't cleareod) */ numscrolls, onumscrolls; /**/ -void +mod_export void zrefresh(void) { static int inlist; /* avoiding recursion */ @@ -893,7 +893,7 @@ moveto(int ln, int cl) } /**/ -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 @@ tc_downcurs(int ct) } /**/ -void +mod_export void tcout(int cap) { tputs(tcstr[cap], 1, putshout); @@ -1008,7 +1008,7 @@ tcoutarg(int cap, int arg) } /**/ -int +mod_export int clearscreen(char **args) { tcout(TCCLEARSCREEN); @@ -1018,7 +1018,7 @@ clearscreen(char **args) } /**/ -int +mod_export int redisplay(char **args) { moveto(0, 0); diff --git a/Src/Zle/zle_thingy.c b/Src/Zle/zle_thingy.c index 1e0d483e2..3d8eb41b2 100644 --- a/Src/Zle/zle_thingy.c +++ b/Src/Zle/zle_thingy.c @@ -134,7 +134,7 @@ freethingynode(HashNode hn) * correctly. */ /**/ -Thingy +mod_export Thingy refthingy(Thingy th) { if(th) @@ -261,7 +261,7 @@ freewidget(Widget w) * returned. */ /**/ -Widget +mod_export Widget addzlefunction(char *name, ZleIntFunc ifunc, int flags) { VARARR(char, dotn, strlen(name) + 2); @@ -290,7 +290,7 @@ addzlefunction(char *name, ZleIntFunc ifunc, int flags) * a widget from the fixed table -- it would be bad. (Thanks, Egon.) */ /**/ -void +mod_export void deletezlefunction(Widget w) { Thingy p, n; diff --git a/Src/Zle/zle_tricky.c b/Src/Zle/zle_tricky.c index b85084355..6c8e6fd0a 100644 --- a/Src/Zle/zle_tricky.c +++ b/Src/Zle/zle_tricky.c @@ -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 @@ int offs; * 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 @@ static char *qword; * 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 @@ char *compfunc = NULL; * 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 @@ completeword(char **args) } /**/ -int +mod_export int menucomplete(char **args) { usemenu = 1; @@ -284,7 +284,7 @@ listexpand(char **args) } /**/ -int +mod_export int reversemenucomplete(char **args) { if (!menucmp) @@ -308,28 +308,28 @@ acceptandmenucomplete(char **args) * 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 @@ Param keypm; /* 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 @@ addx(char **ptmp) /* 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 @@ dupstrspace(const char *str) * functions (there's one for each direction). */ /**/ -void +mod_export void metafy_line(void) { int len = ll; @@ -836,7 +836,7 @@ metafy_line(void) } /**/ -void +mod_export void unmetafy_line(void) { cs = ztrsub((char *) line + cs, (char *) line); @@ -846,7 +846,7 @@ unmetafy_line(void) /* Free a brinfo list. */ /**/ -void +mod_export void freebrinfo(Brinfo p) { Brinfo n; @@ -863,7 +863,7 @@ freebrinfo(Brinfo p) /* Duplicate a brinfo list. */ /**/ -Brinfo +mod_export Brinfo dupbrinfo(Brinfo p, Brinfo *last) { Brinfo ret = NULL, *q = &ret, n = NULL; @@ -1572,7 +1572,7 @@ get_comp_string(void) * 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 @@ docompletion(char *s, int lst, int incmd) /* 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 @@ sfxlen(char *s, char *t) /* This is strcmp with ignoring backslashes. */ /**/ -int +mod_export int strbpcmp(char **aa, char **bb) { char *a = *aa, *b = *bb; @@ -1761,7 +1761,7 @@ strbpcmp(char **aa, char **bb) * 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 --git a/Src/Zle/zle_utils.c b/Src/Zle/zle_utils.c index 2cd985124..772ad708a 100644 --- a/Src/Zle/zle_utils.c +++ b/Src/Zle/zle_utils.c @@ -73,7 +73,7 @@ sizeline(int sz) /* insert space for ct chars at cursor position */ /**/ -void +mod_export void spaceinline(int ct) { int i; @@ -105,7 +105,7 @@ shiftchars(int to, int cnt) } /**/ -void +mod_export void backkill(int ct, int dir) { int i = (cs -= ct); @@ -115,7 +115,7 @@ backkill(int ct, int dir) } /**/ -void +mod_export void forekill(int ct, int dir) { int i = cs; @@ -191,14 +191,14 @@ cut(int i, int ct, int dir) } /**/ -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 @@ hstrnstr(char *haystack, int pos, char *needle, int len, int dir, int sens) * characters are read. Case is folded. */ /**/ -int +mod_export int getzlequery(void) { int c; -- cgit 1.4.1