/***********************************************************************1* *2* This software is part of the ast package *3* Copyright (c) 1996-2011 AT&T Intellectual Property *4* and is licensed under the *5* Eclipse Public License, Version 1.0 *6* by AT&T Intellectual Property *7* *8* A copy of the License is available at *9* http://www.eclipse.org/org/documents/epl-v10.html *10* (with md5 checksum b35adb5213ca9657e911e9befb180842) *11* *12* Information and Software Systems Research *13* AT&T Research *14* Florham Park NJ *15* *16* Glenn Fowler <[email protected]> *17* *18***********************************************************************/19#pragma prototyped2021/*22* Glenn Fowler23* AT&T Research24*25* checksum library interface26*/2728#ifndef _SUM_H29#define _SUM_H3031#include <ast.h>3233#define SUM_SIZE (1<<0) /* print size too */34#define SUM_SCALE (1<<1) /* traditional size scale */35#define SUM_TOTAL (1<<2) /* print totals since sumopen */36#define SUM_LEGACY (1<<3) /* legacy field widths */3738#define _SUM_PUBLIC_ const char* name;3940typedef struct Sumdata_s41{42uint32_t size;43uint32_t num;44void* buf;45} Sumdata_t;4647typedef struct Sum_s48{49_SUM_PUBLIC_50#ifdef _SUM_PRIVATE_51_SUM_PRIVATE_52#endif53} Sum_t;5455extern Sum_t* sumopen(const char*);56extern int suminit(Sum_t*);57extern int sumblock(Sum_t*, const void*, size_t);58extern int sumdone(Sum_t*);59extern int sumdata(Sum_t*, Sumdata_t*);60extern int sumprint(Sum_t*, Sfio_t*, int, size_t);61extern int sumusage(Sfio_t*);62extern int sumclose(Sum_t*);6364#endif656667