// Path: source/model/com/stormmq/java2c/model/C.java
// public abstract class C
// {
// 	protected C()
// 	{
// 	}
// }
// 
// Path: source/model/com/stormmq/java2c/model/primitives/char_.java
// @PrimitiveConversion("char")
// public class char_ extends Primitive
// {
// 	private final byte value;
// 
// 	// In practice, this is a a signed char on Linux for x86, and unsigned for PowerPC and ARM
// 	// Determined by ABI. The options -funsigned-char and -fsigned-char change the default.
// 	// It is probably most sensible to only use char for strings, and avoid its use everywhere else.
// 	// And, in using this value, to go 'the Java way' and treat it as signed (certainly, we're less likely to screw up).
// 	public char_(final byte value)
// 	{
// 		this.value = value;
// 	}
// }


import com.stormmq.java2c.model.C;
import com.stormmq.java2c.model.primitives.Pointer;
import com.stormmq.java2c.model.primitives.char_;
import org.jetbrains.annotations.NotNull;
package com.stormmq.java2c.samples.stdlib;


/*
	Should have no instance methods
	Should have a private constructor
	Should have only public static methods, ideally we'd like to make these native.

	It would be nice to be able to marshal using primitives
		- ultimately, we want to be able to write dynamic glue code to support this API, so we can test from Java!
		- very similar to the BridJ code, but written by us

	Pointers are interesting
		- Structs are passed as references; we'll need special syntax to pass-by-value
			- the only times passing a struct by value makes sense are:-
				- when it's less than 8-bytes (4-bytes on 32-bit systems) [some might argue that 16 bytes makes sense]
				- when we want an explicit copy (not likely)
				- when a library requires it
 */
public final class Stdlib extends C
{
	private Stdlib()
	{
	}

	// var-args handling is going to be a barrel of laughs!
	/*
		This translates as:-

		The annoying thing is that restrict could be used, but we have to know the object we're passing is immutable...

		void printf(const char *format, ...)
		{
			...
		}
	 */
// Path: source/model/com/stormmq/java2c/model/C.java
// public abstract class C
// {
// 	protected C()
// 	{
// 	}
// }
// 
// Path: source/model/com/stormmq/java2c/model/primitives/char_.java
// @PrimitiveConversion("char")
// public class char_ extends Primitive
// {
// 	private final byte value;
// 
// 	// In practice, this is a a signed char on Linux for x86, and unsigned for PowerPC and ARM
// 	// Determined by ABI. The options -funsigned-char and -fsigned-char change the default.
// 	// It is probably most sensible to only use char for strings, and avoid its use everywhere else.
// 	// And, in using this value, to go 'the Java way' and treat it as signed (certainly, we're less likely to screw up).
// 	public char_(final byte value)
// 	{
// 		this.value = value;
// 	}
// }


// Path: source/samples/com/stormmq/java2c/samples/stdlib/Stdlib.java
import com.stormmq.java2c.model.C;
import com.stormmq.java2c.model.primitives.Pointer;
import com.stormmq.java2c.model.primitives.char_;
import org.jetbrains.annotations.NotNull;

package com.stormmq.java2c.samples.stdlib;


/*
	Should have no instance methods
	Should have a private constructor
	Should have only public static methods, ideally we'd like to make these native.

	It would be nice to be able to marshal using primitives
		- ultimately, we want to be able to write dynamic glue code to support this API, so we can test from Java!
		- very similar to the BridJ code, but written by us

	Pointers are interesting
		- Structs are passed as references; we'll need special syntax to pass-by-value
			- the only times passing a struct by value makes sense are:-
				- when it's less than 8-bytes (4-bytes on 32-bit systems) [some might argue that 16 bytes makes sense]
				- when we want an explicit copy (not likely)
				- when a library requires it
 */
public final class Stdlib extends C
{
	private Stdlib()
	{
	}

	// var-args handling is going to be a barrel of laughs!
	/*
		This translates as:-

		The annoying thing is that restrict could be used, but we have to know the object we're passing is immutable...

		void printf(const char *format, ...)
		{
			...
		}
	 */
	public static native void printf(@NotNull final Pointer<char_> format, @NotNull final Object... varargs);