BlitzMax Extended  0.8.18
Pushing Blitz to the Max.
Data Structures | Macros | Typedefs | Enumerations | Variables
blitz_types.h File Reference

Introduces most used data types. More...

#include <float.h>
#include <limits.h>
#include <stdint.h>
#include "_common.h"

Go to the source code of this file.

Data Structures

struct  BBTypeKeyInfo
 Contains useful information about each type key. More...

Macros

#define BBBYTE_MIN
 The minimum value a variable of type BBByte can hold.
#define BBBYTE_MAX
 The maximum value a variable of type BBByte can hold.
#define BBSHORT_MIN
 The minimum value a variable of type BBShort can hold.
#define BBSHORT_MAX
 The maximum value a variable of type BBShort can hold.
#define BBINT_MIN
 The minimum value a variable of type BBInt can hold.
#define BBINT_MAX
 The maximum value a variable of type BBInt can hold.
#define BBLONG_MIN
 The minimum value a variable of type BBLong can hold.
#define BBLONG_MAX
 The maximum value a variable of type BBLong can hold.
#define BBFLOAT_MIN
 The minimum value a variable of type BBFloat can hold.
#define BBFLOAT_MAX
 The maximum value a variable of type BBFloat can hold.
#define BBDOUBLE_MIN
 The minimum value a variable of type BBDouble can hold.
#define BBDOUBLE_MAX
 The maximum value a variable of type BBDouble can hold.
#define BBCHAR_MIN
 The minimum value a variable of type BBChar can hold.
#define BBCHAR_MAX
 The maximum value a variable of type BBChar can hold.
#define BBSIZE_MIN
 The minimal value a variable of type BBSize can hold.
#define BBSIZE_MAX
 The maximum value a variable of type BBSize SHOULD store.
#define BBTYPEKEY_ISVALID(key)
 Checks if a type key is valid.
#define BBTYPEKEY_ISNUMERIC(key)
 Checks if a type key identifies a numeric variable.
#define BBTYPEKEY_ISPRIMITIVE(key)
 Checks if a type key identifies a primitive data type.
#define BBTYPEKEY_ISCOMPLEX(key)
 Checks if a type key identifies a complex data type.
#define BBTYPETAG_KEY(tag)
 Gets the corresponding BBTypeKey for a type tag.

Typedefs

typedef unsigned char BBByte
 The BlitzMax "Byte" data type.
typedef unsigned short BBShort
 The BlitzMax "Short" data type.
typedef signed int BBInt
 The BlitzMax "Int" data type.
typedef BBInt64 BBLong
 The BlitzMax "Long" data type.
typedef float BBFloat
 The BlitzMax "Float" data type.
typedef double BBDouble
 The BlitzMax "Double" data type.
typedef BBUInt16 BBChar
 The BlitzMax internal character type.

Enumerations

enum  BBBool
 Boolean data type. More...
enum  BBTypeKey {
  BBTYPEKEY_BYTE, BBTYPEKEY_SHORT, BBTYPEKEY_INT, BBTYPEKEY_LONG,
  BBTYPEKEY_FLOAT, BBTYPEKEY_DOUBLE, BBTYPEKEY_POINTER, BBTYPEKEY_VOID,
  BBTYPEKEY_FUNCTION, BBTYPEKEY_OBJECT, BBTYPEKEY_STRING, BBTYPEKEY_ARRAY
}

Variables

const BBTypeKeyInfo bbTypeKeyInfo []
 Stores the TypeKey information for all BlitzMax data types.

Detailed Description

Introduces most used data types.

BlitzMax has two kinds of data types: Primitive and complex types.

Primitive types store one value or a pointer to one. They include: BBByte, BBShort, BBInt, BBLong, BBFloat, BBDouble and BBChar

Complex data types are BlitzMax objects, consisting of a C struct to store the data and a BBClass that defines the functionality. They include: BBObject, BBString, BBArray and every user-defined class

Author:
Mark Sibly
Fabian Niemann

Macro Definition Documentation

#define BBSIZE_MAX

The maximum value a variable of type BBSize SHOULD store.

Since the BlitzMax language aswell as it's runtime operate mostly on a signed integer basis, values stored in variables of this data type should not exceed BBINT_MAX. Otherwise there could be problems with legacy code.

#define BBTYPEKEY_ISCOMPLEX (   key)

Checks if a type key identifies a complex data type.

The following data types are considered to be "complex": BBObject, BBString and BBArray

Therefore the following type keys will check positive for complex data type: BBTYPEKEY_OBJECT, BBTYPEKEY_STRING and BBTYPEKEY_ARRAY

See also:
BBTYPEKEY_ISPRIMITIVE
Parameters:
keyThe type key to check
Return values:
trueIf the key identifies a complex data type
falseIf the does not identify a valid complex variable

