util

util — Utility functions

Stability Level

Stable, unless otherwise indicated

Functions

Types and Values

Description

Functions

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.

Parameters

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.

Parameters

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?).

[skip]

Parameters

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.


ipatch_util_abs_filename ()

char *
ipatch_util_abs_filename (const char *filename);

Make a file name absolute, if it isn't already.

[skip]

Parameters

filename

File name to make absolute

 

Returns

Newly allocated filename, converted to an absolute filename (if necessary) or NULL if filename was NULL

Since: 1.1.0


ipatch_util_weakref_destroy ()

void
ipatch_util_weakref_destroy (gpointer value);

A GDestroyNotify function for freeing a slice allocated GWeakRef.

[skip]

Parameters

value

Slice allocated GWeakRef to destroy

 

Since: 1.1.0

Types and Values

ipatch_util_value_bool_true

extern GValue *ipatch_util_value_bool_true;

ipatch_util_value_bool_false

extern GValue *ipatch_util_value_bool_false;