## util

util — Utility functions

## Stability Level

Stable, unless otherwise indicated

## Synopsis

    extern              GValue *ipatch_util_value_bool_true;
    extern              GValue *ipatch_util_value_bool_false;
    #define             IPATCH_UTIL_VALUE_BOOL              (b)
    guint               ipatch_util_value_hash              (GValue *val);
    guint               ipatch_util_value_array_hash        (GValueArray *valarray);
    guint64             ipatch_util_file_size               (const char *fname,
                                                             GError **err);

## Description

## Details

### ipatch_util_value_bool_true

    extern GValue *ipatch_util_value_bool_true;

### ipatch_util_value_bool_false

    extern GValue *ipatch_util_value_bool_false;

### IPATCH_UTIL_VALUE_BOOL()

    #define             IPATCH_UTIL_VALUE_BOOL(b)

### ipatch_util_value_hash ()

    guint               ipatch_util_value_hash              (GValue *val);

Hash a GValue. The hash value can then be used in a GHashTable for example.

`val` : | GValue to hash
Returns : | Hash value corresponding to the `val` key.

### ipatch_util_value_array_hash ()

    guint               ipatch_util_value_array_hash        (GValueArray *valarray);

Hash a GValueArray. The hash value can then be used in a GHashTable for example.

`valarray` : | GValueArray to hash
Returns : | Hash value corresponding to the sum of all values returned by `ipatch_util_value_hash()` for each GValue in the array.

### ipatch_util_file_size ()

    guint64             ipatch_util_file_size               (const char *fname,
                                                             GError **err);

Get the size of a file (tired of using stat every time?).

`fname` : | Path of file to get size of.
`err` : | Location to store error or NULL
Returns : | File size. Will return 0 on error, but `err` must be checked if it is set to determine if an error really occurred.