1: #include "hd.h"
2: #include "mydir.h"
3: #include "classify.h"
4:
5: /* Enterfile selects its parameter fname; Fname may either be a single
6: element file name (no slashes) or a full path name. Enterfile
7: can handle files which look like ".", "..", "file.c", or "/a/b".
8: For files which could look like "/a/b/", "a/b", or "./../../a" use
9: the procedure "file" (file expects an argument in argv format).
10: */
11: enterfile (fname) char *fname; {
12:
13: switch (classify (fname)) {
14:
15: case CL_NULL: case CL_PROTPLN:
16: myperror (fname); return FAILURE;
17:
18: case CL_DIR:
19: return enterdir (fname);
20:
21: case CL_CORE:
22: f_exec (DEBUGGER, DEBUGGER, fname, 0); return SUCCESS;
23:
24: case CL_AOUT:
25: p_exec ("/bin/nm", "nm", fname, 0); return REPLOT;
26:
27: case CL_AR:
28: p_exec ("/bin/ar", "ar", "vt", fname, 0); return REPLOT;
29:
30: case CL_CPIO:
31: p_exec ("/bin/cpio", "cpio", "-vt", 0); return REPLOT;
32:
33: case CL_TEXT:
34: f_exec (EDITOR, EDITOR, fname, 0); return REPLOT;
35:
36: default:
37: putmsg (fname); printf (": Vsh cannot handle this file");
38: }
39: return FAILURE;
40: }
41: home () { /* enter home directory */
42:
43: return file (&envhome);
44: }
Defined functions
home
defined in line
41; used 4 times