xref: /titanic_50/usr/src/cmd/ssh/include/misc.h (revision 4703203d9b3e06246d73931f07359a7ef70f47bf)
1 /*	$OpenBSD: misc.h,v 1.12 2002/03/19 10:49:35 markus Exp $	*/
2 
3 #ifndef	_MISC_H
4 #define	_MISC_H
5 
6 #pragma ident	"%Z%%M%	%I%	%E% SMI"
7 
8 #ifdef __cplusplus
9 extern "C" {
10 #endif
11 
12 
13 /*
14  * Author: Tatu Ylonen <ylo@cs.hut.fi>
15  * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
16  *                    All rights reserved
17  *
18  * As far as I am concerned, the code I have written for this software
19  * can be used freely for any purpose.  Any derived versions of this
20  * software must be clearly marked as such, and if the derived work is
21  * incompatible with the protocol description in the RFC file, it must be
22  * called by a name other than "ssh" or "Secure Shell".
23  */
24 /*
25  * Copyright 2007 Sun Microsystems, Inc.  All rights reserved.
26  * Use is subject to license terms.
27  */
28 
29 char	*chop(char *);
30 char	*strdelim(char **);
31 void	 set_nonblock(int);
32 void	 unset_nonblock(int);
33 void	 set_nodelay(int);
34 int	 a2port(const char *);
35 char	*cleanhostname(char *);
36 char	*colon(char *);
37 long	 convtime(const char *);
38 char	*tohex(const void *, size_t);
39 int	 get_yes_no_flag(int *option, const char *arg, const char *filename,
40 		    int linenum, int active);
41 
42 struct passwd	*pwcopy(struct passwd *);
43 void		 pwfree(struct passwd **);
44 
45 typedef struct arglist arglist;
46 struct arglist {
47 	char    **list;
48 	int     num;
49 	int     nalloc;
50 };
51 void	 addargs(arglist *, char *, ...) __attribute__((format(printf, 2, 3)));
52 void	 freeargs(arglist *);
53 
54 /* wrapper for signal interface */
55 typedef void (*mysig_t)(int);
56 mysig_t mysignal(int sig, mysig_t act);
57 
58 #ifdef __cplusplus
59 }
60 #endif
61 
62 #endif /* _MISC_H */
63