RTI Connext Micro C API Version 4.2.0
Loading...
Searching...
No Matches
OSAPI String API

Functions

OSPSLDllExport RTI_SIZE_T OSAPI_String_length (const char *s)
 Return length of ASCIIZ string.
 
OSPSLDllExport RTI_INT32 OSAPI_String_cmp (const char *left, const char *right)
 Compare two ASCIIZ strings.
 
OSPSLDllExport RTI_INT32 OSAPI_String_ncmp (const char *left, const char *right, RTI_SIZE_T num)
 Return the process ID.
 

Detailed Description

Function Documentation

◆ OSAPI_String_length()

OSPSLDllExport RTI_SIZE_T OSAPI_String_length ( const char * s)

Return length of ASCIIZ string.

Return length of ASCIIZ string not including \0.

Parameters
[in]sPointer to beginning of byte string.
Returns
Length of string not including \0.

References RTI_INT32.

◆ OSAPI_String_cmp()

OSPSLDllExport RTI_INT32 OSAPI_String_cmp ( const char * left,
const char * right )

Compare two ASCIIZ strings.

Lexicographically compare the null-terminated strings l and r. The comparison is using unsigned arithmetic.

Parameters
[in]leftLeft side string.
[in]rightRight side string.
Returns
0 if the strings are identical, a positive integer if left is greater then right, and a negative integer if left less then right.

References RTI_INT32.

◆ OSAPI_String_ncmp()

OSPSLDllExport RTI_INT32 OSAPI_String_ncmp ( const char * left,
const char * right,
RTI_SIZE_T num )

Return the process ID.

Lexicographically compare null-terminated strings l and r, including up to num characters (if the null terminator is not found before the specified number of characters has been compared). The comparison uses unsigned arithmetic.

Parameters
[in]leftLeft side string.
[in]rightRight side string.
[in]numMaximum number of characters to compare.
Returns
0 if the strings are identical, a positive integer if left is greated than right, and a negative integer if left is less than right.