![]() |
Toy 1.1.6
The Toy programming language is an imperative bytecode-intermediate embedded scripting language
|
@???@ More...
Go to the source code of this file.
Data Structures | |
| struct | Toy_RefString |
Typedefs | |
| typedef void *(* | Toy_RefStringAllocatorFn) (void *pointer, size_t oldSize, size_t newSize) |
| Prototype for interface conforms to Toy's memory API, and generally shouldn't be used. | |
| typedef struct Toy_RefString | Toy_RefString |
| @???@ | |
Functions | |
| TOY_API void | Toy_setRefStringAllocatorFn (Toy_RefStringAllocatorFn) |
| Conforms to and is invoked by Toy's memory API, and generally shouldn't be used. | |
| TOY_API Toy_RefString * | Toy_createRefString (const char *cstring) |
| Wraps Toy_CreateRefStringLength, by determining the length of the given cstring and passing it to the other function. | |
| TOY_API Toy_RefString * | Toy_createRefStringLength (const char *cstring, size_t length) |
| Returns a new Toy_RefString, containing a copy of cstring, or NULL on error. This function also sets the returned refstring's reference counter to 1. | |
| TOY_API void | Toy_deleteRefString (Toy_RefString *refString) |
| Reduces the refString's reference counter by 1 and, if it reaches 0, frees the memory. | |
| TOY_API int | Toy_countRefString (Toy_RefString *refString) |
| Returns the total number of references to refString, for debugging. | |
| TOY_API size_t | Toy_lengthRefString (Toy_RefString *refString) |
| Returns the length of the underlying cstring of refString. | |
| TOY_API Toy_RefString * | Toy_copyRefString (Toy_RefString *refString) |
| Increases the reference counter of refString by 1, before returning the given pointer. | |
| TOY_API Toy_RefString * | Toy_deepCopyRefString (Toy_RefString *refString) |
| Behaves identically to Toy_copyRefString, except that it explicitly preforms a deep copy of the internal memory. Using this function should be done carefully, as it incurs a performance penalty that negates the benefit of this module. | |
| TOY_API const char * | Toy_toCString (Toy_RefString *refString) |
| Exposes the interal cstring of refString. Only use this function when dealing with external APIs. | |
| TOY_API bool | Toy_equalsRefString (Toy_RefString *lhs, Toy_RefString *rhs) |
| Returns true when the two refstrings are either the same refstring, or contain the same value. Otherwise it returns false. | |
| TOY_API bool | Toy_equalsRefStringCString (Toy_RefString *lhs, char *cstring) |
| Returns true when the refString contains the same value as the cstring. Otherwise it returns false. | |
@???@
@???@
| void *(* Toy_RefStringAllocatorFn)(void *pointer, size_t oldSize, size_t newSize) |
Prototype for interface conforms to Toy's memory API, and generally shouldn't be used.
| pointer | |
| oldSize | |
| newSize |
| Toy_RefString * Toy_copyRefString | ( | Toy_RefString * | refString | ) |
Increases the reference counter of refString by 1, before returning the given pointer.
| refString |
| int Toy_countRefString | ( | Toy_RefString * | refString | ) |
Returns the total number of references to refString, for debugging.
| refString |
| Toy_RefString * Toy_createRefString | ( | const char * | cstring | ) |
Wraps Toy_CreateRefStringLength, by determining the length of the given cstring and passing it to the other function.
| cstring |
| Toy_RefString * Toy_createRefStringLength | ( | const char * | cstring, |
| size_t | length | ||
| ) |
Returns a new Toy_RefString, containing a copy of cstring, or NULL on error. This function also sets the returned refstring's reference counter to 1.
| cstring | |
| length |
| Toy_RefString * Toy_deepCopyRefString | ( | Toy_RefString * | refString | ) |
Behaves identically to Toy_copyRefString, except that it explicitly preforms a deep copy of the internal memory. Using this function should be done carefully, as it incurs a performance penalty that negates the benefit of this module.
| refString |
| void Toy_deleteRefString | ( | Toy_RefString * | refString | ) |
Reduces the refString's reference counter by 1 and, if it reaches 0, frees the memory.
| refString |
| bool Toy_equalsRefString | ( | Toy_RefString * | lhs, |
| Toy_RefString * | rhs | ||
| ) |
Returns true when the two refstrings are either the same refstring, or contain the same value. Otherwise it returns false.
| lhs | |
| rhs |
| bool Toy_equalsRefStringCString | ( | Toy_RefString * | lhs, |
| char * | cstring | ||
| ) |
Returns true when the refString contains the same value as the cstring. Otherwise it returns false.
| lhs | |
| cstring |
| size_t Toy_lengthRefString | ( | Toy_RefString * | refString | ) |
Returns the length of the underlying cstring of refString.
| refString |
| void Toy_setRefStringAllocatorFn | ( | Toy_RefStringAllocatorFn | ) |
Conforms to and is invoked by Toy's memory API, and generally shouldn't be used.
| Toy_RefStringAllocatorFn |
| const char * Toy_toCString | ( | Toy_RefString * | refString | ) |
Exposes the interal cstring of refString. Only use this function when dealing with external APIs.
| refString |