Commit Graph

11 Commits

Author SHA1 Message Date
thorpej 1aea07a325 Add prop_array_t support to prop_kern. 2006-10-26 18:51:21 +00:00
thorpej 26d4f90430 - Add prop_dictionary_all_keys(). Takes a snapshot of a dictionary's
keys and returns them in an array.  This effectively allows a caller
  to mutate a dictionary while iterating over it (really, you iterate
  over the array of keys instead of the dictionary itself).
- Add a slew of utility functions that make it more convenient (in some
  circumstances, anyway) to get/set values in a dictionary.
2006-10-26 05:02:12 +00:00
thorpej 873293facc Make prop_number_t handle both signed and unsigned numbers. The *integer*
routines now take int64_t arguments, and new *unsigned_integer* routines
take uint64_t arguments.  See prop_number(3) for complete details.
2006-10-12 04:46:56 +00:00
thorpej 6cf1ffe998 Alter the protocol impemented by prop_kern to allow for bi-directional
plist-based messages and to eliminate looping previously required to
receive a plist from the kernel:

- prop_dictionary_copyin_ioctl() and prop_dictionary_copyout_ioctl()
  now take the cmd argument rather than the file open flag.  The
  read-ness or write-ness of an ioctl command is checked by these
  routines to ensure that information is being passed to/from the
  userland component properly.

- prop_dictionary_copyout_ioctl() now allocates the memory for the
  XML plist on behalf of the userland component by way of uvm_mmap().
  The XML plist is copied out to the newly-mapped anonymous region,
  and the pointer returned via the plistref.

- prop_dictionary_recv_ioctl() is responsible for munmap()'ing the
  region after parsing the XML plist into internal represenatation.

- A new prop_dictionary_sendrecv_ioctl() is added, allowing user space
  code to send a dictionary to the kernel and receive one back as a
  reply.


Update users of prop_kern for the API changes (Bluetooth).

This constitutes an ABI / protocol change -- but this will also be put
into NetBSD 4.0 so that the first proplib release will implement the new
scheme.
2006-09-22 04:20:23 +00:00
thorpej d21620b264 Several changes to proplib:
- Arrays can now be externalized and internalized in the same way
  dictionaries can.
- Add new "externalize to file" and "internalize from file" functions
  to make reading a property list from a file and writing a property
  list to a file more convenient.
- Many assertions in the object implementations are gone.  Instead,
  calling an accessor for one object type with a different object type
  as an argument will return a suitable "invalid" value.
- prop_object_type() now returns a new PROP_TYPE_UNKNOWN value if called
  with a NULL object.
- Externalized property lists now contain a reference to the Apple XML
  plist DTD.
- Add a new prop_ingest(3) facility, which provides a convenient way to
  translate a dictionary into an arbitrary binary representation.
2006-08-21 04:13:28 +00:00
yamt 9858dc825d don't include stdint.h for _STANDALONE. 2006-07-12 13:54:55 +00:00
thorpej 723e715a3b Change prop_number_t to store a uint64_t, rather than a uintmax_t. No
ABI change, and we ought to explicitly state that this is a fixed-width
type, since that what it needs to be for binary plist support.
2006-07-07 22:29:55 +00:00
thorpej 434b7a76fc Add kernel and user space parts of a protocol for sending property lists
to / from the kernel using ioctls.
2006-07-05 21:46:10 +00:00
thorpej 3e69f1b2a5 - Add prop_array_equals(), prop_dictionary_equals(), and
prop_dictionary_keysym_equals(), and prop_object_equals() functions.
- Use realloc() where it makes sense.  There will be more changes in this
  area.
- Add a _prop_object_type structure that is used internally to keep
  information about the object types.  Decreases the footprint of the
  objects slightly by replacing several pointers with just one.
2006-05-18 03:05:19 +00:00
he 6bbc42816c Make the conditional for defining boolean_t complement the conditional
in sys/sys/types.h -- also need to test _STANDALONE.
Fixes a build problem for vax.
2006-05-07 12:46:01 +00:00
thorpej 774eb1a395 Initial commit of proplib, a library for manipulating property lists and
converting to/from an XML external representation (based on Apple XML
property lists).  Works in the kernel and user space.
2006-04-27 20:11:27 +00:00