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

Function trap_get_string

src/traps.cpp:1448–1468  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1446 return maxlen;
1447}
1448int trap_get_string(TrapContext *ctx, void *haddrp, uaecptr addr, int maxlen)
1449{
1450 int len = 0;
1451 uae_u8 *haddr = (uae_u8*)haddrp;
1452
1453 if (maxlen <= 0)
1454 return 0;
1455
1456 while (len < maxlen - 1) {
1457 uae_u8 v = trap_get_byte(ctx, addr + len);
1458 haddr[len] = v;
1459 if (!v)
1460 return len;
1461 len++;
1462 }
1463
1464 haddr[len] = 0;
1465 if (!trap_get_byte(ctx, addr + len))
1466 return len;
1467 return maxlen;
1468}
1469uae_char *trap_get_alloc_string(TrapContext *ctx, uaecptr addr, int maxlen)
1470{
1471 uae_char *buf = xmalloc(uae_char, maxlen);

Callers 15

gettaskFunction · 0.85
getsockFunction · 0.85
REGPARAM2Function · 0.85
trap_get_alloc_stringFunction · 0.85
trap_multiFunction · 0.85
char1Function · 0.85
cstrFunction · 0.85
add_residentFunction · 0.85
res_getfuncFunction · 0.85
emulib_InsertDiskFunction · 0.85
emulib_execute_on_hostFunction · 0.85
uaelib_host_openFunction · 0.85

Calls 1

trap_get_byteFunction · 0.85

Tested by

no test coverage detected