mirror of
https://github.com/KytyPS5/KytyPS5.git
synced 2026-08-03 11:23:49 +00:00
new ABIs
This commit is contained in:
@@ -126,10 +126,8 @@ int KYTY_SYSV_ABI AppContentAppParamGetInt(uint32_t param_id, int32_t* value) {
|
||||
return OK;
|
||||
}
|
||||
|
||||
int KYTY_SYSV_ABI AppContentDownloadDataGetAvailableSpaceKb(const AppContentMountPoint* mount_point,
|
||||
size_t* available_space_kb) {
|
||||
PRINT_NAME();
|
||||
|
||||
static int GetAvailableSpaceKb(const AppContentMountPoint* mount_point,
|
||||
size_t* available_space_kb) {
|
||||
LOGF("\t mount_point = 0x%016" PRIx64 "\n"
|
||||
"\t available_space_kb = 0x%016" PRIx64 "\n",
|
||||
reinterpret_cast<uint64_t>(mount_point), reinterpret_cast<uint64_t>(available_space_kb));
|
||||
@@ -157,6 +155,12 @@ int KYTY_SYSV_ABI AppContentDownloadDataGetAvailableSpaceKb(const AppContentMoun
|
||||
return OK;
|
||||
}
|
||||
|
||||
int KYTY_SYSV_ABI AppContentDownloadDataGetAvailableSpaceKb(const AppContentMountPoint* mount_point,
|
||||
size_t* available_space_kb) {
|
||||
PRINT_NAME();
|
||||
return GetAvailableSpaceKb(mount_point, available_space_kb);
|
||||
}
|
||||
|
||||
int KYTY_SYSV_ABI AppContentAddcontMount(uint32_t service_label,
|
||||
const NpUnifiedEntitlementLabel* entitlement_label,
|
||||
AppContentMountPoint* mount_point) {
|
||||
@@ -233,11 +237,18 @@ static int KYTY_SYSV_ABI AppContentTemporaryDataFormat(const AppContentMountPoin
|
||||
return OK;
|
||||
}
|
||||
|
||||
static int KYTY_SYSV_ABI AppContentTemporaryDataGetAvailableSpaceKb(
|
||||
const AppContentMountPoint* mount_point, size_t* available_space_kb) {
|
||||
PRINT_NAME();
|
||||
return AppContent::GetAvailableSpaceKb(mount_point, available_space_kb);
|
||||
}
|
||||
|
||||
} // namespace AppContentTemporary
|
||||
|
||||
LIB_DEFINE(InitAppContent_1_Temporary) {
|
||||
LIB_FUNC("buYbeLOGWmA", AppContentTemporary::AppContentTemporaryDataMount2);
|
||||
LIB_FUNC("a5N7lAG0y2Q", AppContentTemporary::AppContentTemporaryDataFormat);
|
||||
LIB_FUNC("SaKib2Ug0yI", AppContentTemporary::AppContentTemporaryDataGetAvailableSpaceKb);
|
||||
}
|
||||
|
||||
} // namespace LibAppContentTemporary
|
||||
|
||||
@@ -2007,6 +2007,17 @@ int64_t KYTY_SYSV_ABI recv(int s, void* buf, uint64_t len, int flags) {
|
||||
return Network::Net::Recv(s, buf, len, flags);
|
||||
}
|
||||
|
||||
int KYTY_SYSV_ABI inet_pton(int af, const char* src, void* dst) {
|
||||
PRINT_NAME();
|
||||
|
||||
const int result = Network::Net::NetInetPton(af, src, dst);
|
||||
if (result < 0) {
|
||||
*GetErrorAddr() = Network::NetToPosix(result);
|
||||
return -1;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
const char* KYTY_SYSV_ABI inet_ntop(int af, const void* src, char* dst, uint32_t size) {
|
||||
PRINT_NAME();
|
||||
|
||||
@@ -2143,6 +2154,7 @@ LIB_DEFINE(InitLibKernel_1_Posix) {
|
||||
LIB_FUNC("fZOeZIOEmLw", Posix::send);
|
||||
LIB_FUNC("oBr313PppNE", Posix::sendto);
|
||||
LIB_FUNC("Ez8xjo9UF4E", Posix::recv);
|
||||
LIB_FUNC("4n51s0zEf0c", Posix::inet_pton);
|
||||
LIB_FUNC("5jRCs2axtr4", Posix::inet_ntop);
|
||||
LIB_FUNC("cfwBSQyr5Ys", cfwBSQyr5Ys);
|
||||
}
|
||||
|
||||
+10
-20
@@ -1279,33 +1279,23 @@ int KYTY_SYSV_ABI NetResolverStartNtoa(int rid, const char* hostname, void* addr
|
||||
int KYTY_SYSV_ABI NetInetPton(int af, const char* src, void* dst) {
|
||||
PRINT_NAME();
|
||||
|
||||
if (af != 2) {
|
||||
return NET_ERROR_EAFNOSUPPORT;
|
||||
}
|
||||
if (src == nullptr || dst == nullptr) {
|
||||
return NET_ERROR_EINVAL;
|
||||
}
|
||||
|
||||
LOGF("\t src = %.16s\n", src);
|
||||
|
||||
uint32_t octets[4] = {};
|
||||
char extra = '\0';
|
||||
if (sscanf(src, "%u.%u.%u.%u%c", &octets[0], &octets[1], &octets[2], &octets[3], &extra) != 4) {
|
||||
return 0;
|
||||
}
|
||||
for (auto octet: octets) {
|
||||
if (octet > 255) {
|
||||
return 0;
|
||||
}
|
||||
const int host_family = ConvertFamily(af);
|
||||
if (host_family < 0) {
|
||||
return NET_ERROR_EAFNOSUPPORT;
|
||||
}
|
||||
|
||||
auto* out = static_cast<uint8_t*>(dst);
|
||||
out[0] = static_cast<uint8_t>(octets[0]);
|
||||
out[1] = static_cast<uint8_t>(octets[1]);
|
||||
out[2] = static_cast<uint8_t>(octets[2]);
|
||||
out[3] = static_cast<uint8_t>(octets[3]);
|
||||
LOGF("\t src = %.46s\n", src);
|
||||
|
||||
return 1;
|
||||
#if defined(_WIN32)
|
||||
const int result = ::InetPtonA(host_family, src, dst);
|
||||
#else
|
||||
const int result = ::inet_pton(host_family, src, dst);
|
||||
#endif
|
||||
return result < 0 ? NET_ERROR_EINVAL : result;
|
||||
}
|
||||
|
||||
const char* KYTY_SYSV_ABI NetInetNtop(int af, const void* src, char* dst, uint32_t size) {
|
||||
|
||||
Reference in New Issue
Block a user