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

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

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

Go to the source code of this file.

Functions

 if (!slot)
 if (rv !=SCARD_S_SUCCESS)
 push_value (vm, make_int(slot))

Variables

case OP_PCSC_ESTABLISH
pcsc_ctx_entrye = pcsc_get_ctx(slot)
LONG rv = SCardEstablishContext(SCARD_SCOPE_SYSTEM, NULL, NULL, &e->ctx)
 break

Detailed Description

Implements the OP_PCSC_ESTABLISH opcode (conditional build).

Creates a new PC/SC context using SCardEstablishContext(SCARD_SCOPE_SYSTEM) and registers it in the internal PCSC context registry when FUN_WITH_PCSC is enabled. Returns the allocated context id on success, or 0 on failure. When PCSC support is disabled at build time, this opcode returns 0.

OP_PCSC_ESTABLISH: () -> int

  • Returns: context id (>0) on success; 0 on error or when disabled.

Definition in file establish.c.

Function Documentation

◆ if() [1/2]

if ( ! slot)

Definition at line 28 of file establish.c.

◆ if() [2/2]

if ( rv ! = SCARD_S_SUCCESS)

Definition at line 38 of file establish.c.

◆ push_value()

push_value ( vm ,
make_int(slot)  )

Variable Documentation

◆ break

break

Definition at line 47 of file establish.c.

◆ e

Definition at line 32 of file establish.c.

◆ OP_PCSC_ESTABLISH

case OP_PCSC_ESTABLISH

Definition at line 25 of file establish.c.

◆ rv

LONG rv = SCardEstablishContext(SCARD_SCOPE_SYSTEM, NULL, NULL, &e->ctx)

Definition at line 37 of file establish.c.