TestHexAndCopies now copies a source whose first terminator comes after the length limit, and expects exactly the first four characters. On the previous copy helper the new check aborts; with the fix guest_np_common_runtime passes. Both results come from the archive build described in the PR body.
sceNpCalloutTermCtx called from a callout of the same context could not join the worker thread, destroyed the context's mutex and condition anyway, and returned. The worker then locked the destroyed mutex and the host crashed. The call now throws, and the gap is recorded in the library's technical debt.
The constructors, destructors, Clear, IsEmpty, Equals, Parse, Build and the
comparison operators of sce::np::NpCommId, and the C export
sceNpUtilParseTitleId they use, follow libSceNpCommon.sprx of firmware
13.60, checked against 26,501 firmware results.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
The constructors, destructors, AddRef and Release of sce::np::RefObject
follow libSceNpCommon.sprx of firmware 13.60, checked against 7,200
firmware results.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Read, ReadAll, ReadData, SkipAll and SkipData on StreamReader, and Write,
WriteData and WriteFilledData on StreamWriter, with and without a StreamCtx,
follow libSceNpCommon.sprx of firmware 13.60, checked against 20,426
firmware results.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Firmware 13.42 keeps the type of the 16th nested container in the context
slot that also holds the saved parser state, so a call that ends inside a
16th-level object leaves the outermost object open. The parser here does
the same; the test pins it, and the debt file records it together with
where the parser's behaviour comes from.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
sceNpJsonParse, sceNpJsonParseBuf and sceNpJsonParseEx with their
Init calls, and the sceNpServerErrorJson exports, follow firmware
13.42: a resumable byte-by-byte parser that walks a rule table level
by level (member keys compared without case, array elements, keyless
wildcard entries until the first unmatched container, a descend flag)
and calls the caller's handler for each matched container, key and
value. The Buf form uses caller key and value buffers, and the Ex form
also reports the stream offset of each event, delivers long strings
and numbers in pieces and reports everything when no rules are given.
The server error calls read error.code (or a top-level code for the
Multi form) and fall back to the HTTP status.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Constructors, destructors, Read and Write follow libSceNpCommon.sprx of
firmware 13.60, checked against 13,400 firmware results.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
sceNpStrParseHex and sceNpStrnParseHex in firmware 13.60 write the high
nibble of each byte before they read the low digit, so a refused low digit
leaves that byte as the high nibble shifted left by four.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Implements the sce::np::NpTitleId constructors, destructors, assignment,
Clear, IsEmpty, Parse, ConstructFromTitleId, Build and comparisons from
libSceNpCommon.sprx of firmware 13.60. operator==(SceNpTitleId, NpTitleId)
stays a stub; #12866 implements it.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
The previous merge commit kept conflict markers in GuestNpCommonRuntime.cpp;
this keeps both sides and adds the recorded-allocator rows.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Malloc, Realloc and Free call the allocator's own functions with its
context, Strdup and Strndup copy a string into memory from it, and
ConvertAllocator returns the allocator inside the extended one, as
libSceNpCommon.sprx of firmware 13.60 does (read from disassembly, not
measured on a console). Realloc and Free were NotImplemented stubs; the
other four were not exported.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
The ten operators allocate an object behind a 16-byte header that keeps its
allocator and free it through that allocator, as libSceNpCommon.sprx of
firmware 13.60 does (read from disassembly, not measured on a console). Five
were NotImplemented stubs; the other five were not exported.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Read from libSceNpCommon.sprx of firmware 13.60 (disassembly, not measured
on a console).
- sceNpUtilParseJid(jid, text, buffer, bufferSize, required) skips leading
spaces, splits user@domain/resource into terminated copies in the
buffer and points the jid at them, or only measures without a jid or a
buffer. It skips exactly one character after the trimmed domain, as the
module does, and clears the jid when the buffer is too small.
- sceNpUtilJidToNpId(npId, jid) accepts XX.YY.<label>.playstation.net
domains, users of 1 to 16 bytes and resources of up to 4, and builds the
npid from the user, the four domain characters and the resource.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Both take (dst, dstSize, src, srcLength, required), as in libSceNpCommon.sprx
of firmware 13.60 (read from disassembly, not measured on a console).
- Escaping writes the five predefined entities for " & ' < >, copies tab,
LF, CR, other printable ASCII and UTF-8 sequences, and refuses other
control characters, DEL and malformed UTF-8 with 0x80550608.
- Unescaping turns the five entities back and copies every other byte.
- Both write a terminator, report the length with it, measure without a
destination, and return 0x80550601 for a missing source, a zero length
or neither a destination nor a length, and 0x80550602 when the
destination is too small.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
sceNpUtilJsonEscape has to stay inside a partly filled 16 byte buffer and refuse
one without a terminator, sceNpUtilJsonUnescape has to report the length of a
query with a null destination and size 0, and sceNpUtilJsonGetOneChar has to
reject a high surrogate that is not followed by a second unicode escape.