| PROP_ARRAY(3) | Library Functions Manual | PROP_ARRAY(3) |
prop_array, prop_array_create,
prop_array_create_with_capacity,
prop_array_copy,
prop_array_copy_mutable,
prop_array_capacity,
prop_array_count,
prop_array_ensure_capacity,
prop_array_iterator,
prop_array_make_immutable,
prop_array_mutable,
prop_array_get,
prop_array_set,
prop_array_add,
prop_array_remove,
prop_array_externalize,
prop_array_internalize,
prop_array_externalize_to_file,
prop_array_internalize_from_file,
prop_array_externalize_to_pref,
prop_array_internalize_from_pref,
prop_array_equals —
#include <prop/proplib.h>
prop_array_t
prop_array_create(void);
prop_array_t
prop_array_create_with_capacity(unsigned
int capacity);
prop_array_t
prop_array_copy(prop_array_t
array);
prop_array_t
prop_array_copy_mutable(prop_array_t
array);
unsigned int
prop_array_capacity(prop_array_t
array);
unsigned int
prop_array_count(prop_array_t
array);
bool
prop_array_ensure_capacity(prop_array_t
array, unsigned int
capacity);
prop_object_iterator_t
prop_array_iterator(prop_array_t
array);
void
prop_array_make_immutable(prop_array_t
array);
bool
prop_array_mutable(prop_array_t
array);
prop_object_t
prop_array_get(prop_array_t
array, unsigned int
index);
bool
prop_array_set(prop_array_t
array, unsigned int
index, prop_object_t
obj);
bool
prop_array_add(prop_array_t
array, prop_object_t
obj);
void
prop_array_remove(prop_array_t
array, unsigned int
index);
char *
prop_array_externalize(prop_array_t
array);
prop_array_t
prop_array_internalize(const
char *xml);
bool
prop_array_externalize_to_file(prop_array_t
array, const char
*path);
prop_array_t
prop_array_internalize_from_file(const
char *path);
bool
prop_array_externalize_to_pref(prop_array_t
array, struct plistref
*pref);
bool
prop_array_internalize_from_pref(const
struct plistref *pref,
prop_array_t
*arrayp);
bool
prop_array_equals(prop_array_t
array1, prop_array_t
array2);
prop_array() family of functions operate on the
array property collection object type. An array is an ordered set; an iterated
array will return objects in the same order with which they were stored.
prop_array_create(void)NULL on failure.prop_array_create_with_capacity(unsigned
int capacity)NULL on failure.prop_array_copy(prop_array_t
array)NULL on
failure.prop_array_copy_mutable(prop_array_t
array)prop_array_copy(), except the resulting array
is always mutable.prop_array_capacity(prop_array_t
array)prop_array_count(prop_array_t
array)prop_array_ensure_capacity(prop_array_t
array, unsigned int capacity)true if the capacity of the array
is greater or equal to capacity or if expansion of
the array's capacity was successful and false
otherwise.prop_array_iterator(prop_array_t
array)NULL on failure.prop_array_make_immutable(prop_array_t
array)prop_array_mutable(prop_array_t
array)true if the array is mutable.prop_array_get(prop_array_t
array, unsigned int index)NULL on failure.prop_array_set(prop_array_t
array, unsigned int index,
prop_object_t obj)true if storing the object was successful and
false otherwise.prop_array_add(prop_array_t
array, prop_object_t obj)true
if storing the object was successful and false
otherwise.
During expansion, array's capacity is augmented by the
EXPAND_STEP constant, as defined in
libprop/prop_array.c file, e.g.
#define EXPAND_STEP 16prop_array_remove(prop_array_t
array, unsigned int index)prop_array_externalize(prop_array_t
array)NULL is returned.
In user space, the buffer is allocated using
malloc(3). In the kernel,
the buffer is allocated using
malloc(9) using the malloc
type M_TEMP.
prop_array_internalize(const char
*xml)NULL if parsing fails for any reason.prop_array_externalize_to_file(prop_array_t
array, const char *path)0666 as modified by the process's file creation
mask (see umask(2)) and is
written atomically. Returns false if externalizing
or writing the array fails for any reason.prop_array_internalize_from_file(const
char *path)NULL on failure.prop_array_externalize_to_pref(prop_array_t
array, struct plistref *pref)false if
externalizing the array fails for any reason.prop_array_internalize_from_pref(const
struct plistref *pref, prop_array_t
*arrayp)false if internalizing or writing the array fails
for any reason.prop_array_equals(prop_array_t
array1, prop_array_t array2)true if the two arrays are equivalent. If
at least one of the supplied objects isn't an array,
false is returned. Note: Objects contained in the
array are compared by value, not by reference.| October 10, 2009 | NetBSD 9.0 |