Fun 0.41.5
The programming language that makes you have fun!
Loading...
Searching...
No Matches
disconnect.c File Reference

Implements the OP_PCSC_DISCONNECT opcode (conditional build). More...

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

 free_value (vh)
 if (!ce)
 SCardDisconnect (ce->h, SCARD_LEAVE_CARD)
 push_value (vm, make_int(1))

Variables

case OP_PCSC_DISCONNECT
int hid = (int)vh.i
pcsc_card_entryce = pcsc_get_card(hid)
ce in_use = 0
ce h = 0
ce proto = 0
 break

Detailed Description

Implements the OP_PCSC_DISCONNECT opcode (conditional build).

Disconnects a previously connected smart-card handle and frees the corresponding registry slot. When PCSC support is disabled at build time, this opcode returns 0 after consuming its argument.

OP_PCSC_DISCONNECT: (handle_id:int) -> int

  • Pops: handle_id.
  • Pushes: 1 on success; 0 on error (invalid id/not found) or when disabled.
  • Notes: Uses SCardDisconnect(..., SCARD_LEAVE_CARD).

Definition in file disconnect.c.

Function Documentation

◆ free_value()

free_value ( vh )

◆ if()

if ( ! ce)

Definition at line 36 of file disconnect.c.

◆ push_value()

push_value ( vm ,
make_int(1)  )

◆ SCardDisconnect()

SCardDisconnect ( ce-> h,
SCARD_LEAVE_CARD  )

Variable Documentation

◆ break

break

Definition at line 50 of file disconnect.c.

◆ ce

Definition at line 35 of file disconnect.c.

◆ h

ce h = 0

Definition at line 42 of file disconnect.c.

◆ hid

int hid = (int)vh.i

Definition at line 33 of file disconnect.c.

◆ in_use

ce in_use = 0

Definition at line 41 of file disconnect.c.

◆ OP_PCSC_DISCONNECT

case OP_PCSC_DISCONNECT

Definition at line 30 of file disconnect.c.

◆ proto

ce proto = 0

Definition at line 43 of file disconnect.c.