| 535 | static uae_u32 functable, datatable, inittable; |
| 536 | |
| 537 | static 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 | |
| 565 | static uae_u32 REGPARAM2 bsdsocklib_Close (TrapContext *ctx) |
| 566 | { |
nothing calls this directly
no test coverage detected