OpenCore
1.0.4
OpenCore Bootloader
|
Go to the source code of this file.
Macros | |
#define | STREQ_DISPATCH(type1, type2) |
#define | STRCOERCE_DISPATCH(type1, type2) |
Functions | |
fsw_status_t | fsw_alloc_zero (int len, void **ptr_out) |
fsw_status_t | fsw_memdup (void **dest_out, void *src, int len) |
int | fsw_strlen (struct fsw_string *s) |
int | fsw_strsize (struct fsw_string *s) |
void * | fsw_strdata (struct fsw_string *s) |
int | fsw_streq (struct fsw_string *s1, struct fsw_string *s2) |
int | fsw_streq_cstr (struct fsw_string *s1, const char *s2) |
fsw_status_t | fsw_strdup_coerce (struct fsw_string *dest, int type, struct fsw_string *src) |
void | fsw_strsplit (struct fsw_string *element, struct fsw_string *buffer, char separator) |
void | fsw_strfree (struct fsw_string *s) |
Core file system wrapper library functions.
Definition in file fsw_lib.c.
#define STRCOERCE_DISPATCH | ( | type1, | |
type2 ) |
#define STREQ_DISPATCH | ( | type1, | |
type2 ) |
fsw_status_t fsw_alloc_zero | ( | int | len, |
void ** | ptr_out ) |
fsw_status_t fsw_memdup | ( | void ** | dest_out, |
void * | src, | ||
int | len ) |
void * fsw_strdata | ( | struct fsw_string * | s | ) |
fsw_status_t fsw_strdup_coerce | ( | struct fsw_string * | dest, |
int | type, | ||
struct fsw_string * | src ) |
int fsw_streq | ( | struct fsw_string * | s1, |
struct fsw_string * | s2 ) |
int fsw_streq_cstr | ( | struct fsw_string * | s1, |
const char * | s2 ) |
Compare a string with a C string constant. This sets up a string descriptor for the string constant (second argument) and runs fsw_streq on the two strings. Currently the C string is interpreted as ISO 8859-1. Returns boolean true if the strings are considered equal, boolean false otherwise.
void fsw_strfree | ( | struct fsw_string * | s | ) |
int fsw_strlen | ( | struct fsw_string * | s | ) |
int fsw_strsize | ( | struct fsw_string * | s | ) |
void fsw_strsplit | ( | struct fsw_string * | element, |
struct fsw_string * | buffer, | ||
char | separator ) |
Splits a string at the first occurence of the separator character. The buffer string is searched for the separator character. If it is found, the element string descriptor is filled to point at the part of the buffer string before the separator. The buffer string itself is adjusted to point at the remaining part of the string (without the separator).
If the separator is not found in the buffer string, then element is changed to point at the whole buffer string, and the buffer string itself is changed into an empty string.
This function only manipulates the pointers and lengths in the two string descriptors, it does not change the actual string. If the buffer string is dynamically allocated, you must make a copy of it so that you can release it later.