Midgard Globally Unique Identifiers


Functions

gboolean midgard_is_guid (const gchar *guid)
gchar * midgard_guid_new (midgard *mgd)
gchar * midgard_guid_external (midgard *mgd, const gchar *external)
gchar * mgd_create_guid (midgard *mgd, const gchar *table, guint id)

Detailed Description

This module abstracts the generation and handling of Midgard Globally Unique Identifiers (GUIDs).

Each Midgard object is assigned a GUID when it is created. GUIDs can be used to identify a Midgard object even across database and system boundaries.

GUIDs are normally assigned automatically by Midgard core when an object is created. An application can optionally set the object GUID before the object has been saved in a database. This feature is normally only used when replicating or otherwise mirroring content from external sources.

GUIDs can either be created from scratch with midgard_guid_new() or from an external unique identifier with midgard_guid_external().

The midgard_is_guid() function can be used to check whether a given string looks like a Midgard GUID.


Function Documentation

gchar* mgd_create_guid midgard mgd,
const gchar *  table,
guint  id
 

Generates a GUID string from the given table name and record identifier.

Parameters:
[in] mgd the Midgard handle containing GUID configuration
[in] table table name (unused)
[in] id record identifier (unused)
Returns:
UUID string (newly allocated)
Deprecated:
Use the midgard_guid_new() function instead.

Definition at line 58 of file guid.c.

References midgard_guid_new().

Here is the call graph for this function:

gchar* midgard_guid_external midgard mgd,
const gchar *  external
 

Generates a GUID string from the given external identifier.

Parameters:
[in] mgd the Midgard handle containing GUID configuration
[in] external the external identifier
Returns:
UUID string (newly allocated)

Definition at line 50 of file guid.c.

References midgard_uuid_external().

Here is the call graph for this function:

gchar* midgard_guid_new midgard mgd  ) 
 

Generates a new GUID string. The returned UUID is either an old-style Midgard GUID (a hex-encoded semi-random MD5 hash), or a time-based time 1 UUID.

Parameters:
[in] mgd the Midgard handle containing GUID configuration
Returns:
GUID string (newly allocated)

Definition at line 43 of file guid.c.

References midgard_uuid_new().

Referenced by mgd_create_guid().

Here is the call graph for this function:

gboolean midgard_is_guid const gchar *  guid  ) 
 

Checks whether the given string matches the GUID format.

Parameters:
[in] guid the potential GUID string
Returns:
TRUE if the given string is a GUID, FALSE otherwise

Definition at line 22 of file guid.c.

Referenced by _midgard_core_object_is_valid(), and midgard_object_new().


Generated on Thu Feb 22 06:15:20 2007 for midgard-core by  doxygen 1.4.6