Up to [cvs.NetBSD.org] / src / common / include / prop
Request diff between arbitrary revisions
Keyword substitution: kv
Default branch: MAIN
Improvements to the problib(3) API: ==> Provide a much more complete set of setters and getters for different value types in the prop_array_util(3) and prop_dictionary_util(3) functions. ==> Overhaul the prop_data(3), prop_number(3), and prop_string(3) APIs to be easier to use and less awkwardly named, Deprecate the old awkward names, and produce link-time warnings when they are referenced. ==> Deprecate mutable prop_data(3) and prop_string(3) objects. The old APIs that support them still exist, but will now produce link-time warnings when used. ==> When the new prop_string(3) API is used, strings are internally de-duplicated as a memory footprint optimization. ==> Provide a rich set of bounds-checked gettter functions in and a corresponding set of convenience setters in the prop_number(3) API. ==> Add a new prop_bool_value(3) function that is equivalent to prop_bool_true(3), but aligned with the new "value" routines in prop_data(3), prop_string(3), and prop_number(3).
Ooops, restore accidently removed files from merge mishap
Sync with HEAD
Pull up following revision(s) (requested by sborrill in ticket #1645): common/include/prop/prop_dictionary.h: revision 1.16 common/include/prop/prop_array.h: revision 1.15 common/lib/libprop/prop_kern.c: revision 1.21 common/lib/libprop/prop_copyin_ioctl.9: revision 1.12 common/include/prop/prop_array.h: revision 1.16 common/lib/libprop/prop_kern.c: revision 1.22 (patch) common/lib/libprop/prop_kern.c: revision 1.23 (patch) add sized versions of the copyin ioctls. - add sized versions of the copyin ioctls - Update for the new *_size() functions recently added. Mention the implicit size limit (128KB) for the functions which do not take an explicit limit argument. - fix args - missing brace - call the proper size functions
Sync with HEAD
Sync with HEAD
fix args
add sized versions of the copyin ioctls.
Add prop_array_add_cstring{,_no_copy} utility functions as suggested in PR lib/46723 using the patch provided. (Header file updates are mine.)
Fix an implementation inconsistency with the prop_*_send_syscall() and prop_*_recv_syscall() functions from proplib(3). They now share the same logic as the one from prop_*_send_ioctl() functions: - returns an int - 0 indicates "no error", otherwise returns the error number (and set errno) Many consumers of the prop_*_{ioctl, syscall} expect errno to be set on error and use err() to display the error message. As such, ensures that errno gets set before returning from these functions. prop_*_send_syscall() functions returned a boolean, and now return an int. Fix all call sites to use the new paradigm (only quota2 is affected in src). As the prop_*_{send,recv}_syscall() API appeared in -current and is only used by the recent quota2 code, I am not bumping the lib. The API change only affects the prop_*_send_syscall() function (recv_syscall()s were already used correctly), so ensure you are not mixing "old" -current quota binaries with a new proplib(3) (or the other way around). This change will be announced via a HEADS-UP and UPDATING. Does not affect the kernel part of proplib. Document the correct API in prop_array(3) and prop_dictionary(3). Thanks to Francois Tigeot for noticing the API inconsistency and reporting it on tech-kern@. ok bouyer@.
Add a new libquota library, which contains some blocks to build and/or parse quota plists; as well as a getfsquota() function to retrieve quotas for a single id from a single filesystem (whatever filesystem this is: a local quota-enabled fs or NFS). This is build on functions getufsquota() (for local filesystems with UFS-like quotas) and getnfsquota(); which are also available to userland programs. move functions from quota2_subr.c to libquota or libprop as appropriate, and ajust in-tree quota tools. move some declarations from kernel headers to either sys/quota.h or quota/quota.h as appropriate. ufs/ufs/quota.h still installed because it's needed by other installed ufs headers. ufs/ufs/quota1.h still installed as a quick&dirty way to get a code using the old quotactl() to compile (just include ufs/ufs/quota1.h instead of ufs/ufs/quota.h - old code won't compile without this change and this is on purpose). Discussed on tech-kern@ and tech-net@ (long thread, but not much about libquota itself ...)
prop_*_copyout takes an object as second parameter, not a pointer to object.
- Implement prop_{array,dictionary}_copyout(), based on prop_{array,dictionary}_copyout_ioctl(). - Implement prop_{array,dictionary}_recv_syscall(), which takes as parameter the pref we got from kernel and internalize it, and unmaps the buffer prop_{array,dictionary}_copyout() mapped for us. - add a prop_{array,dictionary}_send_syscall() for symetry, which is an alias to prop_{array,dictionary}_externalize_to_pref() Discussed on tech-kern@ and tech-userlevel@
Commit changes to header files missed in my previous commit. Implement prop_array_externalize_to_pref(), prop_array_copyin(), prop_dictionary_externalize_to_pref() and prop_dictionary_copyin() as discussed in the thread: http://mail-index.netbsd.org/tech-kern/2009/07/29/msg005594.html Add prototypes for prop_array_externalize_to_pref() and prop_dictionary_externalize_to_pref().
Merge in changes between wrstuden-revivesa-base-2 and wrstuden-revivesa-base-3.
Add prop_array_add_int* and prop_array_add_uint* functions. These functions can be used to append specified type to the end of prop_array_t. Ok'ed by @joerg.
Sync w/ -current. 34 merge conflicts to follow.
sync with head.
Add prop_array_util functions to proplib. This code is copied/changed prop_dictionary_util. From manual page The prop_array_util family of functions are provided to make getting and setting values in arrays more convenient in some applications. OK by mjf@ and freza@.
sync with head.
Remove clause 3 and 4 from TNF licenses
Catch up on netbsd-4 as of a few days ago.
Pull up following revision(s) (requested by joerg in ticket #904): sbin/veriexecctl/veriexecctl.c: revision 1.29 (via patch) common/lib/libprop/prop_string.c: revision 1.9 (via patch) distrib/sets/lists/comp/mi: revision 1.1063 (via patch) common/lib/libprop/prop_kern.c: revision 1.8 (via patch) common/include/prop/prop_string.h: revision 1.2 (via patch) common/include/prop/prop_ingest.h: revision 1.2 (via patch) usr.sbin/btdevctl/btdevctl.c: revision 1.5 (via patch) common/lib/libprop/prop_object_impl.h: revision 1.14 (via patch) common/lib/libprop/prop_rb.c: revision 1.7 (via patch) common/include/prop/prop_array.h: revision 1.5 (via patch) common/lib/libprop/prop_stack.h: revision 1.1 (via patch) common/lib/libprop/prop_object_impl.h: revision 1.16 (via patch) common/lib/libprop/prop_number.3: revision 1.7 (via patch) common/lib/libprop/prop_stack.h: revision 1.2 (via patch) common/lib/libprop/prop_stack.c: revision 1.1 (via patch) common/lib/libprop/prop_object_impl.h: revision 1.17 (via patch) common/lib/libprop/prop_dictionary_util.c: revision 1.2 (via patch) common/lib/libprop/prop_dictionary_util.3: revision 1.2 (via patch) common/lib/libprop/prop_dictionary.c: revision 1.18 (via patch) common/lib/libprop/prop_stack.c: revision 1.2 (via patch) common/lib/libprop/prop_object_impl.h: revision 1.18 (via patch) common/lib/libprop/prop_dictionary.c: revision 1.19 (via patch) common/include/prop/prop_bool.h: revision 1.3 (via patch) common/include/prop/prop_dictionary.h: revision 1.7 (via patch) common/include/prop/prop_data.h: revision 1.2 (via patch) sys/sys/dkio.h: revision 1.14 (via patch) usr.sbin/btdevctl/sdp.c: revision 1.4 (via patch) common/include/prop/Makefile: revision 1.3 (via patch) common/include/prop/prop_number.h: revision 1.5 (via patch) common/lib/libprop/prop_object.c: revision 1.14 (via patch) common/lib/libprop/prop_object.c: revision 1.15 (via patch) common/lib/libprop/prop_object.c: revision 1.16 (via patch) common/lib/libprop/prop_bool.3: revision 1.3 (via patch) common/lib/libprop/prop_data.3: revision 1.4 (via patch) common/lib/libprop/prop_object.3: revision 1.6 (via patch) common/lib/libprop/prop_data.c: revision 1.7 (via patch) common/lib/libprop/prop_data.c: revision 1.8 (via patch) common/lib/libprop/prop_data.c: revision 1.9 (via patch) common/lib/libprop/prop_dictionary.c: revision 1.20 (via patch) usr.sbin/btdevctl/print.c: revision 1.9 (via patch) sbin/veriexecctl/veriexecctl_parse.y: revision 1.22 (via patch) common/lib/libprop/prop_number.c: revision 1.12 (via patch) common/include/prop/proplib.h: revision 1.5 (via patch) common/lib/libprop/prop_number.c: revision 1.13 (via patch) common/lib/libprop/prop_number.c: revision 1.14 (via patch) common/include/prop/prop_object.h: revision 1.5 (via patch) common/lib/libprop/prop_array.3: revision 1.5 (via patch) common/include/prop/prop_object.h: revision 1.6 (via patch) common/lib/libprop/prop_string.3: revision 1.4 (via patch) common/lib/libprop/prop_bool.c: revision 1.10 (via patch) common/lib/libprop/Makefile.inc: revision 1.6 (via patch) common/lib/libprop/prop_ingest.c: revision 1.2 (via patch) common/lib/libprop/prop_bool.c: revision 1.11 (via patch) common/lib/libprop/prop_array.c: revision 1.10 (via patch) common/lib/libprop/prop_ingest.3: revision 1.3 (via patch) common/lib/libprop/prop_bool.c: revision 1.12 (via patch) common/lib/libprop/prop_array.c: revision 1.11 (via patch) common/lib/libprop/prop_string.c: revision 1.7 (via patch) common/lib/libprop/prop_dictionary.3: revision 1.8 (via patch) common/lib/libprop/prop_array.c: revision 1.9 (via patch) usr.sbin/btdevctl/db.c: revision 1.4 (via patch) common/lib/libprop/prop_string.c: revision 1.8 (via patch) common/include/prop/plistref.h: revision 1.1 (via patch) Consider '\r' to be white space. Discussed with and also kept as local change by freza. With this change, DOS style line endings work. boolean_t -> bool TRUE -> true FALSE -> false libprop is currently using a recursive parser. While this is fine for userland, deeply nested arrays and dictionaries can easily overflow the kernel stack and thereby force a panic. Fix the internalizer and prop_object_release to use a separate call stack and alter the dictionary and array handling to not recurse on the C stack. The default stack has an inline depth of 16 elements, which should keep the overhead reasonable. This issue was found by Pavel Cahyna and Jachym Holecek. Additionally add a limit for prop_object_copyin_ioctl to prevent user programs from temporary allocating unbound amount of kernel memory. Allow malloc to fail so that tight loops of userland processes can't force panics by exhausting the kernel map. Tested with the sample exploit of Jachym, his test suite and reviewed by himself (initial patch), Christos Zoulas and Jason Thorpe. struct plistref does not reference other proplib data types, so split it in its own header file to be included by dkio.h. Fixes breakage due to pollution from proplib.h in programs which include ioctl.h. Tested and OK by dogcow@. Attempt at fixing build failures after proplib was converted to bool: FALSE -> false, TRUE -> true, boolean_t -> bool, int -> bool when appropriate, include stdbool.h . proplib.h no longer provides boolean_t, so it is necessary to change to bool. From Tom Spindler (dogcow@). Avoid using unbound amount of stack frames in prop_object_equal by using a dynamic stack as well. Reorder arguments for the internalizer as the iteration is always present and should go before possibly NULL arguments. Reviewed by mjf@ and adrianp@
boolean_t -> bool TRUE -> true FALSE -> false
Add prop_array_t support to prop_kern.
file prop_array.h was added on branch newlock2 on 2006-10-26 18:51:22 +0000
Add prop_array_t support to prop_kern.
Pull up following revision(s) (requested by thorpej in ticket #43): common/include/prop/prop_ingest.h: revision 1.1 common/lib/libprop/prop_number.c: revision 1.4 common/include/prop/prop_array.h: revision 1.3 common/lib/libprop/prop_object_impl.h: revision 1.4 common/include/prop/prop_dictionary.h: revision 1.4 distrib/sets/lists/comp/mi: revision 1.911 common/include/prop/Makefile: revision 1.2 common/lib/libprop/prop_bool.c: revision 1.4 distrib/sets/lists/base/shl.mi: revision 1.365 common/lib/libprop/prop_data.c: revision 1.3 lib/libprop/shlib_version: revision 1.4 lib/libprop/Makefile: revision 1.6 common/lib/libprop/prop_object.c: revision 1.4 common/lib/libprop/prop_object.3: revision 1.4 common/include/prop/proplib.h: revision 1.3 common/lib/libprop/Makefile.inc: revision 1.3 common/include/prop/prop_object.h: revision 1.4 common/lib/libprop/prop_array.c: revision 1.4 common/lib/libprop/prop_array.3: revision 1.4 common/lib/libprop/prop_string.c: revision 1.3 common/lib/libprop/prop_dictionary.3: revision 1.4 common/lib/libprop/prop_ingest.c: revision 1.1 common/lib/libprop/prop_ingest.3: revision 1.1 common/lib/libprop/prop_dictionary.c: revision 1.9 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.
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.
- 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.
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.