#include <libkern/c++/OSUnserialize.h>
libkern/c++/OSUnserialize.h
OSUnserialize.h created by rsulack on Mon 23-Nov-1998
functionOSUnserializeXML
OSPtr<OSObject> OSUnserializeXML(const char * buffer, OSString * * errorString = NULL)
@function OSUnserializeXML
@abstract Recreates an OSContainer object
from its previously serialized OSContainer class instance data.
@param buffer A buffer containing nul-terminated XML data
representing the object to be recreated.
@param errorString If non-<code>NULL</code>, and the XML parser
finds an error in <code>buffer</code>,
<code>*errorString</code> indicates the line number
and type of error encountered.
@result The recreated object, or <code>NULL</code> on failure.
@discussion <b>Not safe</b> to call in a primary interrupt handler.
▾
claude-fable-5, 2026-08-24 · not from Apple sources · verified against xnu libkern/c++/OSUnserializeXMLSharedImplementation.h (via OSUnserializeXML.cpp)
Recreates a graph of libkern objects (OSDictionary, OSArray, OSSet, OSString, OSData, OSNumber, OSBoolean) from the XML plist-style form produced by OSSerialize. On parse failure returns NULL and, if errorString is non-NULL, an OSString describing the syntax error and line number; on success the root object is returned retained for the caller. The size-bounded kernel variant additionally accepts binary serializations, dispatching to OSUnserializeBinary when the buffer starts with kOSSerializeBinarySignature, and requires XML input to be nul-terminated within bufferSize. Parsing is serialized under an internal lock.
functionOSUnserializeXML
OSPtr<OSObject> OSUnserializeXML(const char * buffer, OSSharedPtr<OSString>& errorString)
▾
claude-fable-5, 2026-08-24 · not from Apple sources · verified against xnu libkern/c++/OSUnserializeXMLSharedImplementation.h (via OSUnserializeXML.cpp)
Recreates a graph of libkern objects (OSDictionary, OSArray, OSSet, OSString, OSData, OSNumber, OSBoolean) from the XML plist-style form produced by OSSerialize. On parse failure returns NULL and, if errorString is non-NULL, an OSString describing the syntax error and line number; on success the root object is returned retained for the caller. The size-bounded kernel variant additionally accepts binary serializations, dispatching to OSUnserializeBinary when the buffer starts with kOSSerializeBinarySignature, and requires XML input to be nul-terminated within bufferSize. Parsing is serialized under an internal lock.
functionOSUnserializeXML
OSPtr<OSObject> OSUnserializeXML( const char * buffer, size_t bufferSize, OSString * *errorString = NULL )
@function OSUnserializeXML
@abstract Recreates an OSContainer object
from its previously serialized OSContainer class instance data.
@param buffer A buffer containing nul-terminated XML data
representing the object to be recreated.
@param bufferSize The size of the block of memory. The function
never scans beyond the first bufferSize bytes.
@param errorString If non-<code>NULL</code>, and the XML parser
finds an error in <code>buffer</code>,
<code>*errorString</code> indicates the line number
and type of error encountered.
@result The recreated object, or <code>NULL</code> on failure.
@discussion <b>Not safe</b> to call in a primary interrupt handler.
▾
claude-fable-5, 2026-08-24 · not from Apple sources · verified against xnu libkern/c++/OSUnserializeXMLSharedImplementation.h (via OSUnserializeXML.cpp)
Recreates a graph of libkern objects (OSDictionary, OSArray, OSSet, OSString, OSData, OSNumber, OSBoolean) from the XML plist-style form produced by OSSerialize. On parse failure returns NULL and, if errorString is non-NULL, an OSString describing the syntax error and line number; on success the root object is returned retained for the caller. The size-bounded kernel variant additionally accepts binary serializations, dispatching to OSUnserializeBinary when the buffer starts with kOSSerializeBinarySignature, and requires XML input to be nul-terminated within bufferSize. Parsing is serialized under an internal lock.
functionOSUnserializeXML
OSPtr<OSObject> OSUnserializeXML( const char * buffer, size_t bufferSize, OSSharedPtr<OSString> &errorString )
▾
claude-fable-5, 2026-08-24 · not from Apple sources · verified against xnu libkern/c++/OSUnserializeXMLSharedImplementation.h (via OSUnserializeXML.cpp)
Recreates a graph of libkern objects (OSDictionary, OSArray, OSSet, OSString, OSData, OSNumber, OSBoolean) from the XML plist-style form produced by OSSerialize. On parse failure returns NULL and, if errorString is non-NULL, an OSString describing the syntax error and line number; on success the root object is returned retained for the caller. The size-bounded kernel variant additionally accepts binary serializations, dispatching to OSUnserializeBinary when the buffer starts with kOSSerializeBinarySignature, and requires XML input to be nul-terminated within bufferSize. Parsing is serialized under an internal lock.
functionOSUnserializeBinary
OSPtr<OSObject> OSUnserializeBinary( const char *buffer, size_t bufferSize, OSString * *errorString )
▾
claude-fable-5, 2026-08-24 · not from Apple sources · verified against xnu libkern/c++/OSSerializeBinary.cpp
Recreates a graph of libkern collection and container objects (OSDictionary, OSArray, OSSet, OSString, OSSymbol, OSData, OSNumber, OSBoolean) from the binary serialization format produced by OSSerialize::binaryWithCapacity. The buffer must be 4-byte aligned and begin with kOSSerializeBinarySignature (or the indexed-binary signature byte); object and stack counts are bounded to guard against malformed input. Returns the root object, retained for the caller, or NULL on malformed data. Overloads report a parse error message through an OSString** or OSSharedPtr<OSString>& errorString, set to NULL on success. The OSSerialize.h variant taking const void* omits error reporting.
functionOSUnserializeBinary
OSPtr<OSObject> OSUnserializeBinary( const char *buffer, size_t bufferSize, OSSharedPtr<OSString>& errorString )
▾
claude-fable-5, 2026-08-24 · not from Apple sources · verified against xnu libkern/c++/OSSerializeBinary.cpp
Recreates a graph of libkern collection and container objects (OSDictionary, OSArray, OSSet, OSString, OSSymbol, OSData, OSNumber, OSBoolean) from the binary serialization format produced by OSSerialize::binaryWithCapacity. The buffer must be 4-byte aligned and begin with kOSSerializeBinarySignature (or the indexed-binary signature byte); object and stack counts are bounded to guard against malformed input. Returns the root object, retained for the caller, or NULL on malformed data. Overloads report a parse error message through an OSString** or OSSharedPtr<OSString>& errorString, set to NULL on success. The OSSerialize.h variant taking const void* omits error reporting.
functionOSUnserialize
extern OSPtr<OSObject> OSUnserialize(const char *buffer, OSString * *errorString = NULL)
▾
claude-fable-5, 2026-08-24 · not from Apple sources · verified against xnu libkern/c++/OSUnserialize.cpp
Recreates a graph of libkern objects from the older curly-brace unserialization syntax that predates OSUnserializeXML (dictionaries as {key=value;...}, arrays as (...), data as <hex>). Parses the nul-terminated buffer under a global lock; on success returns the root object, retained for the caller, and sets *errorString to NULL. On a syntax error returns NULL and, if errorString is non-NULL, returns an OSString describing the error and line number. Kept for compatibility; new code serializes with OSSerialize and unserializes with OSUnserializeXML or OSUnserializeBinary. An overload reports the error through OSSharedPtr<OSString>&.
functionOSUnserialize
extern OSPtr<OSObject> OSUnserialize( const char *buffer, OSSharedPtr<OSString>& errorString )
▾
claude-fable-5, 2026-08-24 · not from Apple sources · verified against xnu libkern/c++/OSUnserialize.cpp
Recreates a graph of libkern objects from the older curly-brace unserialization syntax that predates OSUnserializeXML (dictionaries as {key=value;...}, arrays as (...), data as <hex>). Parses the nul-terminated buffer under a global lock; on success returns the root object, retained for the caller, and sets *errorString to NULL. On a syntax error returns NULL and, if errorString is non-NULL, returns an OSString describing the error and line number. Kept for compatibility; new code serializes with OSSerialize and unserializes with OSUnserializeXML or OSUnserializeBinary. An overload reports the error through OSSharedPtr<OSString>&.