1 /* $Id: hashformat.h,v 1.1 2005/05/14 23:20:30 harbourn Exp $ 2 * dcfldd - The Enhanced Forensic DD 3 * By Nicholas Harbour 4 */ 5 6 /* Copyright (C) 85, 90, 91, 1995-2001, 2005 Free Software Foundation, Inc. 7 8 This program is free software; you can redistribute it and/or modify 9 it under the terms of the GNU General Public License as published by 10 the Free Software Foundation; either version 2, or (at your option) 11 any later version. 12 13 This program is distributed in the hope that it will be useful, 14 but WITHOUT ANY WARRANTY; without even the implied warranty of 15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 GNU General Public License for more details. 17 18 You should have received a copy of the GNU General Public License 19 along with this program; if not, write to the Free Software Foundation, 20 Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ 21 22 /* GNU dd originally written by Paul Rubin, David MacKenzie, and Stuart Kemp. */ 23 24 #ifndef HASH_FORMAT_H 25 #define HASH_FORMAT_H 26 27 #include "dcfldd.h" 28 #include "hash.h" 29 #include <stdio.h> 30 #include <sys/types.h> 31 32 typedef enum { 33 FMT_STRING, 34 FMT_WINDOW_START, 35 FMT_WINDOW_END, 36 FMT_WINBLK_START, /* window offsets / blocksize */ 37 FMT_WINBLK_END, 38 FMT_HASH, 39 FMT_ALGORITHM 40 } fmtatom_t; 41 42 #define FMTATOMOP_ARGS FILE *stream, off_t wina, off_t winb, size_t blksize, char *alg, void *data 43 44 typedef void (fmtatom_op_t)(FMTATOMOP_ARGS); 45 46 #ifndef VARIABLE_HOOK 47 #define VARIABLE_HOOK '#' 48 #endif 49 50 typedef struct format_s { 51 struct format_s *next; 52 fmtatom_t type; 53 fmtatom_op_t *op; 54 void *data; /* optional */ 55 } format_t; 56 57 extern format_t *hashformat; 58 extern format_t *totalhashformat; 59 60 extern void print_fmt(format_t *, FMTATOMOP_ARGS); 61 extern format_t *parse_hashformat(char *); 62 63 #endif /* HASH_FORMAT_H */ 64