common/attr: set MAX_ATTR values correctly for NFS
[xfstests-dev.git] / include / open_flags.h
1 // SPDX-License-Identifier: GPL-2.0
2 /*
3  * Copyright (c) 2000 Silicon Graphics, Inc.
4  * All Rights Reserved.
5  */
6 #ifndef _OPEN_FLAGS_H_
7 #define _OPEN_FLAGS_H_
8
9 /***********************************************************************
10  * This function attempts to convert open flag bits into human readable
11  * symbols (i.e. O_TRUNC).  If there are more than one symbol,
12  * the <sep> string will be placed as a separator between symbols.
13  * Commonly used separators would be a comma "," or pipe "|".
14  * If <mode> is one and not all <openflags> bits can be converted to
15  * symbols, the "UNKNOWN" symbol will be added to return string.
16  * 
17  * Return Value
18  * openflags2symbols will return the indentified symbols.
19  * If no symbols are recognized the return value will be a empty
20  * string or the "UNKNOWN" symbol.
21  *
22  * Limitations
23  * Currently (05/96) all known symbols are coded into openflags2symbols.
24  * If new open flags are added this code will have to updated
25  * to know about them or they will not be recognized.
26  *
27  * The Open_symbols must be large enough to hold all possible symbols
28  * for a given system.
29  *
30  ***********************************************************************/
31 char *openflags2symbols( int, char *, int );
32
33 /***********************************************************************
34  * This function will take a string of comma separated open flags symbols
35  * and translate them into an open flag bitmask.
36  * If any symbol is not valid, -1 is returned.  On this error condition
37  * the badname pointer is updated if not NULL.  badname will point
38  * to the beginning location of where the invalid symbol was found.
39  * string will be returned unchanged. 
40  *
41  * A signal received while parsing string could cause the string to
42  * contain a NULL character in the middle of it.
43  *
44  ***********************************************************************/
45 int parse_open_flags( char *, char ** );
46
47 #endif