## GgitIndexEntry GgitIndexEntry |

## Synopsis

                        GgitIndexEntries;
                        GgitIndexEntry;
    GgitIndexEntries *  ggit_index_entries_ref              (GgitIndexEntries *entries);
    void                ggit_index_entries_unref            (GgitIndexEntries *entries);
    GgitIndexEntry *    ggit_index_entries_get_by_index     (GgitIndexEntries *entries,
                                                             gsize idx);
    GgitIndexEntry *    ggit_index_entries_get_by_path      (GgitIndexEntries *entries,
                                                             GFile *file,
                                                             gboolean stage);
    guint               ggit_index_entries_size             (GgitIndexEntries *entries);
    GgitIndexEntry *    ggit_index_entry_ref                (GgitIndexEntry *entry);
    void                ggit_index_entry_unref              (GgitIndexEntry *entry);
    guint               ggit_index_entry_get_dev            (GgitIndexEntry *entry);
    void                ggit_index_entry_set_dev            (GgitIndexEntry *entry,
                                                             guint dev);
    guint               ggit_index_entry_get_ino            (GgitIndexEntry *entry);
    void                ggit_index_entry_set_ino            (GgitIndexEntry *entry,
                                                             guint ino);
    guint               ggit_index_entry_get_mode           (GgitIndexEntry *entry);
    void                ggit_index_entry_set_mode           (GgitIndexEntry *entry,
                                                             guint mode);
    guint               ggit_index_entry_get_uid            (GgitIndexEntry *entry);
    void                ggit_index_entry_set_uid            (GgitIndexEntry *entry,
                                                             guint uid);
    guint               ggit_index_entry_get_gid            (GgitIndexEntry *entry);
    void                ggit_index_entry_set_gid            (GgitIndexEntry *entry,
                                                             guint gid);
    goffset             ggit_index_entry_get_file_size      (GgitIndexEntry *entry);
    void                ggit_index_entry_set_file_size      (GgitIndexEntry *entry,
                                                             goffset file_size);
    GgitOId *           ggit_index_entry_get_id             (GgitIndexEntry *entry);
    void                ggit_index_entry_set_id             (GgitIndexEntry *entry,
                                                             GgitOId *id);
    guint               ggit_index_entry_get_flags          (GgitIndexEntry *entry);
    void                ggit_index_entry_set_flags          (GgitIndexEntry *entry,
                                                             guint flags);
    guint               ggit_index_entry_get_flags_extended (GgitIndexEntry *entry);
    void                ggit_index_entry_set_flags_extended (GgitIndexEntry *entry,
                                                             guint flags_extended);
    const gchar *       ggit_index_entry_get_path           (GgitIndexEntry *entry);
    void                ggit_index_entry_set_path           (GgitIndexEntry *entry,
                                                             const gchar *path);
    gboolean            ggit_index_entry_stat               (GgitIndexEntry *entry,
                                                             GFile *file,
                                                             GError **error);

## Object Hierarchy

      GBoxed
       +----GgitIndexEntries

      GBoxed
       +----GgitIndexEntry

## Description

## Details

### GgitIndexEntries

    typedef struct _GgitIndexEntries GgitIndexEntries;

Represents the entries in an index object.

### GgitIndexEntry

    typedef struct _GgitIndexEntry GgitIndexEntry;

Represents an index entry object.

### ggit_index_entries_ref ()

    GgitIndexEntries *  ggit_index_entries_ref              (GgitIndexEntries *entries);

Atomically increments the reference count of `entries` by one. This function is MT-safe and may be called from any thread.

`entries` : | a GgitIndexEntries.
Returns : | a GgitIndexEntries. [transfer none]

### ggit_index_entries_unref ()

    void                ggit_index_entries_unref            (GgitIndexEntries *entries);

Atomically decrements the reference count of `entries` by one. If the reference count drops to 0, `entries` is freed.

`entries` : | a GgitIndexEntries.

### ggit_index_entries_get_by_index ()

    GgitIndexEntry *    ggit_index_entries_get_by_index     (GgitIndexEntries *entries,
                                                             gsize idx);

Get a GgitIndexEntry by index. Note that the returned GgitIndexEntry is _only_ valid as long as:

1) The associated index has been closed 2) The entry has not been removed (see `ggit_index_remove()`) 3) The index has not been refreshed (see `ggit_index_read()`)

Changes to the GgitIndexEntry will be reflected in the index once written back to disk using `ggit_index_write()`.

`entries` : | a GgitIndexEntries.
`idx` : | the index of the entry.
Returns : | a GgitIndexEntry or `NULL` if out of bounds. [transfer full]

### ggit_index_entries_get_by_path ()

    GgitIndexEntry *    ggit_index_entries_get_by_path      (GgitIndexEntries *entries,
                                                             GFile *file,
                                                             gboolean stage);

Get a GgitIndexEntry by index. Note that the returned GgitIndexEntry is _only_ valid as long as:

1) The associated index has been closed 2) The entry has not been removed (see `ggit_index_remove()`) 3) The index has not been refreshed (see `ggit_index_read()`)

Changes to the GgitIndexEntry will be reflected in the index once written back to disk using `ggit_index_write()`.

`entries` : | a GgitIndexEntries.
`file` : | the path to search.
`stage` : | stage to search.
Returns : | a GgitIndexEntry or `NULL` if it was not found. [transfer full]

### ggit_index_entries_size ()

    guint               ggit_index_entries_size             (GgitIndexEntries *entries);

Get the number of GgitIndexEntry entries.

`entries` : | a GgitIndexEntries.
Returns : | the number of entries.

### ggit_index_entry_ref ()

    GgitIndexEntry *    ggit_index_entry_ref                (GgitIndexEntry *entry);

