MCPcopy Create free account
hub / github.com/BlitterStudio/amiberry / trap_put_string

Function trap_put_string

src/traps.cpp:1422–1447  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1420}
1421
1422int trap_put_string(TrapContext *ctx, const void *haddrp, uaecptr addr, int maxlen)
1423{
1424 int len = 0;
1425 const uae_u8 *haddr = (const uae_u8*)haddrp;
1426 if (maxlen < 0) {
1427 while (haddr[len])
1428 len++;
1429 trap_put_bytes(ctx, haddr, addr, len + 1);
1430 return len;
1431 }
1432
1433 if (maxlen == 0)
1434 return 0;
1435
1436 while (len < maxlen - 1 && haddr[len])
1437 len++;
1438
1439 if (!haddr[len]) {
1440 trap_put_bytes(ctx, haddr, addr, len + 1);
1441 return len;
1442 }
1443
1444 trap_put_bytes(ctx, haddr, addr, maxlen - 1);
1445 trap_put_byte(ctx, addr + maxlen - 1, 0);
1446 return maxlen;
1447}
1448int trap_get_string(TrapContext *ctx, void *haddrp, uaecptr addr, int maxlen)
1449{
1450 int len = 0;

Callers 12

strncpyhaFunction · 0.85
host_gethostnameFunction · 0.85
trap_multiFunction · 0.85
action_filesystem_attrFunction · 0.85
emulib_GetUaeConfigFunction · 0.85
emulib_GetDiskFunction · 0.85
native_dos_opFunction · 0.85
uaelib_midiFunction · 0.85
cfgfile_uaelib_modifyFunction · 0.85
cfgfile_uaelibFunction · 0.85
host_IoctlSocketFunction · 0.85

Calls 2

trap_put_bytesFunction · 0.85
trap_put_byteFunction · 0.85

Tested by

no test coverage detected