Function

GLibstrcmp0

since: 2.16

Declaration [src]

int
g_strcmp0 (
  const char* str1,
  const char* str2
)

Description [src]

Compares str1 and str2 like strcmp().

Handles NULL gracefully by sorting it before non-NULL strings. Comparing two NULL pointers returns 0.

Available since: 2.16

Parameters

str1

Type: const char*

A string.

The argument can be NULL.
The data is owned by the caller of the function.
The value is a NUL terminated UTF-8 string.
str2

Type: const char*

Another string.

The argument can be NULL.
The data is owned by the caller of the function.
The value is a NUL terminated UTF-8 string.

Return value

Type: int

An integer less than, equal to, or greater than zero, if str1 is <, == or > than str2.