LabWindows/CVI

Content Type
Programming Language
Current manual

IsUTF8PathLengthValid

IsUTF8PathLengthValid

int IsUTF8PathLengthValid (char *path, int *isValid, char **overLimitPtr);

Purpose

Checks whether a UTF-8 string is within the characer limit to represent a valid path.

IsUTF8PathLengthValid sets the isValid parameter to 1 when the UTF-8 string is within the character limit for a valid path.

IsUTF8PathLengthValid sets the isValid parameter to 0 when the UTF-8 string exceeds the character limit for a valid path. Additionally, overLimitPtr points to the characters that need to be truncated in order to obtain a valid path. Refer to MAX_PATHNAME_LEN to find out more about maximum path lengths.

Example Code

char *pathName = "C:\mypath.txt";
int isValid = 0;
IsUTF8PathLengthValid(pathName, &isValid, NULL);

Parameters

Input
Name Type Description
path char * Input path.
Output
Name Type Description
isValid int Pointer to an integer value that will be set to 1 if the path length is valid, 0 otherwise.
overLimitPtr char * Optional. If the path length excceeds the character limit, overLimitPtr will point to the end of the longest subsequence in the input string that represents a valid path. Otherwise, it will be NULL.

Return Value

Name Type Description
result int Return value indicating whether the function was successful. A negative number indicates that an error occurred.

Code Description
0 Success.
-4 Insufficient memory to complete the operation.
-5 Invalid argument.
-11 Conversion error.

Additional Information

Library: Utility Library

Include file: utility.h

LabWindows/CVI compatibility: LabWindows/CVI 2020 and later

Was this information helpful?