PreviousNext

uuid_compare(3rpc)

Compares two UUIDs and determines their order

Used by client, server, or management applications.

Synopsis

#include <dce/uuid.h>

signed32 uuid_compare(

uuid_t *uuid1,

uuid_t *uuid2,

unsigned32 *status);

Parameters

Input

uuid1
Specifies a pointer to a UUID. This UUID is compared with the UUID specified in uuid2.

Use the value NULL to specify a nil UUID for this parameter.

uuid2
Specifies a pointer to a UUID. This UUID is compared with the UUID specified in uuid1.

Use the value NULL to specify a nil UUID for this parameter.

Output

status
Returns the status code from this routine. This status code indicates whether the routine completed successfully or, if not, why not.

Description
The uuid_compare( ) routine compares two UUIDs and determines their order. A nil UUID is considered the first element in order. The order of UUIDs is defined by the RPC architecture and is not a temporal (related to time) ordering. Comparing two specific UUIDs always returns the same result regardless of the implementation or system architecture.

You can use this routine to sort data with UUIDs as a key.

Return Values
Returns one of the following constants:

1 The uuid1 parameter precedes the uuid2 parameter in order.

0 The uuid1 parameter is equal to the uuid2 parameter in order.

1 The uuid1 parameter follows the uuid2 parameter in order.

Note that a value of 0 (zero) has the same meaning as if uuid_equal(&uuid1, &uuid2) returned a value of TRUE.

A nil UUID is the first UUID in order. This means the following:

· If uuid1 is NULL and uuid2 is non-nil, the routine returns 1.

· If uuid1 is NULL and uuid2 is NULL, the routine returns 0.

· If uuid1 is non-nil and uuid2 is NULL, the routine returns 1.

Errors

The following describes a partial list of errors that might be returned. Refer to the OSF DCE Problem Determination Guide for complete descriptions of all error messages.

uuid_s_ok
Success.

uuid_s_bad_version
Bad UUID version.

Related Information
Functions: uuid_equal(3rpc)

uuid_is_nil(3rpc)