xref: /illumos-gate/usr/src/cmd/bnu/uucp.h (revision 9d6681f7f834fe39fc8c9d9a791e581f7684d913)
1 /*
2  * CDDL HEADER START
3  *
4  * The contents of this file are subject to the terms of the
5  * Common Development and Distribution License, Version 1.0 only
6  * (the "License").  You may not use this file except in compliance
7  * with the License.
8  *
9  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10  * or http://www.opensolaris.org/os/licensing.
11  * See the License for the specific language governing permissions
12  * and limitations under the License.
13  *
14  * When distributing Covered Code, include this CDDL HEADER in each
15  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16  * If applicable, add the following below this CDDL HEADER, with the
17  * fields enclosed by brackets "[]" replaced with your own identifying
18  * information: Portions Copyright [yyyy] [name of copyright owner]
19  *
20  * CDDL HEADER END
21  */
22 /*
23  * Copyright 2005 Sun Microsystems, Inc.  All rights reserved.
24  * Use is subject to license terms.
25  */
26 
27 /*	Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T	*/
28 /*	  All Rights Reserved  	*/
29 
30 
31 #ifndef _UUCP_H
32 #define _UUCP_H
33 
34 #ifdef __cplusplus
35 extern "C" {
36 #endif
37 
38 #include <unistd.h>
39 #include <stdlib.h>
40 #include <string.h>
41 #include <locale.h>
42 #include <wchar.h>
43 #include <widec.h>
44 #include <wctype.h>
45 #include <ulimit.h>
46 #include <values.h>
47 #include <sys/types.h>
48 #include <sys/wait.h>
49 
50 #include "parms.h"
51 
52 #ifdef ATTSV
53 #define ATTSVKILL
54 #define ATTSVTTY
55 #define UNAME
56 #ifdef ATTSVR4
57 #define	ATTSVR3
58 #endif /*ATTSVR4*/
59 #endif /*ATTSV*/
60 
61 #ifdef BSD4_3
62 #define BSD4_2
63 #define	BSDINETD
64 #endif /*BSD4_3 */
65 
66 #ifdef DIAL
67 #define EXTERN static
68 #define GLOBAL static
69 #else
70 #define EXTERN extern
71 #define GLOBAL
72 #endif
73 
74 #ifdef BSD4_2
75 #define V7
76 #define ATTSVKILL
77 #undef NONAP	/* conn.c has a nap() for 4.2 -- it's called select() */
78 #undef FASTTIMER
79 #endif /* BSD4_2 */
80 
81 #ifdef V8
82 #define V7
83 #define ATTSVKILL
84 #define UNAME
85 #endif /* V8 */
86 
87 #ifdef FASTTIMER
88 #undef NONAP
89 #endif
90 
91 #include <stdio.h>
92 #include <ctype.h>
93 #include <setjmp.h>
94 #include <sys/param.h>
95 
96 /*
97  * param.h includes types.h and signal.h in 4bsd
98  */
99 #ifdef V7
100 #ifdef ATTSVTTY
101 #include <termio.h>
102 #else /* ATTSVTTY */
103 #include <sgtty.h>
104 #endif /* ATTSVTTY */
105 #include <sys/timeb.h>
106 #ifdef BSD4_2
107 #include <fcntl.h>
108 #endif /* BSD4_2 */
109 #else /* !V7 */
110 #include <termio.h>
111 #include <sys/types.h>
112 #include <signal.h>
113 #include <fcntl.h>
114 #endif /* V7 */
115 
116 #include <sys/stat.h>
117 #include <utime.h>
118 #include <dirent.h>
119 
120 #ifdef BSD4_2
121 #include <sys/time.h>
122 #else /* !BSD4_2 */
123 #include <time.h>
124 #endif /* BSD4_2 */
125 
126 #include <sys/times.h>
127 #include <errno.h>
128 
129 #ifdef ATTSV
130 #ifdef ATTSVR4
131 #include <sys/mkdev.h>
132 #else /* !ATTSVR4 */
133 #include <sys/sysmacros.h>
134 #endif /* ATTSVR4 */
135 #endif /* ATTSV */
136 
137 #ifdef	RT
138 #include "rt/types.h"
139 #include "rt/unix/param.h"
140 #include "rt/stat.h"
141 #include <sys/ustat.h>
142 #endif /* RT */
143 
144 #include <sysexits.h>
145 
146 #ifndef ATTSVR4
147 #define	const
148 #endif /* ATTSVR4 */
149 
150 /* what mode should user files be allowed to have upon creation? */
151 /* NOTE: This does not allow setuid or execute bits on transfer. */
152 #define LEGALMODE (mode_t) 0666
153 
154 /* what mode should public files have upon creation? */
155 #define PUB_FILEMODE (mode_t) 0666
156 
157 /* what mode should log files have upon creation? */
158 #define LOGFILEMODE (mode_t) 0644
159 
160 /* what mode should C. files have upon creation? */
161 #define CFILEMODE (mode_t) 0644
162 
163 /* what mode should D. files have upon creation? */
164 #define DFILEMODE (mode_t) 0600
165 
166 /* define the value of PUBMASK, used for creating "public" directories */
167 #define PUBMASK (mode_t) 0000
168 
169 /* what mode should public directories have upon creation? */
170 #define PUB_DIRMODE (mode_t) 0777
171 
172 /* define the value of DIRMASK, used for creating "system" subdirectories */
173 #define DIRMASK (mode_t) 0022
174 
175 #define MAXSTART	300	/* how long to wait on startup */
176 
177 /* define the last characters for ACU  (used for 801/212 dialers) */
178 #define ACULAST "<"
179 
180 /*  caution - the fillowing names are also in Makefile
181  *    any changes here have to also be made there
182  *
183  * it's a good idea to make directories .foo, since this ensures
184  * that they'll be ignored by processes that search subdirectories in SPOOL
185  *
186  *  XQTDIR=/var/uucp/.Xqtdir
187  *  CORRUPT=/var/uucp/.Corrupt
188  *  LOGDIR=/var/uucp/.Log
189  *  SEQDIR=/var/uucp/.Sequence
190  *  STATDIR=/var/uucp/.Status
191  *
192  */
193 
194 /* where to put the STST. files? */
195 #define STATDIR		"/var/uucp/.Status"
196 
197 /* where should logfiles be kept? */
198 #define LOGUUX		"/var/uucp/.Log/uux"
199 #define LOGUUXQT	"/var/uucp/.Log/uuxqt"
200 #define LOGUUCP		"/var/uucp/.Log/uucp"
201 #define LOGCICO		"/var/uucp/.Log/uucico"
202 
203 /* some sites use /var/uucp/.Corrupt and /var/uucp/.Xqtdir here */
204 /* use caution since things are linked into there from /var/spool/uucp */
205 #define CORRUPTDIR	"/var/spool/uucp/.Corrupt"
206 #define XQTDIR		"/var/spool/uucp/.Xqtdir"
207 
208 /* how much of a system name can we print in a [CX]. file? */
209 /* MAXBASENAME - 1 (pre) - 1 ('.') - 1 (grade) - 4 (sequence number) */
210 #define SYSNSIZE (MAXBASENAME - 7)
211 
212 #ifdef USRSPOOLLOCKS
213 #define LOCKPRE		"/var/spool/locks/LCK."
214 #else /*!USRSPOOLLOCKS*/
215 #define LOCKPRE		"/var/spool/uucp/LCK."
216 #endif /* USRSPOOLLOCKS */
217 
218 #define SQFILE		"/etc/uucp/SQFILE"
219 #define SQTMP		"/etc/uucp/SQTMP"
220 #define SLCKTIME	5400	/* system/device timeout (LCK.. files) */
221 #define DIALCODES	"/etc/uucp/Dialcodes"
222 #define PERMISSIONS	"/etc/uucp/Permissions"
223 #define SYSNAMEFILE	"/etc/uucp/Sysname"
224 
225 #define SPOOL		"/var/spool/uucp"
226 #define SEQDIR		"/var/uucp/.Sequence"
227 
228 #define X_LOCKTIME	3600
229 #ifdef USRSPOOLLOCKS
230 #define SEQLOCK		"/var/spool/locks/LCK.SQ."
231 #define SQLOCK		"/var/spool/locks/LCK.SQ"
232 #define X_LOCK		"/var/spool/locks/LCK.X"
233 #define S_LOCK		"/var/spool/locks/LCK.S"
234 #define L_LOCK		"/var/spool/locks/LK"
235 #define X_LOCKDIR	"/var/spool/locks"	/* must be dir part of above */
236 #else /*!USRSPOOLLOCKS*/
237 #define SEQLOCK		"/var/spool/uucp/LCK.SQ."
238 #define SQLOCK		"/var/spool/uucp/LCK.SQ"
239 #define X_LOCK		"/var/spool/uucp/LCK.X"
240 #define S_LOCK		"/var/spool/uucp/LCK.S"
241 #define L_LOCK		"/var/spool/uucp/LK"
242 #define X_LOCKDIR	"/var/spool/uucp"	/* must be dir part of above */
243 #endif /* USRSPOOLLOCKS */
244 #define X_LOCKPRE	"LCK.X"		/* must be last part of above */
245 #define	S_LOCKPRE	"LCK.S"
246 
247 /*
248  * Note: this should be "/usr/spool/uucppublic", not "/var/spool/uucppublic",
249  * because if a Permissions file entry doesn't explicitly list directories to
250  * which and from which files can be copied you can only copy files to and from
251  * PUBDIR, and most systems out there will think PUBDIR is
252  * "/usr/spool/uucppublic" not "/var/spool/uucppublic" (i.e., if you change
253  * this, other systems may be rudely surprised when they try to get things from
254  * or to PUBDIR).
255  */
256 #define PUBDIR		"/usr/spool/uucppublic"
257 #define ADMIN		"/var/uucp/.Admin"
258 #define ERRLOG		"/var/uucp/.Admin/errors"
259 #define SYSLOG		"/var/uucp/.Admin/xferstats"
260 #define RMTDEBUG	"/var/uucp/.Admin/audit"
261 #define CLEANUPLOGFILE	"/var/uucp/.Admin/uucleanup"
262 #define CMDLOG		"/var/uucp/.Admin/command"
263 #define PERFLOG		"/var/uucp/.Admin/perflog"
264 #define ACCOUNT		"/var/uucp/.Admin/account"
265 #define SECURITY	"/var/uucp/.Admin/security"
266 
267 /*
268  * WORKSPACE should be in the same filesystem as SPOOL so that "mv"
269  * between the two will work.  Otherwise, the file must be copied
270  * and a window exists during which the file is mode 666.
271  */
272 #define	WORKSPACE	"/var/spool/uucp/.Workspace"
273 
274 #define SQTIME		60
275 #define TRYCALLS	2	/* number of tries to dial call */
276 #define MINULIMIT	(1L<<11)	/* minimum reasonable ulimit */
277 #define	MAX_LOCKTRY	5	/* number of attempts to lock device */
278 
279 /*
280  * CDEBUG is for communication line debugging
281  * DEBUG is for program debugging
282  * #define SMALL to compile without the DEBUG code
283  */
284 
285 #ifndef DIAL
286 #define CDEBUG(l, f, s) if (Debug >= l) fprintf(stderr, f, s)
287 #else
288 #define CDEBUG(l, f, s)
289 #define SMALL
290 #endif
291 
292 #ifndef SMALL
293 #define DEBUG(l, f, s) if (Debug >= l) fprintf(stderr, f, s)
294 #else
295 #define DEBUG(l, f, s)
296 #endif /* SMALL */
297 
298 /*
299  * VERBOSE is used by cu and ct to inform the user of progress
300  * In other programs, the Value of Verbose is always 0.
301  */
302 #define VERBOSE(f, s) { if (Verbose > 0) fprintf(stderr, f, s); }
303 
304 #define PREFIX(pre, str)	(strncmp((pre), (str), strlen(pre)) == SAME)
305 #define BASENAME(str, c) ((Bnptr = strrchr((str), c)) ? (Bnptr + 1) : (str))
306 #define EQUALS(a,b)	((a != CNULL) && (b != CNULL) && (strcmp((a),(b))==SAME))
307 #define WEQUALS(a,b)	((a != CNULL) && (b != CNULL) && (wcscmp((a),(b))==SAME))
308 #define EQUALSN(a,b,n)	((a != CNULL) && (b != CNULL) && (strncmp((a),(b),(n))==SAME))
309 #define WEQUALSN(a,b,n)	((a != CNULL) && (b != CNULL) && (wcsncmp((a),(b),(n))==SAME))
310 #define LASTCHAR(s)	(s+strlen(s)-1)
311 
312 #define SAME 0
313 #define ANYREAD 04
314 #define ANYWRITE 02
315 #define FAIL -1
316 #define SUCCESS 0
317 #define NULLCHAR	'\0'
318 #define CNULL ((void *) 0)
319 #define STBNULL (struct sgttyb *) 0
320 #define MASTER 1
321 #define SLAVE 0
322 #define MAXBASENAME 14 /* should be DIRSIZ but that is now fs dependent */
323 #define MAXFULLNAME BUFSIZ
324 #define MAXNAMESIZE	64	/* /var/spool/uucp/<14 chars>/<14 chars>+slop */
325 #define CONNECTTIME 30
326 #define EXPECTTIME 45
327 #define MSGTIME 60
328 #define NAMESIZE MAXBASENAME+1
329 #define	SIZEOFPID	10		/* maximum number of digits in a pid */
330 #define EOTMSG "\004\n\004\n"
331 #define CALLBACK 1
332 
333 /* manifests for sysfiles.c's sysaccess()	*/
334 /* check file access for REAL user id */
335 #define	ACCESS_SYSTEMS	1
336 #define	ACCESS_DEVICES	2
337 #define	ACCESS_DIALERS	3
338 /* check file access for EFFECTIVE user id */
339 #define	EACCESS_SYSTEMS	4
340 #define	EACCESS_DEVICES	5
341 #define	EACCESS_DIALERS	6
342 
343 /* manifest for chkpth flag */
344 #define CK_READ		0
345 #define CK_WRITE	1
346 
347 /*
348  * commands
349  */
350 #define SHELL		"/usr/bin/sh"
351 #define MAIL		"mail"
352 #define UUCICO		"/usr/lib/uucp/uucico"
353 #define UUXQT		"/usr/lib/uucp/uuxqt"
354 #define UUX		"/usr/bin/uux"
355 #define UUCP		"/usr/bin/uucp"
356 
357 
358 /* system status stuff */
359 #define SS_OK			0
360 #define SS_NO_DEVICE		1
361 #define SS_TIME_WRONG		2
362 #define SS_INPROGRESS		3
363 #define SS_CONVERSATION		4
364 #define SS_SEQBAD		5
365 #define SS_LOGIN_FAILED		6
366 #define SS_DIAL_FAILED		7
367 #define SS_BAD_LOG_MCH		8
368 #define SS_LOCKED_DEVICE	9
369 #define SS_ASSERT_ERROR		10
370 #define SS_BADSYSTEM		11
371 #define SS_CANT_ACCESS_DEVICE	12
372 #define SS_DEVICE_FAILED	13	/* used for interface failure */
373 #define SS_WRONG_MCH		14
374 #define SS_CALLBACK		15
375 #define SS_RLOCKED		16
376 #define SS_RUNKNOWN		17
377 #define SS_RLOGIN		18
378 #define SS_UNKNOWN_RESPONSE	19
379 #define SS_STARTUP		20
380 #define SS_CHAT_FAILED		21
381 #define SS_CALLBACK_LOOP	22
382 
383 #define MAXPH	60	/* maximum phone string size */
384 #define	MAXC	BUFSIZ
385 
386 #define	TRUE	1
387 #define	FALSE	0
388 #define NAMEBUF	32
389 
390 /* The call structure is used by ct.c, cu.c, and dial.c.	*/
391 
392 struct call {
393 	char *speed;		/* transmission baud rate */
394 	char *line;		/* device name for outgoing line */
395 	char *telno;		/* ptr to tel-no digit string */
396 	char *type;		/* type of device to use for call. */
397 };
398 
399 /* structure of an Systems file line */
400 #define F_MAX	50	/* max number of fields in Systems file line */
401 #define F_NAME 0
402 #define F_TIME 1
403 #define F_TYPE 2
404 #define F_CLASS 3	/* an optional prefix and the speed */
405 #define F_PHONE 4
406 #define F_LOGIN 5
407 
408 /* structure of an Devices file line */
409 #define D_TYPE 0
410 #define D_LINE 1
411 #define D_CALLDEV 2
412 #define D_CLASS 3
413 #define D_CALLER 4
414 #define D_ARG 5
415 #define D_MAX	50	/* max number of fields in Devices file line */
416 
417 #define D_ACU 1
418 #define D_DIRECT 2
419 #define D_PROT 4
420 
421 #define GRADES "/etc/uucp/Grades"
422 
423 #define	D_QUEUE	'Z'	/* default queue */
424 
425 /* past here, local changes are not recommended */
426 #define CMDPRE		'C'
427 #define DATAPRE		'D'
428 #define XQTPRE		'X'
429 
430 /*
431  * stuff for command execution
432  */
433 #define X_RQDFILE	'F'
434 #define X_STDIN		'I'
435 #define X_STDOUT	'O'
436 #define X_STDERR	'E'
437 #define X_CMD		'C'
438 #define X_USER		'U'
439 #define X_BRINGBACK	'B'
440 #define X_MAILF		'M'
441 #define X_RETADDR	'R'
442 #define X_COMMENT	'#'
443 #define X_NONZERO	'Z'
444 #define X_SENDNOTHING	'N'
445 #define X_SENDZERO	'n'
446 #define X_JOBID		'J'
447 
448 
449 /* This structure describes call routines */
450 struct caller {
451 	char	*CA_type;
452 	int	(*CA_caller)();
453 };
454 
455 /* structure for a saved C file */
456 
457 struct cs_struct {
458 	char	file[NAMESIZE];
459 	char	sys[NAMESIZE+5];
460 	char	sgrade[NAMESIZE];
461 	char	grade;
462 	long	jsize;
463 };
464 
465 /* This structure describes dialing routines */
466 struct dialer {
467 	char	*DI_type;
468 	int	(*DI_dialer)();
469 };
470 
471 struct nstat {
472 	pid_t	t_pid;		/* process id				*/
473 	time_t	t_start;	/* start time				*/
474 	time_t	t_scall;	/* start call to system			*/
475 	time_t	t_ecall;	/* end call to system			*/
476 	time_t	t_tacu;		/* acu time				*/
477 	time_t	t_tlog;		/* login time				*/
478 	time_t	t_sftp;		/* start file transfer protocol		*/
479 	time_t	t_sxf;		/* start xfer 				*/
480 	time_t	t_exf;		/* end xfer 				*/
481 	time_t	t_eftp;		/* end file transfer protocol		*/
482 	time_t	t_qtime;	/* time file queued			*/
483 	int	t_ndial;	/* # of dials				*/
484 	int	t_nlogs;	/* # of login trys			*/
485 	struct tms t_tbb;	/* start execution times		*/
486 	struct tms t_txfs;	/* xfer start times			*/
487 	struct tms t_txfe;	/* xfer end times 			*/
488 	struct tms t_tga;	/* garbage execution times		*/
489 };
490 
491 /* This structure describes the values from Limits file */
492 struct limits {
493 	int	totalmax;	/* overall limit */
494 	int	sitemax;	/* limit per site */
495 	char	mode[64];	/* uucico mode */
496 };
497 
498 /* external declarations */
499 
500 EXTERN ssize_t (*Read)(), (*Write)();
501 #if defined(__STDC__)
502 EXTERN int (*Ioctl)(int,int,...);
503 #else
504 EXTERN int (*Ioctl)();
505 #endif
506 EXTERN int Ifn, Ofn;
507 EXTERN int Debug, Verbose;
508 EXTERN uid_t Uid, Euid;		/* user-id and effective-uid */
509 EXTERN long Ulimit;
510 EXTERN mode_t Dev_mode;		/* save device mode here */
511 EXTERN char Wrkdir[];
512 EXTERN long Retrytime;
513 EXTERN char **Env;
514 EXTERN char Uucp[];
515 EXTERN char Pchar;
516 EXTERN struct nstat Nstat;
517 EXTERN char Dc[];			/* line name			*/
518 EXTERN int Seqn;			/* sequence #			*/
519 EXTERN int Role;
520 EXTERN int Sgrades;		/* flag for administrator defined service grades */
521 EXTERN char Grade;
522 EXTERN char Logfile[MAXFULLNAME];
523 EXTERN char Rmtname[MAXFULLNAME];
524 EXTERN char JobGrade[MAXBASENAME+1];
525 EXTERN char User[MAXFULLNAME];
526 EXTERN char Loginuser[NAMESIZE];
527 EXTERN char *Spool;
528 EXTERN char *Pubdir;
529 EXTERN char Myname[];
530 EXTERN char Progname[];
531 EXTERN char RemSpool[];
532 EXTERN char *Bnptr;		/* used when BASENAME macro is expanded */
533 EXTERN char *Shchar;		/* shell meta-charaters */
534 EXTERN int SizeCheck;		/* ulimit check supported flag */
535 EXTERN long RemUlimit;		/* remote ulimit if supported */
536 EXTERN int Restart;		/* checkpoint restart supported flag */
537 
538 EXTERN char Jobid[NAMESIZE];	/* Jobid of current C. file */
539 EXTERN int Uerror;		/* global error code */
540 EXTERN char *UerrorText[];	/* text for error code */
541 
542 #define UERRORTEXT		UerrorText[Uerror]
543 #define UTEXT(x)		UerrorText[x]
544 
545 /* things get kind of tricky beyond this point -- please stay out */
546 
547 #ifdef ATTSV
548 #define index strchr
549 #define rindex strrchr
550 #else /*!ATTSV*/
551 #define strchr index
552 #define strrchr rindex
553 #endif /*ATTSV*/
554 
555 #ifdef BSD4_2
556 #define memcpy(s1,s2,n) bcopy(s2,s1,n)
557 extern void	bcopy();
558 #else
559 #ifndef ATTSVR4
560 #define vfork fork
561 extern char	*memcpy();
562 #endif
563 #endif
564 
565 EXTERN struct stat __s_;
566 #define F_READANY(f)	((fstat((f),&__s_)==0) && ((__s_.st_mode&(0004))!=0) )
567 #define READANY(f)	((stat((f),&__s_)==0) && ((__s_.st_mode&(0004))!=0) )
568 
569 #define WRITEANY(f)	((stat((f),&__s_)==0) && ((__s_.st_mode&(0002))!=0) )
570 #define DIRECTORY(f)	((stat((f),&__s_)==0) && ((__s_.st_mode&(S_IFMT))==S_IFDIR) )
571 #define NOTEMPTY(f)	((stat((f),&__s_)==0) && (__s_.st_size!=0) )
572 
573 /* uucp functions and subroutine */
574 EXTERN void	(*genbrk)();
575 extern int	iswrk(), gtwvec();			/* anlwrk.c */
576 extern void	findgrade();				/* grades.c */
577 extern void	chremdir(), mkremdir();			/* chremdir.c */
578 extern void	toCorrupt();				/* cpmv.c  */
579 extern int	xmv();					/* cpmv.c  */
580 
581 EXTERN int	getargs();				/* getargs.c */
582 EXTERN void	bsfix();				/* getargs.c */
583 extern char	*_uu_setlocale();			/* getargs.c */
584 extern void	_uu_resetlocale();			/* getargs.c */
585 extern char	*getprm();				/* getprm.c */
586 
587 extern char	*next_token();				/* permission.c */
588 extern char	*nextarg();				/* permission.c */
589 extern int	getuline();				/* permission.c */
590 
591 EXTERN void	logent(), usyslog(), ucloselog();	/* logent.c */
592 extern void	commandlog();				/* logent.c */
593 extern time_t	millitick();				/* logent.c */
594 
595 extern unsigned long	getfilesize();			/* statlog.c */
596 extern void 		putfilesize();			/* statlog.c */
597 
598 EXTERN char	*protoString();				/* permission.c */
599 extern int	logFind(), mchFind();			/* permission.c */
600 extern int	chkperm(), chkpth();			/* permission.c */
601 extern int	cmdOK(), switchRole();			/* permission.c */
602 extern int	callBack(), requestOK();		/* permission.c */
603 extern int	noSpool();				/* permission.c */
604 extern void	myName();				/* permission.c */
605 
606 extern int	mkdirs();				/* expfile.c */
607 extern int	scanlimit();				/* limits.c */
608 extern void	systat();				/* systat.c */
609 EXTERN int	fd_mklock(), fd_cklock();		/* ulockf.c */
610 EXTERN int	fn_cklock();				/* ulockf.c */
611 EXTERN int	mklock(), cklock(), umlock();		/* ulockf.c */
612 EXTERN void	fd_rmlock(), delock(), rmlock();	/* ulockf.c */
613 extern char	*timeStamp();				/* utility.c */
614 EXTERN void	assert(), errent();			/* utility.c */
615 extern void	uucpname();				/* uucpname.c */
616 extern int	versys();				/* versys.c */
617 extern void	xuuxqt(), xuucico();			/* xqt.c */
618 EXTERN void	cleanup();				/* misc main.c */
619 
620 #define ASSERT(e, s1, s2, i1) if (!(e)) {\
621 	assert(s1, s2, i1, __FILE__, __LINE__);\
622 	cleanup(FAIL);};
623 
624 #ifdef ATTSV
625 void	setbuf();
626 #else /* !ATTSV */
627 int	setbuf(), ftime();
628 char	*mktemp();
629 #endif /*ATTSV*/
630 
631 #ifdef UNAME
632 #include <sys/utsname.h>
633 #endif /* UNAME */
634 
635 #ifndef NOUSTAT
636 #ifdef V7USTAT
637 struct  ustat {
638 	daddr_t	f_tfree;	/* total free */
639 	ino_t	f_tinode;	/* total inodes free */
640 };
641 #else /* !NOUSTAT && !V7USTAT */
642 #ifdef STATFS
643 #include <sys/vfs.h>
644 #else
645 #include <ustat.h>
646 #endif /* STATFS */
647 #endif /* V7USTAT */
648 #endif /* NOUSTAT */
649 
650 #ifdef BSD4_2
651 int	gethostname();
652 #endif /* BSD4_2 */
653 
654 /* messages */
655 EXTERN char *Ct_OPEN;
656 EXTERN char *Ct_WRITE;
657 EXTERN char *Ct_READ;
658 EXTERN char *Ct_CREATE;
659 EXTERN char *Ct_ALLOCATE;
660 EXTERN char *Ct_LOCK;
661 EXTERN char *Ct_STAT;
662 EXTERN char *Ct_CHOWN;
663 EXTERN char *Ct_CHMOD;
664 EXTERN char *Ct_LINK;
665 EXTERN char *Ct_CHDIR;
666 EXTERN char *Ct_UNLINK;
667 EXTERN char *Wr_ROLE;
668 EXTERN char *Ct_CORRUPT;
669 EXTERN char *Ct_FORK;
670 EXTERN char *Ct_CLOSE;
671 EXTERN char *Ct_BADOWN;
672 EXTERN char *Fl_EXISTS;
673 
674 
675 #ifdef __cplusplus
676 }
677 #endif
678 
679 #endif	/* _UUCP_H */
680