All Downloads are FREE. Search and download functionalities are using the official Maven repository.

jdk.internal.sys.stdc.Stdio Maven / Gradle / Ivy

There is a newer version: 17.alpha.0.57
Show newest version
package jdk.internal.sys.stdc;

import static org.qbicc.runtime.CNative.*;
import static org.qbicc.runtime.stdc.Stddef.*;

import org.qbicc.runtime.Build;

/**
 * C standard I/O should only be used for specialized debugging purposes.
 */
@include("")
public final class Stdio {
    public static native c_int printf(@restrict ptr<@c_const c_char> format, object... args);

    public static native c_int fprintf(@restrict ptr stream, @restrict ptr<@c_const c_char> format, object... args);

    public static native c_int snprintf(@restrict ptr str, size_t size, @restrict ptr<@c_const c_char> format, object... args);

    public static native c_int fscanf(@restrict ptr stream, ptr<@c_const c_char> format, object... args);
    public static native c_int scanf(@restrict ptr<@c_const c_char> format, object... args);
    public static native c_int sscanf(@restrict ptr<@c_const c_char> s, @restrict ptr<@c_const c_char> format, object... args);

    @incomplete
    public static final class FILE extends object {
    }

    @define("_POSIX_C_SOURCE")
    public static native ptr fdopen(c_int fd, ptr<@c_const c_char> mode);

    public static native ptr fopen(ptr<@c_const c_char> path, ptr<@c_const c_char> mode);

    public static native c_int fclose(ptr stream);

    public static native size_t fread(@restrict ptr ptr, size_t size, size_t nitems, ptr stream);

    public static native c_int remove(ptr<@c_const c_char> path);

    @extern
    @name(value = "__stdinp", when = Build.Target.IsMacOs.class)
    public static ptr stdin;
    @extern
    @name(value = "__stdoutp", when = Build.Target.IsMacOs.class)
    public static ptr stdout;
    @extern
    @name(value = "__stderrp", when = Build.Target.IsMacOs.class)
    public static ptr stderr;

    public static native c_int fflush(ptr stream);
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy