1 // SPDX-License-Identifier: GPL-2.0
3 * Copyright (c) 2000 Silicon Graphics, Inc.
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.
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.
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.
27 * The Open_symbols must be large enough to hold all possible symbols
30 ***********************************************************************/
31 char *openflags2symbols( int, char *, int );
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.
41 * A signal received while parsing string could cause the string to
42 * contain a NULL character in the middle of it.
44 ***********************************************************************/
45 int parse_open_flags( char *, char ** );