generic: test reflinked file corruption after short COW
[xfstests-dev.git] / include / dataascii.h
1 // SPDX-License-Identifier: GPL-2.0
2 /*
3  * Copyright (c) 2000 Silicon Graphics, Inc.
4  * All Rights Reserved.
5  */
6 #ifndef _DATAASCII_H_
7 #define _DATAASCII_H_
8
9 /***********************************************************************
10  * int dataasciigen(listofchars, buffer, size, offset)
11  *
12  * This function fills buffer with ascii characters.
13  * The ascii characters are obtained from listofchars or the CHARS array
14  *  if listofchars is NULL.
15  * Each char is selected by an index.  The index is the remainder
16  *  of count divided by the array size. 
17  * This method allows more than one process to write to a location
18  *  in a file without corrupting it for another process' point of view.
19  *
20  * The return value will be the number of character written in buffer
21  *  (size).
22  *
23  ***********************************************************************/
24 int dataasciigen(char *, char *, int, int);
25
26 /***********************************************************************
27  * int dataasciichk(listofchars, buffer, size, count, errmsg)
28  *
29  * This function checks the contents of a buffer produced by
30  *  dataasciigen.
31  *
32  * return values:
33  *      >= 0 : error at character count
34  *      < 0  : no error
35  ***********************************************************************/
36
37 int dataasciichk(char *, char *, int, int, char**);
38
39 #endif