17c478bd9Sstevel@tonic-gate /* 27c478bd9Sstevel@tonic-gate * CDDL HEADER START 37c478bd9Sstevel@tonic-gate * 47c478bd9Sstevel@tonic-gate * The contents of this file are subject to the terms of the 57c478bd9Sstevel@tonic-gate * Common Development and Distribution License, Version 1.0 only 67c478bd9Sstevel@tonic-gate * (the "License"). You may not use this file except in compliance 77c478bd9Sstevel@tonic-gate * with the License. 87c478bd9Sstevel@tonic-gate * 97c478bd9Sstevel@tonic-gate * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 107c478bd9Sstevel@tonic-gate * or http://www.opensolaris.org/os/licensing. 117c478bd9Sstevel@tonic-gate * See the License for the specific language governing permissions 127c478bd9Sstevel@tonic-gate * and limitations under the License. 137c478bd9Sstevel@tonic-gate * 147c478bd9Sstevel@tonic-gate * When distributing Covered Code, include this CDDL HEADER in each 157c478bd9Sstevel@tonic-gate * file and include the License file at usr/src/OPENSOLARIS.LICENSE. 167c478bd9Sstevel@tonic-gate * If applicable, add the following below this CDDL HEADER, with the 177c478bd9Sstevel@tonic-gate * fields enclosed by brackets "[]" replaced with your own identifying 187c478bd9Sstevel@tonic-gate * information: Portions Copyright [yyyy] [name of copyright owner] 197c478bd9Sstevel@tonic-gate * 207c478bd9Sstevel@tonic-gate * CDDL HEADER END 217c478bd9Sstevel@tonic-gate */ 227c478bd9Sstevel@tonic-gate /* 23ace1a5f1Sdp * Copyright 2005 Sun Microsystems, Inc. All rights reserved. 247c478bd9Sstevel@tonic-gate * Use is subject to license terms. 257c478bd9Sstevel@tonic-gate */ 267c478bd9Sstevel@tonic-gate 277c478bd9Sstevel@tonic-gate /* Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */ 287c478bd9Sstevel@tonic-gate /* All Rights Reserved */ 297c478bd9Sstevel@tonic-gate 307c478bd9Sstevel@tonic-gate 317c478bd9Sstevel@tonic-gate #ifndef _UUCP_H 327c478bd9Sstevel@tonic-gate #define _UUCP_H 337c478bd9Sstevel@tonic-gate 34ace1a5f1Sdp #ifdef __cplusplus 35ace1a5f1Sdp extern "C" { 36ace1a5f1Sdp #endif 37ace1a5f1Sdp 387c478bd9Sstevel@tonic-gate #include <unistd.h> 397c478bd9Sstevel@tonic-gate #include <stdlib.h> 407c478bd9Sstevel@tonic-gate #include <string.h> 417c478bd9Sstevel@tonic-gate #include <locale.h> 427c478bd9Sstevel@tonic-gate #include <wchar.h> 437c478bd9Sstevel@tonic-gate #include <widec.h> 447c478bd9Sstevel@tonic-gate #include <wctype.h> 457c478bd9Sstevel@tonic-gate #include <ulimit.h> 467c478bd9Sstevel@tonic-gate #include <values.h> 47ace1a5f1Sdp #include <sys/types.h> 48ace1a5f1Sdp #include <sys/wait.h> 497c478bd9Sstevel@tonic-gate 507c478bd9Sstevel@tonic-gate #include "parms.h" 517c478bd9Sstevel@tonic-gate 527c478bd9Sstevel@tonic-gate #ifdef ATTSV 537c478bd9Sstevel@tonic-gate #define ATTSVKILL 547c478bd9Sstevel@tonic-gate #define ATTSVTTY 557c478bd9Sstevel@tonic-gate #define UNAME 567c478bd9Sstevel@tonic-gate #ifdef ATTSVR4 577c478bd9Sstevel@tonic-gate #define ATTSVR3 587c478bd9Sstevel@tonic-gate #endif /*ATTSVR4*/ 597c478bd9Sstevel@tonic-gate #endif /*ATTSV*/ 607c478bd9Sstevel@tonic-gate 617c478bd9Sstevel@tonic-gate #ifdef BSD4_3 627c478bd9Sstevel@tonic-gate #define BSD4_2 637c478bd9Sstevel@tonic-gate #define BSDINETD 647c478bd9Sstevel@tonic-gate #endif /*BSD4_3 */ 657c478bd9Sstevel@tonic-gate 667c478bd9Sstevel@tonic-gate #ifdef DIAL 677c478bd9Sstevel@tonic-gate #define EXTERN static 687c478bd9Sstevel@tonic-gate #define GLOBAL static 697c478bd9Sstevel@tonic-gate #else 707c478bd9Sstevel@tonic-gate #define EXTERN extern 717c478bd9Sstevel@tonic-gate #define GLOBAL 727c478bd9Sstevel@tonic-gate #endif 737c478bd9Sstevel@tonic-gate 747c478bd9Sstevel@tonic-gate #ifdef BSD4_2 757c478bd9Sstevel@tonic-gate #define V7 767c478bd9Sstevel@tonic-gate #define ATTSVKILL 777c478bd9Sstevel@tonic-gate #undef NONAP /* conn.c has a nap() for 4.2 -- it's called select() */ 787c478bd9Sstevel@tonic-gate #undef FASTTIMER 797c478bd9Sstevel@tonic-gate #endif /* BSD4_2 */ 807c478bd9Sstevel@tonic-gate 817c478bd9Sstevel@tonic-gate #ifdef V8 827c478bd9Sstevel@tonic-gate #define V7 837c478bd9Sstevel@tonic-gate #define ATTSVKILL 847c478bd9Sstevel@tonic-gate #define UNAME 857c478bd9Sstevel@tonic-gate #endif /* V8 */ 867c478bd9Sstevel@tonic-gate 877c478bd9Sstevel@tonic-gate #ifdef FASTTIMER 887c478bd9Sstevel@tonic-gate #undef NONAP 897c478bd9Sstevel@tonic-gate #endif 907c478bd9Sstevel@tonic-gate 917c478bd9Sstevel@tonic-gate #include <stdio.h> 927c478bd9Sstevel@tonic-gate #include <ctype.h> 937c478bd9Sstevel@tonic-gate #include <setjmp.h> 947c478bd9Sstevel@tonic-gate #include <sys/param.h> 957c478bd9Sstevel@tonic-gate 967c478bd9Sstevel@tonic-gate /* 977c478bd9Sstevel@tonic-gate * param.h includes types.h and signal.h in 4bsd 987c478bd9Sstevel@tonic-gate */ 997c478bd9Sstevel@tonic-gate #ifdef V7 1007c478bd9Sstevel@tonic-gate #ifdef ATTSVTTY 1017c478bd9Sstevel@tonic-gate #include <termio.h> 1027c478bd9Sstevel@tonic-gate #else /* ATTSVTTY */ 1037c478bd9Sstevel@tonic-gate #include <sgtty.h> 1047c478bd9Sstevel@tonic-gate #endif /* ATTSVTTY */ 1057c478bd9Sstevel@tonic-gate #include <sys/timeb.h> 1067c478bd9Sstevel@tonic-gate #ifdef BSD4_2 1077c478bd9Sstevel@tonic-gate #include <fcntl.h> 1087c478bd9Sstevel@tonic-gate #endif /* BSD4_2 */ 1097c478bd9Sstevel@tonic-gate #else /* !V7 */ 1107c478bd9Sstevel@tonic-gate #include <termio.h> 1117c478bd9Sstevel@tonic-gate #include <sys/types.h> 1127c478bd9Sstevel@tonic-gate #include <signal.h> 1137c478bd9Sstevel@tonic-gate #include <fcntl.h> 1147c478bd9Sstevel@tonic-gate #endif /* V7 */ 1157c478bd9Sstevel@tonic-gate 1167c478bd9Sstevel@tonic-gate #include <sys/stat.h> 1177c478bd9Sstevel@tonic-gate #include <utime.h> 1187c478bd9Sstevel@tonic-gate #include <dirent.h> 1197c478bd9Sstevel@tonic-gate 1207c478bd9Sstevel@tonic-gate #ifdef BSD4_2 1217c478bd9Sstevel@tonic-gate #include <sys/time.h> 1227c478bd9Sstevel@tonic-gate #else /* !BSD4_2 */ 1237c478bd9Sstevel@tonic-gate #include <time.h> 1247c478bd9Sstevel@tonic-gate #endif /* BSD4_2 */ 1257c478bd9Sstevel@tonic-gate 1267c478bd9Sstevel@tonic-gate #include <sys/times.h> 1277c478bd9Sstevel@tonic-gate #include <errno.h> 1287c478bd9Sstevel@tonic-gate 1297c478bd9Sstevel@tonic-gate #ifdef ATTSV 1307c478bd9Sstevel@tonic-gate #ifdef ATTSVR4 1317c478bd9Sstevel@tonic-gate #include <sys/mkdev.h> 1327c478bd9Sstevel@tonic-gate #else /* !ATTSVR4 */ 1337c478bd9Sstevel@tonic-gate #include <sys/sysmacros.h> 1347c478bd9Sstevel@tonic-gate #endif /* ATTSVR4 */ 1357c478bd9Sstevel@tonic-gate #endif /* ATTSV */ 1367c478bd9Sstevel@tonic-gate 1377c478bd9Sstevel@tonic-gate #ifdef RT 1387c478bd9Sstevel@tonic-gate #include "rt/types.h" 1397c478bd9Sstevel@tonic-gate #include "rt/unix/param.h" 1407c478bd9Sstevel@tonic-gate #include "rt/stat.h" 1417c478bd9Sstevel@tonic-gate #include <sys/ustat.h> 1427c478bd9Sstevel@tonic-gate #endif /* RT */ 1437c478bd9Sstevel@tonic-gate 1447c478bd9Sstevel@tonic-gate #include <sysexits.h> 1457c478bd9Sstevel@tonic-gate 1467c478bd9Sstevel@tonic-gate #ifndef ATTSVR4 1477c478bd9Sstevel@tonic-gate #define const 1487c478bd9Sstevel@tonic-gate #endif /* ATTSVR4 */ 1497c478bd9Sstevel@tonic-gate 1507c478bd9Sstevel@tonic-gate /* what mode should user files be allowed to have upon creation? */ 1517c478bd9Sstevel@tonic-gate /* NOTE: This does not allow setuid or execute bits on transfer. */ 1527c478bd9Sstevel@tonic-gate #define LEGALMODE (mode_t) 0666 1537c478bd9Sstevel@tonic-gate 1547c478bd9Sstevel@tonic-gate /* what mode should public files have upon creation? */ 1557c478bd9Sstevel@tonic-gate #define PUB_FILEMODE (mode_t) 0666 1567c478bd9Sstevel@tonic-gate 1577c478bd9Sstevel@tonic-gate /* what mode should log files have upon creation? */ 1587c478bd9Sstevel@tonic-gate #define LOGFILEMODE (mode_t) 0644 1597c478bd9Sstevel@tonic-gate 1607c478bd9Sstevel@tonic-gate /* what mode should C. files have upon creation? */ 1617c478bd9Sstevel@tonic-gate #define CFILEMODE (mode_t) 0644 1627c478bd9Sstevel@tonic-gate 1637c478bd9Sstevel@tonic-gate /* what mode should D. files have upon creation? */ 1647c478bd9Sstevel@tonic-gate #define DFILEMODE (mode_t) 0600 1657c478bd9Sstevel@tonic-gate 1667c478bd9Sstevel@tonic-gate /* define the value of PUBMASK, used for creating "public" directories */ 1677c478bd9Sstevel@tonic-gate #define PUBMASK (mode_t) 0000 1687c478bd9Sstevel@tonic-gate 1697c478bd9Sstevel@tonic-gate /* what mode should public directories have upon creation? */ 1707c478bd9Sstevel@tonic-gate #define PUB_DIRMODE (mode_t) 0777 1717c478bd9Sstevel@tonic-gate 1727c478bd9Sstevel@tonic-gate /* define the value of DIRMASK, used for creating "system" subdirectories */ 1737c478bd9Sstevel@tonic-gate #define DIRMASK (mode_t) 0022 1747c478bd9Sstevel@tonic-gate 1757c478bd9Sstevel@tonic-gate #define MAXSTART 300 /* how long to wait on startup */ 1767c478bd9Sstevel@tonic-gate 1777c478bd9Sstevel@tonic-gate /* define the last characters for ACU (used for 801/212 dialers) */ 1787c478bd9Sstevel@tonic-gate #define ACULAST "<" 1797c478bd9Sstevel@tonic-gate 180*2a8bcb4eSToomas Soome /* caution - the fillowing names are also in Makefile 1817c478bd9Sstevel@tonic-gate * any changes here have to also be made there 1827c478bd9Sstevel@tonic-gate * 1837c478bd9Sstevel@tonic-gate * it's a good idea to make directories .foo, since this ensures 1847c478bd9Sstevel@tonic-gate * that they'll be ignored by processes that search subdirectories in SPOOL 1857c478bd9Sstevel@tonic-gate * 1867c478bd9Sstevel@tonic-gate * XQTDIR=/var/uucp/.Xqtdir 1877c478bd9Sstevel@tonic-gate * CORRUPT=/var/uucp/.Corrupt 1887c478bd9Sstevel@tonic-gate * LOGDIR=/var/uucp/.Log 1897c478bd9Sstevel@tonic-gate * SEQDIR=/var/uucp/.Sequence 1907c478bd9Sstevel@tonic-gate * STATDIR=/var/uucp/.Status 191*2a8bcb4eSToomas Soome * 1927c478bd9Sstevel@tonic-gate */ 1937c478bd9Sstevel@tonic-gate 1947c478bd9Sstevel@tonic-gate /* where to put the STST. files? */ 1957c478bd9Sstevel@tonic-gate #define STATDIR "/var/uucp/.Status" 1967c478bd9Sstevel@tonic-gate 1977c478bd9Sstevel@tonic-gate /* where should logfiles be kept? */ 1987c478bd9Sstevel@tonic-gate #define LOGUUX "/var/uucp/.Log/uux" 1997c478bd9Sstevel@tonic-gate #define LOGUUXQT "/var/uucp/.Log/uuxqt" 2007c478bd9Sstevel@tonic-gate #define LOGUUCP "/var/uucp/.Log/uucp" 2017c478bd9Sstevel@tonic-gate #define LOGCICO "/var/uucp/.Log/uucico" 2027c478bd9Sstevel@tonic-gate 2037c478bd9Sstevel@tonic-gate /* some sites use /var/uucp/.Corrupt and /var/uucp/.Xqtdir here */ 2047c478bd9Sstevel@tonic-gate /* use caution since things are linked into there from /var/spool/uucp */ 2057c478bd9Sstevel@tonic-gate #define CORRUPTDIR "/var/spool/uucp/.Corrupt" 2067c478bd9Sstevel@tonic-gate #define XQTDIR "/var/spool/uucp/.Xqtdir" 2077c478bd9Sstevel@tonic-gate 2087c478bd9Sstevel@tonic-gate /* how much of a system name can we print in a [CX]. file? */ 2097c478bd9Sstevel@tonic-gate /* MAXBASENAME - 1 (pre) - 1 ('.') - 1 (grade) - 4 (sequence number) */ 2107c478bd9Sstevel@tonic-gate #define SYSNSIZE (MAXBASENAME - 7) 2117c478bd9Sstevel@tonic-gate 2127c478bd9Sstevel@tonic-gate #ifdef USRSPOOLLOCKS 2137c478bd9Sstevel@tonic-gate #define LOCKPRE "/var/spool/locks/LCK." 2147c478bd9Sstevel@tonic-gate #else /*!USRSPOOLLOCKS*/ 2157c478bd9Sstevel@tonic-gate #define LOCKPRE "/var/spool/uucp/LCK." 2167c478bd9Sstevel@tonic-gate #endif /* USRSPOOLLOCKS */ 2177c478bd9Sstevel@tonic-gate 2187c478bd9Sstevel@tonic-gate #define SQFILE "/etc/uucp/SQFILE" 2197c478bd9Sstevel@tonic-gate #define SQTMP "/etc/uucp/SQTMP" 2207c478bd9Sstevel@tonic-gate #define SLCKTIME 5400 /* system/device timeout (LCK.. files) */ 2217c478bd9Sstevel@tonic-gate #define DIALCODES "/etc/uucp/Dialcodes" 2227c478bd9Sstevel@tonic-gate #define PERMISSIONS "/etc/uucp/Permissions" 2237c478bd9Sstevel@tonic-gate #define SYSNAMEFILE "/etc/uucp/Sysname" 2247c478bd9Sstevel@tonic-gate 2257c478bd9Sstevel@tonic-gate #define SPOOL "/var/spool/uucp" 2267c478bd9Sstevel@tonic-gate #define SEQDIR "/var/uucp/.Sequence" 2277c478bd9Sstevel@tonic-gate 2287c478bd9Sstevel@tonic-gate #define X_LOCKTIME 3600 2297c478bd9Sstevel@tonic-gate #ifdef USRSPOOLLOCKS 2307c478bd9Sstevel@tonic-gate #define SEQLOCK "/var/spool/locks/LCK.SQ." 2317c478bd9Sstevel@tonic-gate #define SQLOCK "/var/spool/locks/LCK.SQ" 2327c478bd9Sstevel@tonic-gate #define X_LOCK "/var/spool/locks/LCK.X" 2337c478bd9Sstevel@tonic-gate #define S_LOCK "/var/spool/locks/LCK.S" 2347c478bd9Sstevel@tonic-gate #define L_LOCK "/var/spool/locks/LK" 2357c478bd9Sstevel@tonic-gate #define X_LOCKDIR "/var/spool/locks" /* must be dir part of above */ 2367c478bd9Sstevel@tonic-gate #else /*!USRSPOOLLOCKS*/ 2377c478bd9Sstevel@tonic-gate #define SEQLOCK "/var/spool/uucp/LCK.SQ." 2387c478bd9Sstevel@tonic-gate #define SQLOCK "/var/spool/uucp/LCK.SQ" 2397c478bd9Sstevel@tonic-gate #define X_LOCK "/var/spool/uucp/LCK.X" 2407c478bd9Sstevel@tonic-gate #define S_LOCK "/var/spool/uucp/LCK.S" 2417c478bd9Sstevel@tonic-gate #define L_LOCK "/var/spool/uucp/LK" 2427c478bd9Sstevel@tonic-gate #define X_LOCKDIR "/var/spool/uucp" /* must be dir part of above */ 2437c478bd9Sstevel@tonic-gate #endif /* USRSPOOLLOCKS */ 2447c478bd9Sstevel@tonic-gate #define X_LOCKPRE "LCK.X" /* must be last part of above */ 2457c478bd9Sstevel@tonic-gate #define S_LOCKPRE "LCK.S" 2467c478bd9Sstevel@tonic-gate 2477c478bd9Sstevel@tonic-gate /* 2487c478bd9Sstevel@tonic-gate * Note: this should be "/usr/spool/uucppublic", not "/var/spool/uucppublic", 2497c478bd9Sstevel@tonic-gate * because if a Permissions file entry doesn't explicitly list directories to 2507c478bd9Sstevel@tonic-gate * which and from which files can be copied you can only copy files to and from 2517c478bd9Sstevel@tonic-gate * PUBDIR, and most systems out there will think PUBDIR is 2527c478bd9Sstevel@tonic-gate * "/usr/spool/uucppublic" not "/var/spool/uucppublic" (i.e., if you change 2537c478bd9Sstevel@tonic-gate * this, other systems may be rudely surprised when they try to get things from 2547c478bd9Sstevel@tonic-gate * or to PUBDIR). 2557c478bd9Sstevel@tonic-gate */ 2567c478bd9Sstevel@tonic-gate #define PUBDIR "/usr/spool/uucppublic" 2577c478bd9Sstevel@tonic-gate #define ADMIN "/var/uucp/.Admin" 2587c478bd9Sstevel@tonic-gate #define ERRLOG "/var/uucp/.Admin/errors" 2597c478bd9Sstevel@tonic-gate #define SYSLOG "/var/uucp/.Admin/xferstats" 2607c478bd9Sstevel@tonic-gate #define RMTDEBUG "/var/uucp/.Admin/audit" 2617c478bd9Sstevel@tonic-gate #define CLEANUPLOGFILE "/var/uucp/.Admin/uucleanup" 2627c478bd9Sstevel@tonic-gate #define CMDLOG "/var/uucp/.Admin/command" 2637c478bd9Sstevel@tonic-gate #define PERFLOG "/var/uucp/.Admin/perflog" 2647c478bd9Sstevel@tonic-gate #define ACCOUNT "/var/uucp/.Admin/account" 2657c478bd9Sstevel@tonic-gate #define SECURITY "/var/uucp/.Admin/security" 2667c478bd9Sstevel@tonic-gate 2677c478bd9Sstevel@tonic-gate /* 2687c478bd9Sstevel@tonic-gate * WORKSPACE should be in the same filesystem as SPOOL so that "mv" 2697c478bd9Sstevel@tonic-gate * between the two will work. Otherwise, the file must be copied 2707c478bd9Sstevel@tonic-gate * and a window exists during which the file is mode 666. 2717c478bd9Sstevel@tonic-gate */ 2727c478bd9Sstevel@tonic-gate #define WORKSPACE "/var/spool/uucp/.Workspace" 2737c478bd9Sstevel@tonic-gate 2747c478bd9Sstevel@tonic-gate #define SQTIME 60 2757c478bd9Sstevel@tonic-gate #define TRYCALLS 2 /* number of tries to dial call */ 2767c478bd9Sstevel@tonic-gate #define MINULIMIT (1L<<11) /* minimum reasonable ulimit */ 2777c478bd9Sstevel@tonic-gate #define MAX_LOCKTRY 5 /* number of attempts to lock device */ 2787c478bd9Sstevel@tonic-gate 2797c478bd9Sstevel@tonic-gate /* 280*2a8bcb4eSToomas Soome * CDEBUG is for communication line debugging 281*2a8bcb4eSToomas Soome * DEBUG is for program debugging 2827c478bd9Sstevel@tonic-gate * #define SMALL to compile without the DEBUG code 2837c478bd9Sstevel@tonic-gate */ 2847c478bd9Sstevel@tonic-gate 2857c478bd9Sstevel@tonic-gate #ifndef DIAL 2867c478bd9Sstevel@tonic-gate #define CDEBUG(l, f, s) if (Debug >= l) fprintf(stderr, f, s) 2877c478bd9Sstevel@tonic-gate #else 2887c478bd9Sstevel@tonic-gate #define CDEBUG(l, f, s) 2897c478bd9Sstevel@tonic-gate #define SMALL 2907c478bd9Sstevel@tonic-gate #endif 2917c478bd9Sstevel@tonic-gate 2927c478bd9Sstevel@tonic-gate #ifndef SMALL 2937c478bd9Sstevel@tonic-gate #define DEBUG(l, f, s) if (Debug >= l) fprintf(stderr, f, s) 2947c478bd9Sstevel@tonic-gate #else 295*2a8bcb4eSToomas Soome #define DEBUG(l, f, s) 2967c478bd9Sstevel@tonic-gate #endif /* SMALL */ 2977c478bd9Sstevel@tonic-gate 2987c478bd9Sstevel@tonic-gate /* 2997c478bd9Sstevel@tonic-gate * VERBOSE is used by cu and ct to inform the user of progress 3007c478bd9Sstevel@tonic-gate * In other programs, the Value of Verbose is always 0. 3017c478bd9Sstevel@tonic-gate */ 3027c478bd9Sstevel@tonic-gate #define VERBOSE(f, s) { if (Verbose > 0) fprintf(stderr, f, s); } 3037c478bd9Sstevel@tonic-gate 3047c478bd9Sstevel@tonic-gate #define PREFIX(pre, str) (strncmp((pre), (str), strlen(pre)) == SAME) 3057c478bd9Sstevel@tonic-gate #define BASENAME(str, c) ((Bnptr = strrchr((str), c)) ? (Bnptr + 1) : (str)) 3067c478bd9Sstevel@tonic-gate #define EQUALS(a,b) ((a != CNULL) && (b != CNULL) && (strcmp((a),(b))==SAME)) 3077c478bd9Sstevel@tonic-gate #define WEQUALS(a,b) ((a != CNULL) && (b != CNULL) && (wcscmp((a),(b))==SAME)) 3087c478bd9Sstevel@tonic-gate #define EQUALSN(a,b,n) ((a != CNULL) && (b != CNULL) && (strncmp((a),(b),(n))==SAME)) 3097c478bd9Sstevel@tonic-gate #define WEQUALSN(a,b,n) ((a != CNULL) && (b != CNULL) && (wcsncmp((a),(b),(n))==SAME)) 3107c478bd9Sstevel@tonic-gate #define LASTCHAR(s) (s+strlen(s)-1) 3117c478bd9Sstevel@tonic-gate 3127c478bd9Sstevel@tonic-gate #define SAME 0 3137c478bd9Sstevel@tonic-gate #define ANYREAD 04 3147c478bd9Sstevel@tonic-gate #define ANYWRITE 02 3157c478bd9Sstevel@tonic-gate #define FAIL -1 3167c478bd9Sstevel@tonic-gate #define SUCCESS 0 3177c478bd9Sstevel@tonic-gate #define NULLCHAR '\0' 3187c478bd9Sstevel@tonic-gate #define CNULL ((void *) 0) 3197c478bd9Sstevel@tonic-gate #define STBNULL (struct sgttyb *) 0 3207c478bd9Sstevel@tonic-gate #define MASTER 1 3217c478bd9Sstevel@tonic-gate #define SLAVE 0 3227c478bd9Sstevel@tonic-gate #define MAXBASENAME 14 /* should be DIRSIZ but that is now fs dependent */ 3237c478bd9Sstevel@tonic-gate #define MAXFULLNAME BUFSIZ 3247c478bd9Sstevel@tonic-gate #define MAXNAMESIZE 64 /* /var/spool/uucp/<14 chars>/<14 chars>+slop */ 3257c478bd9Sstevel@tonic-gate #define CONNECTTIME 30 3267c478bd9Sstevel@tonic-gate #define EXPECTTIME 45 3277c478bd9Sstevel@tonic-gate #define MSGTIME 60 3287c478bd9Sstevel@tonic-gate #define NAMESIZE MAXBASENAME+1 3297c478bd9Sstevel@tonic-gate #define SIZEOFPID 10 /* maximum number of digits in a pid */ 3307c478bd9Sstevel@tonic-gate #define EOTMSG "\004\n\004\n" 3317c478bd9Sstevel@tonic-gate #define CALLBACK 1 3327c478bd9Sstevel@tonic-gate 3337c478bd9Sstevel@tonic-gate /* manifests for sysfiles.c's sysaccess() */ 3347c478bd9Sstevel@tonic-gate /* check file access for REAL user id */ 3357c478bd9Sstevel@tonic-gate #define ACCESS_SYSTEMS 1 3367c478bd9Sstevel@tonic-gate #define ACCESS_DEVICES 2 3377c478bd9Sstevel@tonic-gate #define ACCESS_DIALERS 3 3387c478bd9Sstevel@tonic-gate /* check file access for EFFECTIVE user id */ 3397c478bd9Sstevel@tonic-gate #define EACCESS_SYSTEMS 4 3407c478bd9Sstevel@tonic-gate #define EACCESS_DEVICES 5 3417c478bd9Sstevel@tonic-gate #define EACCESS_DIALERS 6 3427c478bd9Sstevel@tonic-gate 3437c478bd9Sstevel@tonic-gate /* manifest for chkpth flag */ 3447c478bd9Sstevel@tonic-gate #define CK_READ 0 3457c478bd9Sstevel@tonic-gate #define CK_WRITE 1 3467c478bd9Sstevel@tonic-gate 3477c478bd9Sstevel@tonic-gate /* 3487c478bd9Sstevel@tonic-gate * commands 3497c478bd9Sstevel@tonic-gate */ 3507c478bd9Sstevel@tonic-gate #define SHELL "/usr/bin/sh" 3517c478bd9Sstevel@tonic-gate #define MAIL "mail" 3527c478bd9Sstevel@tonic-gate #define UUCICO "/usr/lib/uucp/uucico" 3537c478bd9Sstevel@tonic-gate #define UUXQT "/usr/lib/uucp/uuxqt" 3547c478bd9Sstevel@tonic-gate #define UUX "/usr/bin/uux" 3557c478bd9Sstevel@tonic-gate #define UUCP "/usr/bin/uucp" 3567c478bd9Sstevel@tonic-gate 3577c478bd9Sstevel@tonic-gate 3587c478bd9Sstevel@tonic-gate /* system status stuff */ 3597c478bd9Sstevel@tonic-gate #define SS_OK 0 3607c478bd9Sstevel@tonic-gate #define SS_NO_DEVICE 1 3617c478bd9Sstevel@tonic-gate #define SS_TIME_WRONG 2 3627c478bd9Sstevel@tonic-gate #define SS_INPROGRESS 3 3637c478bd9Sstevel@tonic-gate #define SS_CONVERSATION 4 3647c478bd9Sstevel@tonic-gate #define SS_SEQBAD 5 3657c478bd9Sstevel@tonic-gate #define SS_LOGIN_FAILED 6 3667c478bd9Sstevel@tonic-gate #define SS_DIAL_FAILED 7 3677c478bd9Sstevel@tonic-gate #define SS_BAD_LOG_MCH 8 3687c478bd9Sstevel@tonic-gate #define SS_LOCKED_DEVICE 9 3697c478bd9Sstevel@tonic-gate #define SS_ASSERT_ERROR 10 3707c478bd9Sstevel@tonic-gate #define SS_BADSYSTEM 11 3717c478bd9Sstevel@tonic-gate #define SS_CANT_ACCESS_DEVICE 12 3727c478bd9Sstevel@tonic-gate #define SS_DEVICE_FAILED 13 /* used for interface failure */ 3737c478bd9Sstevel@tonic-gate #define SS_WRONG_MCH 14 3747c478bd9Sstevel@tonic-gate #define SS_CALLBACK 15 3757c478bd9Sstevel@tonic-gate #define SS_RLOCKED 16 3767c478bd9Sstevel@tonic-gate #define SS_RUNKNOWN 17 3777c478bd9Sstevel@tonic-gate #define SS_RLOGIN 18 3787c478bd9Sstevel@tonic-gate #define SS_UNKNOWN_RESPONSE 19 3797c478bd9Sstevel@tonic-gate #define SS_STARTUP 20 3807c478bd9Sstevel@tonic-gate #define SS_CHAT_FAILED 21 3817c478bd9Sstevel@tonic-gate #define SS_CALLBACK_LOOP 22 3827c478bd9Sstevel@tonic-gate 3837c478bd9Sstevel@tonic-gate #define MAXPH 60 /* maximum phone string size */ 3847c478bd9Sstevel@tonic-gate #define MAXC BUFSIZ 3857c478bd9Sstevel@tonic-gate 3867c478bd9Sstevel@tonic-gate #define TRUE 1 3877c478bd9Sstevel@tonic-gate #define FALSE 0 3887c478bd9Sstevel@tonic-gate #define NAMEBUF 32 3897c478bd9Sstevel@tonic-gate 3907c478bd9Sstevel@tonic-gate /* The call structure is used by ct.c, cu.c, and dial.c. */ 3917c478bd9Sstevel@tonic-gate 392462be471Sceastha struct call { 3937c478bd9Sstevel@tonic-gate char *speed; /* transmission baud rate */ 3947c478bd9Sstevel@tonic-gate char *line; /* device name for outgoing line */ 3957c478bd9Sstevel@tonic-gate char *telno; /* ptr to tel-no digit string */ 3967c478bd9Sstevel@tonic-gate char *type; /* type of device to use for call. */ 3977c478bd9Sstevel@tonic-gate }; 3987c478bd9Sstevel@tonic-gate 3997c478bd9Sstevel@tonic-gate /* structure of an Systems file line */ 4007c478bd9Sstevel@tonic-gate #define F_MAX 50 /* max number of fields in Systems file line */ 4017c478bd9Sstevel@tonic-gate #define F_NAME 0 4027c478bd9Sstevel@tonic-gate #define F_TIME 1 4037c478bd9Sstevel@tonic-gate #define F_TYPE 2 4047c478bd9Sstevel@tonic-gate #define F_CLASS 3 /* an optional prefix and the speed */ 4057c478bd9Sstevel@tonic-gate #define F_PHONE 4 4067c478bd9Sstevel@tonic-gate #define F_LOGIN 5 4077c478bd9Sstevel@tonic-gate 4087c478bd9Sstevel@tonic-gate /* structure of an Devices file line */ 4097c478bd9Sstevel@tonic-gate #define D_TYPE 0 4107c478bd9Sstevel@tonic-gate #define D_LINE 1 4117c478bd9Sstevel@tonic-gate #define D_CALLDEV 2 4127c478bd9Sstevel@tonic-gate #define D_CLASS 3 4137c478bd9Sstevel@tonic-gate #define D_CALLER 4 4147c478bd9Sstevel@tonic-gate #define D_ARG 5 4157c478bd9Sstevel@tonic-gate #define D_MAX 50 /* max number of fields in Devices file line */ 4167c478bd9Sstevel@tonic-gate 4177c478bd9Sstevel@tonic-gate #define D_ACU 1 4187c478bd9Sstevel@tonic-gate #define D_DIRECT 2 4197c478bd9Sstevel@tonic-gate #define D_PROT 4 4207c478bd9Sstevel@tonic-gate 4217c478bd9Sstevel@tonic-gate #define GRADES "/etc/uucp/Grades" 4227c478bd9Sstevel@tonic-gate 4237c478bd9Sstevel@tonic-gate #define D_QUEUE 'Z' /* default queue */ 4247c478bd9Sstevel@tonic-gate 4257c478bd9Sstevel@tonic-gate /* past here, local changes are not recommended */ 4267c478bd9Sstevel@tonic-gate #define CMDPRE 'C' 4277c478bd9Sstevel@tonic-gate #define DATAPRE 'D' 4287c478bd9Sstevel@tonic-gate #define XQTPRE 'X' 4297c478bd9Sstevel@tonic-gate 4307c478bd9Sstevel@tonic-gate /* 4317c478bd9Sstevel@tonic-gate * stuff for command execution 4327c478bd9Sstevel@tonic-gate */ 4337c478bd9Sstevel@tonic-gate #define X_RQDFILE 'F' 4347c478bd9Sstevel@tonic-gate #define X_STDIN 'I' 4357c478bd9Sstevel@tonic-gate #define X_STDOUT 'O' 4367c478bd9Sstevel@tonic-gate #define X_STDERR 'E' 4377c478bd9Sstevel@tonic-gate #define X_CMD 'C' 4387c478bd9Sstevel@tonic-gate #define X_USER 'U' 4397c478bd9Sstevel@tonic-gate #define X_BRINGBACK 'B' 4407c478bd9Sstevel@tonic-gate #define X_MAILF 'M' 4417c478bd9Sstevel@tonic-gate #define X_RETADDR 'R' 4427c478bd9Sstevel@tonic-gate #define X_COMMENT '#' 4437c478bd9Sstevel@tonic-gate #define X_NONZERO 'Z' 4447c478bd9Sstevel@tonic-gate #define X_SENDNOTHING 'N' 4457c478bd9Sstevel@tonic-gate #define X_SENDZERO 'n' 4467c478bd9Sstevel@tonic-gate #define X_JOBID 'J' 4477c478bd9Sstevel@tonic-gate 4487c478bd9Sstevel@tonic-gate 4497c478bd9Sstevel@tonic-gate /* This structure describes call routines */ 4507c478bd9Sstevel@tonic-gate struct caller { 4517c478bd9Sstevel@tonic-gate char *CA_type; 4527c478bd9Sstevel@tonic-gate int (*CA_caller)(); 4537c478bd9Sstevel@tonic-gate }; 4547c478bd9Sstevel@tonic-gate 4557c478bd9Sstevel@tonic-gate /* structure for a saved C file */ 4567c478bd9Sstevel@tonic-gate 457462be471Sceastha struct cs_struct { 4587c478bd9Sstevel@tonic-gate char file[NAMESIZE]; 4597c478bd9Sstevel@tonic-gate char sys[NAMESIZE+5]; 4607c478bd9Sstevel@tonic-gate char sgrade[NAMESIZE]; 4617c478bd9Sstevel@tonic-gate char grade; 4627c478bd9Sstevel@tonic-gate long jsize; 4637c478bd9Sstevel@tonic-gate }; 4647c478bd9Sstevel@tonic-gate 4657c478bd9Sstevel@tonic-gate /* This structure describes dialing routines */ 4667c478bd9Sstevel@tonic-gate struct dialer { 4677c478bd9Sstevel@tonic-gate char *DI_type; 4687c478bd9Sstevel@tonic-gate int (*DI_dialer)(); 4697c478bd9Sstevel@tonic-gate }; 4707c478bd9Sstevel@tonic-gate 4717c478bd9Sstevel@tonic-gate struct nstat { 4727c478bd9Sstevel@tonic-gate pid_t t_pid; /* process id */ 4737c478bd9Sstevel@tonic-gate time_t t_start; /* start time */ 4747c478bd9Sstevel@tonic-gate time_t t_scall; /* start call to system */ 4757c478bd9Sstevel@tonic-gate time_t t_ecall; /* end call to system */ 4767c478bd9Sstevel@tonic-gate time_t t_tacu; /* acu time */ 4777c478bd9Sstevel@tonic-gate time_t t_tlog; /* login time */ 4787c478bd9Sstevel@tonic-gate time_t t_sftp; /* start file transfer protocol */ 4797c478bd9Sstevel@tonic-gate time_t t_sxf; /* start xfer */ 4807c478bd9Sstevel@tonic-gate time_t t_exf; /* end xfer */ 4817c478bd9Sstevel@tonic-gate time_t t_eftp; /* end file transfer protocol */ 4827c478bd9Sstevel@tonic-gate time_t t_qtime; /* time file queued */ 4837c478bd9Sstevel@tonic-gate int t_ndial; /* # of dials */ 4847c478bd9Sstevel@tonic-gate int t_nlogs; /* # of login trys */ 4857c478bd9Sstevel@tonic-gate struct tms t_tbb; /* start execution times */ 4867c478bd9Sstevel@tonic-gate struct tms t_txfs; /* xfer start times */ 4877c478bd9Sstevel@tonic-gate struct tms t_txfe; /* xfer end times */ 4887c478bd9Sstevel@tonic-gate struct tms t_tga; /* garbage execution times */ 4897c478bd9Sstevel@tonic-gate }; 4907c478bd9Sstevel@tonic-gate 4917c478bd9Sstevel@tonic-gate /* This structure describes the values from Limits file */ 4927c478bd9Sstevel@tonic-gate struct limits { 4937c478bd9Sstevel@tonic-gate int totalmax; /* overall limit */ 4947c478bd9Sstevel@tonic-gate int sitemax; /* limit per site */ 4957c478bd9Sstevel@tonic-gate char mode[64]; /* uucico mode */ 4967c478bd9Sstevel@tonic-gate }; 4977c478bd9Sstevel@tonic-gate 4987c478bd9Sstevel@tonic-gate /* external declarations */ 4997c478bd9Sstevel@tonic-gate 5007c478bd9Sstevel@tonic-gate EXTERN ssize_t (*Read)(), (*Write)(); 5017c478bd9Sstevel@tonic-gate #if defined(__STDC__) 5027c478bd9Sstevel@tonic-gate EXTERN int (*Ioctl)(int,int,...); 5037c478bd9Sstevel@tonic-gate #else 5047c478bd9Sstevel@tonic-gate EXTERN int (*Ioctl)(); 5057c478bd9Sstevel@tonic-gate #endif 5067c478bd9Sstevel@tonic-gate EXTERN int Ifn, Ofn; 5077c478bd9Sstevel@tonic-gate EXTERN int Debug, Verbose; 5087c478bd9Sstevel@tonic-gate EXTERN uid_t Uid, Euid; /* user-id and effective-uid */ 5097c478bd9Sstevel@tonic-gate EXTERN long Ulimit; 5107c478bd9Sstevel@tonic-gate EXTERN mode_t Dev_mode; /* save device mode here */ 5117c478bd9Sstevel@tonic-gate EXTERN char Wrkdir[]; 5127c478bd9Sstevel@tonic-gate EXTERN long Retrytime; 5137c478bd9Sstevel@tonic-gate EXTERN char **Env; 5147c478bd9Sstevel@tonic-gate EXTERN char Uucp[]; 5157c478bd9Sstevel@tonic-gate EXTERN char Pchar; 5167c478bd9Sstevel@tonic-gate EXTERN struct nstat Nstat; 5177c478bd9Sstevel@tonic-gate EXTERN char Dc[]; /* line name */ 5187c478bd9Sstevel@tonic-gate EXTERN int Seqn; /* sequence # */ 5197c478bd9Sstevel@tonic-gate EXTERN int Role; 5207c478bd9Sstevel@tonic-gate EXTERN int Sgrades; /* flag for administrator defined service grades */ 5217c478bd9Sstevel@tonic-gate EXTERN char Grade; 5227c478bd9Sstevel@tonic-gate EXTERN char Logfile[MAXFULLNAME]; 5237c478bd9Sstevel@tonic-gate EXTERN char Rmtname[MAXFULLNAME]; 5247c478bd9Sstevel@tonic-gate EXTERN char JobGrade[MAXBASENAME+1]; 5257c478bd9Sstevel@tonic-gate EXTERN char User[MAXFULLNAME]; 5267c478bd9Sstevel@tonic-gate EXTERN char Loginuser[NAMESIZE]; 5277c478bd9Sstevel@tonic-gate EXTERN char *Spool; 5287c478bd9Sstevel@tonic-gate EXTERN char *Pubdir; 5297c478bd9Sstevel@tonic-gate EXTERN char Myname[]; 5307c478bd9Sstevel@tonic-gate EXTERN char Progname[]; 5317c478bd9Sstevel@tonic-gate EXTERN char RemSpool[]; 5327c478bd9Sstevel@tonic-gate EXTERN char *Bnptr; /* used when BASENAME macro is expanded */ 5337c478bd9Sstevel@tonic-gate EXTERN char *Shchar; /* shell meta-charaters */ 5347c478bd9Sstevel@tonic-gate EXTERN int SizeCheck; /* ulimit check supported flag */ 5357c478bd9Sstevel@tonic-gate EXTERN long RemUlimit; /* remote ulimit if supported */ 5367c478bd9Sstevel@tonic-gate EXTERN int Restart; /* checkpoint restart supported flag */ 5377c478bd9Sstevel@tonic-gate 5387c478bd9Sstevel@tonic-gate EXTERN char Jobid[NAMESIZE]; /* Jobid of current C. file */ 5397c478bd9Sstevel@tonic-gate EXTERN int Uerror; /* global error code */ 5407c478bd9Sstevel@tonic-gate EXTERN char *UerrorText[]; /* text for error code */ 5417c478bd9Sstevel@tonic-gate 5427c478bd9Sstevel@tonic-gate #define UERRORTEXT UerrorText[Uerror] 5437c478bd9Sstevel@tonic-gate #define UTEXT(x) UerrorText[x] 5447c478bd9Sstevel@tonic-gate 5457c478bd9Sstevel@tonic-gate /* things get kind of tricky beyond this point -- please stay out */ 5467c478bd9Sstevel@tonic-gate 5477c478bd9Sstevel@tonic-gate #ifdef ATTSV 5487c478bd9Sstevel@tonic-gate #define index strchr 549*2a8bcb4eSToomas Soome #define rindex strrchr 5507c478bd9Sstevel@tonic-gate #else /*!ATTSV*/ 5517c478bd9Sstevel@tonic-gate #define strchr index 5527c478bd9Sstevel@tonic-gate #define strrchr rindex 5537c478bd9Sstevel@tonic-gate #endif /*ATTSV*/ 5547c478bd9Sstevel@tonic-gate 5557c478bd9Sstevel@tonic-gate #ifdef BSD4_2 5567c478bd9Sstevel@tonic-gate #define memcpy(s1,s2,n) bcopy(s2,s1,n) 5577c478bd9Sstevel@tonic-gate extern void bcopy(); 5587c478bd9Sstevel@tonic-gate #else 5597c478bd9Sstevel@tonic-gate #ifndef ATTSVR4 5607c478bd9Sstevel@tonic-gate #define vfork fork 5617c478bd9Sstevel@tonic-gate extern char *memcpy(); 5627c478bd9Sstevel@tonic-gate #endif 5637c478bd9Sstevel@tonic-gate #endif 5647c478bd9Sstevel@tonic-gate 5657c478bd9Sstevel@tonic-gate EXTERN struct stat __s_; 5667c478bd9Sstevel@tonic-gate #define F_READANY(f) ((fstat((f),&__s_)==0) && ((__s_.st_mode&(0004))!=0) ) 5677c478bd9Sstevel@tonic-gate #define READANY(f) ((stat((f),&__s_)==0) && ((__s_.st_mode&(0004))!=0) ) 5687c478bd9Sstevel@tonic-gate 5697c478bd9Sstevel@tonic-gate #define WRITEANY(f) ((stat((f),&__s_)==0) && ((__s_.st_mode&(0002))!=0) ) 5707c478bd9Sstevel@tonic-gate #define DIRECTORY(f) ((stat((f),&__s_)==0) && ((__s_.st_mode&(S_IFMT))==S_IFDIR) ) 5717c478bd9Sstevel@tonic-gate #define NOTEMPTY(f) ((stat((f),&__s_)==0) && (__s_.st_size!=0) ) 5727c478bd9Sstevel@tonic-gate 5737c478bd9Sstevel@tonic-gate /* uucp functions and subroutine */ 5747c478bd9Sstevel@tonic-gate EXTERN void (*genbrk)(); 5757c478bd9Sstevel@tonic-gate extern int iswrk(), gtwvec(); /* anlwrk.c */ 5767c478bd9Sstevel@tonic-gate extern void findgrade(); /* grades.c */ 5777c478bd9Sstevel@tonic-gate extern void chremdir(), mkremdir(); /* chremdir.c */ 5787c478bd9Sstevel@tonic-gate extern void toCorrupt(); /* cpmv.c */ 5797c478bd9Sstevel@tonic-gate extern int xmv(); /* cpmv.c */ 5807c478bd9Sstevel@tonic-gate 5817c478bd9Sstevel@tonic-gate EXTERN int getargs(); /* getargs.c */ 5827c478bd9Sstevel@tonic-gate EXTERN void bsfix(); /* getargs.c */ 5837c478bd9Sstevel@tonic-gate extern char *_uu_setlocale(); /* getargs.c */ 5847c478bd9Sstevel@tonic-gate extern void _uu_resetlocale(); /* getargs.c */ 5857c478bd9Sstevel@tonic-gate extern char *getprm(); /* getprm.c */ 5867c478bd9Sstevel@tonic-gate 5877c478bd9Sstevel@tonic-gate extern char *next_token(); /* permission.c */ 5887c478bd9Sstevel@tonic-gate extern char *nextarg(); /* permission.c */ 5897c478bd9Sstevel@tonic-gate extern int getuline(); /* permission.c */ 5907c478bd9Sstevel@tonic-gate 5917c478bd9Sstevel@tonic-gate EXTERN void logent(), usyslog(), ucloselog(); /* logent.c */ 5927c478bd9Sstevel@tonic-gate extern void commandlog(); /* logent.c */ 5937c478bd9Sstevel@tonic-gate extern time_t millitick(); /* logent.c */ 5947c478bd9Sstevel@tonic-gate 5957c478bd9Sstevel@tonic-gate extern unsigned long getfilesize(); /* statlog.c */ 5967c478bd9Sstevel@tonic-gate extern void putfilesize(); /* statlog.c */ 5977c478bd9Sstevel@tonic-gate 5987c478bd9Sstevel@tonic-gate EXTERN char *protoString(); /* permission.c */ 599462be471Sceastha extern int logFind(), mchFind(); /* permission.c */ 600462be471Sceastha extern int chkperm(), chkpth(); /* permission.c */ 601462be471Sceastha extern int cmdOK(), switchRole(); /* permission.c */ 602462be471Sceastha extern int callBack(), requestOK(); /* permission.c */ 603462be471Sceastha extern int noSpool(); /* permission.c */ 6047c478bd9Sstevel@tonic-gate extern void myName(); /* permission.c */ 6057c478bd9Sstevel@tonic-gate 6067c478bd9Sstevel@tonic-gate extern int mkdirs(); /* expfile.c */ 6077c478bd9Sstevel@tonic-gate extern int scanlimit(); /* limits.c */ 6087c478bd9Sstevel@tonic-gate extern void systat(); /* systat.c */ 6097c478bd9Sstevel@tonic-gate EXTERN int fd_mklock(), fd_cklock(); /* ulockf.c */ 6107c478bd9Sstevel@tonic-gate EXTERN int fn_cklock(); /* ulockf.c */ 6117c478bd9Sstevel@tonic-gate EXTERN int mklock(), cklock(), umlock(); /* ulockf.c */ 6127c478bd9Sstevel@tonic-gate EXTERN void fd_rmlock(), delock(), rmlock(); /* ulockf.c */ 6137c478bd9Sstevel@tonic-gate extern char *timeStamp(); /* utility.c */ 6147c478bd9Sstevel@tonic-gate EXTERN void assert(), errent(); /* utility.c */ 6157c478bd9Sstevel@tonic-gate extern void uucpname(); /* uucpname.c */ 6167c478bd9Sstevel@tonic-gate extern int versys(); /* versys.c */ 6177c478bd9Sstevel@tonic-gate extern void xuuxqt(), xuucico(); /* xqt.c */ 6187c478bd9Sstevel@tonic-gate EXTERN void cleanup(); /* misc main.c */ 6197c478bd9Sstevel@tonic-gate 6207c478bd9Sstevel@tonic-gate #define ASSERT(e, s1, s2, i1) if (!(e)) {\ 6217c478bd9Sstevel@tonic-gate assert(s1, s2, i1, __FILE__, __LINE__);\ 6227c478bd9Sstevel@tonic-gate cleanup(FAIL);}; 6237c478bd9Sstevel@tonic-gate 6247c478bd9Sstevel@tonic-gate #ifdef ATTSV 6257c478bd9Sstevel@tonic-gate void setbuf(); 6267c478bd9Sstevel@tonic-gate #else /* !ATTSV */ 6277c478bd9Sstevel@tonic-gate int setbuf(), ftime(); 6287c478bd9Sstevel@tonic-gate char *mktemp(); 6297c478bd9Sstevel@tonic-gate #endif /*ATTSV*/ 6307c478bd9Sstevel@tonic-gate 6317c478bd9Sstevel@tonic-gate #ifdef UNAME 6327c478bd9Sstevel@tonic-gate #include <sys/utsname.h> 6337c478bd9Sstevel@tonic-gate #endif /* UNAME */ 6347c478bd9Sstevel@tonic-gate 6357c478bd9Sstevel@tonic-gate #ifndef NOUSTAT 6367c478bd9Sstevel@tonic-gate #ifdef V7USTAT 6377c478bd9Sstevel@tonic-gate struct ustat { 6387c478bd9Sstevel@tonic-gate daddr_t f_tfree; /* total free */ 6397c478bd9Sstevel@tonic-gate ino_t f_tinode; /* total inodes free */ 6407c478bd9Sstevel@tonic-gate }; 6417c478bd9Sstevel@tonic-gate #else /* !NOUSTAT && !V7USTAT */ 6427c478bd9Sstevel@tonic-gate #ifdef STATFS 6437c478bd9Sstevel@tonic-gate #include <sys/vfs.h> 6447c478bd9Sstevel@tonic-gate #else 6457c478bd9Sstevel@tonic-gate #include <ustat.h> 6467c478bd9Sstevel@tonic-gate #endif /* STATFS */ 6477c478bd9Sstevel@tonic-gate #endif /* V7USTAT */ 6487c478bd9Sstevel@tonic-gate #endif /* NOUSTAT */ 6497c478bd9Sstevel@tonic-gate 6507c478bd9Sstevel@tonic-gate #ifdef BSD4_2 6517c478bd9Sstevel@tonic-gate int gethostname(); 6527c478bd9Sstevel@tonic-gate #endif /* BSD4_2 */ 6537c478bd9Sstevel@tonic-gate 6547c478bd9Sstevel@tonic-gate /* messages */ 6557c478bd9Sstevel@tonic-gate EXTERN char *Ct_OPEN; 6567c478bd9Sstevel@tonic-gate EXTERN char *Ct_WRITE; 6577c478bd9Sstevel@tonic-gate EXTERN char *Ct_READ; 6587c478bd9Sstevel@tonic-gate EXTERN char *Ct_CREATE; 6597c478bd9Sstevel@tonic-gate EXTERN char *Ct_ALLOCATE; 6607c478bd9Sstevel@tonic-gate EXTERN char *Ct_LOCK; 6617c478bd9Sstevel@tonic-gate EXTERN char *Ct_STAT; 6627c478bd9Sstevel@tonic-gate EXTERN char *Ct_CHOWN; 6637c478bd9Sstevel@tonic-gate EXTERN char *Ct_CHMOD; 6647c478bd9Sstevel@tonic-gate EXTERN char *Ct_LINK; 6657c478bd9Sstevel@tonic-gate EXTERN char *Ct_CHDIR; 6667c478bd9Sstevel@tonic-gate EXTERN char *Ct_UNLINK; 6677c478bd9Sstevel@tonic-gate EXTERN char *Wr_ROLE; 6687c478bd9Sstevel@tonic-gate EXTERN char *Ct_CORRUPT; 6697c478bd9Sstevel@tonic-gate EXTERN char *Ct_FORK; 6707c478bd9Sstevel@tonic-gate EXTERN char *Ct_CLOSE; 6717c478bd9Sstevel@tonic-gate EXTERN char *Ct_BADOWN; 6727c478bd9Sstevel@tonic-gate EXTERN char *Fl_EXISTS; 6737c478bd9Sstevel@tonic-gate 674ace1a5f1Sdp 675ace1a5f1Sdp #ifdef __cplusplus 676ace1a5f1Sdp } 6777c478bd9Sstevel@tonic-gate #endif 678ace1a5f1Sdp 679ace1a5f1Sdp #endif /* _UUCP_H */ 680