wiki.icculus.org
[ front page | index | search | recent changes | git repo | offline html ]

PHYSFS_ucs4stricmp

Case-insensitive compare of two UCS-4 strings.

Header File

Defined in <physfs.h>

Syntax

int PHYSFS_ucs4stricmp(const PHYSFS_uint32 *str1, const PHYSFS_uint32 *str2);

Function Parameters

const PHYSFS_uint32 * str1 First string to compare.
const PHYSFS_uint32 * str2 Second string to compare.

Return Value

(int) Returns -1 if str1 is "less than" str2, 1 if "greater than", 0 if equal.

Remarks

This is a strcasecmp/stricmp replacement that expects both strings to be in UCS-4 (aka UTF-32) encoding. It will do "case folding" to decide if the Unicode codepoints in the strings match.

It will report which string is "greater than" the other, but be aware that this doesn't necessarily mean anything: 'a' may be "less than" 'b', but a Japanese kuten has no meaningful alphabetically relationship to a Greek lambda, but being able to assign a reliable "value" makes sorting algorithms possible, if not entirely sane. Most cases should treat the return value as "equal" or "not equal".

Like stricmp, this expects both strings to be NULL-terminated.

Thread Safety

It is safe to call this function from any thread.

Version

This function is available since PhysicsFS 2.1.0.


CategoryAPI, CategoryAPIFunction, CategoryPhysicsFS


[ edit | delete | history | feedback | raw ]

All wiki content is licensed under Creative Commons Attribution 4.0 International (CC BY 4.0).
Wiki powered by ghwikipp.