Mako 7.3.0 API
Platform-dependent

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. More...
 
EDL_API int edlRmdir (const char *dir)
 Removes a subdirectory, if it is empty. More...
 
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. More...
 
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. More...
 
EDL_API char * edlExclusiveMakeTempDir (const char *subdir, int pidNo)
 As edlMakeTempDir, but fails if the directory exists. More...
 
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. More...
 
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. More...
 
EDL_API FILE * edlFopen (const char *filename, const char *mode)
 Open a file as per fopen, handling UTF8 file names on all platforms. More...
 
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() More...
 
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(). More...
 
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() More...
 

Detailed Description

Platform-dependent functions that are visible through the EDL API.

Function Documentation

◆ edlExclusiveMakeTempDir()

EDL_API char* edlExclusiveMakeTempDir ( const char *  subdir,
int  pidNo 
)

As edlMakeTempDir, but fails if the directory exists.

Parameters
subdirSpecifies the first part of the path to the temporary directory to be created. The path is treated as a UTF8 string.
pidNoSpecifies 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.
Returns
A pointer to a string containing the path of the created directory. If the call fails, the pointer will be NULL. It is the responsibility of the caller to release the memory pointed to by the return value by calling free().

◆ 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
filenameThe path to the file.
modeAn 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().

◆ edlMakeTempDir()

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.

Parameters
subdirSpecifies the first part of the path to the temporary directory to be created. The path is treated as a UTF8 string.
pidNoSpecifies 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.
Returns
A pointer to a string containing the path of the created directory. If the call fails, the pointer will be NULL. It is the responsibility of the caller to release the memory pointed to by the return value by calling free().

◆ edlMakeTempDirProvidingSubDirPath()

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.

Parameters
subdirSpecifies the first part of the path to the temporary directory to be created. The path is treated as a UTF8 string.
pidNoSpecifies 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.
fullSubDirThe pointer to the address of a UTF8 path to the subdir
Returns
A pointer to a string containing the path of the created directory. If the call fails, the pointer will be NULL. 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
dirSpecifies 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
dirSpecifies 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
bufferC string to accept the result
nBuffer size
formatFormat 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
strC string with the representation of a floating-point number.
endptrReference 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
bufferC string to accept the result
nBuffer size
formatFormat string
apVariable 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.