3 Declarations and administrivia.
5 Copyright (C) James Peach 2005-2006
7 This program is free software; you can redistribute it and/or modify
8 it under the terms of the GNU General Public License as published by
9 the Free Software Foundation; either version 2 of the License, or
10 (at your option) any later version.
12 This program is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 GNU General Public License for more details.
17 You should have received a copy of the GNU General Public License
18 along with this program; if not, write to the Free Software
19 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
22 extern const char * const PROGNAME;
34 const char * arg_name;
35 enum argtype arg_type;
36 const char * arg_help;
46 int set_arg_argv(const char * argv);
47 void set_arg_val(const char * name, ...);
49 BOOL check_arg_bool(const char * name);
50 uint64_t check_arg_numeric(const char * name);
51 const char * check_arg_pathname(const char * name);
53 typedef BOOL (*dd_seek_func)(void * handle, uint64_t offset);
54 typedef BOOL (*dd_read_func)(void * handle, uint8_t * buf,
55 uint64_t wanted, uint64_t * actual);
56 typedef BOOL (*dd_write_func)(void * handle, uint8_t * buf,
57 uint64_t wanted, uint64_t * actual);
59 struct dd_stats_record
63 uint64_t fblocks; /* Full blocks. */
64 uint64_t pblocks; /* Partial blocks. */
65 uint64_t bytes; /* Total bytes read. */
69 uint64_t fblocks; /* Full blocks. */
70 uint64_t pblocks; /* Partial blocks. */
71 uint64_t bytes; /* Total bytes written. */
75 extern struct dd_stats_record dd_stats;
81 dd_write_func io_write;
85 #define DD_END_OF_FILE 0x10000000
87 #define DD_DIRECT_IO 0x00000001
88 #define DD_SYNC_IO 0x00000002
89 #define DD_WRITE 0x00000004
90 #define DD_OPLOCK 0x00000008
92 struct dd_iohandle * dd_open_path(const char * path,
93 uint64_t io_size, int options);
94 BOOL dd_fill_block(struct dd_iohandle * h, uint8_t * buf,
95 uint64_t * buf_size, uint64_t need_size, uint64_t block_size);
96 BOOL dd_flush_block(struct dd_iohandle * h, uint8_t * buf,
97 uint64_t * buf_size, uint64_t block_size);
99 /* vim: set sw=8 sts=8 ts=8 tw=79 : */