Top Description Fields Constructors Methods
org.lwjgl.system.libc

public Class LibCStdio

extends Object
Class Inheritance
Imports
javax.annotation.*, java.nio.*, org.lwjgl.system.*

Native bindings to stdio.h.

Field Summary

Modifier and TypeField and Description
public static final long
snprintf

The address of the snprintf function.

public static final long
sscanf

The address of the sscanf function.

Constructor Summary

AccessConstructor and Description
protected

Method Summary

Modifier and TypeMethod and Description
public static native int
nvsnprintf(long buffer, long
up to buf_size - 1 characters may be written, plus the null terminator
buf_size
,
long format, long vlist)

Unsafe version of: vsnprintf

public static native int
nvsscanf(long buffer, long format, long vlist)

Unsafe version of: vsscanf

private static native long
private static native long
public static int

Returns:

the number of characters written if successful or negative value if an error occurred. If the resulting string gets truncated due to buf_size limit, function returns the total number of characters (not including the terminating null-byte) which would have been written, if the limit was not imposed.
vsnprintf
(ByteBuffer
pointer to a character string to write to
buffer
,
ByteBuffer
pointer to a null-terminated character string specifying how to interpret the data
format
,
long
variable argument list containing the data to print
vlist
)

Loads the data from the locations, defined by vlist, converts them to character string equivalents and writes the results to a character string buffer.

public static int

Returns:

the number of characters written if successful or negative value if an error occurred. If the resulting string gets truncated due to buf_size limit, function returns the total number of characters (not including the terminating null-byte) which would have been written, if the limit was not imposed.
vsnprintf
(ByteBuffer
pointer to a character string to write to
buffer
,
CharSequence
pointer to a null-terminated character string specifying how to interpret the data
format
,
long
variable argument list containing the data to print
vlist
)

Loads the data from the locations, defined by vlist, converts them to character string equivalents and writes the results to a character string buffer.

public static int

Returns:

the number of receiving arguments successfully assigned, or EOF if read failure occurs before the first receiving argument was assigned
vsscanf
(ByteBuffer
pointer to a null-terminated character string to read from
buffer
,
ByteBuffer
pointer to a null-terminated character string specifying how to read the input
format
,
long
variable argument list containing the receiving arguments
vlist
)

Reads data from the null-terminated character string buffer, interprets it according to format and stores the results into locations defined by vlist.

public static int

Returns:

the number of receiving arguments successfully assigned, or EOF if read failure occurs before the first receiving argument was assigned
vsscanf
(CharSequence
pointer to a null-terminated character string to read from
buffer
,
CharSequence
pointer to a null-terminated character string specifying how to read the input
format
,
long
variable argument list containing the receiving arguments
vlist
)

Reads data from the null-terminated character string buffer, interprets it according to format and stores the results into locations defined by vlist.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

snprintfback to summary
public static final long snprintf

The address of the snprintf function.

sscanfback to summary
public static final long sscanf

The address of the sscanf function.

Constructor Detail

LibCStdioback to summary
protected LibCStdio()

Method Detail

nvsnprintfback to summary
public static native int nvsnprintf(long buffer, long buf_size, long format, long vlist)

Unsafe version of: vsnprintf

Parameters
buf_size:long

up to buf_size - 1 characters may be written, plus the null terminator

nvsscanfback to summary
public static native int nvsscanf(long buffer, long format, long vlist)

Unsafe version of: vsscanf

snprintfback to summary
private static native long snprintf()
Annotations
@NativeType:void *
sscanfback to summary
private static native long sscanf()
Annotations
@NativeType:void *
vsnprintfback to summary
public static int vsnprintf(ByteBuffer buffer, ByteBuffer format, long vlist)

Loads the data from the locations, defined by vlist, converts them to character string equivalents and writes the results to a character string buffer.

Parameters
buffer:ByteBuffer

pointer to a character string to write to

format:ByteBuffer

pointer to a null-terminated character string specifying how to interpret the data

vlist:long

variable argument list containing the data to print

Returns:int

the number of characters written if successful or negative value if an error occurred. If the resulting string gets truncated due to buf_size limit, function returns the total number of characters (not including the terminating null-byte) which would have been written, if the limit was not imposed.

vsnprintfback to summary
public static int vsnprintf(ByteBuffer buffer, CharSequence format, long vlist)

Loads the data from the locations, defined by vlist, converts them to character string equivalents and writes the results to a character string buffer.

Parameters
buffer:ByteBuffer

pointer to a character string to write to

format:CharSequence

pointer to a null-terminated character string specifying how to interpret the data

vlist:long

variable argument list containing the data to print

Returns:int

the number of characters written if successful or negative value if an error occurred. If the resulting string gets truncated due to buf_size limit, function returns the total number of characters (not including the terminating null-byte) which would have been written, if the limit was not imposed.

vsscanfback to summary
public static int vsscanf(ByteBuffer buffer, ByteBuffer format, long vlist)

Reads data from the null-terminated character string buffer, interprets it according to format and stores the results into locations defined by vlist.

Parameters
buffer:ByteBuffer

pointer to a null-terminated character string to read from

format:ByteBuffer

pointer to a null-terminated character string specifying how to read the input

vlist:long

variable argument list containing the receiving arguments

Returns:int

the number of receiving arguments successfully assigned, or EOF if read failure occurs before the first receiving argument was assigned

vsscanfback to summary
public static int vsscanf(CharSequence buffer, CharSequence format, long vlist)

Reads data from the null-terminated character string buffer, interprets it according to format and stores the results into locations defined by vlist.

Parameters
buffer:CharSequence

pointer to a null-terminated character string to read from

format:CharSequence

pointer to a null-terminated character string specifying how to read the input

vlist:long

variable argument list containing the receiving arguments

Returns:int

the number of receiving arguments successfully assigned, or EOF if read failure occurs before the first receiving argument was assigned