Fun 0.41.5
The programming language that makes You have fun
Loading...
Searching...
No Matches
connect.c File Reference

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

Go to the source code of this file.

Functions

 free_value (vreader)
 free_value (vctx)
 push_value (vm, make_int(0))

Variables

case OP_PCSC_CONNECT
Value vctx = pop_value(vm)
 break

Detailed Description

Implements the OP_PCSC_CONNECT opcode (conditional build).

Connects to a smart card in the specified reader using an existing PC/SC context. On success, allocates/returns a card handle id from the internal registry. When PCSC support is disabled at build time, this opcode returns 0.

Definition in file connect.c.

Function Documentation

◆ free_value() [1/2]

free_value(vctx)

◆ free_value() [2/2]

free_value(vreader)

◆ push_value()

push_value(vm,
make_int(0) )

Variable Documentation

◆ break

break

Definition at line 73 of file connect.c.

◆ OP_PCSC_CONNECT

case OP_PCSC_CONNECT

OP_PCSC_CONNECT: (ctx_id:int, reader_name:any) -> int

  • Pops: reader_name (converted to string), then ctx_id.
  • Pushes: card handle id (>0) on success; 0 on error/invalid inputs or when FUN_WITH_PCSC is disabled.
  • Notes: Uses SCARD_SHARE_SHARED and negotiates T0/T1 protocols.

Definition at line 29 of file connect.c.

◆ vctx

Value vctx = pop_value(vm)

Definition at line 69 of file connect.c.