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

Last change on this file since 1532 was 1532, checked in by Sam Hocevar, 16 years ago
  • Implemented signal handling.
  • Updated documentation accordingly and improved a few parts.
  • Property svn:keywords set to Id
File size: 1.5 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 1532 2007-01-01 21:35:54Z 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 fuzz
26{
27    int cur;
28    uint8_t *data;
29};
30
31/* Internal variables */
32extern int       _zz_ready;
33extern int       _zz_hasdebug;
34extern float     _zz_ratio;
35extern int       _zz_seed;
36extern int       _zz_signal;
37
38/* Library initialisation shit */
39extern void _zz_init(void) __attribute__((constructor));
40extern void _zz_fini(void) __attribute__((destructor));
41
42/* File descriptor handling */
43extern int _zz_mustwatch(char const *);
44extern int _zz_iswatched(int);
45extern void _zz_register(int);
46extern void _zz_unregister(int);
47extern long int _zz_getpos(int);
48extern void _zz_setpos(int, long int);
49extern void _zz_addpos(int, long int);
50extern struct fuzz *_zz_getfuzz(int);
51
Note: See TracBrowser for help on using the repository browser.