1246223Ssjg/*-
2246223Ssjg * Copyright (c) 2014 Michihiro NAKAJIMA
3236769Sobrien * All rights reserved.
4236769Sobrien *
5236769Sobrien * Redistribution and use in source and binary forms, with or without
6236769Sobrien * modification, are permitted provided that the following conditions
7236769Sobrien * are met:
8236769Sobrien * 1. Redistributions of source code must retain the above copyright
9236769Sobrien *    notice, this list of conditions and the following disclaimer.
10236769Sobrien * 2. Redistributions in binary form must reproduce the above copyright
11236769Sobrien *    notice, this list of conditions and the following disclaimer in the
12236769Sobrien *    documentation and/or other materials provided with the distribution.
13236769Sobrien *
14236769Sobrien * THIS SOFTWARE IS PROVIDED BY THE AUTHOR(S) ``AS IS'' AND ANY EXPRESS OR
15236769Sobrien * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
16236769Sobrien * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
17236769Sobrien * IN NO EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY DIRECT, INDIRECT,
18236769Sobrien * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
19236769Sobrien * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
20236769Sobrien * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
21236769Sobrien * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
22236769Sobrien * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
23236769Sobrien * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
24236769Sobrien *
25236769Sobrien */
26236769Sobrien
27236769Sobrien#ifndef ARCHIVE_XXHASH_H_INCLUDED
28236769Sobrien#define ARCHIVE_XXHASH_H_INCLUDED
29236769Sobrien
30236769Sobrien#ifndef __LIBARCHIVE_BUILD
31236769Sobrien#error This header is only to be used internally to libarchive.
32236769Sobrien#endif
33236769Sobrien
34236769Sobrien
35236769Sobrientypedef enum { XXH_OK=0, XXH_ERROR } XXH_errorcode;
36236769Sobrien
37236769Sobrienstruct archive_xxhash {
38236769Sobrien	unsigned int  (*XXH32)(const void* input, unsigned int len,
39236769Sobrien			unsigned int seed);
40236769Sobrien	void*         (*XXH32_init)(unsigned int seed);
41236769Sobrien	XXH_errorcode (*XXH32_update)(void* state, const void* input,
42236769Sobrien			unsigned int len);
43236769Sobrien	unsigned int  (*XXH32_digest)(void* state);
44236769Sobrien};
45236769Sobrien
46236769Sobrienextern const struct archive_xxhash __archive_xxhash;
47236769Sobrien
48236769Sobrien#endif
49236769Sobrien