ref.h

This interface exports several simple functions for allocating pointers to the atomic types.
Functions
newRefInt(value) Allocates a ref pointing to the specified int value.
newRefShort(value) Allocates a ref pointing to the specified short value.
newRefLong(value) Allocates a ref pointing to the specified long value.
newRefFloat(value) Allocates a ref pointing to the specified float value.
newRefDouble(value) Allocates a ref pointing to the specified double value.
newRefChar(value) Allocates a ref pointing to the specified char value.
newRefBool(value) Allocates a ref pointing to the specified bool value.
newRefUnsigned(value) Allocates a ref pointing to the specified unsigned value.
newRefUnsignedShort(value) Allocates a ref pointing to the specified unsigned short value.
newRefUnsignedLong(value) Allocates a ref pointing to the specified unsigned long value.
newRefUnsignedChar(value) Allocates a ref pointing to the specified unsigned char value.
refToInt(ref) Returns the int to which this reference points.
refToShort(ref) Returns the short to which this reference points.
refToLong(ref) Returns the long to which this reference points.
refToFloat(ref) Returns the float to which this reference points.
refToDouble(ref) Returns the double to which this reference points.
refToChar(ref) Returns the char to which this reference points.
refToBool(ref) Returns the bool to which this reference points.
refToUnsigned(ref) Returns the unsigned to which this reference points.
refToUnsignedShort(ref) Returns the unsigned short to which this reference points.
refToUnsignedLong(ref) Returns the unsigned long to which this reference points.
refToUnsignedChar(ref) Returns the unsigned char to which this reference points.

Function detail


void *newRefInt(int value);
Allocates a ref pointing to the specified int value.

Usage:

ref = newRefInt(value);

void *newRefShort(short value);
Allocates a ref pointing to the specified short value.

Usage:

ref = newRefShort(value);

void *newRefLong(long value);
Allocates a ref pointing to the specified long value.

Usage:

ref = newRefLong(value);

void *newRefFloat(float value);
Allocates a ref pointing to the specified float value.

Usage:

ref = newRefFloat(value);

void *newRefDouble(double value);
Allocates a ref pointing to the specified double value.

Usage:

ref = newRefDouble(value);

void *newRefChar(char value);
Allocates a ref pointing to the specified char value.

Usage:

ref = newRefChar(value);

void *newRefBool(bool value);
Allocates a ref pointing to the specified bool value.

Usage:

ref = newRefBool(value);

void *newRefUnsigned(unsigned value);
Allocates a ref pointing to the specified unsigned value.

Usage:

ref = newRefUnsigned(value);

void *newRefUnsignedShort(unsigned short value);
Allocates a ref pointing to the specified unsigned short value.

Usage:

ref = newRefUnsignedShort(value);

void *newRefUnsignedLong(unsigned long value);
Allocates a ref pointing to the specified unsigned long value.

Usage:

ref = newRefUnsignedLong(value);

void *newRefUnsignedChar(unsigned char value);
Allocates a ref pointing to the specified unsigned char value.

Usage:

ref = newRefUnsignedChar(value);

int refToInt(void *ref);
Returns the int to which this reference points.

Usage:

i = refToInt(ref);

short refToShort(void *ref);
Returns the short to which this reference points.

Usage:

s = refToShort(ref);

long refToLong(void *ref);
Returns the long to which this reference points.

Usage:

l = refToLong(ref);

float refToFloat(void *ref);
Returns the float to which this reference points.

Usage:

f = refToFloat(ref);

double refToDouble(void *ref);
Returns the double to which this reference points.

Usage:

d = refToDouble(ref);

char refToChar(void *ref);
Returns the char to which this reference points.

Usage:

c = refToChar(ref);

bool refToBool(void *ref);
Returns the bool to which this reference points.

Usage:

b = refToBool(ref);

unsigned refToUnsigned(void *ref);
Returns the unsigned to which this reference points.

Usage:

u = refToUnsigned(ref);

unsigned short refToUnsignedShort(void *ref);
Returns the unsigned short to which this reference points.

Usage:

us = refToUnsignedShort(ref);

unsigned long refToUnsignedLong(void *ref);
Returns the unsigned long to which this reference points.

Usage:

ul = refToUnsignedLong(ref);

unsigned char refToUnsignedChar(void *ref);
Returns the unsigned char to which this reference points.

Usage:

uc = refToUnsignedChar(ref);