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

Implements the OP_PCSC_LIST_READERS 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 (vid)
 if (!e)
 if (rv !=SCARD_S_SUCCESS||sz==0)
whilep (int)(sizeof(vals)/sizeof(vals[0]))
 for (int i=0;i< count;++i) free_value(vals[i])
 free (msz)
 if (arr.type !=VAL_ARRAY)

Variables

case OP_PCSC_LIST_READERS
int id = (int)vid.i
pcsc_ctx_entrye = pcsc_get_ctx(id)
DWORD sz = 0
LONG rv = SCardListReaders(e->ctx, NULL, NULL, &sz)
char * msz = (char *)malloc(sz)
Value vals [64]
int count = 0
char * p = msz
Value arr = make_array_from_values(vals, count)
 else
 break

Detailed Description

Implements the OP_PCSC_LIST_READERS opcode (conditional build).

Lists available PC/SC reader names for a given context. On success returns an array of strings. When PCSC support is disabled at build time, returns an empty array after consuming its argument to keep the stack balanced.

OP_PCSC_LIST_READERS: (ctx_id:int) -> array<string>

  • Pops: ctx_id.
  • Pushes: array of reader names on success; empty array on error/disabled.

Definition in file list_readers.c.

Function Documentation

◆ for()

for ( )

Definition at line 49 of file make_array.c.

◆ free()

free ( msz )

◆ free_value()

free_value ( vid )

◆ if() [1/3]

if ( ! e)

Definition at line 33 of file list_readers.c.

◆ if() [2/3]

if ( arr.type ! = VAL_ARRAY)

Definition at line 71 of file list_readers.c.

◆ if() [3/3]

if ( rv ! = SCARD_S_SUCCESS || sz == 0)

Definition at line 40 of file list_readers.c.

◆ p()

while * p ( int )

Definition at line 61 of file list_readers.c.

Variable Documentation

◆ arr

Definition at line 66 of file list_readers.c.

◆ break

break

Definition at line 82 of file list_readers.c.

◆ count

int count = 0

Definition at line 59 of file list_readers.c.

◆ e

Definition at line 32 of file list_readers.c.

◆ else

else
Initial value:
{
array_clear & arr
Definition clear.c:38
static void push_value(VM *vm, Value v)
Push a Value onto the VM operand stack.
Definition vm.c:564

Definition at line 73 of file list_readers.c.

◆ id

int id = (int)vid.i

Definition at line 29 of file list_readers.c.

◆ msz

char* msz = (char *)malloc(sz)

Definition at line 45 of file list_readers.c.

◆ OP_PCSC_LIST_READERS

case OP_PCSC_LIST_READERS

Definition at line 25 of file list_readers.c.

◆ p

char* p = msz

Definition at line 60 of file list_readers.c.

◆ rv

rv = SCardListReaders(e->ctx, NULL, NULL, &sz)

Definition at line 39 of file list_readers.c.

◆ sz

DWORD sz = 0

Definition at line 38 of file list_readers.c.

◆ vals

Value vals[64]

Definition at line 58 of file list_readers.c.