file reorg, pathnames.h, paths.h
authorKeith Bostic <bostic@ucbvax.Berkeley.EDU>
Thu, 11 May 1989 13:41:11 +0000 (05:41 -0800)
committerKeith Bostic <bostic@ucbvax.Berkeley.EDU>
Thu, 11 May 1989 13:41:11 +0000 (05:41 -0800)
SCCS-vsn: lib/libterm/Makefile 5.7
SCCS-vsn: lib/libterm/termcap.c 5.4

usr/src/lib/libterm/Makefile
usr/src/lib/libterm/termcap.c

index 477a3cc..60d8cd7 100644 (file)
@@ -14,7 +14,7 @@
 # IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
 # WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
 #
 # IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
 # WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
 #
-#      @(#)Makefile    5.6 (Berkeley) %G%
+#      @(#)Makefile    5.7 (Berkeley) %G%
 #
 CFLAGS=        -O -DCM_N -DCM_GT -DCM_B -DCM_D
 LIBC=  /lib/libc.a
 #
 CFLAGS=        -O -DCM_N -DCM_GT -DCM_B -DCM_D
 LIBC=  /lib/libc.a
@@ -33,11 +33,14 @@ MDIR=       ${DESTDIR}/usr/man/cat3
 all: termcap.a termcap_p.a
 
 termcap.a termcap_p.a: ${OBJS}
 all: termcap.a termcap_p.a
 
 termcap.a termcap_p.a: ${OBJS}
-       ar cr termcap.a ${OBJS}
-       cd profiled; ar cr ../termcap_p.a ${OBJS}
+       @echo building normal termcap
+       @ar cr termcap.a ${OBJS}
+       ranlib termcap.a
+       @echo building profiled termcap
+       @cd profiled; ar cr ../termcap_p.a ${OBJS}
+       ranlib termcap_p.a
 
 test:
 
 test:
-       ranlib termcap.a
        ${CC} ${CFLAGS} -o tc1 tc1.c termcap.a
        ${CC} ${CFLAGS} -o tc2 tc2.c termcap.a
        ${CC} ${CFLAGS} -o tc3 tc3.c termcap.a
        ${CC} ${CFLAGS} -o tc1 tc1.c termcap.a
        ${CC} ${CFLAGS} -o tc2 tc2.c termcap.a
        ${CC} ${CFLAGS} -o tc3 tc3.c termcap.a
@@ -53,13 +56,14 @@ depend:
 
 install: ${MAN}
        install -o bin -g bin -m 644 termcap.a ${DESTDIR}/usr/lib/libtermcap.a
 
 install: ${MAN}
        install -o bin -g bin -m 644 termcap.a ${DESTDIR}/usr/lib/libtermcap.a
+       ranlib -t ${DESTDIR}/usr/lib/libtermcap.a
        rm -f ${DESTDIR}/usr/lib/libtermlib.a
        ln ${DESTDIR}/usr/lib/libtermcap.a ${DESTDIR}/usr/lib/libtermlib.a
        rm -f ${DESTDIR}/usr/lib/libtermlib.a
        ln ${DESTDIR}/usr/lib/libtermcap.a ${DESTDIR}/usr/lib/libtermlib.a
-       ranlib ${DESTDIR}/usr/lib/libtermcap.a
-       install -o bin -g bin -m 644 termcap_p.a ${DESTDIR}/usr/lib/libtermcap_p.a
+       install -o bin -g bin -m 644 termcap_p.a \
+           ${DESTDIR}/usr/lib/libtermcap_p.a
+       ranlib -t ${DESTDIR}/urs/lib/libtermcap_p.a
        rm -f ${DESTDIR}/usr/lib/libtermlib_p.a
        ln ${DESTDIR}/usr/lib/libtermcap_p.a ${DESTDIR}/usr/lib/libtermlib_p.a
        rm -f ${DESTDIR}/usr/lib/libtermlib_p.a
        ln ${DESTDIR}/usr/lib/libtermcap_p.a ${DESTDIR}/usr/lib/libtermlib_p.a
-       ranlib ${DESTDIR}/usr/lib/libtermcap_p.a
        install -c -o bin -g bin -m 444 termcap.0 ${DESTDIR}/usr/man/cat3
        rm -f ${MDIR}/tgetent.0; ln ${MDIR}/termcap.0 ${MDIR}/tgetent.0
        rm -f ${MDIR}/tgetflag.0; ln ${MDIR}/termcap.0 ${MDIR}/tgetflag.0
        install -c -o bin -g bin -m 444 termcap.0 ${DESTDIR}/usr/man/cat3
        rm -f ${MDIR}/tgetent.0; ln ${MDIR}/termcap.0 ${MDIR}/tgetent.0
        rm -f ${MDIR}/tgetflag.0; ln ${MDIR}/termcap.0 ${MDIR}/tgetflag.0
index b3ae0fe..61e1d11 100644 (file)
  */
 
 #ifndef lint
  */
 
 #ifndef lint
-static char sccsid[] = "@(#)termcap.c  5.3 (Berkeley) %G%";
+static char sccsid[] = "@(#)termcap.c  5.4 (Berkeley) %G%";
 #endif /* not lint */
 
 #define        BUFSIZ          1024
 #define MAXHOP         32      /* max number of tc= indirections */
 #define        PBUFSIZ         512     /* max length of filename path */
 #define        PVECSIZ         32      /* max number of names in path */
 #endif /* not lint */
 
 #define        BUFSIZ          1024
 #define MAXHOP         32      /* max number of tc= indirections */
 #define        PBUFSIZ         512     /* max length of filename path */
 #define        PVECSIZ         32      /* max number of names in path */
-#define DEF_PATH       ".termcap /etc/termcap"
 
 #include <ctype.h>
 
 #include <ctype.h>
+#include "pathnames.h"
+
 /*
  * termcap - routines for dealing with the terminal capability data base
  *
 /*
  * termcap - routines for dealing with the terminal capability data base
  *
@@ -65,7 +66,6 @@ tgetent(bp, name)
        pvec = pathvec;
        tbuf = bp;
        p = pathbuf;
        pvec = pathvec;
        tbuf = bp;
        p = pathbuf;
-#ifndef V6
        cp = getenv("TERMCAP");
        /*
         * TERMCAP can have one of two things in it. It can be the
        cp = getenv("TERMCAP");
        /*
         * TERMCAP can have one of two things in it. It can be the
@@ -86,14 +86,12 @@ tgetent(bp, name)
                                strcpy(pathbuf, home);  /* $HOME first */
                                *p++ = '/';
                        }       /* if no $HOME look in current directory */
                                strcpy(pathbuf, home);  /* $HOME first */
                                *p++ = '/';
                        }       /* if no $HOME look in current directory */
-                       strncpy(p, DEF_PATH, PBUFSIZ - (p - pathbuf));
+                       strncpy(p, _PATH_DEF, PBUFSIZ - (p - pathbuf));
                }
        }
        else                            /* user-defined name in TERMCAP */
                strncpy(pathbuf, cp, PBUFSIZ);  /* still can be tokenized */
                }
        }
        else                            /* user-defined name in TERMCAP */
                strncpy(pathbuf, cp, PBUFSIZ);  /* still can be tokenized */
-#else
-       strncpy(pathbuf, "/etc/termcap", PBUFSIZ);
-#endif
+
        *fname++ = pathbuf;     /* tokenize path into vector of names */
        while (*++p)
                if (*p == ' ' || *p == ':') {
        *fname++ = pathbuf;     /* tokenize path into vector of names */
        while (*++p)
                if (*p == ' ' || *p == ':') {