Ruby 3.5.0dev (2025-02-22 revision b17f984e4e903d3ece3013c1488279d1947dfc39)
Functions
pm_strncasecmp.h File Reference

(b17f984e4e903d3ece3013c1488279d1947dfc39)

A custom strncasecmp implementation. More...

#include "prism/defines.h"
#include <ctype.h>
#include <stddef.h>
#include <stdint.h>
Include dependency graph for pm_strncasecmp.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

int pm_strncasecmp (const uint8_t *string1, const uint8_t *string2, size_t length)
 Compare two strings, ignoring case, up to the given length.
 

Detailed Description

A custom strncasecmp implementation.

Definition in file pm_strncasecmp.h.

Function Documentation

◆ pm_strncasecmp()

int pm_strncasecmp ( const uint8_t *  string1,
const uint8_t *  string2,
size_t  length 
)

Compare two strings, ignoring case, up to the given length.

Returns 0 if the strings are equal, a negative number if string1 is less than string2, or a positive number if string1 is greater than string2.

Note that this is effectively our own implementation of strncasecmp, but it's not available on all of the platforms we want to support so we're rolling it here.

Parameters
string1The first string to compare.
string2The second string to compare
lengthThe maximum number of characters to compare.
Returns
0 if the strings are equal, a negative number if string1 is less than string2, or a positive number if string1 is greater than string2.

Returns 0 if the strings are equal, a negative number if string1 is less than string2, or a positive number if string1 is greater than string2.

Note that this is effectively our own implementation of strncasecmp, but it's not available on all of the platforms we want to support so we're rolling it here.

Definition at line 13 of file pm_strncasecmp.c.