Parolin 0.7.9 6796
Console (soon DLLs) to do a tar like job
Loading...
Searching...
No Matches
seqgen.h
Go to the documentation of this file.
1/*
2 * Copyright (c) Meta Platforms, Inc. and affiliates.
3 * All rights reserved.
4 *
5 * This source code is licensed under both the BSD-style license (found in the
6 * LICENSE file in the root directory of this source tree) and the GPLv2 (found
7 * in the COPYING file in the root directory of this source tree).
8 * You may select, at your option, one of the above-listed licenses.
9 */
10
11#ifndef SEQGEN_H
12#define SEQGEN_H
13
14#define XXH_STATIC_LINKING_ONLY
15
16#include "xxhash.h"
17#include <stddef.h> /* size_t */
18
19typedef enum {
23 SEQ_gen_max /* Must be the last value */
25
26/* Internal state, do not use */
27typedef struct {
28 XXH64_state_t xxh; /* xxh state for all the data produced so far (seed=0) */
29 unsigned seed;
30 int state; /* enum to control state machine (clean=0) */
31 unsigned saved;
32 size_t bytesLeft;
34
36
37typedef struct {
38 void* dst;
39 size_t size;
40 size_t pos;
42
43/* Returns non-zero until the current type/value has been generated.
44 * Must pass the same type/value until it returns 0.
45 *
46 * Recommended to pick a value in the middle of the range you want, since there
47 * may be some noise that causes actual results to be slightly different.
48 * We try to be more accurate for smaller values.
49 *
50 * NOTE: Very small values don't work well (< 6).
51 */
52size_t SEQ_gen(SEQ_stream* stream, SEQ_gen_type type, unsigned value,
53 SEQ_outBuffer* out);
54
55/* Returns the xxhash of the data produced so far */
57
58#endif /* SEQGEN_H */
unsigned long long XXH64_hash_t
Definition xxhash.h:219
struct XXH64_state_s XXH64_state_t
The opaque state struct for the XXH64 streaming API.
Definition xxhash.h:229
char * dst
Definition lz4.h:833
Definition seqgen.h:37
Definition seqgen.h:27
size_t size
Definition platform.h:559
uint32_t seed
Definition stream_decompress.c:26
size_t SEQ_gen(SEQ_stream *stream, SEQ_gen_type type, unsigned value, SEQ_outBuffer *out)
Definition seqgen.c:245
XXH64_hash_t SEQ_digest(SEQ_stream const *stream)
Definition seqgen.c:257
SEQ_stream SEQ_initStream(unsigned seed)
Definition seqgen.c:32
SEQ_gen_type
Definition seqgen.h:19
@ SEQ_gen_of
Definition seqgen.h:22
@ SEQ_gen_max
Definition seqgen.h:23
@ SEQ_gen_ml
Definition seqgen.h:20
@ SEQ_gen_ll
Definition seqgen.h:21