diff options
author | ache <ache@FreeBSD.org> | 1994-10-06 23:38:41 +0000 |
---|---|---|
committer | ache <ache@FreeBSD.org> | 1994-10-06 23:38:41 +0000 |
commit | b32637dd9bf4e7ee14b7c850eff0ebc0fe42076a (patch) | |
tree | 42730d0413bbd6de0453b7861f6e510473226e61 /lib/libmytinfo/getother.c | |
download | FreeBSD-src-b32637dd9bf4e7ee14b7c850eff0ebc0fe42076a.zip FreeBSD-src-b32637dd9bf4e7ee14b7c850eff0ebc0fe42076a.tar.gz |
Moved from ports + several enhacmenets
Diffstat (limited to 'lib/libmytinfo/getother.c')
-rw-r--r-- | lib/libmytinfo/getother.c | 49 |
1 files changed, 49 insertions, 0 deletions
diff --git a/lib/libmytinfo/getother.c b/lib/libmytinfo/getother.c new file mode 100644 index 0000000..2542f66 --- /dev/null +++ b/lib/libmytinfo/getother.c @@ -0,0 +1,49 @@ +/* + * getother.c + * + * By Ross Ridge + * Public Domain + * 92/02/01 07:29:58 + * + */ + +#include "defs.h" +#include <term.h> + +#ifdef USE_SCCS_IDS +static const char SCCSid[] = "@(#) mytinfo getother.c 3.2 92/02/01 public domain, By Ross Ridge"; +#endif + +int +_getother(name, path, ct) +char *name; +struct term_path *path; +TERMINAL *ct; { + static int depth = 0; + int r; + char buf[MAX_BUF]; + + if (depth >= MAX_DEPTH) + return 1; /* infinite loop */ + +#ifdef DEBUG + printf("\ngetother: %s\n", name); +#endif + + switch(_findterm(name, path, buf)) { + case -3: + return 1; + case 1: + depth++; + r = _gettcap(buf, ct, path); + break; + case 2: + depth++; + r = _gettinfo(buf, ct, path); + break; + default: + return 0; + } + depth--; + return r; +} |