Atomically increments the reference count of `entry` by one. This function is MT-safe and may be called from any thread.

`entry` : | a GgitIndexEntry.
Returns : | a GgitIndexEntry. [transfer none]

### ggit_index_entry_unref ()

    void                ggit_index_entry_unref              (GgitIndexEntry *entry);

Atomically decrements the reference count of `entry` by one. If the reference count drops to 0, `entry` is freed.

`entry` : | a GgitIndexEntry.

### ggit_index_entry_get_dev ()

    guint               ggit_index_entry_get_dev            (GgitIndexEntry *entry);

Get the dev of the index entry.

`entry` : | a GgitIndexEntry.
Returns : | the dev.

### ggit_index_entry_set_dev ()

    void                ggit_index_entry_set_dev            (GgitIndexEntry *entry,
                                                             guint dev);

Set the dev of the index entry.

`entry` : | a GgitIndexEntry.
`dev` : | the dev.

### ggit_index_entry_get_ino ()

    guint               ggit_index_entry_get_ino            (GgitIndexEntry *entry);

Get the ino of the index entry.

`entry` : | a GgitIndexEntry.
Returns : | the ino.

### ggit_index_entry_set_ino ()

    void                ggit_index_entry_set_ino            (GgitIndexEntry *entry,
                                                             guint ino);

Set the ino of the index entry.

`entry` : | a GgitIndexEntry.
`ino` : | the ino.

### ggit_index_entry_get_mode ()

    guint               ggit_index_entry_get_mode           (GgitIndexEntry *entry);

Get the mode of the index entry.

`entry` : | a GgitIndexEntry.
Returns : | the mode.

### ggit_index_entry_set_mode ()

    void                ggit_index_entry_set_mode           (GgitIndexEntry *entry,
                                                             guint mode);

Set the mode of the index entry.

`entry` : | a GgitIndexEntry.
`mode` : | the mode.

### ggit_index_entry_get_uid ()

    guint               ggit_index_entry_get_uid            (GgitIndexEntry *entry);

Get the uid of the index entry.

`entry` : | a GgitIndexEntry.
Returns : | the uid.

### ggit_index_entry_set_uid ()

    void                ggit_index_entry_set_uid            (GgitIndexEntry *entry,
                                                             guint uid);

Set the uid of the index entry.

`entry` : | a GgitIndexEntry.
`uid` : | the uid.

### ggit_index_entry_get_gid ()

    guint               ggit_index_entry_get_gid            (GgitIndexEntry *entry);

Get the gid of the index entry.

`entry` : | a GgitIndexEntry.
Returns : | the gid.

### ggit_index_entry_set_gid ()

    void                ggit_index_entry_set_gid            (GgitIndexEntry *entry,
                                                             guint gid);

Set the gid of the index entry.

`entry` : | a GgitIndexEntry.
`gid` : | the gid.

### ggit_index_entry_get_file_size ()

    goffset             ggit_index_entry_get_file_size      (GgitIndexEntry *entry);

Get the file size of the index entry.

`entry` : | a GgitIndexEntry.
Returns : | the file size.

### ggit_index_entry_set_file_size ()

    void                ggit_index_entry_set_file_size      (GgitIndexEntry *entry,
                                                             goffset file_size);

Set the file size of the index entry.

`entry` : | a GgitIndexEntry.
`file_size` : | the file size.

### ggit_index_entry_get_id ()

    GgitOId *           ggit_index_entry_get_id             (GgitIndexEntry *entry);

Get the oid of the index entry.

`entry` : | a GgitIndexEntry.
Returns : | the oid.

### ggit_index_entry_set_id ()

    void                ggit_index_entry_set_id             (GgitIndexEntry *entry,
                                                             GgitOId *id);

Set the oid of the index entry.

`entry` : | a GgitIndexEntry.
`id` : | the oid. [allow-none]

### ggit_index_entry_get_flags ()

    guint               ggit_index_entry_get_flags          (GgitIndexEntry *entry);

Get the flags of the index entry.

`entry` : | a GgitIndexEntry.
Returns : | the flags.

### ggit_index_entry_set_flags ()

    void                ggit_index_entry_set_flags          (GgitIndexEntry *entry,
                                                             guint flags);

Set the flags of the index entry.

`entry` : | a GgitIndexEntry.
`flags` : | the flags.

### ggit_index_entry_get_flags_extended ()

    guint               ggit_index_entry_get_flags_extended (GgitIndexEntry *entry);

Get the extended flags of the index entry.

`entry` : | a GgitIndexEntry.
Returns : | the extended flags.

### ggit_index_entry_set_flags_extended ()

    void                ggit_index_entry_set_flags_extended (GgitIndexEntry *entry,
                                                             guint flags_extended);

Set the extended flags of the index entry.

`entry` : | a GgitIndexEntry.
`flags_extended` : | the extended flags.

### ggit_index_entry_get_path ()

    const gchar *       ggit_index_entry_get_path           (GgitIndexEntry *entry);

### ggit_index_entry_set_path ()

    void                ggit_index_entry_set_path           (GgitIndexEntry *entry,
                                                             const gchar *path);

Set the path of the index entry. The path should be relative to the working directory.

`entry` : | a GgitIndexEntry.
`path` : | the path. [allow-none]

### ggit_index_entry_stat ()

    gboolean            ggit_index_entry_stat               (GgitIndexEntry *entry,
                                                             GFile *file,
                                                             GError **error);

Fill the entry fields from statting `file`.

`entry` : | a GgitIndexEntry.
`file` : | the file to stat.
`error` : | a GError for error reporting, or `NULL`.
Returns : | `TRUE` if the entry was filled from statting `file` successfully, `FALSE` otherwise.