1 /*
2 ** str2.h - String to Foo conversion routines.
3 **
4 ** Copyright (c) 1997-2000 Peter Eriksson <pen@lysator.liu.se>
5 **
6 ** This program is free software; you can redistribute it and/or
7 ** modify it as you wish - as long as you don't claim that you wrote
8 ** it.
9 **
10 ** This program is distributed in the hope that it will be useful,
11 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
12 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
13 */
14 
15 #ifndef PLIB_STR2_H
16 #define PLIB_STR2_H
17 
18 #include "plib/sockaddr.h"
19 
20 extern int
21 str2int(const char *buf,
22 	int *out);
23 
24 extern int
25 str2str(const char *buf,
26 	char **out);
27 
28 extern int
29 str2bool(const char *buf,
30 	 int *out);
31 
32 extern int
33 str2port(const char *str,
34 	 int *out);
35 
36 extern int
37 str2addr(const char *str,
38 	 struct sockaddr_gen *sg);
39 
40 extern int
41 str2gid(const char *str,
42 	gid_t *out);
43 
44 extern int
45 str2uid(const char *str,
46 	uid_t *uid,
47 	gid_t *gid);
48 
49 #endif
50 
51