Platform-dependent functions that are visible through the EDL API. More...
Files | |
file | platform.h |
Platform-dependent defines, enumerations, types etc. that are visible through the EDL API. | |
Functions | |
_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 char * | edlMakeTempDir (const char *subdir, int pidNo) |
Creates an EDL temporary directory as specified by the two parameters. The temporary directory will be created as a subdirectory of the root temporary directory, which is specified by either the TEMP or TMP environment variables on most platforms, with platform specific methods used on iOS and UWP instead. For example, if TMP is set to c:\tmp and you invoke edlMakeTempDir ("edl", 2) then it will create c:\tmp\edl\2. | |
EDL_API char * | edlExclusiveMakeTempDir (const char *subdir, int pidNo) |
As edlMakeTempDir, but fails if the directory exists. | |
EDL_API char * | edlMakeTempDirProvidingSubDirPath (const char *subdir, int pidNo, char **fullSubDir) |
As edlMakeTempDir, but also provides the UTF8 path to the subdir to the pointer at address fullSubDir. This must be freed by the caller using free() . This is useful if the user wishes to delete that directory. If the subdir parameter was an empty string or nothing but path separators, then fullSubDir will be NULL on exit. | |
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.
EDL_API char * edlExclusiveMakeTempDir | ( | const char * | subdir, |
int | pidNo ) |
As edlMakeTempDir, but fails if the directory exists.
subdir | Specifies the first part of the path to the temporary directory to be created. The path is treated as a UTF8 string. |
pidNo | Specifies the second part of the path to the temporary directory to be created. This parameter allows multiple instances of the application to run on the same machine whilst maintaining independent temporary directories. |
free()
. EDL_API FILE * edlFopen | ( | const char * | filename, |
const char * | mode ) |
Open a file as per fopen, handling UTF8 file names on all platforms.
filename | The path to the file. |
mode | An fopen mode string. |
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 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 char * edlMakeTempDir | ( | const char * | subdir, |
int | pidNo ) |
Creates an EDL temporary directory as specified by the two parameters. The temporary directory will be created as a subdirectory of the root temporary directory, which is specified by either the TEMP
or TMP
environment variables on most platforms, with platform specific methods used on iOS and UWP instead. For example, if TMP
is set to c:\tmp and you invoke edlMakeTempDir
("edl", 2) then it will create c:\tmp\edl\2.
subdir | Specifies the first part of the path to the temporary directory to be created. The path is treated as a UTF8 string. |
pidNo | Specifies the second part of the path to the temporary directory to be created. This parameter allows multiple instances of the application to run on the same machine whilst maintaining independent temporary directories. |
free()
. EDL_API char * edlMakeTempDirProvidingSubDirPath | ( | const char * | subdir, |
int | pidNo, | ||
char ** | fullSubDir ) |
As edlMakeTempDir, but also provides the UTF8 path to the subdir to the pointer at address fullSubDir. This must be freed by the caller using free()
. This is useful if the user wishes to delete that directory. If the subdir parameter was an empty string or nothing but path separators, then fullSubDir will be NULL on exit.
subdir | Specifies the first part of the path to the temporary directory to be created. The path is treated as a UTF8 string. |
pidNo | Specifies the second part of the path to the temporary directory to be created. This parameter allows multiple instances of the application to run on the same machine whilst maintaining independent temporary directories. |
fullSubDir | The pointer to the address of a UTF8 path to the subdir |
free()
. _BEGIN_EDL_NAMESPACE EDL_API int edlMkdir | ( | const char * | dir | ) |
Creates a subdirectory path (including parents) in an existing directory tree.
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. |
EDL_API int edlRmdir | ( | const char * | dir | ) |
Removes a subdirectory, if it is empty.
dir | Specifies the path to, and name of, the directory to be removed. The path is treated as a UTF8 string. |
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().
buffer | C string to accept the result |
n | Buffer size |
format | Format string |
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()
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. |
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()
buffer | C string to accept the result |
n | Buffer size |
format | Format string |
ap | Variable argument list |