package jGPIO;

import com.sun.jna.Structure;

import anywheresoftware.b4a.BA.Hide;

public class timeval extends Structure {
	/**
	 * Seconds.<br>
	 * C type : __time_t
	 */
	public int tv_sec;
	/**
	 * Microseconds.<br>
	 * C type : __suseconds_t
	 */
	public int tv_usec;
	
	public timeval() {
		super();
	}
	/**
	 * @param tv_sec Seconds.<br>
	 * C type : __time_t<br>
	 * @param tv_usec Microseconds.<br>
	 * C type : __suseconds_t
	 */
	public timeval(int tv_sec, int tv_usec) {
		super();
		this.tv_sec = tv_sec;
		this.tv_usec = tv_usec;
	}
	protected ByReference newByReference() {
		ByReference s = new ByReference();
		s.useMemory(getPointer());
		write();
		s.read();
		return s;
	}
	protected ByValue newByValue() {
		ByValue s = new ByValue();
		s.useMemory(getPointer());
		write();
		s.read();
		return s;
	}
	protected timeval newInstance() {
		timeval s = new timeval();
		s.useMemory(getPointer());
		write();
		s.read();
		return s;
	}
	
	@Override
	@Hide
	public void autoWrite() {super.autoWrite();}
	
	@Override
	@Hide
	public void autoRead() {super.autoRead();}
	
	public static class ByReference extends timeval implements com.sun.jna.Structure.ByReference {}
	public static class ByValue extends timeval implements com.sun.jna.Structure.ByValue {}
}
