1 /* @(#)header.h	1.4 19/12/03 Copyright 2001-2019 J. Schilling */
2 /*
3  *	Defitions for the stream archive internal interfaces.
4  *
5  *	Copyright (c) 2001-2019 J. Schilling
6  */
7 /*
8  * The contents of this file are subject to the terms of the
9  * Common Development and Distribution License, Version 1.0 only
10  * (the "License").  You may not use this file except in compliance
11  * with the License.
12  *
13  * See the file CDDL.Schily.txt in this distribution for details.
14  * A copy of the CDDL is also available via the Internet at
15  * http://www.opensource.org/licenses/cddl1.txt
16  *
17  * When distributing Covered Code, include this CDDL HEADER in each
18  * file and include the License file CDDL.Schily.txt from this distribution.
19  */
20 
21 #ifndef	_HEADER_H
22 #define	_HEADER_H
23 
24 #ifndef _SCHILY_MCONFIG_H
25 #include <schily/mconfig.h>
26 #endif
27 #ifndef _SCHILY_UTYPES_H
28 #include <schily/utypes.h>
29 #endif
30 
31 #ifndef _SCHILY_STRAR_H
32 #include <schily/strar.h>
33 #endif
34 
35 /*
36  * Flags for gen_text()
37  */
38 #define	T_ADDSLASH	1	/* Add slash to the argument	*/
39 #define	T_UTF8		2	/* Convert arg to UTF-8 coding	*/
40 
41 /*
42  * Transfer direction types for utf8_init()
43  */
44 #define	S_CREATE	1
45 #define	S_EXTRACT	2
46 
47 extern	void	strar_xbreset		__PR((void));
48 extern	char	*strar_gxbuf		__PR((void));
49 extern	size_t	strar_gxbsize		__PR((void));
50 extern	size_t	strar_gxblen		__PR((void));
51 extern	void	strar_xbgrow		__PR((size_t newsize));
52 
53 extern	void	strar_gen_text		__PR((char *keyword,
54 						char *arg, size_t alen,
55 						Uint flags));
56 extern	void	strar_gen_xtime		__PR((char *keyword, time_t sec,
57 						Ulong nsec));
58 extern	void	strar_gen_number	__PR((char *keyword, Llong arg));
59 extern	void	strar_gen_unumber	__PR((char *keyword, ULlong arg));
60 
61 extern	BOOL	strar_xhparse		__PR((FINFO *info, char	*p, char *ep));
62 
63 /*
64  * unicode.c
65  */
66 extern	void	utf8_codeset	__PR((const char *code_set));
67 extern	void	utf8_init	__PR((int type));
68 extern	void	utf8_fini	__PR((void));
69 extern	size_t	to_utf8		__PR((Uchar *to, size_t tolen,
70 					Uchar *from, size_t len));
71 extern	BOOL	from_utf8	__PR((Uchar *to, size_t tolen,
72 					Uchar *from, size_t *len));
73 
74 #endif	/* _HEADER_H */
75