"

2013 FRC Java API

"

com.sun.squawk.os
Class CSystem

java.lang.Object
  extended by com.sun.squawk.os.CSystem

public class CSystem
extends Object

Static class that represents the 'C' programming environment.


Constructor Summary
CSystem()
           
 
Method Summary
static int copy(int addr, byte[] bytes, int lth)
          Copy data from a byte array into a malloc buffer.
static double dcall(Parm x)
          Call a 'C' function.
static float fcall(Parm x)
          Call a 'C' function.
static void free(int address)
          Free a buffer allocated with malloc.
static int getByte(int address)
          Get a byte in memory.
static int getInt(int address)
          Get a word in memory.
static int icall(Parm x)
          Call a 'C' function.
static long lcall(Parm x)
          Call a 'C' function.
static int lookup(String s)
          Lookup a C link symbol.
static int malloc(int size)
          Malloc some memory.
static int mallocBytes(byte[] bytes)
          Malloc some memory and copy a byte array into it.
static int mallocString(String str)
          Malloc some memory and copy a string into it.
static Object ocall(Parm x)
          Call a 'C' function.
static void setByte(int address, int bite)
          Set a byte in memory.
static void setInt(int address, int value)
          Set a word in memory.
static void vcall(Parm x)
          Call a 'C' function.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CSystem

public CSystem()
Method Detail

lookup

public static int lookup(String s)
Lookup a C link symbol.

Parameters:
s - the symbole
Returns:
the address

malloc

public static int malloc(int size)
Malloc some memory.

Parameters:
size - the size in bytes
Returns:
the address

mallocBytes

public static int mallocBytes(byte[] bytes)
Malloc some memory and copy a byte array into it.

Parameters:
bytes - the byte array
Returns:
the address

mallocString

public static int mallocString(String str)
Malloc some memory and copy a string into it.

Parameters:
str - the string
Returns:
the address

setByte

public static void setByte(int address,
                           int bite)
Set a byte in memory.

Parameters:
address - the address
bite - the value

getByte

public static int getByte(int address)
Get a byte in memory.

Parameters:
address - the address
Returns:
the value

setInt

public static void setInt(int address,
                          int value)
Set a word in memory.

Parameters:
address - the address
value - the value

getInt

public static int getInt(int address)
Get a word in memory.

Parameters:
address - the address
Returns:
the value

copy

public static int copy(int addr,
                       byte[] bytes,
                       int lth)
Copy data from a byte array into a malloc buffer.

Parameters:
addr - the address of the malloc buffer
bytes - the byte array to copy
lth - the length of the buffer to copy
Returns:
the address the data was copied to

free

public static void free(int address)
Free a buffer allocated with malloc.

Parameters:
address - the address of the buffer

vcall

public static void vcall(Parm x)
Call a 'C' function.

Parameters:
x - the parameter list

icall

public static int icall(Parm x)
Call a 'C' function.

Parameters:
x - the parameter list
Returns:
the result

lcall

public static long lcall(Parm x)
Call a 'C' function.

Parameters:
x - the parameter list
Returns:
the result

fcall

public static float fcall(Parm x)
Call a 'C' function.

Parameters:
x - the parameter list
Returns:
the result

dcall

public static double dcall(Parm x)
Call a 'C' function.

Parameters:
x - the parameter list
Returns:
the result

ocall

public static Object ocall(Parm x)
Call a 'C' function.

Parameters:
x - the parameter list
Returns:
the result

"

2013 FRC Java API

"

"
For updated information see the Java FRC site
"