Home | History | Annotate | Download | only in sh

Lines Matching refs:cmdp

334 	struct tblentry *cmdp;
350 for (cmdp = *pp ; cmdp ; cmdp = cmdp->next) {
351 if (verbose || cmdp->cmdtype == CMDNORMAL)
352 printentry(cmdp, verbose);
358 if ((cmdp = cmdlookup(name, 0)) != NULL
359 && (cmdp->cmdtype == CMDNORMAL
360 || (cmdp->cmdtype == CMDBUILTIN && builtinloc >= 0)))
365 cmdp = cmdlookup(name, 0);
366 printentry(cmdp, verbose);
377 printentry(struct tblentry *cmdp, int verbose)
383 switch (cmdp->cmdtype) {
385 idx = cmdp->param.index;
388 name = padvance(&path, cmdp->cmdname);
394 out1fmt("special builtin %s", cmdp->cmdname);
397 out1fmt("builtin %s", cmdp->cmdname);
400 out1fmt("function %s", cmdp->cmdname);
404 commandtext(&ps, cmdp->param.func);
412 error("internal error: %s cmdtype %d", cmdp->cmdname, cmdp->cmdtype);
414 if (cmdp->rehash)
429 struct tblentry *cmdp, loc_cmd;
467 if ((cmdp = cmdlookup(name, 0)) != NULL) {
469 switch (cmdp->cmdtype) {
472 cmdp = NULL;
478 cmdp = NULL;
484 cmdp = NULL;
490 if (cmdp->rehash == 0)
502 if (cmdp) { /* doing a rehash */
503 if (cmdp->cmdtype == CMDBUILTIN)
506 prev = cmdp->param.index;
551 if ((cmdp = cmdlookup(name, 0)) == NULL ||
552 cmdp->cmdtype != CMDFUNCTION)
575 cmdp = &loc_cmd;
577 cmdp = cmdlookup(name, 1);
578 cmdp->cmdtype = CMDNORMAL;
579 cmdp->param.index = idx;
585 if (cmdp)
595 cmdp = &loc_cmd;
597 cmdp = cmdlookup(name, 1);
598 if (cmdp->cmdtype == CMDFUNCTION)
600 cmdp = &loc_cmd;
601 cmdp->cmdtype = CMDBUILTIN;
602 cmdp->param.bltin = bltin;
605 cmdp->rehash = 0;
606 entry->cmdtype = cmdp->cmdtype;
607 entry->u = cmdp->param;
653 struct tblentry *cmdp;
656 cmdp = cmdlookup(bp->name, 1);
657 cmdp->cmdtype = CMDSPLBLTIN;
658 cmdp->param.bltin = bp->builtin;
673 struct tblentry *cmdp;
676 for (cmdp = *pp ; cmdp ; cmdp = cmdp->next) {
677 if (cmdp->cmdtype == CMDNORMAL
678 || (cmdp->cmdtype == CMDBUILTIN && builtinloc >= 0))
679 cmdp->rehash = 1;
742 struct tblentry *cmdp;
747 while ((cmdp = *pp) != NULL) {
748 if ((cmdp->cmdtype == CMDNORMAL &&
749 cmdp->param.index >= firstchange)
750 || (cmdp->cmdtype == CMDBUILTIN &&
752 *pp = cmdp->next;
753 ckfree(cmdp);
755 pp = &cmdp->next;
785 struct tblentry *cmdp;
790 while ((cmdp = *pp) != NULL) {
791 if (cmdp->cmdtype == CMDFUNCTION) {
792 *pp = cmdp->next;
793 freefunc(cmdp->param.func);
794 ckfree(cmdp);
796 pp = &cmdp->next;
821 struct tblentry *cmdp;
830 for (cmdp = *pp ; cmdp ; cmdp = cmdp->next) {
831 if (equal(cmdp->cmdname, name))
833 pp = &cmdp->next;
835 if (add && cmdp == NULL) {
837 cmdp = *pp = ckmalloc(sizeof (struct tblentry) - ARB
839 cmdp->next = NULL;
840 cmdp->cmdtype = CMDUNKNOWN;
841 cmdp->rehash = 0;
842 strcpy(cmdp->cmdname, name);
846 return cmdp;
856 struct tblentry *cmdp;
859 cmdp = *lastcmdentry;
860 *lastcmdentry = cmdp->next;
861 ckfree(cmdp);
871 struct tblentry *cmdp = cmdlookup(name, 0);
873 if (cmdp) {
874 entry->u = cmdp->param;
875 entry->cmdtype = cmdp->cmdtype;
892 struct tblentry *cmdp;
895 cmdp = cmdlookup(name, 1);
896 if (cmdp->cmdtype != CMDSPLBLTIN) {
897 if (cmdp->cmdtype == CMDFUNCTION) {
898 freefunc(cmdp->param.func);
900 cmdp->cmdtype = entry->cmdtype;
901 cmdp->param = entry->u;
931 struct tblentry *cmdp;
933 if ((cmdp = cmdlookup(name, 0)) != NULL &&
934 cmdp->cmdtype == CMDFUNCTION) {
935 freefunc(cmdp->param.func);
951 struct tblentry *cmdp;
997 if ((cmdp = cmdlookup(arg, 0)) != NULL) {
998 entry.cmdtype = cmdp->cmdtype;
999 entry.u = cmdp->param;
1017 cmdp ? " a tracked alias for" : "");