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