libutil.h revision 24461
155714Skris/*
255714Skris * Copyright (c) 1995 Peter Wemm <peter@freebsd.org>
355714Skris * All rights reserved.
455714Skris *
555714Skris * Redistribution and use in source and binary forms, with or without
655714Skris * modification, is permitted provided that the following conditions
755714Skris * are met:
8280304Sjkim * 1. Redistributions of source code must retain the above copyright
955714Skris *    notice immediately at the beginning of the file, without modification,
1055714Skris *    this list of conditions, and the following disclaimer.
1155714Skris * 2. Redistributions in binary form must reproduce the above copyright
1255714Skris *    notice, this list of conditions and the following disclaimer in the
1355714Skris *    documentation and/or other materials provided with the distribution.
1455714Skris * 3. This work was done expressly for inclusion into FreeBSD.  Other use
15280304Sjkim *    is permitted provided this notation is included.
1655714Skris * 4. Absolutely no warranty of function or purpose is made by the author
1755714Skris *    Peter Wemm.
1855714Skris * 5. Modifications may be freely made to this file providing the above
1955714Skris *    conditions are met.
2055714Skris *
2155714Skris * $Id: libutil.h,v 1.5 1997/03/30 12:11:27 brian Exp $
22280304Sjkim */
2355714Skris
2455714Skris#ifndef _LIBUTIL_H_
2555714Skris#define	_LIBUTIL_H_
2655714Skris
2755714Skris#include <sys/cdefs.h>
2855714Skris
2955714Skris/* Avoid pulling in all the include files for no need */
3055714Skrisstruct termios;
3155714Skrisstruct winsize;
3255714Skrisstruct utmp;
3355714Skris
3455714Skris__BEGIN_DECLS
3555714Skrisvoid	setproctitle __P((const char *fmt, ...));
3655714Skrisvoid	login __P((struct utmp *ut));
37280304Sjkimint	login_tty __P((int fd));
3855714Skrisint	logout __P((char *line));
3955714Skrisvoid	logwtmp __P((char *line, char *name, char *host));
40280304Sjkimint	openpty __P((int *amaster, int *aslave, char *name,
4155714Skris		     struct termios *termp, struct winsize *winp));
4255714Skrisint	forkpty __P((int *amaster, char *name,
4355714Skris		     struct termios *termp, struct winsize *winp));
4455714Skrischar	*uu_lockerr __P((int uu_lockresult));
4555714Skrisint	uu_lock __P((char *ttyname));
4655714Skrisint	uu_unlock __P((char *ttyname));
4755714Skris__END_DECLS
4855714Skris
4955714Skris#define UU_LOCK_INUSE (1)
5055714Skris#define UU_LOCK_OK (0)
5155714Skris#define UU_LOCK_OPEN_ERR (-1)
52280304Sjkim#define UU_LOCK_READ_ERR (-2)
5355714Skris#define UU_LOCK_SEEK_ERR (-3)
5455714Skris#define UU_LOCK_WRITE_ERR (-4)
5555714Skris
5655714Skris#endif /* !_LIBUTIL_H_ */
5755714Skris