]> git.cameronkatri.com Git - pw-darwin.git/blob - libutil/libutil.h
Add realhostname() - a function to correctly lookup
[pw-darwin.git] / libutil / libutil.h
1 /*
2 * Copyright (c) 1995 Peter Wemm <peter@freebsd.org>
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, is permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright
9 * notice immediately at the beginning of the file, without modification,
10 * this list of conditions, and the following disclaimer.
11 * 2. Redistributions in binary form must reproduce the above copyright
12 * notice, this list of conditions and the following disclaimer in the
13 * documentation and/or other materials provided with the distribution.
14 * 3. This work was done expressly for inclusion into FreeBSD. Other use
15 * is permitted provided this notation is included.
16 * 4. Absolutely no warranty of function or purpose is made by the author
17 * Peter Wemm.
18 * 5. Modifications may be freely made to this file providing the above
19 * conditions are met.
20 *
21 * $Id: libutil.h,v 1.21 1998/12/16 17:52:15 bde Exp $
22 */
23
24 #ifndef _LIBUTIL_H_
25 #define _LIBUTIL_H_
26
27 #include <sys/cdefs.h>
28
29 /* for properties.c */
30 typedef struct _property {
31 struct _property *next;
32 char *name;
33 char *value;
34 } *properties;
35
36 /* Avoid pulling in all the include files for no need */
37 struct termios;
38 struct winsize;
39 struct utmp;
40 struct in_addr;
41
42 __BEGIN_DECLS
43 void setproctitle __P((const char *_fmt, ...)) __printf0like(1, 2);
44 void login __P((struct utmp *_ut));
45 int login_tty __P((int _fd));
46 int logout __P((char *_line));
47 void logwtmp __P((const char *_line, const char *_name, const char *_host));
48 void trimdomain __P((char *_fullhost, int _hostsize));
49 int openpty __P((int *_amaster, int *_aslave, char *_name,
50 struct termios *_termp, struct winsize *_winp));
51 int forkpty __P((int *_amaster, char *_name,
52 struct termios *_termp, struct winsize *_winp));
53 const char *uu_lockerr __P((int _uu_lockresult));
54 int uu_lock __P((const char *_ttyname));
55 int uu_unlock __P((const char *_ttyname));
56 int uu_lock_txfr __P((const char *_ttyname, pid_t _pid));
57 int _secure_path __P((const char *_path, uid_t _uid, gid_t _gid));
58 properties properties_read __P((int fd));
59 void properties_free __P((properties list));
60 char *property_find __P((properties list, const char *name));
61 char *auth_getval __P((const char *name));
62 int realhostname __P((char *host, size_t hsize, const struct in_addr *ip));
63 __END_DECLS
64
65 #define UU_LOCK_INUSE (1)
66 #define UU_LOCK_OK (0)
67 #define UU_LOCK_OPEN_ERR (-1)
68 #define UU_LOCK_READ_ERR (-2)
69 #define UU_LOCK_CREAT_ERR (-3)
70 #define UU_LOCK_WRITE_ERR (-4)
71 #define UU_LOCK_LINK_ERR (-5)
72 #define UU_LOCK_TRY_ERR (-6)
73 #define UU_LOCK_OWNER_ERR (-7)
74
75 /* return values from realhostname() */
76 #define HOSTNAME_FOUND (0)
77 #define HOSTNAME_INCORRECTNAME (1)
78 #define HOSTNAME_INVALIDADDR (2)
79 #define HOSTNAME_INVALIDNAME (3)
80
81 #endif /* !_LIBUTIL_H_ */