Version information for the Teascript library and the numeric types used throughout the C API. The version constants are defined in tea.h and can be used both at compile time and at run time to check which version of the API a program was built against.

TEA_REPOSITORY

Signature

#define TEA_REPOSITORY "https://github.com/RevengerWizard/teascript"

Description

String literal with the URL of the Teascript source repository.

Example

printf("Teascript: %s\n", TEA_REPOSITORY);

See also

TEA_VERSION

TEA_VERSION_MAJOR

Signature

#define TEA_VERSION_MAJOR 0

Description

The major version number of Teascript.

Example

#if TEA_VERSION_MAJOR < 1
#warning "built against a pre-1.0 Teascript"
#endif

See also

TEA_VERSION_MINOR, TEA_VERSION_PATCH, TEA_VERSION_NUMBER

TEA_VERSION_MINOR

Signature

#define TEA_VERSION_MINOR 0

Description

The minor version number of Teascript.

Example

printf("%d.%d\n", TEA_VERSION_MAJOR, TEA_VERSION_MINOR);

See also

TEA_VERSION_MAJOR, TEA_VERSION_PATCH, TEA_VERSION_NUMBER

TEA_VERSION_PATCH

Signature

#define TEA_VERSION_PATCH 0

Description

The patch version number of Teascript.

Example

printf("%d.%d.%d\n", TEA_VERSION_MAJOR, TEA_VERSION_MINOR, TEA_VERSION_PATCH);

See also

TEA_VERSION_MAJOR, TEA_VERSION_MINOR, TEA_VERSION_NUMBER

TEA_VERSION_NUMBER

Signature

#define TEA_VERSION_NUMBER (TEA_VERSION_MAJOR * 10000 + TEA_VERSION_MINOR * 100 + TEA_VERSION_PATCH)

Description

The version as a single integer, major * 10000 + minor * 100 + patch, so that versions compare with ordinary integer comparison. For example, version 1.2.3 is 10203.

Example

#if TEA_VERSION_NUMBER >= 10200
/* requires Teascript 1.2.0 or later */
#endif

See also

TEA_VERSION_MAJOR, TEA_VERSION_MINOR, TEA_VERSION_PATCH, TEA_VERSION

TEA_VERSION

Signature

#define TEA_VERSION "0.0.0"

Description

The version as a string literal in the form "major.minor.patch".

Example

printf("Teascript %s\n", TEA_VERSION);

See also

TEA_VERSION_NUMBER, TEA_REPOSITORY

tea_Number

Signature

typedef double tea_Number;

Description

The type of numbers in Teascript, a double-precision IEEE 754 floating-point number. Every Teascript number has this type, whether or not it has a fractional part.

Example

tea_Number half = tea_check_number(T, 1) / 2;
tea_push_number(T, half);

See also

tea_Integer, tea_push_number, tea_get_number, tea_check_number

tea_Integer

Signature

typedef ptrdiff_t tea_Integer;

Description

The signed integer type used by the C API for counts, indices and integer keys. It is a ptrdiff_t, so it matches the platform’s pointer width.

Teascript numbers are doubles, so converting to a tea_Integer truncates the fractional part, and values beyond 2^53 cannot be represented exactly when converted back.

Example

tea_Integer n = tea_check_integer(T, 1);
tea_push_integer(T, n * 2);

See also

tea_Number, tea_push_integer, tea_get_integer, tea_check_integer