POSIX C Library Extension option group.
More...
|
| #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.
|
| |
|
| 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 | getsubopt (char **optionp, char *const *keylistp, char **valuep) |
| | Parse sub-options from a command-line argument 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 | getopt (int argc, char *const argv[], const char *optstring) |
| | Parse command-line options.
|
| |
POSIX C Library Extension option group.
◆ FNM_IGNORECASE
| #define FNM_IGNORECASE FNM_CASEFOLD |
Alias for FNM_CASEFOLD.
Definition at line 40 of file fnmatch.h.
◆ FNM_NOESCAPE
| #define FNM_NOESCAPE 0x01 |
Flag: treat backslash as an ordinary character rather than an escape character.
Definition at line 26 of file fnmatch.h.
◆ FNM_NOMATCH
Return value of fnmatch() indicating the string did not match the pattern.
Definition at line 24 of file fnmatch.h.
◆ FNM_PATHNAME
| #define FNM_PATHNAME 0x02 |
Flag: a slash must be matched by a slash (not '?' or '*' or a bracket expression).
Definition at line 28 of file fnmatch.h.
◆ FNM_PERIOD
Flag: a leading '.
' must be matched explicitly.
Definition at line 30 of file fnmatch.h.
◆ fnmatch()
| int fnmatch |
( |
const char * |
pattern, |
|
|
const char * |
string, |
|
|
int |
flags |
|
) |
| |
Match a filename or path against a shell-style pattern.
- Parameters
-
| pattern | Shell pattern (using ?, *, and bracket expressions). |
| string | String to test against pattern. |
| flags | Combination of FNM_* flags, or 0 for default matching. |
- Returns
- 0 if
string matches pattern, FNM_NOMATCH if it does not, or a non-zero value on error.
- See also
- https://pubs.opengroup.org/onlinepubs/9699919799/functions/fnmatch.html
◆ getopt()
| int getopt |
( |
int |
argc, |
|
|
char *const |
argv[], |
|
|
const char * |
optstring |
|
) |
| |
◆ getsubopt()
| 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.
- Parameters
-
| 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. |
- Returns
- Index into
keylistp of the matched keyword, or -1 if not found.
- See also
- https://pubs.opengroup.org/onlinepubs/9699919799/functions/getsubopt.html
◆ strfmon()
| 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.
- Parameters
-
| 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). |
- Returns
- Number of bytes written (excluding NUL) on success, or -1 on error.
- See also
- https://pubs.opengroup.org/onlinepubs/9699919799/functions/strfmon.html
◆ strfmon_l()
| 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.
- Parameters
-
| 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). |
- Returns
- Number of bytes written (excluding NUL) on success, or -1 on error.
- See also
- https://pubs.opengroup.org/onlinepubs/9699919799/functions/strfmon_l.html
◆ strftime_l()
| 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.
- Parameters
-
| 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. |
- Returns
- Number of bytes written (excluding NUL) on success, or 0 if
maxsize was exceeded.
- See also
- https://pubs.opengroup.org/onlinepubs/9699919799/functions/strftime_l.html
◆ optarg
Argument for the current option from getopt().
◆ opterr
Error flag for getopt() (non-zero enables error messages).
◆ optind
Index of the next element to be processed by getopt().
◆ optopt
Unrecognised option character from getopt().