home *** CD-ROM | disk | FTP | other *** search
- diff -c ../lc.old/README ./README
- *** ../lc.old/README Tue Jan 8 21:23:29 1991
- --- ./README Tue Jan 8 21:22:27 1991
- ***************
- *** 1,23 ****
-
- LC
-
- ! "@(#)README 1.3 9/7/90 Kent Landfield"
-
- This directory contains the source to lc. lc is much like the ls
- command except it separates the types of files into groups and then
- displays located file names to the user is a columnar fashion.
-
- ! lc was initially implemented by myself after I became accustomed
- ! to the lc command on a Mark Williams Coherent system I was running back
- ! in 1984. When I started moving to different systems I found that I did
- ! not like the lack of information, flexibility and the general display
- ! that ls provided. I have found that I am not the only one that has
- ! become feed up with ls and its jumbled output. All the people here use
- ! lc much more than they use ls. It is a locally well known fact that when
- ! a new machine comes into the house, the first local software that is put
- ! on the machine is lc. It is far from perfect but it is better than ls on
- ! a general use basis.
-
- lc uses three different environment variables COLS, CDPATH, and LC
- allowing you to customize how you wish lc to perform on a default
- basis. COLS is used to switch the column width between 80 and 132
- --- 1,29 ----
-
- LC
-
- ! "@(#)README 1.4 1/8/91 Kent Landfield"
-
- This directory contains the source to lc. lc is much like the ls
- command except it separates the types of files into groups and then
- displays located file names to the user is a columnar fashion.
-
- ! "lc"'s history goes back to 1978 when it was originally developed at the
- ! University of Waterloo on a Honeywell 66/60 system. It became so popular
- ! that it was ported to Waterloo's V7 Unix systems shortly thereafter.
- ! This version is a complete re-implementation of lc and contains no
- ! University of Waterloo code.
-
- + This version of lc was initially implemented by myself after I became
- + accustomed to the lc command on a Mark Williams Coherent system I was
- + running back in 1984. When I started moving to different systems I
- + found that I did not like the lack of information, flexibility and the
- + general display that ls provided. I have found that I am not the only
- + one that has become feed up with ls and its jumbled output. All the
- + people here use lc much more than they use ls. It is a locally well
- + known fact that when a new machine comes into the house, the first local
- + software that is put on the machine is lc. It is far from perfect but
- + it is better than ls on a general use basis.
- +
- lc uses three different environment variables COLS, CDPATH, and LC
- allowing you to customize how you wish lc to perform on a default
- basis. COLS is used to switch the column width between 80 and 132
- ***************
- *** 59,70 ****
- -l Mark symbolic links with '@'
- -I Suppress unresolved symbolic link messages.
-
- ! The "only" options can not be combined.
-
- If there is no 'directory' specified, the current directory is used.
-
- Not all options are supported on every system. (e.g. no symbolic links
- ! on your system ? Options -s, -L or -l won't be available..)
- If your system does not support shared memory name space entry files,
- then you cannot use the -m option...
-
- --- 65,76 ----
- -l Mark symbolic links with '@'
- -I Suppress unresolved symbolic link messages.
-
- ! The "only" options can be combined.
-
- If there is no 'directory' specified, the current directory is used.
-
- Not all options are supported on every system. (e.g. no symbolic links
- ! on your system ? Options -s, -I -L or -l won't be available..)
- If your system does not support shared memory name space entry files,
- then you cannot use the -m option...
-
- ***************
- *** 87,93 ****
- --- 93,102 ----
- Tested with SunOS 4.0.3 on a Sparkstation 1 in 1989.
- Tested with UTek on a Tektronix XD8810 in 1989.
- Tested with AIX 3.+ on a Risc System/6000 in 1990.
- + Ivan Fris added the ability to combine "only" options in 1990.
- + Mike Peterson ported it to the Apollo Domain/OS SR10.2 in 1990.
-
- +
- The following is a todo list that may get done someday...
-
- 1. Port to all flavors of unix on all platforms. Lofty goal but
- ***************
- *** 95,101 ****
- 2. Need to modify lc so that one environment (or compile) option will
- only let you see files you own or have access to.
- 3. Add spell checking code to CDPATH usage
- - 4. Allow combination of only options...
-
- *PLEASE!*
- If you have a problem, there's someone else out there who either has
- --- 104,109 ----
- ***************
- *** 102,108 ****
- had or will have the same problem. Please send all "lc" ideas, patches,
- etc to
-
- ! INTERNET: kent@sparky.IMD.Sterling.COM or UUCP: uunet!ssbell!sparky!kent
-
- so that I can continue to improve the functionality and portability of lc.
-
- --- 110,116 ----
- had or will have the same problem. Please send all "lc" ideas, patches,
- etc to
-
- ! INTERNET: kent@sparky.IMD.Sterling.COM or UUCP: uunet!sparky!kent
-
- so that I can continue to improve the functionality and portability of lc.
-
- diff -c ../lc.old/lc.1 ./lc.1
- *** ../lc.old/lc.1 Tue Jan 8 21:23:34 1991
- --- ./lc.1 Tue Jan 8 21:22:27 1991
- ***************
- *** 1,4 ****
- ! .\" @(#)lc.1 1.1 9/7/90 Kent Landfield;
- .TH LC 1 "Usenet Source"
- .SH NAME
- .B lc
- --- 1,4 ----
- ! .\" @(#)lc.1 1.2 1/8/91 Kent Landfield;
- .TH LC 1 "Usenet Source"
- .SH NAME
- .B lc
- ***************
- *** 46,52 ****
- is used to switch the column width between 80 and 132 column display.
- .PP
- .B lc
- ! has incorporated the minimal the spell checking routines found in the book,
- The UNIX Programming Environment, by Brian Kernighan and Rob Pike.
- .PP
- If the command line argument list contains more than one name, the
- --- 46,52 ----
- is used to switch the column width between 80 and 132 column display.
- .PP
- .B lc
- ! has incorporated the minimal spell checking routines found in the book,
- The UNIX Programming Environment, by Brian Kernighan and Rob Pike.
- .PP
- If the command line argument list contains more than one name, the
- ***************
- *** 127,133 ****
- .IP "-1"
- List files one per line instead of in columns.
- .SH DIAGNOSTICS
- ! The "only" options can not be combined at this time.
- .PP
- The spell checking does not work when the CDPATH is searched for a
- file or directory not found in the current directory.
- --- 127,133 ----
- .IP "-1"
- List files one per line instead of in columns.
- .SH DIAGNOSTICS
- ! The "only" options can be combined.
- .PP
- The spell checking does not work when the CDPATH is searched for a
- file or directory not found in the current directory.
- ***************
- *** 142,147 ****
- .SH AUTHOR
- Kent Landfield <kent@sparky.IMD.Sterling.COM>
- .SH CREDITS
- ! Jeff Minnig <jeff@dsndata> and Rick Ohnemus <rick@sparky.IMD.Sterling.COM>
- ! were a *great* help with this program at different stages of its development...
- ! Thanks!
- --- 142,160 ----
- .SH AUTHOR
- Kent Landfield <kent@sparky.IMD.Sterling.COM>
- .SH CREDITS
- !
- ! .nr
- ! Jeff Minnig <jeff@dsndata>,
- ! .nf
- ! .nr
- ! Rick Ohnemus <rick@sparky.IMD.Sterling.COM>,
- ! .nf
- ! .nr
- ! Mike Peterson <root@alchemy.chem.utoronto.ca> and
- ! .nf
- ! .nr
- ! Ivan Fris <neumann.une.oz.au!ivan>
- ! .nf
- ! .nf
- ! were a *great* help with this program at different stages
- ! of its development... Thanks!
- diff -c ../lc.old/lc.c ./lc.c
- *** ../lc.old/lc.c Tue Jan 8 21:23:31 1991
- --- ./lc.c Tue Jan 8 21:20:38 1991
- ***************
- *** 48,54 ****
- ** -l Mark symbolic links with '@'
- ** -I Suppress unresolved symbolic link messages.
- **
- ! ** The "only" options can not be combined.
- ** If there is no 'directory' specified, the current directory is used.
- ** Not all options are supported on every system. (e.g. no symbolic links
- ** on your system ? Options -s, -L or -l won't be available..)
- --- 48,54 ----
- ** -l Mark symbolic links with '@'
- ** -I Suppress unresolved symbolic link messages.
- **
- ! ** The "only" options can be combined.
- ** If there is no 'directory' specified, the current directory is used.
- ** Not all options are supported on every system. (e.g. no symbolic links
- ** on your system ? Options -s, -L or -l won't be available..)
- ***************
- *** 70,79 ****
- ** Tested with AmigaDOS 1.3 on an Amiga 1000 in 1989.
- ** Tested with SunOS 4.0.3 on a Sparkstation 1 in 1989.
- ** Tested with AIX 3.+ on a Risc System/6000 in 1990.
- **
- */
- #ifndef lint
- ! static char *sccsid = "@(#)lc.c 1.23 9/7/90 Kent Landfield";
- #endif
-
- #include <stdio.h>
- --- 70,80 ----
- ** Tested with AmigaDOS 1.3 on an Amiga 1000 in 1989.
- ** Tested with SunOS 4.0.3 on a Sparkstation 1 in 1989.
- ** Tested with AIX 3.+ on a Risc System/6000 in 1990.
- + ** Ivan Fris added the ability to combine "only" options.
- **
- */
- #ifndef lint
- ! static char *sccsid = "@(#)lc.c 1.25 1/2/91 Kent Landfield";
- #endif
-
- #include <stdio.h>
- ***************
- *** 143,168 ****
- # define S_IXOTH (S_IEXEC >> 6)
- #endif
-
- ! #define DIR_ONLY 1
- ! #define FILE_ONLY 2
- #ifdef S_IFCHR
- ! # define CHAR_ONLY 3
- #endif
- #ifdef S_IFBLK
- ! # define BLOCK_ONLY 4
- #endif
- #ifdef S_IFIFO
- ! # define FIFO_ONLY 5
- #endif
- #ifdef S_IFLNK
- ! # define LNK_ONLY 6
- #endif
- #ifdef S_IFSOCK
- ! # define SOCK_ONLY 7
- #endif
- #ifdef S_IFNAM
- ! # define SEM_ONLY 8
- ! # define SD_ONLY 9
- #endif
-
- #ifdef BSD
- --- 144,169 ----
- # define S_IXOTH (S_IEXEC >> 6)
- #endif
-
- ! #define DIR_ONLY 1<<0
- ! #define FILE_ONLY 1<<2
- #ifdef S_IFCHR
- ! # define CHAR_ONLY 1<<3
- #endif
- #ifdef S_IFBLK
- ! # define BLOCK_ONLY 1<<4
- #endif
- #ifdef S_IFIFO
- ! # define FIFO_ONLY 1<<5
- #endif
- #ifdef S_IFLNK
- ! # define LNK_ONLY 1<<6
- #endif
- #ifdef S_IFSOCK
- ! # define SOCK_ONLY 1<<7
- #endif
- #ifdef S_IFNAM
- ! # define SEM_ONLY 1<<8
- ! # define SD_ONLY 1<<9
- #endif
-
- #ifdef BSD
- ***************
- *** 499,504 ****
- --- 500,508 ----
- ind++;
- }
- *frmt = '\0';
- + while (*--frmt == ' ') /* strip trailing blanks */
- + *frmt = '\0';
- +
- (void) puts(out_str);
- }
- return (ind);
- ***************
- *** 576,582 ****
-
- Current = 0;
-
- ! if (Lnks.num > 0 && (Disp_links == TRUE || Only == LNK_ONLY)) {
- ssing = Single;
- Single = TRUE;
- Current = LNK_ONLY;
- --- 580,586 ----
-
- Current = 0;
-
- ! if (Lnks.num > 0 && (Disp_links == TRUE || Only & LNK_ONLY)) {
- ssing = Single;
- Single = TRUE;
- Current = LNK_ONLY;
- ***************
- *** 586,622 ****
- #endif
-
- #ifdef S_IFSOCK
- ! if (Socks.num > 0 && (Only == 0 || Only == SOCK_ONLY))
- flag = pr_info("Sockets: ", &Socks, flag, Sort_wanted);
- #endif
-
- #ifdef S_IFNAM
- ! if (Sems.num > 0 && (Only == 0 || Only == SEM_ONLY))
- flag = pr_info("Semaphore Files: ", &Sems, flag, Sort_wanted);
-
- ! if (Sds.num > 0 && (Only == 0 || Only == SD_ONLY))
- flag = pr_info("Shared Data Files: ", &Sds, flag, Sort_wanted);
- #endif
-
- #ifdef S_IFIFO
- ! if (Fifos.num > 0 && (Only == 0 || Only == FIFO_ONLY))
- flag = pr_info("Fifo Files: ", &Fifos, flag, Sort_wanted);
- #endif
-
- #ifdef S_IFCHR
- ! if (Chrs.num > 0 && (Only == 0 || Only == CHAR_ONLY))
- flag = pr_info("Character Special Files: ", &Chrs, flag, Sort_wanted);
- #endif
-
- #ifdef S_IFBLK
- ! if (Blks.num > 0 && (Only == 0 || Only == BLOCK_ONLY))
- flag = pr_info("Block Special Files: ", &Blks, flag, Sort_wanted);
- #endif
-
- ! if (Dirs.num > 0 && (Only == 0 || Only == DIR_ONLY))
- flag = pr_info("Directories: ", &Dirs, flag, Sort_wanted);
-
- ! if (Fls.num > 0 && (Only == 0 || Only == FILE_ONLY))
- flag = pr_info("Files: ", &Fls, flag, Sort_wanted);
-
- return;
- --- 590,626 ----
- #endif
-
- #ifdef S_IFSOCK
- ! if (Socks.num > 0 && (Only == 0 || Only & SOCK_ONLY))
- flag = pr_info("Sockets: ", &Socks, flag, Sort_wanted);
- #endif
-
- #ifdef S_IFNAM
- ! if (Sems.num > 0 && (Only == 0 || Only & SEM_ONLY))
- flag = pr_info("Semaphore Files: ", &Sems, flag, Sort_wanted);
-
- ! if (Sds.num > 0 && (Only == 0 || Only & SD_ONLY))
- flag = pr_info("Shared Data Files: ", &Sds, flag, Sort_wanted);
- #endif
-
- #ifdef S_IFIFO
- ! if (Fifos.num > 0 && (Only == 0 || Only & FIFO_ONLY))
- flag = pr_info("Fifo Files: ", &Fifos, flag, Sort_wanted);
- #endif
-
- #ifdef S_IFCHR
- ! if (Chrs.num > 0 && (Only == 0 || Only & CHAR_ONLY))
- flag = pr_info("Character Special Files: ", &Chrs, flag, Sort_wanted);
- #endif
-
- #ifdef S_IFBLK
- ! if (Blks.num > 0 && (Only == 0 || Only & BLOCK_ONLY))
- flag = pr_info("Block Special Files: ", &Blks, flag, Sort_wanted);
- #endif
-
- ! if (Dirs.num > 0 && (Only == 0 || Only & DIR_ONLY))
- flag = pr_info("Directories: ", &Dirs, flag, Sort_wanted);
-
- ! if (Fls.num > 0 && (Only == 0 || Only & FILE_ONLY))
- flag = pr_info("Files: ", &Fls, flag, Sort_wanted);
-
- return;
- ***************
- *** 976,990 ****
- break;
-
- case 'b':
- ! Only = BLOCK_ONLY;
- break;
-
- case 'c':
- ! Only = CHAR_ONLY;
- break;
-
- case 'd':
- ! Only = DIR_ONLY;
- break;
-
- case 'D':
- --- 980,994 ----
- break;
-
- case 'b':
- ! Only |= BLOCK_ONLY;
- break;
-
- case 'c':
- ! Only |= CHAR_ONLY;
- break;
-
- case 'd':
- ! Only |= DIR_ONLY;
- break;
-
- case 'D':
- ***************
- *** 996,1002 ****
- break;
-
- case 'f':
- ! Only = FILE_ONLY;
- break;
-
- case 'r':
- --- 1000,1006 ----
- break;
-
- case 'f':
- ! Only |= FILE_ONLY;
- break;
-
- case 'r':
- ***************
- *** 1005,1011 ****
-
- #ifdef S_IFIFO
- case 'F':
- ! Only = FIFO_ONLY;
- break;
- #endif
-
- --- 1009,1015 ----
-
- #ifdef S_IFIFO
- case 'F':
- ! Only |= FIFO_ONLY;
- break;
- #endif
-
- ***************
- *** 1015,1021 ****
-
- #ifdef S_IFLNK
- case 's':
- ! Only = LNK_ONLY;
- break;
-
- case 'l':
- --- 1019,1025 ----
-
- #ifdef S_IFLNK
- case 's':
- ! Only |= LNK_ONLY;
- break;
-
- case 'l':
- ***************
- *** 1033,1049 ****
-
- #ifdef S_IFSOCK
- case 'S':
- ! Only = SOCK_ONLY;
- break;
- #endif
-
- #ifdef S_IFNAM
- case 'm':
- ! Only = SD_ONLY;
- break;
-
- case 'M':
- ! Only = SEM_ONLY;
- break;
- #endif
-
- --- 1037,1053 ----
-
- #ifdef S_IFSOCK
- case 'S':
- ! Only |= SOCK_ONLY;
- break;
- #endif
-
- #ifdef S_IFNAM
- case 'm':
- ! Only |= SD_ONLY;
- break;
-
- case 'M':
- ! Only |= SEM_ONLY;
- break;
- #endif
-
-