PPATH_BOOL(3) | Library Functions Manual | PPATH_BOOL(3)

# NAME

`ppath_bool`, `ppath_copydel_bool`, `ppath_copyset_bool`, `ppath_set_bool`, `ppath_get_bool`, `ppath_delete_bool` —
boolean property path operations

# LIBRARY

Property-List Paths Library (libppath, -lppath)

# SYNOPSIS

`#include <ppath/ppath.h>`

int
`ppath_copydel_bool`(prop_object_t, prop_object_t *, const ppath_t *);

int
`ppath_copyset_bool`(prop_object_t, prop_object_t *, const ppath_t *, bool);

int
`ppath_set_bool`(prop_object_t, const ppath_t *, bool);

int
`ppath_get_bool`(prop_object_t, const ppath_t *, bool *);

int
`ppath_delete_bool`(prop_object_t, const ppath_t *);

# DESCRIPTION

The `ppath_bool` routines read, write, or delete boolean values in a property list by path.

# FUNCTIONS

`ppath_bool` provides these functions for manipulating boolean values in a property list by the values' paths:

`ppath_copydel_bool`(prop_object_t o, prop_object_t *op, const ppath_t *p)
  Create a copy of the property list o at *op. Delete from the copy the prop_bool_t named by p.

  If *op is `NULL`, `ppath_copydel_bool`() creates a shallow copy of o at *op. If *op is not `NULL`, `ppath_copydel_bool`() expects for *op to be an existing shallow copy of o.

  For the purposes of `ppath_copydel_bool`(), *op is a shallow copy of property list o if equal properties at equal paths are shared between the two. Before `ppath_copydel_bool`() modifies a property shared by *op and o, it creates a private copy of the property for *op.

`ppath_copyset_bool`(prop_object_t o, prop_object_t *op, const ppath_t *p, bool v)
  Create a copy of the property list o at *op. In the copy, replace with v the prop_bool_t named by p.

  If *op is `NULL`, `ppath_copyset_bool`() creates a shallow copy of o at *op. If *op is not `NULL`, `ppath_copyset_bool`() expects for *op to be an existing shallow copy of o.

  For the purposes of `ppath_copyset_bool`(), *op is a shallow copy of property list o if equal properties at equal paths are shared between the two. Before `ppath_copydel_bool`() modifies a property shared by *op and o, it creates a private copy of the property for *op.

`ppath_set_bool`(prop_object_t o, const ppath_t *p, bool v)
  Replace with v the prop_bool_t in o named by p.
`ppath_get_bool`(prop_object_t o, const ppath_t *p, bool *vp)
  Retrieve the prop_bool_t named by p from o, and write it to *vp.
`ppath_delete_bool`(prop_object_t o, const ppath_t *p)
  Delete the prop_bool_t named by p from o. `ppath_delete_bool`() decreases by one the deleted boolean value's reference count.

# RETURN VALUES

`ppath_bool` routines return 0 on success, and non-zero on error.

# ERRORS

[`EFTYPE`]
  A `ppath_bool` operation returns `EFTYPE` when the object named by the path is not a prop_bool_t.
[`ENOENT`]
  `ppath_bool` routines return `ENOENT` if the path p does not exist in o.
[`ENOMEM`]
  `ppath_set_bool`(), and `ppath_copyset_bool`() return `ENOMEM` if there was insufficient memory to complete the operation.

# SEE ALSO

ppath(3), ppath_object(3), proplib(3)

# HISTORY

The `ppath_bool` property container path library first appeared in NetBSD 6.0.

# AUTHORS

David Young ⟨dyoung@pobox.com⟩

September 13, 2011 | NetBSD 9.1