| Top |
| #define | IPATCH_UTIL_VALUE_BOOL() |
| guint | ipatch_util_value_hash () |
| guint | ipatch_util_garray_value_hash () |
| guint | ipatch_util_value_array_hash () |
| guint64 | ipatch_util_file_size () |
| char * | ipatch_util_abs_filename () |
| void | ipatch_util_weakref_destroy () |
| void | ipatch_util_strncpy_pad () |
| extern GValue * | ipatch_util_value_bool_true |
| extern GValue * | ipatch_util_value_bool_false |
guint
ipatch_util_value_hash (GValue *val);
Hash a GValue. The hash value can then be used in a GHashTable for example.
guint
ipatch_util_garray_value_hash (GArray *valarray);
Hash a GArray of GValue elements (as returned by
ipatch_item_get_unique_props_array()). The hash value can then be used
in a GHashTable for example.
Hash value corresponding to the sum of all values returned
by ipatch_util_value_hash() for each GValue in the array.
Since: 1.1.1
guint
ipatch_util_value_array_hash (GValueArray *valarray);
ipatch_util_value_array_hash has been deprecated since version 1.1.1 and should not be used in newly-written code.
Use ipatch_util_garray_value_hash() instead, since
GValueArray is deprecated in GLib.
Hash a GValueArray. The hash value can then be used in a GHashTable for example.
Hash value corresponding to the sum of all values returned
by ipatch_util_value_hash() for each GValue in the array.
guint64 ipatch_util_file_size (const char *fname,GError **err);
Get the size of a file (tired of using stat every time?).
[skip]
char *
ipatch_util_abs_filename (const char *filename);
Make a file name absolute, if it isn't already.
[skip]
Newly allocated filename, converted to an absolute filename (if necessary)
or NULL if filename
was NULL
Since: 1.1.0
void
ipatch_util_weakref_destroy (gpointer value);
A GDestroyNotify function for freeing a slice allocated GWeakRef.
[skip]
Since: 1.1.0
void ipatch_util_strncpy_pad (char *dest,const char *src,gsize n);
Copy up to n
bytes of src
into dest
: like strncpy(dest, src, n),
truncating without a trailing NUL if src
is n
bytes or longer, and
zero-padding the remainder of dest
if src
is shorter than n
bytes.
Used when writing fixed-width name fields into binary file formats
(SoundFont, DLS, GigaSampler, Spectralis) where truncation without a
trailing NUL is valid/expected once the field is exactly full.
Implemented without calling strncpy() directly so this deliberate
truncate-and-pad usage doesn't trip GCC's -Wstringop-truncation, which
otherwise (correctly, in general, but not for this specific idiom)
flags any strncpy() call where the bound equals the destination size.
dest |
Destination buffer of exactly |
|
src |
Source string to copy (may be |
|
n |
Size of |
Since: 1.1.1