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

Function bsdsocklib_Open

src/bsdsocket.cpp:537–563  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

535static uae_u32 functable, datatable, inittable;
536
537static uae_u32 REGPARAM2 bsdsocklib_Open (TrapContext *ctx)
538{
539 uae_u32 result = 0;
540 int opencount;
541 SB;
542
543 BSDTRACE ((_T("OpenLibrary() -> ")));
544
545 if ((sb = alloc_socketbase(ctx)) != NULL) {
546 trap_put_word(ctx, SockLibBase + 32, opencount = trap_get_word(ctx, SockLibBase + 32) + 1);
547
548
549 trap_call_add_areg(ctx, 0, functable);
550 trap_call_add_areg(ctx, 1, datatable);
551 trap_call_add_areg(ctx, 2, 0);
552 trap_call_add_dreg(ctx, 0, sizeof (struct UAEBSDBase));
553 trap_call_add_dreg(ctx, 1, 0);
554 result = trap_call_lib(ctx, sb->sysbase, -0x54); /* MakeLibrary */
555
556 put_pointer(result + offsetof(struct UAEBSDBase, sb), sb);
557
558 BSDTRACE ((_T("%0x [%d]\n"), result, opencount));
559 } else
560 BSDTRACE ((_T("failed (out of memory)\n")));
561
562 return result;
563}
564
565static uae_u32 REGPARAM2 bsdsocklib_Close (TrapContext *ctx)
566{

Callers

nothing calls this directly

Calls 7

alloc_socketbaseFunction · 0.85
trap_put_wordFunction · 0.85
trap_get_wordFunction · 0.85
trap_call_add_aregFunction · 0.85
trap_call_add_dregFunction · 0.85
trap_call_libFunction · 0.85
put_pointerFunction · 0.85

Tested by

no test coverage detected