Lines Matching defs:name

16  * 3. Neither the name of the University nor the names of its contributors
48 * would make the command name "hash" a misnomer.
81 char cmdname[]; /* name of command */
205 padvance(const char **path, const char **popt, const char *name)
220 namelen = strlen(name);
229 memcpy(q, name, namelen + 1);
257 char *name;
278 while ((name = *argptr) != NULL) {
279 if ((cmdp = cmdlookup(name, 0)) != NULL
282 find_command(name, &entry, DO_ERR, pathval());
286 cmdp = cmdlookup(name, 0);
290 outfmt(out2, "%s: not found\n", name);
306 char *name;
312 name = padvance(&path, &opt, cmdp->cmdname);
313 stunalloc(name);
315 out1str(name);
322 name = commandtext(getfuncnode(cmdp->param.func));
324 out1str(name);
325 ckfree(name);
339 * Resolve a command name. If you change this routine, you may have to
344 find_command(const char *name, struct cmdentry *entry, int act,
357 /* If name contains a slash, don't use the hash table */
358 if (strchr(name, '/') != NULL) {
367 /* If name is in the table, we're done */
368 if ((cmdp = cmdlookup(name, 0)) != NULL) {
376 if ((i = find_builtin(name, &spec)) >= 0) {
378 cmdp = cmdlookup(name, 1);
392 for (;(fullname = padvance(&path, &opt, name)) != NULL;
414 if ((cmdp = cmdlookup(name, 0)) == NULL || cmdp->cmdtype != CMDFUNCTION)
415 error("%s not defined in %s", name, fullname);
431 TRACE(("searchexec \"%s\" returns \"%s\"\n", name, fullname));
434 cmdp = cmdlookup(name, 1);
446 outfmt(out2, "%s: not found\n", name);
448 outfmt(out2, "%s: %s\n", name, strerror(e));
470 find_builtin(const char *name, int *special)
475 len = strlen(name);
477 if (bp[0] == len && memcmp(bp + 2, name, len) == 0) {
567 cmdlookup(const char *name, int add)
573 pp = &cmdtable[hashname(name)];
575 if (equal(cmdp->cmdname, name))
581 len = strlen(name);
585 memcpy(cmdp->cmdname, name, len + 1);
637 * the same name.
641 addcmdentry(const char *name, struct cmdentry *entry)
646 cmdp = cmdlookup(name, 1);
662 defun(const char *name, union node *func)
670 addcmdentry(name, &entry);
681 unsetfunc(const char *name)
685 if ((cmdp = cmdlookup(name, 0)) != NULL && cmdp->cmdtype == CMDFUNCTION) {
695 * Check if a function by a certain name exists.
698 isfunc(const char *name)
701 cmdp = cmdlookup(name, 0);
707 print_absolute_path(const char *name)
711 if (*name != '/' && (pwd = lookupvar("PWD")) != NULL && *pwd != '\0') {
716 out1str(name);
781 char *name;
784 name = padvance(&path2, &opt2, argv[i]);
785 stunalloc(name);
791 print_absolute_path(name);