Fun 0.41.5
The programming language that makes You have fun
Loading...
Searching...
No Matches
release.c
Go to the documentation of this file.
1/*
2 * This file is part of the Fun programming language.
3 * https://fun-lang.xyz/
4 *
5 * Copyright 2025 Johannes Findeisen <you@hanez.org>
6 * Licensed under the terms of the Apache-2.0 license.
7 * https://opensource.org/license/apache-2-0
8 */
9
18
25
26/* PCSC release */
28#ifdef FUN_WITH_PCSC
29 Value vid = pop_value(vm);
30 int id = (int)vid.i;
31 free_value(vid);
32 pcsc_ctx_entry *e = pcsc_get_ctx(id);
33 if (!e) {
34 push_value(vm, make_int(0));
35 break;
36 }
37 SCardReleaseContext(e->ctx);
38 e->in_use = 0;
39 e->ctx = 0;
40 push_value(vm, make_int(1));
41#else
42 Value vid = pop_value(vm);
45#endif
46 break;
47}
@ OP_PCSC_RELEASE
Definition bytecode.h:185
free_value(vid)
push_value(vm, make_int(0))
Tagged union representing a Fun value.
Definition value.h:68
int64_t i
Definition value.h:71
Value make_int(int64_t v)
Construct a Value representing a 64-bit integer.
Definition value.c:51