alaffin | cc2e555 | 2000-07-27 17:13:18 +0000 | [diff] [blame] | 1 | #ifndef _DATABIN_H_ |
| 2 | #define _DATABIN_H_ |
| 3 | |
| 4 | /******************************************************************************* |
| 5 | * NAME |
| 6 | * databingen - fill a buffer with a data pattern |
| 7 | * |
| 8 | * SYNOPSIS |
| 9 | * (void) databingen(mode, buffer, bsize, offset) |
| 10 | * int mode; |
| 11 | * char *buffer; |
| 12 | * int bsize; |
| 13 | * int offset; |
| 14 | * |
| 15 | * DESCRIPTION |
| 16 | * datagen fills the buffer pointed to by 'buffer' with 'bsize' bytes |
vapier | 45a8ba0 | 2009-07-20 10:59:32 +0000 | [diff] [blame] | 17 | * of data of the form indicated by 'mode'. |
alaffin | cc2e555 | 2000-07-27 17:13:18 +0000 | [diff] [blame] | 18 | * All modes (expect r -random) are file offset based. |
| 19 | * This allows more than process to do writing to the file without |
| 20 | * corrupting it if the same modes were used. |
| 21 | * They data modes to choose from, these are: |
| 22 | * |
| 23 | * 'a' - writes an alternating bit pattern (i.e. 0x5555555...) |
| 24 | * |
| 25 | * 'c' - writes a checkerboard pattern (i.e. 0xff00ff00ff00...) |
| 26 | * |
| 27 | * 'C' - writes counting pattern (i.e. 0 - 07, 0 - 07, ...); |
| 28 | * |
| 29 | * 'o' - writes all bits set (i.e. 0xffffffffffffff...) |
| 30 | * |
| 31 | * 'z' - writes all bits cleared (i.e. 0x000000000...); |
| 32 | * |
| 33 | * 'r' - writes random integers |
| 34 | * |
| 35 | * RETURN VALUE |
| 36 | * None |
| 37 | * |
| 38 | *******************************************************************************/ |
| 39 | |
subrata_modak | b15aafd | 2008-10-20 06:30:32 +0000 | [diff] [blame] | 40 | void databingen( int mode, char *buffer, int bsize, int offset ); |
alaffin | cc2e555 | 2000-07-27 17:13:18 +0000 | [diff] [blame] | 41 | |
Alex Elder | 86d0dba | 2011-04-01 17:01:23 -0500 | [diff] [blame] | 42 | int databinchk( int mode, char *buffer, int bsize, int offset, char **errmsg); |
alaffin | cc2e555 | 2000-07-27 17:13:18 +0000 | [diff] [blame] | 43 | |
| 44 | #endif |