xref: /titanic_41/usr/src/lib/libast/common/include/sfdisc.h (revision cde2885fdf538266ee2a3b08dee2d5075ce8fa2b)
1 /***********************************************************************
2 *                                                                      *
3 *               This software is part of the ast package               *
4 *          Copyright (c) 1985-2008 AT&T Intellectual Property          *
5 *                      and is licensed under the                       *
6 *                  Common Public License, Version 1.0                  *
7 *                    by AT&T Intellectual Property                     *
8 *                                                                      *
9 *                A copy of the License is available at                 *
10 *            http://www.opensource.org/licenses/cpl1.0.txt             *
11 *         (with md5 checksum 059e8cd6165cb4c31e351f2b69388fd9)         *
12 *                                                                      *
13 *              Information and Software Systems Research               *
14 *                            AT&T Research                             *
15 *                           Florham Park NJ                            *
16 *                                                                      *
17 *                 Glenn Fowler <gsf@research.att.com>                  *
18 *                  David Korn <dgk@research.att.com>                   *
19 *                   Phong Vo <kpv@research.att.com>                    *
20 *                                                                      *
21 ***********************************************************************/
22 #pragma prototyped
23 /*
24  * AT&T Research
25  *
26  * sfio discipline interface definitions
27  */
28 
29 #ifndef _SFDISC_H
30 #define _SFDISC_H
31 
32 #include <ast.h>
33 
34 #define SFDCEVENT(a,b,n)	((((a)-'A'+1)<<11)^(((b)-'A'+1)<<6)^(n))
35 
36 #if _BLD_ast && defined(__EXPORT__)
37 #define extern		__EXPORT__
38 #endif
39 
40 #define SFSK_DISCARD		SFDCEVENT('S','K',1)
41 
42 /*
43  * %(...) printf support
44  */
45 
46 typedef int (*Sf_key_lookup_t)(void*, Sffmt_t*, const char*, char**, Sflong_t*);
47 typedef char* (*Sf_key_convert_t)(void*, Sffmt_t*, const char*, char*, Sflong_t);
48 
49 extern int		sfkeyprintf(Sfio_t*, void*, const char*, Sf_key_lookup_t, Sf_key_convert_t);
50 #define sfkeyprintf	sfkeyprintf_20000308 /* Sffmt_t* callback args */
51 extern int		sfkeyprintf(Sfio_t*, void*, const char*, Sf_key_lookup_t, Sf_key_convert_t);
52 
53 /*
54  * pure sfio read and/or write disciplines
55  */
56 
57 extern int		sfdcdio(Sfio_t*, size_t);
58 extern int		sfdcdos(Sfio_t*);
59 extern int		sfdcfilter(Sfio_t*, const char*);
60 extern int		sfdcmore(Sfio_t*, const char*, int, int);
61 extern int		sfdcprefix(Sfio_t*, const char*);
62 extern int		sfdcseekable(Sfio_t*);
63 extern int		sfdcslow(Sfio_t*);
64 extern int		sfdctee(Sfio_t*, Sfio_t*);
65 extern int		sfdcunion(Sfio_t*, Sfio_t**, int);
66 
67 extern Sfio_t*		sfdcsubstream(Sfio_t*, Sfio_t*, Sfoff_t, Sfoff_t);
68 
69 #undef	extern
70 
71 #endif
72