Skip to content

feat(libc): implement index string search - #8842

Merged
oneandonlydean merged 1 commit into
boykopovar:mainfrom
UnhealthyKraken:feat/libc-index
Oct 21, 2026
Merged

oneandonlydean merged 1 commit into
boykopovar:mainfrom
UnhealthyKraken:feat/libc-index

Conversation

@UnhealthyKraken

@UnhealthyKraken UnhealthyKraken commented Oct 21, 2026 •

Copy link
Copy Markdown
Contributor

What

Adds the legacy index(const char*, int) string search to the common libc exports, beside the existing strchr and rindex. It returns the first matching byte, including the terminating NUL, by forwarding to the existing strchr implementation. There is no allocation or new mutable state.

Name and NID t3RFHn0bTPg appear in the public PS5 3.20 libSceLibcInternal inventory. The public PS5 payload SDK declaration supplies the prototype. FreeBSD 11.4 strchr.c makes index a weak alias of strchr. These establish the public interface and reference behavior; this was not measured on a PS5, and the inventory does not establish module/library versions. Null string pointers are outside the reference function's defined input domain.

Tested

Windows x86-64, supported WinLibs MinGW-w64 GCC 15.2.0, Release full configuration with BUILD_TESTING=ON in an independent checkout of cd700fe9ec.

Checklist

  • Based on current main; no other open PR implements the same functions
  • One topic per PR; follow-ups go in a new PR
  • No comments in code except technical debt
  • Unimplemented paths throw (NotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file
  • No notes, investigation .md files or images added to the repository (attach them to this PR)
  • New third-party code is a submodule built from source
  • Generic behaviour, not specific to one title
  • Depends on: none
  • Unblocks: none
  • GPUs tested: n/a
  • AI-assisted: yes

@github-actions

Copy link
Copy Markdown

Progress report (cd700fe → 20e9537)

➖ System libraries: 62.76% (+0.0%, +1 implemented functions)

✅ 1 implemented
Library Name
libc index_nid_postfix

@github-actions

github-actions Bot commented Oct 21, 2026 •

Copy link
Copy Markdown

Some comparisons could not be completed because a pull request conflicts with the base branch. Review these shared files manually before concluding that there is no overlap.

Pull request Shared files not compared
PR 3965 core/libs/prx/libc/CMakeLists.txt
PR 5021 core/libs/prx/libc/CMakeLists.txt
core/libs/prx/libc/src/Strings.cpp
PR 6044 core/libs/prx/libc/CMakeLists.txt
PR 6819 core/libs/prx/libc/CMakeLists.txt
PR 6879 core/libs/prx/libc/src/Strings.cpp
PR 7081 core/libs/prx/libc/CMakeLists.txt
PR 7201 core/libs/prx/libc/CMakeLists.txt
core/libs/prx/libc/src/Strings.cpp
PR 7715 core/libs/prx/libc/CMakeLists.txt
PR 8150 core/libs/prx/libc/CMakeLists.txt
PR 8352 core/libs/prx/libc/CMakeLists.txt
PR 8520 core/libs/prx/libc/CMakeLists.txt
PR 8658 core/libs/prx/libc/CMakeLists.txt
core/libs/prx/libc/src/Strings.cpp
PR 8711 core/libs/prx/libc/src/Strings.cpp

@oneandonlydean
oneandonlydean merged commit 2923f29 into boykopovar:main Oct 21, 2026
20 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants