Commit Graph

27 Commits

Author SHA1 Message Date
thorpej 452b3d1a33 Take the node indices out of the same namespace that <sys/tree.h> uses. 2006-09-09 15:19:18 +00:00
thorpej fd7e02e68f Revert previous. 2006-09-09 15:01:37 +00:00
xtraeme 82b358e3b5 Don't re-define RB_{LEFT,RIGHT,PARENT} before undef'ing them first. 2006-09-09 09:35:16 +00:00
thorpej 25b4258767 Adapt Matt Thomas's red-black tree implementation for use in proplib. This
has a significant code size savings over <sys/tree.h>.

Also change prop_number_t to store all number objects in an r-b tree,
only ever allocating one object for any given number (we can do this
because numbers are immutable).  This results in significant run-time
memory savings.
2006-09-09 06:59:28 +00:00
christos 0616c072ff complete initialization. 2006-08-27 22:31:55 +00:00
wiz f46bc596c0 Remove duplicate word. Markup fixes. 2006-08-23 20:50:37 +00:00
wiz 18a66ca024 Bump date for previous. 2006-08-23 20:46:22 +00:00
thorpej beabdd9bdd Also guard object accessors against NULL (like we do foreign object types)
so that apps can use this construct safely:

	obj = prop_dictionary_get(dict, "value");
	if (! prop_number_equals_integer(obj, 5)) {
		...
	}

Suggested by Iain Hibbert.
2006-08-22 21:21:23 +00:00
he 325cec31d4 Add a workaround for GCC -Wuninitialized, similar to the prop_array.c
workaround, and properly marked with XXXGCC -Wuninitialized.
2006-08-21 17:35:15 +00:00
he 1a119b51b3 Add a workaround for a GCC -Wuninitialized mis-warning (seen for mips). 2006-08-21 15:39:02 +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
wiz 2115abd72d Make HTML-safe. 2006-07-09 19:08:31 +00:00
wiz cafa4de049 Sort SEE ALSO, make HTML-safe. 2006-07-09 19:08:23 +00:00
wiz f988fad75e Drop trailing whitespace. 2006-07-09 19:04:02 +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 296508b606 Use a red-black tree to unique'ify the dictionary key symbols, rather than
a sorted array.  Using a tree puts the linkage into the key symbol itself,
allowing us to avoid having to allocate memory with a mutex held.
2006-07-07 17:09:36 +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 2f3beab89e Reduce the memory footprint for prop_bool_t objects significantly, taking
adavantage of the immutability of these objects:

Statically allocate a TRUE object and a FALSE object, and simply return
references to those objects for create and copy operations.
2006-07-05 20:29:28 +00:00
jnemeth 03f6e8b0e6 remove unused variable that broke build 2006-05-28 10:15:25 +00:00
thorpej e79f2cf0d1 Keep a table of unique dictionary keysyms. This way, if we have 200 devices
with the "fw-path" property, we only have one copy of the "fw-path" string
as a dictionary key.
2006-05-28 03:56:29 +00:00
thorpej 42e8dee346 Fix the way that prop_array_ensure_capacity() and _prop_array_expand()
interact.
2006-05-28 03:53:51 +00:00
thorpej 9e4cb79390 More cleanup. 2006-05-18 16:35:33 +00:00
thorpej eff718846c Move all of the locking compatibility definitions into prop_object_impl.h. 2006-05-18 16:23:55 +00:00
thorpej 1eaa09f21d Minor cleanup. 2006-05-18 16:11:33 +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
simonb fda54e7c6f In _prop_dictionary_alloc(), explicitly set pd->pd_flags to zero
instead of leaving random garbage in there.
Should we just use "memset(pd, 0, sizeof(*pd));" instead?

Fixes boot problems on evbppc/WALNUT with new proplib.
2006-05-07 06:25:49 +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