source: zzuf/trunk/src/libzzuf.h @ 1498

Last change on this file since 1498 was 1498, checked in by Sam Hocevar, 16 years ago
  • Huge performance improvement by caching the bit array. Yay.
  • Property svn:keywords set to Id
File size: 1.3 KB
Line 
1/*
2 *  zzuf - general purpose fuzzer
3 *  Copyright (c) 2006 Sam Hocevar <sam@zoy.org>
4 *                All Rights Reserved
5 *
6 *  $Id: libzzuf.h 1498 2006-12-17 23:58:23Z sam $
7 *
8 *  This program is free software. It comes without any warranty, to
9 *  the extent permitted by applicable law. You can redistribute it
10 *  and/or modify it under the terms of the Do What The Fuck You Want
11 *  To Public License, Version 2, as published by Sam Hocevar. See
12 *  http://sam.zoy.org/wtfpl/COPYING for more details.
13 */
14
15/*
16 *  libzzuf.h: preloaded wrapper library
17 */
18
19/* We arbitrarily split files into 1024-byte chunks. Each chunk has an
20 * associated seed that can be computed from the zzuf seed, the chunk
21 * index and the fuzziness density. This allows us to predictably fuzz
22 * any part of the file without reading the whole file. */
23#define CHUNKBYTES 1024
24
25struct zzuf
26{
27    int managed;
28    uint64_t seed;
29    uint64_t pos;
30    int cur;
31    char *data;
32};
33
34extern struct zzuf files[];
35
36/* Internal stuff */
37extern int       _zzuf_ready;
38extern int       _zzuf_debug;
39extern int       _zzuf_seed;
40extern float     _zzuf_ratio;
41extern regex_t * _zzuf_include;
42extern regex_t * _zzuf_exclude;
43
44/* Library initialisation shit */
45extern void zzuf_init(void) __attribute__((constructor));
46extern void zzuf_fini(void) __attribute__((destructor));
47
Note: See TracBrowser for help on using the repository browser.