comm.c (78718) | comm.c (87213) |
---|---|
1/* 2 * Copyright (c) 1989, 1993, 1994 3 * The Regents of the University of California. All rights reserved. 4 * 5 * This code is derived from software contributed to Berkeley by 6 * Case Larsen. 7 * 8 * Redistribution and use in source and binary forms, with or without --- 31 unchanged lines hidden (view full) --- 40 The Regents of the University of California. All rights reserved.\n"; 41#endif /* not lint */ 42 43#ifndef lint 44#if 0 45static char sccsid[] = "From: @(#)comm.c 8.4 (Berkeley) 5/4/95"; 46#endif 47static const char rcsid[] = | 1/* 2 * Copyright (c) 1989, 1993, 1994 3 * The Regents of the University of California. All rights reserved. 4 * 5 * This code is derived from software contributed to Berkeley by 6 * Case Larsen. 7 * 8 * Redistribution and use in source and binary forms, with or without --- 31 unchanged lines hidden (view full) --- 40 The Regents of the University of California. All rights reserved.\n"; 41#endif /* not lint */ 42 43#ifndef lint 44#if 0 45static char sccsid[] = "From: @(#)comm.c 8.4 (Berkeley) 5/4/95"; 46#endif 47static const char rcsid[] = |
48 "$FreeBSD: head/usr.bin/comm/comm.c 78718 2001-06-24 19:50:42Z dd $"; | 48 "$FreeBSD: head/usr.bin/comm/comm.c 87213 2001-12-02 13:18:59Z markm $"; |
49#endif /* not lint */ 50 51#include <ctype.h> 52#include <err.h> 53#include <limits.h> 54#include <locale.h> 55#include <stdio.h> 56#include <stdlib.h> 57#include <string.h> 58#include <unistd.h> 59 60#define MAXLINELEN (LINE_MAX + 1) 61 | 49#endif /* not lint */ 50 51#include <ctype.h> 52#include <err.h> 53#include <limits.h> 54#include <locale.h> 55#include <stdio.h> 56#include <stdlib.h> 57#include <string.h> 58#include <unistd.h> 59 60#define MAXLINELEN (LINE_MAX + 1) 61 |
62char *tabs[] = { "", "\t", "\t\t" }; | 62const char *tabs[] = { "", "\t", "\t\t" }; |
63 64FILE *file __P((char *)); | 63 64FILE *file __P((char *)); |
65void show __P((FILE *, char *, char *)); | 65void show __P((FILE *, const char *, char *)); |
66int stricoll __P((char *, char *)); 67static void usage __P((void)); 68 69int 70main(argc, argv) 71 int argc; 72 char *argv[]; 73{ 74 int comp, file1done = 0, file2done = 0, read1, read2; 75 int ch, flag1, flag2, flag3, iflag; 76 FILE *fp1, *fp2; | 66int stricoll __P((char *, char *)); 67static void usage __P((void)); 68 69int 70main(argc, argv) 71 int argc; 72 char *argv[]; 73{ 74 int comp, file1done = 0, file2done = 0, read1, read2; 75 int ch, flag1, flag2, flag3, iflag; 76 FILE *fp1, *fp2; |
77 char *col1, *col2, *col3; 78 char **p, line1[MAXLINELEN], line2[MAXLINELEN]; | 77 const char *col1, *col2, *col3; 78 char line1[MAXLINELEN], line2[MAXLINELEN]; 79 const char **p; |
79 80 flag1 = flag2 = flag3 = 1; 81 iflag = 0; 82 83 (void) setlocale(LC_CTYPE, ""); 84 85 while ((ch = getopt(argc, argv, "-123i")) != -1) 86 switch(ch) { --- 81 unchanged lines hidden (view full) --- 168 } 169 } 170 exit(0); 171} 172 173void 174show(fp, offset, buf) 175 FILE *fp; | 80 81 flag1 = flag2 = flag3 = 1; 82 iflag = 0; 83 84 (void) setlocale(LC_CTYPE, ""); 85 86 while ((ch = getopt(argc, argv, "-123i")) != -1) 87 switch(ch) { --- 81 unchanged lines hidden (view full) --- 169 } 170 } 171 exit(0); 172} 173 174void 175show(fp, offset, buf) 176 FILE *fp; |
176 char *offset, *buf; | 177 const char *offset; 178 char *buf; |
177{ 178 179 do { 180 (void)printf("%s%s", offset, buf); 181 } while (fgets(buf, MAXLINELEN, fp)); 182} 183 184FILE * --- 34 unchanged lines hidden --- | 179{ 180 181 do { 182 (void)printf("%s%s", offset, buf); 183 } while (fgets(buf, MAXLINELEN, fp)); 184} 185 186FILE * --- 34 unchanged lines hidden --- |