Platform-dependent functions that are visible through the EDL API.
More...
|
file | platform.h |
| Platform-dependent defines, enumerations, types etc. that are visible through the EDL API.
|
|
|
_BEGIN_EDL_NAMESPACE EDL_API int | edlMkdir (const char *dir) |
| Creates a subdirectory path (including parents) in an existing directory tree.
|
|
EDL_API int | edlRmdir (const char *dir) |
| Removes a subdirectory, if it is empty.
|
|
EDL_API char * | edlGetTemporaryDirectory (void) |
| Get the platform-specific temporary directory path. This is created by consulting platform specific APIs or through the TEMP or TMP environment variables.
|
|
EDL_API int | edlGetProcessId () |
| Gets the process id of the calling process. This is useful if the user wants to provide separate temporary directories for each instance of EDL.
|
|
EDL_API FILE * | edlFopen (const char *filename, const char *mode) |
| Open a file as per fopen, handling UTF8 file names on all platforms.
|
|
EDL_API int | edlVsnprintf (char *buffer, size_t n, const char *format, va_list ap) |
| Implementation of vsnprintf that always uses the C locale, to write formatted data from variable argument list to sized buffer Parameters as per vsnprintf()
|
|
EDL_API int | edlSnprintf (char *buffer, size_t n, const char *format,...) |
| Implementation of snprintf that always uses the C locale. Parameters as per snprintf().
|
|
EDL_API double | edlStrtod (const char *str, char **endptr) |
| Implementation of strtod that always uses the C locale to parse the C string str interpreting its content as a floating point number as per strtod()
|
|
Platform-dependent functions that are visible through the EDL API.
◆ edlFopen()
EDL_API FILE * edlFopen |
( |
const char * | filename, |
|
|
const char * | mode ) |
Open a file as per fopen, handling UTF8 file names on all platforms.
- Parameters
-
filename | The path to the file. |
mode | An fopen mode string. |
- Returns
- FILE A file pointer, or NULL on failure.
◆ edlGetProcessId()
EDL_API int edlGetProcessId |
( |
| ) |
|
Gets the process id of the calling process. This is useful if the user wants to provide separate temporary directories for each instance of EDL.
- Returns
- int The process id of the calling process.
◆ edlGetTemporaryDirectory()
EDL_API char * edlGetTemporaryDirectory |
( |
void | | ) |
|
Get the platform-specific temporary directory path. This is created by consulting platform specific APIs or through the TEMP or TMP environment variables.
- Returns
- A pointer to a string containing the temporary directory path. If the call fails NULL is returned. It is the responsibility of the caller to release the memory pointed to by the return value by calling free().
◆ edlMkdir()
_BEGIN_EDL_NAMESPACE EDL_API int edlMkdir |
( |
const char * | dir | ) |
|
Creates a subdirectory path (including parents) in an existing directory tree.
- Parameters
-
dir | Specifies the path to be created. If the parameter is specified as /foo/bar/dir, and the path /foo/bar already exists, the directory dir will be created within bar. If the parameter is specified as /foo/bar and /foo already exists, then both bar and bar/dir are created, and so forth. The path is treated as a UTF8 string. |
- Returns
- int Non-zero on success, zero if the call fails.
◆ edlRmdir()
EDL_API int edlRmdir |
( |
const char * | dir | ) |
|
Removes a subdirectory, if it is empty.
- Parameters
-
dir | Specifies the path to, and name of, the directory to be removed. The path is treated as a UTF8 string. |
- Returns
- int Non-zero on success, zero if the call fails.
◆ edlSnprintf()
EDL_API int edlSnprintf |
( |
char * | buffer, |
|
|
size_t | n, |
|
|
const char * | format, |
|
|
| ... ) |
Implementation of snprintf that always uses the C locale. Parameters as per snprintf().
- Parameters
-
buffer | C string to accept the result |
n | Buffer size |
format | Format string |
- Returns
- int Either the number of characters printed (not including the null terminator) or the number of characters that would have been printed if the target buffer was unlimited in size.
◆ edlStrtod()
EDL_API double edlStrtod |
( |
const char * | str, |
|
|
char ** | endptr ) |
Implementation of strtod that always uses the C locale to parse the C string str interpreting its content as a floating point number as per strtod()
- Parameters
-
str | C string with the representation of a floating-point number. |
endptr | Reference to an already allocated object of type char *, whose value is set by the function to the next character in str after the numerical value. This parameter can also be a null pointer, in which case it is not used. |
- Returns
- double Either the converted floating point number, or 0.0 if the conversion failed.
◆ edlVsnprintf()
EDL_API int edlVsnprintf |
( |
char * | buffer, |
|
|
size_t | n, |
|
|
const char * | format, |
|
|
va_list | ap ) |
Implementation of vsnprintf that always uses the C locale, to write formatted data from variable argument list to sized buffer Parameters as per vsnprintf()
- Parameters
-
buffer | C string to accept the result |
n | Buffer size |
format | Format string |
ap | Variable argument list |
- Returns
- int Either the number of characters printed (not including the null terminator) or the number of characters that would have been printed if the target buffer was unlimited in size.