From owner-p4-projects@FreeBSD.ORG Wed Oct 22 19:38:57 2003 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 3975216A4C0; Wed, 22 Oct 2003 19:38:57 -0700 (PDT) Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 0DD3B16A4B3 for ; Wed, 22 Oct 2003 19:38:57 -0700 (PDT) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id AF0C543FA3 for ; Wed, 22 Oct 2003 19:38:54 -0700 (PDT) (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.12.9/8.12.9) with ESMTP id h9N2csXJ061084 for ; Wed, 22 Oct 2003 19:38:54 -0700 (PDT) (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.12.9/8.12.9/Submit) id h9N2csI3061068 for perforce@freebsd.org; Wed, 22 Oct 2003 19:38:54 -0700 (PDT) (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Date: Wed, 22 Oct 2003 19:38:54 -0700 (PDT) Message-Id: <200310230238.h9N2csI3061068@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to bb+lists.freebsd.perforce@cyrus.watson.org using -f From: Robert Watson To: Perforce Change Reviews Subject: PERFORCE change 40246 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 23 Oct 2003 02:38:57 -0000 http://perforce.freebsd.org/chv.cgi?CH=40246 Change 40246 by rwatson@rwatson_paprika on 2003/10/22 19:38:15 Integrate trustedbsd_sebsd usr.bin tree forward to 39070, the last major integration of the trustedbsd_mac branch, which brings in many of the major changes in the last four months to the main FreeBSD tree. This includes substantial lock pushdown, threading bug fixes, compiler upgrades, et al. Affected files ... .. //depot/projects/trustedbsd/sebsd/usr.bin/Makefile#4 integrate .. //depot/projects/trustedbsd/sebsd/usr.bin/calendar/calendars/calendar.australia#4 integrate .. //depot/projects/trustedbsd/sebsd/usr.bin/calendar/calendars/calendar.birthday#4 integrate .. //depot/projects/trustedbsd/sebsd/usr.bin/calendar/calendars/calendar.freebsd#4 integrate .. //depot/projects/trustedbsd/sebsd/usr.bin/calendar/calendars/calendar.holiday#2 integrate .. //depot/projects/trustedbsd/sebsd/usr.bin/calendar/calendars/calendar.music#2 integrate .. //depot/projects/trustedbsd/sebsd/usr.bin/chat/chat.c#2 integrate .. //depot/projects/trustedbsd/sebsd/usr.bin/colldef/colldef.1#2 integrate .. //depot/projects/trustedbsd/sebsd/usr.bin/doscmd/doscmd.1#2 integrate .. //depot/projects/trustedbsd/sebsd/usr.bin/elfdump/elfdump.c#3 integrate .. //depot/projects/trustedbsd/sebsd/usr.bin/fetch/fetch.1#4 integrate .. //depot/projects/trustedbsd/sebsd/usr.bin/file/file.1#4 integrate .. //depot/projects/trustedbsd/sebsd/usr.bin/fstat/msdosfs.c#4 integrate .. //depot/projects/trustedbsd/sebsd/usr.bin/getconf/confstr.gperf#2 integrate .. //depot/projects/trustedbsd/sebsd/usr.bin/getconf/fake-gperf.awk#2 integrate .. //depot/projects/trustedbsd/sebsd/usr.bin/getconf/getconf.1#2 integrate .. //depot/projects/trustedbsd/sebsd/usr.bin/getconf/getconf.c#4 integrate .. //depot/projects/trustedbsd/sebsd/usr.bin/getconf/limits.gperf#2 integrate .. //depot/projects/trustedbsd/sebsd/usr.bin/getconf/pathconf.gperf#2 integrate .. //depot/projects/trustedbsd/sebsd/usr.bin/getconf/progenv.gperf#2 integrate .. //depot/projects/trustedbsd/sebsd/usr.bin/getconf/sysconf.gperf#2 integrate .. //depot/projects/trustedbsd/sebsd/usr.bin/killall/killall.c#4 integrate .. //depot/projects/trustedbsd/sebsd/usr.bin/last/last.1#4 integrate .. //depot/projects/trustedbsd/sebsd/usr.bin/last/last.c#4 integrate .. //depot/projects/trustedbsd/sebsd/usr.bin/lock/lock.c#4 integrate .. //depot/projects/trustedbsd/sebsd/usr.bin/make/cond.c#4 integrate .. //depot/projects/trustedbsd/sebsd/usr.bin/make/dir.c#2 integrate .. //depot/projects/trustedbsd/sebsd/usr.bin/make/dir.h#2 integrate .. //depot/projects/trustedbsd/sebsd/usr.bin/make/for.c#2 integrate .. //depot/projects/trustedbsd/sebsd/usr.bin/make/main.c#4 integrate .. //depot/projects/trustedbsd/sebsd/usr.bin/make/make.1#4 integrate .. //depot/projects/trustedbsd/sebsd/usr.bin/make/var.c#4 integrate .. //depot/projects/trustedbsd/sebsd/usr.bin/mklocale/lex.l#2 integrate .. //depot/projects/trustedbsd/sebsd/usr.bin/mklocale/mklocale.1#4 integrate .. //depot/projects/trustedbsd/sebsd/usr.bin/mkstr/mkstr.1#2 integrate .. //depot/projects/trustedbsd/sebsd/usr.bin/mt/mt.1#4 integrate .. //depot/projects/trustedbsd/sebsd/usr.bin/netstat/inet.c#4 integrate .. //depot/projects/trustedbsd/sebsd/usr.bin/netstat/main.c#4 integrate .. //depot/projects/trustedbsd/sebsd/usr.bin/netstat/mroute.c#3 integrate .. //depot/projects/trustedbsd/sebsd/usr.bin/netstat/netstat.1#4 integrate .. //depot/projects/trustedbsd/sebsd/usr.bin/netstat/netstat.h#4 integrate .. //depot/projects/trustedbsd/sebsd/usr.bin/nl/nl.c#2 integrate .. //depot/projects/trustedbsd/sebsd/usr.bin/ranlib/Makefile#2 delete .. //depot/projects/trustedbsd/sebsd/usr.bin/ranlib/build.c#2 delete .. //depot/projects/trustedbsd/sebsd/usr.bin/ranlib/extern.h#2 delete .. //depot/projects/trustedbsd/sebsd/usr.bin/ranlib/misc.c#2 delete .. //depot/projects/trustedbsd/sebsd/usr.bin/ranlib/pathnames.h#2 delete .. //depot/projects/trustedbsd/sebsd/usr.bin/ranlib/ranlib.1#2 delete .. //depot/projects/trustedbsd/sebsd/usr.bin/ranlib/ranlib.1aout#2 delete .. //depot/projects/trustedbsd/sebsd/usr.bin/ranlib/ranlib.5#2 delete .. //depot/projects/trustedbsd/sebsd/usr.bin/ranlib/ranlib.c#2 delete .. //depot/projects/trustedbsd/sebsd/usr.bin/ranlib/touch.c#2 delete .. //depot/projects/trustedbsd/sebsd/usr.bin/rlogin/rlogin.1#2 integrate .. //depot/projects/trustedbsd/sebsd/usr.bin/rlogin/rlogin.c#2 integrate .. //depot/projects/trustedbsd/sebsd/usr.bin/rpcinfo/rpcinfo.c#2 integrate .. //depot/projects/trustedbsd/sebsd/usr.bin/rsh/rsh.c#2 integrate .. //depot/projects/trustedbsd/sebsd/usr.bin/script/script.1#2 integrate .. //depot/projects/trustedbsd/sebsd/usr.bin/su/su.1#4 integrate .. //depot/projects/trustedbsd/sebsd/usr.bin/symorder/Makefile#2 delete .. //depot/projects/trustedbsd/sebsd/usr.bin/symorder/symorder.1#4 delete .. //depot/projects/trustedbsd/sebsd/usr.bin/symorder/symorder.c#2 delete .. //depot/projects/trustedbsd/sebsd/usr.bin/tail/forward.c#2 integrate .. //depot/projects/trustedbsd/sebsd/usr.bin/talk/ctl.c#2 integrate .. //depot/projects/trustedbsd/sebsd/usr.bin/talk/io.c#2 integrate .. //depot/projects/trustedbsd/sebsd/usr.bin/talk/look_up.c#2 integrate .. //depot/projects/trustedbsd/sebsd/usr.bin/tcopy/tcopy.1#4 integrate .. //depot/projects/trustedbsd/sebsd/usr.bin/tftp/main.c#4 integrate .. //depot/projects/trustedbsd/sebsd/usr.bin/tftp/tftp.1#2 integrate .. //depot/projects/trustedbsd/sebsd/usr.bin/tip/tip/tip.1#4 integrate .. //depot/projects/trustedbsd/sebsd/usr.bin/truss/main.c#2 integrate .. //depot/projects/trustedbsd/sebsd/usr.bin/truss/setup.c#2 integrate .. //depot/projects/trustedbsd/sebsd/usr.bin/tsort/tsort.c#2 integrate .. //depot/projects/trustedbsd/sebsd/usr.bin/w/w.c#4 integrate .. //depot/projects/trustedbsd/sebsd/usr.bin/window/main.c#2 integrate Differences ... ==== //depot/projects/trustedbsd/sebsd/usr.bin/Makefile#4 (text+ko) ==== @@ -1,5 +1,5 @@ # From: @(#)Makefile 8.3 (Berkeley) 1/7/94 -# $FreeBSD: src/usr.bin/Makefile,v 1.245 2003/07/24 18:30:24 markm Exp $ +# $FreeBSD: src/usr.bin/Makefile,v 1.250 2003/09/24 00:43:48 marcel Exp $ # XXX MISSING: deroff diction graph learn plot # spell spline struct xsend @@ -8,14 +8,25 @@ # .if ${MACHINE_ARCH} != "ia64" +.if !defined(NO_TOOLCHAIN) _xlint= xlint .endif +.endif .if ${MACHINE_ARCH} != "powerpc" && ${MACHINE_ARCH} != "amd64" +.if !defined(NO_TOOLCHAIN) _gprof= gprof +.endif _truss= truss .endif +.if !defined(NO_TOOLCHAIN) +_c89= c89 +_c99= c99 +_lex= lex +_yacc= yacc +.endif + SUBDIR= alias \ apply \ asa \ @@ -27,8 +38,8 @@ brandelf \ bzip2 \ bzip2recover \ - c89 \ - c99 \ + ${_c89} \ + ${_c99} \ calendar \ cap_mkdb \ catman \ @@ -96,7 +107,7 @@ less \ lessecho \ lesskey \ - lex \ + ${_lex} \ limits \ locale \ locate \ @@ -160,7 +171,6 @@ split \ stat \ su \ - symorder \ systat \ tabs \ tail \ @@ -188,8 +198,6 @@ uniq \ units \ unvis \ - usbhidaction \ - usbhidctl \ users \ uudecode \ uuencode \ @@ -212,7 +220,7 @@ xinstall \ ${_xlint} \ xstr \ - yacc \ + ${_yacc} \ yes \ ypcat \ ypmatch \ @@ -229,6 +237,11 @@ SUBDIR+=vacation .endif +.if !defined(NO_USB) +SUBDIR+=usbhidaction \ + usbhidctl +.endif + .if ${MACHINE_ARCH} == "i386" # Things that don't compile on alpha or are aout specific: SUBDIR+=doscmd \ ==== //depot/projects/trustedbsd/sebsd/usr.bin/calendar/calendars/calendar.australia#4 (text+ko) ==== @@ -1,15 +1,16 @@ /* * Australian holidays * - * $FreeBSD: src/usr.bin/calendar/calendars/calendar.australia,v 1.3 2002/12/25 23:15:36 grog Exp $ + * $FreeBSD: src/usr.bin/calendar/calendars/calendar.australia,v 1.4 2003/10/01 00:58:35 grog Exp $ */ #ifndef _calendar_australia_ #define _calendar_australia_ /* Australia */ -Jan 28 Australia Day Holiday (Australia, except NSW, Vic) -Jun 10 Queen's Birthday Holiday (Australia, except WA) +Jan 26 Australia Day +Apr 25 Anzac Day +Jun/MonSecond Queen's Birthday Holiday (Australia, except WA) /* ACT, NSW, common */ Mar 18 Canberra Day (ACT) @@ -29,7 +30,7 @@ Nov 04 Recreation Day (N Tas) /* South Australia */ -May 20 Adelaide Cup (SA) +May/MonThird Adelaide Cup (SA) Dec 26 Proclamation Day holiday (SA) /* Western Australia */ ==== //depot/projects/trustedbsd/sebsd/usr.bin/calendar/calendars/calendar.birthday#4 (text+ko) ==== @@ -1,7 +1,7 @@ /* * Birthday * - * $FreeBSD: src/usr.bin/calendar/calendars/calendar.birthday,v 1.24 2003/08/06 03:38:12 grog Exp $ + * $FreeBSD: src/usr.bin/calendar/calendars/calendar.birthday,v 1.25 2003/08/13 19:21:11 murray Exp $ */ #ifndef _calendar_birthday_ @@ -179,6 +179,7 @@ 08/06 Jonathan B. Postel is born in Altadena, California, 1943 08/08 Dustin Hoffman born in Los Angeles, 1937 08/12 Thomas Mann's Death, 1955 +08/13 Alfred Hitchcock born, 1899 08/13 Annie Oakley born, 1860 08/13 Fidel Castro born, 1927 08/17 Mae West born, 1892 ==== //depot/projects/trustedbsd/sebsd/usr.bin/calendar/calendars/calendar.freebsd#4 (text+ko) ==== @@ -1,7 +1,7 @@ /* * FreeBSD * - * $FreeBSD: src/usr.bin/calendar/calendars/calendar.freebsd,v 1.104 2003/07/21 10:43:37 krion Exp $ + * $FreeBSD: src/usr.bin/calendar/calendars/calendar.freebsd,v 1.106 2003/08/15 12:02:31 mat Exp $ */ #ifndef _calendar_freebsd_ @@ -38,6 +38,7 @@ 02/21 Alexey Zelkin born in Simferopol, Ukraine, 1978 02/22 Brooks Davis born in Longview, Washington, United States, 1976 02/22 Jake Burkholder born in Maynooth, Ontario, Canada, 1979 +02/23 Mathieu Arnold born in Champigny sur Marne, Val de Marne, France, 1978 02/23 Peter Wemm born in Perth, Western Australia, Australia, 1971 02/24 Johan Karlsson born in Mariannelund, Sweden, 1974 02/28 Daichi GOTO born in Shimizu Suntou, Shizuoka, Japan, 1980 @@ -119,6 +120,7 @@ 07/22 James Housley born in Chicago, Illinois, United States, 1965 07/22 Jens Schweikhardt born in Waiblingen, Baden-Wuerttemberg, Germany, 1967 07/23 Sergey A. Osokin born in Krasnogorsky, Stepnogorsk, Akmolinskaya region, Kazakhstan, 1972 +07/24 Alexander Nedotsukov born in Ulyanovsk, Russian Federation, 1974 07/28 Jim Mock born in Bethlehem, Pennsylvania, United States, 1974 07/28 Tom Hukins born in Manchester, United Kingdom, 1976 07/29 Dirk Meyer born in Kassel, Hessen, Germany, 1965 ==== //depot/projects/trustedbsd/sebsd/usr.bin/calendar/calendars/calendar.holiday#2 (text+ko) ==== @@ -1,7 +1,7 @@ /* * Holiday * - * $FreeBSD: src/usr.bin/calendar/calendars/calendar.holiday,v 1.23 2002/11/19 00:29:36 grog Exp $ + * $FreeBSD: src/usr.bin/calendar/calendars/calendar.holiday,v 1.27 2003/10/01 00:57:49 grog Exp $ */ #ifndef _calendar_holiday_ @@ -36,7 +36,6 @@ 01/23 Feast of St. Ildefonsus 01/23 US National Handwriting Day 01/24 Economic Liberation Day in Togo -01/26 Australia Day in Australia 01/26 Republic Day in India 01/MonSecond Adults Day in Japan 01/MonThird Lee-Jackson Day in Virginia (3rd Monday) @@ -400,15 +399,14 @@ 09/26 Revolution Anniversary Day in Yemen 09/27 Feast of Finding the True Cross in Ethiopia 09/28 Confucius' Day in Taiwan +09/29 Michaelmas 09/29 Battle of Boqueron in Paraguay 09/30 Botswana Day in Botswana -09/MonSecond Respect for the Aged Day in Japan +09/MonThird Respect for the Aged Day in Japan 10/01 Armed Forces Day in South Korea 10/01 Independence Day in Nigeria -10/01 Labour Day in Australia (ACT, NSW and SA only) 10/01 National Liberation Day (2 days) in China 10/01 Public Holiday in Botswana -10/01 Queen's Birthday in Western Australia 10/02 Anniversary of Guinean Independence in Guinea 10/03 Chung Yeung Festival in Hong Kong 10/03 Francisco Morazan's Birthday in Honduras @@ -453,6 +451,7 @@ 10/24 Independence Day in Zambia 10/24 United Nations Day 10/25 Taiwan Restoration Day in Taiwan +10/25 St. Crispin's day, patron saint of shoemakers 10/26 Agam Day in Nauru 10/26 Armed Forces Day in Benin and Rwanda 10/26 National Day in Austria ==== //depot/projects/trustedbsd/sebsd/usr.bin/calendar/calendars/calendar.music#2 (text+ko) ==== @@ -1,7 +1,7 @@ /* * Music * - * $FreeBSD: src/usr.bin/calendar/calendars/calendar.music,v 1.11 2002/07/28 00:42:02 grog Exp $ + * $FreeBSD: src/usr.bin/calendar/calendars/calendar.music,v 1.12 2003/10/01 00:59:13 grog Exp $ */ #ifndef _calendar_music_ @@ -116,8 +116,7 @@ 07/28 Antonio Vivaldi dies in Vienna, 1741 07/28 The Watkins Glen "Summer Jam" opens, 1973 08/01 The Concert for Bangla Desh takes place at Madison Square Garden, 1971 -08/04 John Lennon points out that "the Beatles are more popular than Jesus", - 1966 +08/04 John Lennon points out that "the Beatles are more popular than Jesus", 1966 08/10 Ian Anderson (Jethro Tull) is born in Edinburgh, Scotland, 1947 08/13 Dan Fogelberg is born in Peoria, Illinois, 1951 08/15 Beatles replace drummer Pete Best with Richard Starkey ==== //depot/projects/trustedbsd/sebsd/usr.bin/chat/chat.c#2 (text+ko) ==== @@ -77,35 +77,23 @@ * */ -#ifndef lint -static const char rcsid[] = - "$FreeBSD: src/usr.bin/chat/chat.c,v 1.19 2002/08/25 13:22:33 charnier Exp $"; -#endif +#include +__FBSDID("$FreeBSD: src/usr.bin/chat/chat.c,v 1.20 2003/08/22 17:47:40 markm Exp $"); -#include +#include +#include #include -#include +#include #include #include -#include +#include +#include +#include #include -#include -#include -#include -#include #include - -#ifndef TERMIO -#undef TERMIOS -#define TERMIOS -#endif - -#ifdef TERMIO -#include -#endif -#ifdef TERMIOS #include -#endif +#include +#include #define STR_LEN 1024 @@ -113,27 +101,16 @@ #define SIGTYPE void #endif -#include - #ifndef O_NONBLOCK #define O_NONBLOCK O_NDELAY #endif -#ifdef SUNOS -extern int sys_nerr; -extern char *sys_errlist[]; -#define memmove(to, from, n) bcopy(from, to, n) -#define strerror(n) ((unsigned)(n) < sys_nerr? sys_errlist[(n)] :\ - "unknown error") -#endif - /*************** Micro getopt() *********************************************/ #define OPTION(c,v) (_O&2&&**v?*(*v)++:!c||_O&4?0:(!(_O&1)&& \ (--c,++v),_O=4,c&&**v=='-'&&v[0][1]?*++*v=='-'\ &&!v[0][1]?(--c,++v,0):(_O=2,*(*v)++):0)) #define OPTARG(c,v) (_O&2?**v||(++v,--c)?(_O=1,--c,*v++): \ (_O=4,(char*)0):(char*)0) -#define OPTONLYARG(c,v) (_O&2&&**v?(_O=1,--c,*v++):(char*)0) #define ARG(c,v) (c?(--c,*v++):(char*)0) static int _O = 0; /* Internal state */ @@ -149,7 +126,6 @@ int to_stderr = 0; int Verbose = 0; int quiet = 0; -int report = 0; int exit_code = 0; FILE* report_fp = (FILE *) 0; char *report_file = (char *) 0; @@ -158,21 +134,14 @@ char *phone_num2 = (char *) 0; int timeout = DEFAULT_CHAT_TIMEOUT; +static char blank[] = ""; + int have_tty_parameters = 0; -#ifdef TERMIO -#define term_parms struct termio -#define get_term_param(param) ioctl(0, TCGETA, param) -#define set_term_param(param) ioctl(0, TCSETA, param) -struct termio saved_tty_parameters; -#endif - -#ifdef TERMIOS #define term_parms struct termios #define get_term_param(param) tcgetattr(0, param) #define set_term_param(param) tcsetattr(0, TCSANOW, param) struct termios saved_tty_parameters; -#endif char *abort_string[MAX_ABORTS], *fail_reason = (char *)0, fail_buffer[50]; @@ -195,31 +164,27 @@ SIGTYPE sigint(int signo); SIGTYPE sigterm(int signo); SIGTYPE sighup(int signo); -void unalarm(void); void init(void); void set_tty_parameters(void); void echo_stderr(int); void break_sequence(void); void terminate(int status); -void do_file(char *chat_file); -int get_string(register char *string); -int put_string(register char *s); +void do_file(char *chatfile); +int get_string(char *string); +int put_string(char *s); int write_char(int c); int put_char(int c); int get_char(void); -void chat_send(register char *s); +void chat_send(char *s); char *character(int c); -void chat_expect(register char *s); -char *clean(register char *s, int sending); -void break_sequence(void); -void terminate(int status); +void chat_expect(char *s); +char *clean(char *s, int sending); void pack_array(char **array, int end); -char *expect_strtok(char *, char *); +char *expect_strtok(char *, const char *); int vfmtmsg(char *, int, const char *, va_list); /* vsprintf++ */ -void *dup_mem(b, c) -void *b; -size_t c; +void * +dup_mem(void *b, size_t c) { void *ans = malloc (c); if (!ans) @@ -229,8 +194,8 @@ return ans; } -void *copy_of (s) -char *s; +void * +copy_of(char *s) { return dup_mem (s, strlen (s) + 1); } @@ -243,9 +208,7 @@ * Perform a UUCP-dialer-like chat script on stdin and stdout. */ int -main(argc, argv) - int argc; - char **argv; +main(int argc, char *argv[]) { int option; char *arg; @@ -299,7 +262,6 @@ if (verbose) fprintf (report_fp, "Opening \"%s\"...\n", report_file); - report = 1; } } break; @@ -330,16 +292,12 @@ report_fp = stderr; if (to_log) { -#ifdef ultrix - openlog("chat", LOG_PID); -#else openlog("chat", LOG_PID | LOG_NDELAY, LOG_LOCAL2); if (verbose) setlogmask(LOG_UPTO(LOG_INFO)); else setlogmask(LOG_UPTO(LOG_WARNING)); -#endif } init(); @@ -367,17 +325,17 @@ * Process a chat script when read from a file. */ -void do_file (chat_file) -char *chat_file; +void +do_file(char *chatfile) { int linect, sendflg; char *sp, *arg, quote; char buf [STR_LEN]; FILE *cfp; - cfp = fopen (chat_file, "r"); + cfp = fopen (chatfile, "r"); if (cfp == NULL) - fatal(1, "%s -- open failed: %m", chat_file); + fatal(1, "%s -- open failed: %m", chatfile); linect = 0; sendflg = 0; @@ -437,7 +395,7 @@ * We got an error parsing the command line. */ static void -usage() +usage(void) { fprintf(stderr, "\ Usage: chat [-e] [-v] [-V] [-t timeout] [-r report-file] [-T phone-number]\n\ @@ -450,7 +408,8 @@ /* * Send a message to syslog and/or stderr. */ -void logf(const char *fmt, ...) +void +logf(const char *fmt, ...) { va_list args; @@ -466,7 +425,8 @@ * Print an error message and terminate. */ -void fatal(int code, const char *fmt, ...) +void +fatal(int code, const char *fmt, ...) { va_list args; @@ -481,8 +441,7 @@ int alarmed = 0; -SIGTYPE sigalrm(signo) -int signo; +SIGTYPE sigalrm(int signo __unused) { int flags; @@ -500,36 +459,22 @@ logf("alarm"); } -void unalarm() -{ - int flags; - - if ((flags = fcntl(0, F_GETFL, 0)) == -1) - fatal(2, "Can't get file mode flags on stdin: %m"); - - if (fcntl(0, F_SETFL, flags & ~O_NONBLOCK) == -1) - fatal(2, "Can't set file mode flags on stdin: %m"); -} - -SIGTYPE sigint(signo) -int signo; +SIGTYPE sigint(int signo __unused) { fatal(2, "SIGINT"); } -SIGTYPE sigterm(signo) -int signo; +SIGTYPE sigterm(int signo __unused) { fatal(2, "SIGTERM"); } -SIGTYPE sighup(signo) -int signo; +SIGTYPE sighup(int signo __unused) { fatal(2, "SIGHUP"); } -void init() +void init(void) { signal(SIGINT, sigint); signal(SIGTERM, sigterm); @@ -541,7 +486,7 @@ alarmed = 0; } -void set_tty_parameters() +void set_tty_parameters(void) { #if defined(get_term_param) term_parms t; @@ -565,15 +510,12 @@ #endif } -void break_sequence() +void break_sequence(void) { -#ifdef TERMIOS tcsendbreak (0, 0); -#endif } -void terminate(status) -int status; +void terminate(int status) { echo_stderr(-1); if (report_file != (char *) 0 && report_fp != (FILE *) NULL) { @@ -581,7 +523,8 @@ * Allow the last of the report string to be gathered before we terminate. */ if (report_gathering) { - int c, rep_len; + int c; + size_t rep_len; rep_len = strlen(report_buffer); while (rep_len + 1 <= sizeof(report_buffer)) { @@ -615,18 +558,17 @@ /* * 'Clean up' this string. */ -char *clean(s, sending) -register char *s; -int sending; /* set to 1 when sending (putting) this string. */ +char * +clean(char *s, int sending) { char temp[STR_LEN], cur_chr; - register char *s1, *phchar; + char *s1, *phchar; int add_return = sending; #define isoctal(chr) (((chr) >= '0') && ((chr) <= '7')) s1 = temp; /* Don't overflow buffer, leave room for chars we append later */ - while (*s && s1 - temp < sizeof(temp) - 2 - add_return) { + while (*s && s1 - temp < (off_t)(sizeof(temp) - 2 - add_return)) { cur_chr = *s++; if (cur_chr == '^') { cur_chr = *s++; @@ -767,10 +709,10 @@ * A modified version of 'strtok'. This version skips \ sequences. */ -char *expect_strtok (s, term) - char *s, *term; +char * +expect_strtok (char *s, const char *term) { - static char *str = ""; + static char *str = blank; int escape_flag = 0; char *result; @@ -822,8 +764,8 @@ * Process the expect string */ -void chat_expect (s) -char *s; +void +chat_expect(char *s) { char *expect; char *reply; @@ -911,11 +853,11 @@ * the data. */ -char *character(c) -int c; +char * +character(int c) { static char string[10]; - char *meta; + const char *meta; meta = (c & 0x80) ? "M-" : ""; c &= 0x7F; @@ -933,8 +875,8 @@ /* * process the reply string */ -void chat_send (s) -register char *s; +void +chat_send(char *s) { if (say_next) { say_next = 0; @@ -1075,15 +1017,16 @@ } if (strcmp(s, "EOT") == 0) - s = "^D\\c"; + s = strdup("^D\\c"); else if (strcmp(s, "BREAK") == 0) - s = "\\K\\c"; + s = strdup("\\K\\c"); if (!put_string(s)) fatal(1, "Failed"); } -int get_char() +int +get_char(void) { int status; char c; @@ -1108,8 +1051,7 @@ } } -int put_char(c) -int c; +int put_char(int c) { int status; char ch = c; @@ -1136,8 +1078,8 @@ } } -int write_char (c) -int c; +int +write_char(int c) { if (alarmed || put_char(c) < 0) { alarm(0); @@ -1154,23 +1096,19 @@ return (1); } -int put_string (s) -register char *s; +int +put_string(char *s) { quiet = 0; s = clean(s, 1); - if (verbose) { - if (quiet) - logf("send (??????)"); - else - logf("send (%v)", s); - } + if (verbose) + logf("send (%v)", quiet ? "??????" : s); alarm(timeout); alarmed = 0; while (*s) { - register char c = *s++; + char c = *s++; if (c != '\\') { if (!write_char (c)) @@ -1209,8 +1147,8 @@ * When called with -1, a '\n' character is generated when * the cursor is not at the beginning of a line. */ -void echo_stderr(n) -int n; +void +echo_stderr(int n) { static int need_lf; char *s; @@ -1237,12 +1175,13 @@ /* * 'Wait for' this string to appear on this file descriptor. */ -int get_string(string) -register char *string; +int +get_string(char *string) { char temp[STR_LEN]; - int c, printed = 0, len, minlen; - register char *s = temp, *end = s + STR_LEN; + int c, printed = 0; + size_t len, minlen; + char *s = temp, *end = s + STR_LEN; char *logged = temp; fail_reason = (char *)0; @@ -1325,7 +1264,7 @@ } } - if (s - temp >= len && + if ((size_t)(s - temp) >= len && c == string[len - 1] && strncmp(s - len, string, len) == 0) { if (verbose) { @@ -1385,47 +1324,8 @@ return (0); } -/* - * Gross kludge to handle Solaris versions >= 2.6 having usleep. - */ -#ifdef SOL2 -#include -#if MAXUID > 65536 /* then this is Solaris 2.6 or later */ -#undef NO_USLEEP -#endif -#endif /* SOL2 */ - -#ifdef NO_USLEEP -#include -#include - -/* - usleep -- support routine for 4.2BSD system call emulations - last edit: 29-Oct-1984 D A Gwyn - */ - -extern int select(); - -int -usleep( usec ) /* returns 0 if ok, else -1 */ - long usec; /* delay in microseconds */ -{ - static struct { /* `timeval' */ - long tv_sec; /* seconds */ - long tv_usec; /* microsecs */ - } delay; /* _select() timeout */ - - delay.tv_sec = usec / 1000000L; - delay.tv_usec = usec % 1000000L; - - return select(0, (long *)0, (long *)0, (long *)0, &delay); -} -#endif - void -pack_array (array, end) - char **array; /* The address of the array of string pointers */ - int end; /* The index of the next free entry before CLR_ */ +pack_array(char **array, int end) { int i, j; @@ -1451,11 +1351,7 @@ #define OUTCHAR(c) (buflen > 0? (--buflen, *buf++ = (c)): 0) int -vfmtmsg(buf, buflen, fmt, args) - char *buf; - int buflen; - const char *fmt; - va_list args; +vfmtmsg(char *buf, int buflen, const char *fmt, va_list args) { int c, i, n; int width, prec, fillch; ==== //depot/projects/trustedbsd/sebsd/usr.bin/colldef/colldef.1#2 (text+ko) ==== @@ -23,7 +23,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.\" $FreeBSD: src/usr.bin/colldef/colldef.1,v 1.18 2002/11/26 17:33:34 ru Exp $ +.\" $FreeBSD: src/usr.bin/colldef/colldef.1,v 1.20 2003/09/14 13:41:57 ru Exp $ .\" .Dd January 27, 1995 .Dt COLLDEF 1 @@ -47,8 +47,9 @@ functions. It is used to define the many ways in which strings can be ordered and collated. +The .Fn strxfrm -transforms +function transforms its first argument and places the result in its second argument. The transformed string is such that it can be @@ -57,8 +58,9 @@ .Fn strncmp , or .Fn memcmp . +The .Fn strcoll -transforms its arguments and does a +function transforms its arguments and does a comparison. .Pp The @@ -69,14 +71,14 @@ database with collating sequence information in a form usable by system commands and routines. .Pp -Options list: -.Bl -tag -width 4n +The following options are available: +.Bl -tag -width indent .It Fl I Ar map_dir -This option set directory name where +Set directory name where .Ar charmap files can be found, current directory by default. .It Fl o Ar out_file -This option set output file name, +Set output file name, .Ar LC_COLLATE by default. .El @@ -104,15 +106,17 @@ statements after the order statement are ignored. .Pp Lines in the specification file beginning with a -.Ar # +.Em # are treated as comments and are ignored. Blank lines are also ignored. .Pp -.Ar charmap charmapfile +.Bd -literal -offset indent +charmap charmapfile +.Ed .Pp -.Ar charmap +.Ar Charmap defines where a mapping of the character and collating element symbols to the actual character encoding can be found. @@ -122,23 +126,27 @@ is shown below. Symbol names are separated from their values by TAB or -SPACE characters. symbol-value can be specified in +SPACE characters. Symbol-value can be specified in a hexadecimal (\ex\fI??\fR) or octal (\e\fI???\fR) representation, and can be only one character in length. -.Bd -literal -.Ar symbol-name1 symbol-value1 -.Ar symbol-name2 symbol-value2 -.Ar ... +.Pp +.Bd -literal -offset indent +symbol-name1 symbol-value1 +symbol-name2 symbol-value2 +\&... .Ed >>> TRUNCATED FOR MAIL (1000 lines) <<<