dmake: do not set MAKEFLAGS=k
[unleashed/tickless.git] / usr / src / lib / libsum / common / sum.h
blob254130e10856bc03f92ef7b826905d6f7d8510b9
1 /***********************************************************************
2 * *
3 * This software is part of the ast package *
4 * Copyright (c) 1996-2010 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 * *
19 ***********************************************************************/
20 #pragma prototyped
23 * Glenn Fowler
24 * AT&T Research
26 * checksum library interface
29 #ifndef _SUM_H
30 #define _SUM_H
32 #include <ast.h>
34 #define SUM_SIZE (1<<0) /* print size too */
35 #define SUM_SCALE (1<<1) /* traditional size scale */
36 #define SUM_TOTAL (1<<2) /* print totals since sumopen */
37 #define SUM_LEGACY (1<<3) /* legacy field widths */
39 #define _SUM_PUBLIC_ const char* name;
41 typedef struct Sumdata_s
43 uint32_t size;
44 uint32_t num;
45 void* buf;
46 } Sumdata_t;
48 typedef struct Sum_s
50 _SUM_PUBLIC_
51 #ifdef _SUM_PRIVATE_
52 _SUM_PRIVATE_
53 #endif
54 } Sum_t;
56 extern Sum_t* sumopen(const char*);
57 extern int suminit(Sum_t*);
58 extern int sumblock(Sum_t*, const void*, size_t);
59 extern int sumdone(Sum_t*);
60 extern int sumdata(Sum_t*, Sumdata_t*);
61 extern int sumprint(Sum_t*, Sfio_t*, int, size_t);
62 extern int sumusage(Sfio_t*);
63 extern int sumclose(Sum_t*);
65 #endif