xref: /titanic_44/usr/src/lib/libsum/amd64/include/ast/sum.h (revision 3e14f97f673e8a630f076077de35afdd43dc1587)
1 
2 /* : : generated by proto : : */
3 /***********************************************************************
4 *                                                                      *
5 *               This software is part of the ast package               *
6 *          Copyright (c) 1996-2010 AT&T Intellectual Property          *
7 *                      and is licensed under the                       *
8 *                  Common Public License, Version 1.0                  *
9 *                    by AT&T Intellectual Property                     *
10 *                                                                      *
11 *                A copy of the License is available at                 *
12 *            http://www.opensource.org/licenses/cpl1.0.txt             *
13 *         (with md5 checksum 059e8cd6165cb4c31e351f2b69388fd9)         *
14 *                                                                      *
15 *              Information and Software Systems Research               *
16 *                            AT&T Research                             *
17 *                           Florham Park NJ                            *
18 *                                                                      *
19 *                 Glenn Fowler <gsf@research.att.com>                  *
20 *                                                                      *
21 ***********************************************************************/
22 
23 
24 /*
25  * Glenn Fowler
26  * AT&T Research
27  *
28  * checksum library interface
29  */
30 
31 #ifndef _SUM_H
32 #if !defined(__PROTO__)
33 #include <prototyped.h>
34 #endif
35 #if !defined(__LINKAGE__)
36 #define __LINKAGE__		/* 2004-08-11 transition */
37 #endif
38 
39 #define _SUM_H
40 
41 #include <ast.h>
42 
43 #define SUM_SIZE	(1<<0)		/* print size too		*/
44 #define SUM_SCALE	(1<<1)		/* traditional size scale	*/
45 #define SUM_TOTAL	(1<<2)		/* print totals since sumopen	*/
46 #define SUM_LEGACY	(1<<3)		/* legacy field widths		*/
47 
48 #define _SUM_PUBLIC_	const char*	name;
49 
50 typedef struct Sumdata_s
51 {
52 	uint32_t	size;
53 	uint32_t	num;
54 	__V_*		buf;
55 } Sumdata_t;
56 
57 typedef struct Sum_s
58 {
59 	_SUM_PUBLIC_
60 #ifdef	_SUM_PRIVATE_
61 	_SUM_PRIVATE_
62 #endif
63 } Sum_t;
64 
65 extern __MANGLE__ Sum_t*	sumopen __PROTO__((const char*));
66 extern __MANGLE__ int	suminit __PROTO__((Sum_t*));
67 extern __MANGLE__ int	sumblock __PROTO__((Sum_t*, const __V_*, size_t));
68 extern __MANGLE__ int	sumdone __PROTO__((Sum_t*));
69 extern __MANGLE__ int	sumdata __PROTO__((Sum_t*, Sumdata_t*));
70 extern __MANGLE__ int	sumprint __PROTO__((Sum_t*, Sfio_t*, int, size_t));
71 extern __MANGLE__ int	sumusage __PROTO__((Sfio_t*));
72 extern __MANGLE__ int	sumclose __PROTO__((Sum_t*));
73 
74 #endif
75