GgitOId: libgit2-glib Reference Manual

## GgitOId GgitOId |

## Functions

GgitOId * | ggit_oid_copy ()
void | ggit_oid_free ()
GgitOId * | ggit_oid_new_from_string ()
GgitOId * | ggit_oid_new_from_raw ()
gint | ggit_oid_compare ()
gchar * | ggit_oid_to_string ()
guint | ggit_oid_hash ()
gboolean | ggit_oid_equal ()

## Types and Values

| GgitOId

## Object Hierarchy

        GBoxed
        ╰── GgitOId

## Description

## Functions

### ggit_oid_copy ()

    GgitOId *
    ggit_oid_copy (GgitOId *oid);

Copies `oid` into a newly allocated GgitOId.

#### Parameters

oid | a GgitOId. |

#### Returns

a newly allocated GgitOId.

[transfer full][nullable]

### ggit_oid_free ()

    void
    ggit_oid_free (GgitOId *oid);

Frees `oid` .

#### Parameters

oid | a GgitOId. |

### ggit_oid_new_from_string ()

    GgitOId *
    ggit_oid_new_from_string (const gchar *str);

Parses a hex formatted object id into a GgitOId.

#### Parameters

str | input hex string; must be pointing at the start of the hex sequence and have at least the number of bytes needed for an oid encoded in hex (40 bytes). |

#### Returns

a newly allocated GgitOId or `NULL` on error.

[transfer full][nullable]

### ggit_oid_new_from_raw ()

    GgitOId *
    ggit_oid_new_from_raw (const guchar *raw);

Creates a new GgitOId from a raw oid.

#### Parameters

raw | the raw input bytes to be copied. |

#### Returns

a newly allocated GgitOId or `NULL` on error.

[transfer full][nullable]

### ggit_oid_compare ()

    gint
    ggit_oid_compare (GgitOId *a,
                      GgitOId *b);

Compare two GgitOId structures.

#### Parameters

a | first GgitOId. |
b | second GgitOId. |

#### Returns

<0, 0, >0 if a < b, a == b, a > b.

### ggit_oid_to_string ()

    gchar *
    ggit_oid_to_string (GgitOId *oid);

Converts `oid` into a readable string.

#### Parameters

oid | a GgitOId. |

#### Returns

a newly allocated string representing `oid` or `NULL`.

[transfer full][nullable]

### ggit_oid_hash ()

    guint
    ggit_oid_hash (GgitOId const *oid);

Computes a hash value for a git object identifier.

#### Parameters

oid | a GgitOId. |

#### Returns

the hash value

### ggit_oid_equal ()

    gboolean
    ggit_oid_equal (GgitOId const *a,
                    GgitOId const *b);

Compares two GgitOId for equality.

#### Parameters

a | a GgitOId. |
b | a GgitOId. |

#### Returns

`TRUE` if `a` and `b` are equal, `FALSE` otherwise

## Types and Values

### GgitOId

    typedef struct _GgitOId GgitOId;

Represents a unique ID of any object.