Referenced by bbObjectClone().

#define BBTYPEKEY_ISNUMERIC (   key)

Checks if a type key identifies a numeric variable.

The following data types are considered to be "numeric": BBByte, BBShort and BBInt, BBLong, BBFloat and BBDouble

Therefore the following type keys will check positive for complex data type: BBTYPEKEY_BYTE, BBTYPEKEY_SHORT and BBTYPEKEY_INT, BBTYPEKEY_LONG, BBTYPEKEY_FLOAT and BBTYPEKEY_DOUBLE

See also:
BBTYPEKEY_ISPRIMITIVE
Parameters:
keyThe type key to check
Return values:
trueIf the key identifies a numeric variable
falseIf the does not identify a valid numeric variable
#define BBTYPEKEY_ISPRIMITIVE (   key)

Checks if a type key identifies a primitive data type.

The following data types are considered to be "primitive": BBByte, BBShort, BBInt, BBLong, BBFloat, BBDouble, void*, void and (*)

Therefore the following type keys will check positive for primitive data type: BBTYPEKEY_BYTE, BBTYPEKEY_SHORT and BBTYPEKEY_INT, BBTYPEKEY_LONG, BBTYPEKEY_FLOAT, BBTYPEKEY_DOUBLE, BBTYPEKEY_POINTER, BBTYPEKEY_VOID, BBTYPEKEY_FUNCTION

See also:
BBTYPEKEY_ISCOMPLEX, BBTYPEKEY_ISNUMERIC
Parameters:
keyThe type key to check
Return values:
trueIf the key identifies a primitive data type
falseIf the does not identify a valid primitive variable

Referenced by bbArrayClone().

#define BBTYPEKEY_ISVALID (   key)

Checks if a type key is valid.

All known keys are considered to be valid.

Parameters:
keyThe type key to check as an integer
Return values:
trueIf the key is valid
falseIf the key is not valid
#define BBTYPETAG_KEY (   tag)

Gets the corresponding BBTypeKey for a type tag.

See also:
BBTypeKey
Parameters:
tagThe type tag as a null-terminated string
Returns:
The corresponding type key

Referenced by bbArrayClone(), bbArrayCompare(), bbArrayEndsWith(), bbArrayFindDouble(), bbArrayFindFloat(), bbArrayFindInt(), bbArrayFindLong(), bbArrayFindObject(), bbArrayFindString(), bbArrayNew1D(), bbArrayReverse(), bbArrayRotate(), bbArrayStartsWith(), bbArrayToString(), and bbObjectClone().


Typedef Documentation

typedef unsigned char BBByte

The BlitzMax "Byte" data type.

See also:
BBBYTE_MIN, BBBYTE_MAX
typedef BBUInt16 BBChar

The BlitzMax internal character type.

Represents a single UCS-2 character code.

See also:
BBCHAR_MIN, BBCHAR_MAX
typedef signed int BBInt

The BlitzMax "Int" data type.

See also:
BBINT_MIN, BBINT_MAX
typedef BBInt64 BBLong

The BlitzMax "Long" data type.

See also:
BBLONG_MIN, BBLONG_MAX
typedef unsigned short BBShort

The BlitzMax "Short" data type.

See also:
BBSHORT_MIN, BBSHORT_MAX

Enumeration Type Documentation

enum BBBool

Boolean data type.

Although BlitzMax does not have a designated boolean data type as of now, this is useful for improving readability.

See also:
BBTRUE, BBFALSE
Note:
In BlitzMax everything with a value 0 is considered 'False' and everything non-zero is considered 'True'. No matter the type.
enum BBTypeKey
Enumerator:
BBTYPEKEY_BYTE 

Identifies the type BBByte.

BBTYPEKEY_SHORT 

Identifies the type BBShort.

BBTYPEKEY_INT 

Identifies the type BBInt.

BBTYPEKEY_LONG 

Identifies the type BBLong.

BBTYPEKEY_FLOAT 

Identifies the type BBFloat.

BBTYPEKEY_DOUBLE 

Identifies the type BBDouble.

BBTYPEKEY_POINTER 

Identifies a pointer to a variable.

BBTYPEKEY_VOID 

Identifies the type void.

BBTYPEKEY_FUNCTION 

Identifies a function.

BBTYPEKEY_OBJECT 

Identifies the type BBObject*.

BBTYPEKEY_STRING 

Identifies the type BBString*.

BBTYPEKEY_ARRAY 

Identifies the type BBArray*.


Variable Documentation

const BBTypeKeyInfo bbTypeKeyInfo[]

Stores the TypeKey information for all BlitzMax data types.

See also:
BBTypeKeyInfo