summaryrefslogtreecommitdiff
path: root/include/dataascii.h
blob: 50a73dcc4264486151e517311383c510e2804a08 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
// SPDX-License-Identifier: GPL-2.0
/*
 * Copyright (c) 2000 Silicon Graphics, Inc.
 * All Rights Reserved.
 */
#ifndef _DATAASCII_H_
#define _DATAASCII_H_

/***********************************************************************
 * int dataasciigen(listofchars, buffer, size, offset)
 *
 * This function fills buffer with ascii characters.
 * The ascii characters are obtained from listofchars or the CHARS array
 *  if listofchars is NULL.
 * Each char is selected by an index.  The index is the remainder
 *  of count divided by the array size. 
 * This method allows more than one process to write to a location
 *  in a file without corrupting it for another process' point of view.
 *
 * The return value will be the number of character written in buffer
 *  (size).
 *
 ***********************************************************************/
int dataasciigen(char *, char *, int, int);

/***********************************************************************
 * int dataasciichk(listofchars, buffer, size, count, errmsg)
 *
 * This function checks the contents of a buffer produced by
 *  dataasciigen.
 *
 * return values:
 *	>= 0 : error at character count
 *	< 0  : no error
 ***********************************************************************/

int dataasciichk(char *, char *, int, int, char**);

#endif