htc: implement service channel parsing (ReceiveReadyPacket)

This commit is contained in:
Michael Scire 2021-02-08 15:50:00 -08:00 committed by SciresM
parent 4e9bc617bb
commit 6fc24d8883
5 changed files with 322 additions and 0 deletions

View file

@ -88,4 +88,17 @@ namespace ams::util {
return static_cast<int>(cur - src);
}
template<typename T>
constexpr int Strnlen(const T *str, int count) {
AMS_ASSERT(str != nullptr);
AMS_ASSERT(count >= 0);
int length = 0;
while (count-- && *str++) {
++length;
}
return length;
}
}