• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /macosx-10.9.5/zsh-60/zsh/Src/Zle/

Lines Matching refs:cc

97     freecompctl(ccp->cc);
103 freecompctl(Compctl cc)
105 if (cc == &cc_default ||
106 cc == &cc_first ||
107 cc == &cc_compos ||
108 --cc->refc > 0)
111 zsfree(cc->keyvar);
112 zsfree(cc->glob);
113 zsfree(cc->str);
114 zsfree(cc->func);
115 zsfree(cc->explain);
116 zsfree(cc->ylist);
117 zsfree(cc->prefix);
118 zsfree(cc->suffix);
119 zsfree(cc->hpat);
120 zsfree(cc->gname);
121 zsfree(cc->subcmd);
122 zsfree(cc->substr);
123 if (cc->cond)
124 freecompcond(cc->cond);
125 if (cc->ext) {
128 n = cc->ext;
136 if (cc->xor && cc->xor != &cc_default)
137 freecompctl(cc->xor);
138 if (cc->matcher)
139 freecmatcher(cc->matcher);
140 zsfree(cc->mstr);
141 zfree(cc, sizeof(struct compctl));
148 Compcond cc = (Compcond) a;
152 for (c = cc; c; c = or) {
377 get_compctl(char *name, char ***av, Compctl cc, int first, int isdef, int cl)
401 freecompctl(cc);
867 if (cc_assign(name, &cc, &cct, first && !hx))
881 cc->xor = &cc_default;
884 cc->xor = (Compctl) zshcalloc(sizeof(*cc));
885 cc = cc->xor;
898 if (cc_assign(name, &cc, &cct, first && !hx))
910 get_xcompctl(char *name, char ***av, Compctl cc, int isdef)
915 Compctl *next = &(cc->ext);
1138 *next = (Compctl) zshcalloc(sizeof(*cc));
1178 Compctl cc;
1207 cc = *ccptr;
1208 zsfree(cc->keyvar);
1209 zsfree(cc->glob);
1210 zsfree(cc->str);
1211 zsfree(cc->func);
1212 zsfree(cc->explain);
1213 zsfree(cc->ylist);
1214 zsfree(cc->prefix);
1215 zsfree(cc->suffix);
1216 zsfree(cc->subcmd);
1217 zsfree(cc->substr);
1218 zsfree(cc->withd);
1219 zsfree(cc->hpat);
1220 zsfree(cc->gname);
1221 zsfree(cc->mstr);
1222 freecmatcher(cc->matcher);
1227 cc->mask = cct->mask;
1228 cc->mask2 = cct->mask2;
1229 cc->keyvar = ztrdup(cct->keyvar);
1230 cc->glob = ztrdup(cct->glob);
1231 cc->str = ztrdup(cct->str);
1232 cc->func = ztrdup(cct->func);
1233 cc->explain = ztrdup(cct->explain);
1234 cc->ylist = ztrdup(cct->ylist);
1235 cc->prefix = ztrdup(cct->prefix);
1236 cc->suffix = ztrdup(cct->suffix);
1237 cc->subcmd = ztrdup(cct->subcmd);
1238 cc->substr = ztrdup(cct->substr);
1239 cc->withd = ztrdup(cct->withd);
1240 cc->gname = ztrdup(cct->gname);
1241 cc->hpat = ztrdup(cct->hpat);
1242 cc->hnum = cct->hnum;
1243 cc->matcher = cpcmatcher(cct->matcher);
1244 cc->mstr = ztrdup(cct->mstr);
1247 cc->ext = cct->ext;
1254 cc_reassign(Compctl cc)
1262 c2 = (Compctl) zshcalloc(sizeof *cc);
1263 c2->xor = cc->xor;
1264 c2->ext = cc->ext;
1269 cc->ext = cc->xor = NULL;
1306 freecompctl(p->cc);
1316 compctl_process_cc(char **s, Compctl cc)
1333 cc->refc = 0;
1337 cc->refc++;
1344 pc->cc = cc;
1349 ccp->cc = cc;
1360 printcompctl(char *s, Compctl cc, int printflags, int ispat)
1366 unsigned long flags = cc->mask, flags2 = cc->mask2;
1392 if (cc == &cc_compos)
1394 if (cc == &cc_default)
1396 if (cc == &cc_first)
1435 printif(cc->mstr, 'M');
1437 printif(cc->gname, 'V');
1439 printif(cc->gname, 'J');
1440 printif(cc->keyvar, 'k');
1441 printif(cc->func, 'K');
1442 printif(cc->explain, (cc->mask & CC_EXPANDEXPL) ? 'Y' : 'X');
1443 printif(cc->ylist, 'y');
1444 printif(cc->prefix, 'P');
1445 printif(cc->suffix, 'S');
1446 printif(cc->glob, 'g');
1447 printif(cc->str, 's');
1448 printif(cc->subcmd, 'l');
1449 printif(cc->substr, 'h');
1450 printif(cc->withd, 'W');
1451 if (cc->hpat) {
1452 printf(" -H %d ", cc->hnum);
1453 quotedzputs(cc->hpat, stdout);
1457 if (cc->ext) {
1461 cc2 = cc->ext;
1519 if (cc && cc->xor) {
1522 if (cc->xor != &cc_default)
1523 printcompctl(NULL, cc->xor, 0, 0);
1526 if ((cclist & COMP_LIST) && (cc != &cc_compos)
1527 && (cc != &cc_default) && (cc != &cc_first)) {
1556 printcompctl(ccp->node.nam, ccp->cc, printflags, 0);
1565 Compctl cc = NULL;
1578 cc = (Compctl) zshcalloc(sizeof(*cc));
1579 if (get_compctl(name, &argv, cc, 1, 0, 0)) {
1580 freecompctl(cc);
1585 showmask = cc->mask;
1589 /* if no command arguments or just listing, we don't want cc */
1591 freecompctl(cc);
1601 printcompctl(pc->pat, pc->cc, 0, 1);
1625 printcompctl(pc->pat, pc->cc, 0, 1);
1657 compctl_process_cc(argv, cc);
2378 Compctl cc = NULL;
2387 cc = &cc_default;
2401 cc = &cc_dummy;
2416 cc = &cc_dummy;
2423 cc = &cc_default;
2431 if (cc) {
2439 makecomplistcc(cc, os, incmd);
2451 Compctl cc;
2485 cc = &cc_compos;
2488 (cc = ccp->cc)) ||
2491 (cc = ccp->cc))))) {
2494 cc = &cc_default;
2497 makecomplistcc(cc, os, incmd);
2519 makecomplistcc(pc->cc, os, incmd);
2532 makecomplistcc(Compctl cc, char *s, int incmd)
2534 cc->refc++;
2537 addlinknode(ccused, cc);
2541 makecomplistor(cc, s, incmd, 0, 0);
2548 makecomplistor(Compctl cc, char *s, int incmd, int compadd, int sub)
2564 makecomplistlist(cc, s, incmd, compadd);
2567 ct = cc->mask2 & CC_XORCONT;
2569 cc = cc->xor;
2570 } while (cc && ct);
2575 if (cc) {
2580 } while (cc);
2589 makecomplistlist(Compctl cc, char *s, int incmd, int compadd)
2595 if (cc->ext)
2597 makecomplistext(cc, s, incmd);
2600 makecomplistflags(cc, s, incmd, compadd);
2617 Compcond or, cc;
2629 for (cc = compc->cond; cc && !t; cc = or) {
2630 or = cc->or;
2632 for (t = 1; cc && t; cc = cc->and) {
2634 for (t = i = 0; i < cc->n && !t; i++) {
2638 switch (cc->type) {
2640 t = ((cc->u.s.s[i][0] == 's' && ins == QT_SINGLE) ||
2641 (cc->u.s.s[i][0] == 'd' && ins == QT_DOUBLE) ||
2642 (cc->u.s.s[i][0] == 'b' && ins == QT_BACKTICK));
2650 if ((a = cc->u.r.a[i]) < 0)
2652 if ((b = cc->u.r.b[i]) < 0)
2654 if (cc->type == CCT_POS)
2663 sc = rembslash(cc->u.s.s[i]);
2666 compadd = (cc->type == CCT_CURSUF ? a : 0);
2679 cc->u.s.p[i],
2680 cc->u.s.s[i],
2681 cc->type == CCT_CURSUBC);
2695 if ((a = tt + cc->u.s.p[i]) < 0)
2701 if (cc->type == CCT_CURPAT ||
2702 cc->type == CCT_WORDPAT) {
2703 tokenize(ss = dupstring(cc->u.s.s[i]));
2707 t = (!strcmp(s, rembslash(cc->u.s.s[i])));
2711 if (cc->type == CCT_RANGEPAT)
2712 tokenize(sc = dupstring(cc->u.l.a[i]));
2715 if (cc->type == CCT_RANGESTR)
2716 sc = rembslash(cc->u.l.a[i]);
2717 if (cc->type == CCT_RANGESTR ?
2728 if (t && cc->u.l.b[i]) {
2729 if (cc->type == CCT_RANGEPAT)
2730 tokenize(sc = dupstring(cc->u.l.b[i]));
2733 if (cc->type == CCT_RANGESTR)
2734 sc = rembslash(cc->u.l.b[i]);
2735 if (cc->type == CCT_RANGESTR ?
3010 makecomplistflags(Compctl cc, char *s, int incmd, int compadd)
3017 ccont |= (cc->mask2 & (CC_CCCONT | CC_DEFCONT | CC_PATCONT));
3019 if (incompfunc != 1 && ccstack && findnode(ccstack, cc))
3024 addlinknode(ccstack, cc);
3027 if (findnode(allccs, cc)) {
3031 addlinknode(allccs, cc);
3045 curcc = cc;
3048 gflags = (((cc->mask2 & CC_NOSORT ) ? CGF_NOSORT : 0) |
3049 ((cc->mask2 & CC_UNIQALL) ? CGF_UNIQALL : 0) |
3050 ((cc->mask2 & CC_UNIQCON) ? CGF_UNIQCON : 0));
3051 if (cc->gname) {
3053 begcmgroup(cc->gname, gflags);
3055 if (cc->ylist) {
3059 if (cc->mask & CC_REMOVE)
3061 if (cc->explain) {
3082 if (cc->matcher) {
3084 ms.matcher = cc->matcher;
3088 add_bmatchers(cc->matcher);
3090 addlinknode(matchers, cc->matcher);
3091 cc->matcher->refc++;
3097 if (cc->prefix) {
3101 char *dp = rembslash(cc->prefix);
3112 if (cc->suffix) {
3113 char *sdup = rembslash(cc->suffix);
3138 cc = &cc_dummy;
3144 if (cc->mask & CC_DELETE) {
3236 if (!(cc->mask & CC_DELETE))
3241 if ((cc->mask & (CC_FILES | CC_DIRS | CC_COMMPATH)) || cc->glob) {
3404 if (cc->withd) {
3408 if ((pp = get_user_var(cc->withd))) {
3425 if (cc->withd) {
3427 int pl = strlen(cc->withd);
3430 strcpy(tp, cc->withd);
3444 if (cc->mask & CC_FILES)
3447 else if (cc->mask & CC_COMMPATH) {
3449 if (sf1 || cc->withd)
3467 } else if (cc->mask & CC_DIRS)
3470 if (cc->glob) {
3472 char *g = dupstring(cc->glob), *pa;
3514 if ((*g == Equals || *g == Tilde) && !cc->withd) {
3520 } else if (*g == '/' && !cc->withd)
3546 *g == '/') || cc->withd) {
3595 if (!ic && (cc->mask & CC_COMMPATH) && !*ppre && !*psuf) {
3609 oaw = addwhat = (cc->mask & CC_QUOTEFLAG) ? -2 : CC_QUOTEFLAG;
3611 if (cc->mask & CC_NAMED)
3614 if (cc->mask & CC_OPTIONS)
3617 if (cc->mask & CC_VARS) {
3622 if (cc->mask & CC_BINDINGS) {
3627 if (cc->keyvar) {
3630 char **usr = get_user_var(cc->keyvar);
3636 if (cc->mask & CC_USERS) {
3641 if (cc->func) {
3648 if ((shfunc = getshfunc(cc->func))) {
3653 addlinknode(args, cc->func);
3682 if (cc->mask & (CC_JOBS | CC_RUNNING | CC_STOPPED)) {
3693 if ((cc->mask & CC_JOBS) ||
3694 (stopped && (cc->mask & CC_STOPPED)) ||
3695 (!stopped && (cc->mask & CC_RUNNING)))
3699 if (cc->str) {
3713 tmpbuf = (char *)zhalloc(strlen(cc->str) + 5);
3714 sprintf(tmpbuf, "foo %s", cc->str); /* KLUDGE! */
3744 if (cc->hpat) {
3748 zlong i = addhistnum(curhist,-1,HIST_FOREIGN), n = cc->hnum;
3752 if (*(cc->hpat)) {
3753 char *thpat = dupstring(cc->hpat);
3783 if ((t = cc->mask & (CC_ARRAYS | CC_INTVARS | CC_ENVVARS | CC_SCALARS |
3787 if ((t = cc->mask & CC_SHFUNCS))
3789 dumphashtable(shfunctab, t | (cc->mask & (CC_DISCMDS|CC_EXCMDS)));
3790 if ((t = cc->mask & CC_BUILTINS))
3792 dumphashtable(builtintab, t | (cc->mask & (CC_DISCMDS|CC_EXCMDS)));
3793 if ((t = cc->mask & CC_EXTCMDS)) {
3797 dumphashtable(cmdnamtab, t | (cc->mask & (CC_DISCMDS|CC_EXCMDS)));
3799 if ((t = cc->mask & CC_RESWDS))
3801 dumphashtable(reswdtab, t | (cc->mask & (CC_DISCMDS|CC_EXCMDS)));
3802 if ((t = cc->mask & (CC_ALREG | CC_ALGLOB)))
3804 dumphashtable(aliastab, t | (cc->mask & (CC_DISCMDS|CC_EXCMDS)));
3805 if (keypm && cc == &cc_dummy) {
3814 if (!errflag && cc->ylist) {
3820 if (cc->ylist[0] == '$' || cc->ylist[0] == '(') {
3822 uv = cc->ylist + (cc->ylist[0] == '$');
3823 } else if ((shfunc = getshfunc(cc->ylist))) {
3830 addlinknode(args, cc->ylist);
3855 if ((tt = cc->explain)) {
3857 if ((cc->mask & CC_EXPANDEXPL) && !parsestr(tt)) {
3862 if (cc->gname) {
3864 begcmgroup(cc->gname, gflags);
3875 } else if ((tt = cc->explain)) {
3877 if ((cc->mask & CC_EXPANDEXPL) && !parsestr(tt)) {
3884 if (cc->subcmd) {
3905 if (cc->subcmd[0]) {
3912 clwords[br - 1] = ztrdup(cc->subcmd);
3913 cmdstr = ztrdup(cc->subcmd);
3935 if (cc->substr)
3936 sep_comp_string(cc->substr, s, offs);
3938 if (cc->matcher)