Commit Graph

9 Commits

Author SHA1 Message Date
martin ce099b4099 Remove clause 3 and 4 from TNF licenses 2008-04-28 20:22:51 +00:00
mjf 83535b7f11 Nuke prop_dictionary_capacity, there was no implementation for it.
No objections on tech-kern.
2008-01-05 00:23:46 +00:00
thorpej 04377267cc boolean_t -> bool
TRUE -> true
FALSE -> false
2007-08-16 16:28:17 +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 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
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
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