PPATH_NUMBER(3)

PPATH_NUMBER(3) | Library Functions Manual | PPATH_NUMBER(3)

# NAME

`ppath_number`, `ppath_copydel_int64`, `ppath_copyset_int64`, `ppath_set_int64`, `ppath_get_int64`, `ppath_delete_int64`, `ppath_copydel_uint64`, `ppath_copyset_uint64`, `ppath_set_uint64`, `ppath_get_uint64`, `ppath_delete_uint64` —
integer property path operations

# LIBRARY

Property-List Paths Library (libppath, -lppath)

# SYNOPSIS

`#include <ppath/ppath.h>`

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

int
`ppath_copyset_int64`(prop_object_t, prop_object_t *, const ppath_t *, int64_t);

int
`ppath_set_int64`(prop_object_t, const ppath_t *, int64_t);

int
`ppath_get_int64`(prop_object_t, const ppath_t *, int64_t *);

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

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

int
`ppath_copyset_uint64`(prop_object_t, prop_object_t *, const ppath_t *, uint64_t);

int
`ppath_set_uint64`(prop_object_t, const ppath_t *, uint64_t);

int
`ppath_get_uint64`(prop_object_t, const ppath_t *, uint64_t *);

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

# DESCRIPTION

The `ppath_number` routines read, write, or delete integers in a property list by path.

# FUNCTIONS

`ppath_number` provides these functions for manipulating integers in a property list by the integers' paths:

`ppath_copydel_int64`(prop_object_t o, prop_object_t *op, const ppath_t *p)
`ppath_copydel_uint64`(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_number_t named by p.

  If *op is `NULL`, `ppath_copydel_int64`() and `ppath_copydel_uint64`() create a shallow copy of o at *op. If *op is not `NULL`, `ppath_copydel_int64`() and `ppath_copydel_uint64`() expect for *op to be an existing shallow copy of o.

  For the purposes of `ppath_copydel_int64`() and `ppath_copydel_uint64`(), *op is a shallow copy of property list o if equal properties at equal paths are shared between the two. Before `ppath_copydel_int64`() and `ppath_copydel_uint64`() modify a property shared by *op and o, they create a private copy of the property for *op.

`ppath_copyset_int64`(prop_object_t o, prop_object_t *op, const ppath_t *p, int64_t v)
`ppath_copyset_uint64`(prop_object_t o, prop_object_t *op, const ppath_t *p, uint64_t v)
  Create a copy of the property list o at *op. In the copy, replace with v the prop_number_t named by p.

  If *op is `NULL`, `ppath_copyset_int64`() and `ppath_copyset_uint64`() create a shallow copy of o at *op. If *op is not `NULL`, `ppath_copyset_int64`() and `ppath_copyset_uint64`() expect for *op to be an existing shallow copy of o.

  For the purposes of `ppath_copyset_int64`() and `ppath_copyset_uint64`(), *op is a shallow copy of property list o if equal properties at equal paths are shared between the two. Before `ppath_copydel_int64`() and `ppath_copydel_uint64`() modify a property shared by *op and o, they create a private copy of the property for *op.

`ppath_set_int64`(prop_object_t o, const ppath_t *p, int64_t v)
`ppath_set_uint64`(prop_object_t o, const ppath_t *, uint64_t v)
  Replace with v the prop_number_t in o named by p.
`ppath_get_int64`(prop_object_t o, const ppath_t *p, int64_t *vp)
`ppath_get_uint64`(prop_object_t o, const ppath_t *p, uint64_t *vp)
  Retrieve the prop_number_t named by p from o, and write it to *vp.
`ppath_delete_int64`(prop_object_t o, const ppath_t *p)
`ppath_delete_uint64`(prop_object_t o, const ppath_t *p)
  Delete the prop_number_t named by p from o. `ppath_delete_int64`() and `ppath_delete_uint64`() decrease by one the deleted number's reference count.

# RETURN VALUES

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

# ERRORS

[`EFTYPE`]
  A `ppath_number` operation returns `EFTYPE` when the object named by the path is not a prop_number_t.
[`ENOENT`]
  `ppath_number` routines return `ENOENT` if the path p does not exist in o.
[`ENOMEM`]
  `ppath_set_int64`(), `ppath_set_uint64`(), `ppath_copyset_int64`(), and `ppath_copyset_uint64`() return `ENOMEM` if there was insufficient memory to complete the operation.

# SEE ALSO

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

# HISTORY

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

# AUTHORS

David Young ⟨dyoung@pobox.com⟩

September 13, 2011 | NetBSD 9.0