nk 1.0.0
C++ Numerical Computing Runtime
Loading...
Searching...
No Matches
runtime/include/nk/runtime/io.hpp
Go to the documentation of this file.
1
3// src/runtime/include/nk/runtime/io.hpp
4//
5// Language-runtime I/O functions coupled to the Engine execution context
6// (outputText sink, fid table, OpenFile).
7#pragma once
8
9#include <cstddef>
10#include <nk/value/value.hpp>
11#include <nk/value/span.hpp>
12
13namespace nk {
14
17
18class Engine;
19}
20
21namespace nk::runtime {
22
27std::size_t fprintf(::nk::Engine &engine, Span<const Value> args);
28
33
39void fscanf(::nk::Engine &engine, Span<const Value> args, size_t nargout, Span<Value> outs);
40
46void textscan(::nk::Engine &engine, Span<const Value> args, size_t nargout, Span<Value> outs);
47
48
50} // namespace nk::runtime
void fscanf(::nk::Engine &engine, Span< const Value > args, size_t nargout, Span< Value > outs)
Reads formatted data from file descriptor (fscanf(fid, fmt, size)).
std::size_t fprintf(::nk::Engine &engine, Span< const Value > args)
Formats and writes text to engine stdout or open file descriptor.
void textscan(::nk::Engine &engine, Span< const Value > args, size_t nargout, Span< Value > outs)
Reads tabular data from open file descriptor or string (textscan(fid, fmt)).
void disp(::nk::Engine &engine, Span< const Value > args)
Displays value to engine standard output (disp(v)).