![]() |
posix-next API 0.1.0
Out-of-tree Zephyr POSIX module
|
POSIX C Library Extension option group. More...
Files | |
| file | monetary.h |
| POSIX monetary formatting functions (<monetary.h>) | |
| file | strings.h |
| POSIX string operations (<strings.h>) | |
Macros | |
| #define | FNM_NOMATCH 1 |
| Return value of fnmatch() indicating the string did not match the pattern. | |
| #define | FNM_NOESCAPE 0x01 |
| Flag: treat backslash as an ordinary character rather than an escape character. | |
| #define | FNM_PATHNAME 0x02 |
| Flag: a slash must be matched by a slash (not '?' or '*' or a bracket expression). | |
| #define | FNM_PERIOD 0x04 |
| Flag: a leading '. | |
| #define | FNM_IGNORECASE FNM_CASEFOLD |
| Alias for FNM_CASEFOLD. | |
Functions | |
| int | fnmatch (const char *pattern, const char *string, int flags) |
| Match a filename or path against a shell-style pattern. | |
| ssize_t | strfmon (char *ZRESTRICT s, size_t maxsize, const char *ZRESTRICT format,...) |
| Format a monetary value into a string according to the current locale. | |
| ssize_t | strfmon_l (char *ZRESTRICT s, size_t maxsize, locale_t locale, const char *ZRESTRICT format,...) |
| Format a monetary value using the specified locale. | |
| int | dprintf (int fildes, const char *ZRESTRICT format,...) |
| Print formatted output to a file descriptor. | |
| FILE * | fmemopen (void *ZRESTRICT buf, size_t size, const char *ZRESTRICT mode) |
| Open a memory-backed stream. | |
| ssize_t | getdelim (char **ZRESTRICT lineptr, size_t *ZRESTRICT n, int delimiter, FILE *ZRESTRICT stream) |
| Read a delimited record from a stream. | |
| ssize_t | getline (char **ZRESTRICT lineptr, size_t *ZRESTRICT n, FILE *ZRESTRICT stream) |
| Read a line from a stream. | |
| FILE * | open_memstream (char **bufp, size_t *sizep) |
| Open a dynamic memory output stream. | |
| int | vdprintf (int fildes, const char *ZRESTRICT format, va_list ap) |
| Print formatted output to a file descriptor. | |
| int | getsubopt (char **optionp, char *const *keylistp, char **valuep) |
| Parse sub-options from a command-line argument string. | |
| char * | stpcpy (char *ZRESTRICT s1, const char *ZRESTRICT s2) |
| Copy a string and return a pointer to the terminating NUL byte. | |
| char * | stpncpy (char *ZRESTRICT s1, const char *ZRESTRICT s2, size_t n) |
Copy at most n bytes of a string and return a pointer to the terminating NUL byte. | |
| char * | strdup (const char *s) |
| Duplicate a string. | |
| char * | strndup (const char *s, size_t n) |
Duplicate at most n bytes of a string. | |
| size_t | strnlen (const char *s, size_t maxlen) |
| Determine the length of a fixed-size string. | |
| size_t | strftime_l (char *ZRESTRICT s, size_t maxsize, const char *ZRESTRICT format, const struct tm *ZRESTRICT timeptr, locale_t locale) |
| Format broken-down time into a string using the specified locale. | |
| int | strcasecmp (const char *s1, const char *s2) |
| Compare two strings, ignoring case. | |
| int | strncasecmp (const char *s1, const char *s2, size_t n) |
| Compare two strings, ignoring case, up to a maximum length. | |
| int | getentropy (void *buffer, size_t length) |
| Fill a buffer with cryptographically secure random bytes. | |
| int | getopt (int argc, char *const argv[], const char *optstring) |
| Parse command-line options. | |
Variables | |
| char * | optarg |
| Argument for the current option from getopt(). | |
| int | opterr |
| Error flag for getopt() (non-zero enables error messages). | |
| int | optind |
| Index of the next element to be processed by getopt(). | |
| int | optopt |
| Unrecognised option character from getopt(). | |
POSIX C Library Extension option group.
Covers XSI string and option-parsing extensions such as strdup(), strcasecmp(), and getsubopt().
| #define FNM_IGNORECASE FNM_CASEFOLD |
| #define FNM_NOESCAPE 0x01 |
| #define FNM_NOMATCH 1 |
| #define FNM_PATHNAME 0x02 |
| #define FNM_PERIOD 0x04 |
| int dprintf | ( | int | fildes, |
| const char *ZRESTRICT | format, | ||
| ... | |||
| ) |
Print formatted output to a file descriptor.
| fildes | Open file descriptor to write to. |
| format | Format string. |
| ... | Additional arguments for the format string. |
| FILE * fmemopen | ( | void *ZRESTRICT | buf, |
| size_t | size, | ||
| const char *ZRESTRICT | mode | ||
| ) |
Open a memory-backed stream.
| buf | Initial buffer, or NULL to allocate automatically. |
| size | Size of buf when supplied by the caller. |
| mode | Mode string as for fopen(). |
NULL on failure. | int fnmatch | ( | const char * | pattern, |
| const char * | string, | ||
| int | flags | ||
| ) |
Match a filename or path against a shell-style pattern.
| pattern | Shell pattern (using ?, *, and bracket expressions). |
| string | String to test against pattern. |
| flags | Combination of FNM_* flags, or 0 for default matching. |
string matches pattern, FNM_NOMATCH if it does not, or a non-zero value on error. | ssize_t getdelim | ( | char **ZRESTRICT | lineptr, |
| size_t *ZRESTRICT | n, | ||
| int | delimiter, | ||
| FILE *ZRESTRICT | stream | ||
| ) |
Read a delimited record from a stream.
| lineptr | Pointer to the buffer pointer; updated on return. |
| n | Pointer to the buffer size; updated on return. |
| delimiter | Record delimiter byte. |
| stream | Stream to read from. |
| int getentropy | ( | void * | buffer, |
| size_t | length | ||
| ) |
Fill a buffer with cryptographically secure random bytes.
| ssize_t getline | ( | char **ZRESTRICT | lineptr, |
| size_t *ZRESTRICT | n, | ||
| FILE *ZRESTRICT | stream | ||
| ) |
Read a line from a stream.
| lineptr | Pointer to the buffer pointer; updated on return. |
| n | Pointer to the buffer size; updated on return. |
| stream | Stream to read from. |
| int getsubopt | ( | char ** | optionp, |
| char *const * | keylistp, | ||
| char ** | valuep | ||
| ) |
Parse sub-options from a command-line argument string.
Modifies *optionp in place, separating comma-delimited sub-options.
| optionp | Pointer to the option string; advanced past each parsed token. |
| keylistp | NULL-terminated array of recognised keyword strings. |
| valuep | Output: pointer to the value part after '=', or NULL. |
keylistp of the matched keyword, or -1 if not found. | FILE * open_memstream | ( | char ** | bufp, |
| size_t * | sizep | ||
| ) |
Open a dynamic memory output stream.
| bufp | Pointer to the buffer pointer; updated on return. |
| sizep | Pointer to the buffer size; updated on return. |
NULL on failure. | char * stpcpy | ( | char *ZRESTRICT | s1, |
| const char *ZRESTRICT | s2 | ||
| ) |
Copy a string and return a pointer to the terminating NUL byte.
| s1 | Destination buffer. |
| s2 | Source string. |
s1. | char * stpncpy | ( | char *ZRESTRICT | s1, |
| const char *ZRESTRICT | s2, | ||
| size_t | n | ||
| ) |
| int strcasecmp | ( | const char * | s1, |
| const char * | s2 | ||
| ) |
| char * strdup | ( | const char * | s | ) |
Duplicate a string.
| s | Source string. |
NULL on failure. | ssize_t strfmon | ( | char *ZRESTRICT | s, |
| size_t | maxsize, | ||
| const char *ZRESTRICT | format, | ||
| ... | |||
| ) |
Format a monetary value into a string according to the current locale.
| s | Output buffer. |
| maxsize | Maximum number of bytes (including NUL) to write. |
| format | Conversion format string (%-based, similar to printf). |
| ... | Monetary values to format (type double). |
| ssize_t strfmon_l | ( | char *ZRESTRICT | s, |
| size_t | maxsize, | ||
| locale_t | locale, | ||
| const char *ZRESTRICT | format, | ||
| ... | |||
| ) |
Format a monetary value using the specified locale.
| s | Output buffer. |
| maxsize | Maximum number of bytes (including NUL) to write. |
| locale | Locale to use for formatting. |
| format | Conversion format string. |
| ... | Monetary values to format (type double). |
| size_t strftime_l | ( | char *ZRESTRICT | s, |
| size_t | maxsize, | ||
| const char *ZRESTRICT | format, | ||
| const struct tm *ZRESTRICT | timeptr, | ||
| locale_t | locale | ||
| ) |
Format broken-down time into a string using the specified locale.
| s | Output buffer. |
| maxsize | Maximum number of bytes to write including the NUL terminator. |
| format | Format string (same syntax as strftime()). |
| timeptr | Broken-down time to format. |
| locale | Locale to use for formatting. |
maxsize was exceeded. | int strncasecmp | ( | const char * | s1, |
| const char * | s2, | ||
| size_t | n | ||
| ) |
Compare two strings, ignoring case, up to a maximum length.
| s1 | First string. |
| s2 | Second string. |
| n | Maximum number of bytes to compare. |
n bytes of s1 are found, respectively, to be less than, equal to, or greater than those of s2. | char * strndup | ( | const char * | s, |
| size_t | n | ||
| ) |
| size_t strnlen | ( | const char * | s, |
| size_t | maxlen | ||
| ) |
| int vdprintf | ( | int | fildes, |
| const char *ZRESTRICT | format, | ||
| va_list | ap | ||
| ) |
Print formatted output to a file descriptor.
| fildes | Open file descriptor to write to. |
| format | Format string. |
| ap | Arguments for the format string. |
|
extern |
Argument for the current option from getopt().
|
extern |
Error flag for getopt() (non-zero enables error messages).
|
extern |
Index of the next element to be processed by getopt().
|
extern |
Unrecognised option character from getopt().