C runtime functions

EsCRTabs

int EsCRTabs(int n);

Returns the absolute value of the integer argument.

EsCRTacosf

float EsCRTacosf(float x);

Returns the arc cosine of the argument.

EsCRTasinf

float EsCRTasinf(float x);

Returns the arc sine of the argument.

EsCRTatan2

double EsCRTatan2(double y, double x);

Returns the arc tangent of y over x. The signs of both arguments determine the quadrant.

EsCRTatan2f

float EsCRTatan2f(float y, float x);

Returns the arc tangent of y over x. The signs of both arguments determine the quadrant.

EsCRTatanf

float EsCRTatanf(float x);

Returns the arc tangent of the argument.

EsCRTatod

double EsCRTatod(EsCString string);

Converts the string to a double value.

EsCRTatoi

int EsCRTatoi(EsCString string);

Converts the string to an integer value.

EsCRTatof

float EsCRTatof(EsCString string);

Converts the string to a float value.

EsCRTbsearch

void *EsCRTbsearch(const void *key, const void *base, size_t num, size_t size, EsCRTComparisonCallback compar);

Searches the sorted array for the key. Returns a pointer to the matching element.

EsCRTcalloc

void *EsCRTcalloc(size_t num, size_t size);

Allocates and zero-initialises a block of memory for the given number of elements.

EsCRTcbrt

double EsCRTcbrt(double x);

Returns the cube root of the argument.

EsCRTcbrtf

float EsCRTcbrtf(float x);

Returns the cube root of the argument.

EsCRTceil

double EsCRTceil(double x);

Returns the smallest integer value not less than the argument.

EsCRTceilf

float EsCRTceilf(float x);

Returns the smallest integer value not less than the argument.

EsCRTcos

double EsCRTcos(double x);

Returns the cosine of the argument.

EsCRTcosf

float EsCRTcosf(float x);

Returns the cosine of the argument.

EsCRTexp

double EsCRTexp(double x);

Returns e raised to the power of the argument.

EsCRTexpf

float EsCRTexpf(float x);

Returns e raised to the power of the argument.

EsCRTexp2

double EsCRTexp2(double x);

Returns 2 raised to the power of the argument.

EsCRTexp2f

float EsCRTexp2f(float x);

Returns 2 raised to the power of the argument.

EsCRTfabs

double EsCRTfabs(double x);

Returns the absolute value of the argument.

EsCRTfabsf

float EsCRTfabsf(float x);

Returns the absolute value of the argument.

EsCRTfloor

double EsCRTfloor(double x);

Returns the largest integer value not greater than the argument.

EsCRTfloorf

float EsCRTfloorf(float x);

Returns the largest integer value not greater than the argument.

EsCRTfmod

double EsCRTfmod(double x, double y);

Returns the remainder of x divided by y.

EsCRTfmodf

float EsCRTfmodf(float x, float y);

Returns the remainder of x divided by y.

EsCRTfree

void EsCRTfree(void *ptr);

Frees a block of memory allocated with EsCRTmalloc, EsCRTcalloc, or EsCRTrealloc.

EsCRTgetenv

char *EsCRTgetenv(EsCString name);

Returns the value of the environment variable with the given name.

EsCRTisalpha

int EsCRTisalpha(int c);

Returns nonzero if the character is a letter.

EsCRTisdigit

int EsCRTisdigit(int c);

Returns nonzero if the character is a decimal digit.

EsCRTisnanf

bool EsCRTisnanf(float f);

Returns true if the argument is not a number.

EsCRTisspace

int EsCRTisspace(int c);

Returns nonzero if the character is whitespace.

EsCRTisupper

int EsCRTisupper(int c);

Returns nonzero if the character is an uppercase letter.

EsCRTisxdigit

int EsCRTisxdigit(int c);

Returns nonzero if the character is a hexadecimal digit.

EsCRTlog2

double EsCRTlog2(double x);

Returns the base-2 logarithm of the argument.

EsCRTlog2f

float EsCRTlog2f(float x);

Returns the base-2 logarithm of the argument.

EsCRTmalloc

void *EsCRTmalloc(size_t size);

Allocates a block of memory of the given size.

EsCRTmemchr

void *EsCRTmemchr(const void *_s, int _c, size_t n);

Returns a pointer to the first occurrence of the character in the block of memory.

EsCRTmemcmp

int EsCRTmemcmp(const void *s1, const void *s2, size_t n);

Compares the bytes of two blocks of memory. Returns zero if they are equal.

EsCRTmemcpy

void *EsCRTmemcpy(void *dest, const void *src, size_t n);

Copies n bytes from the source to the destination. Returns the destination.

EsCRTmemmove

void *EsCRTmemmove(void *dest, const void *src, size_t n);

Copies n bytes from the source to the destination. The blocks may overlap. Returns the destination.

EsCRTmemset

void *EsCRTmemset(void *s, int c, size_t n);

Sets each byte of the block to the given value. Returns the block.

EsCRTpow

double EsCRTpow(double x, double y);

Returns x raised to the power of y.

EsCRTpowf

float EsCRTpowf(float x, float y);

Returns x raised to the power of y.

EsCRTqsort

void EsCRTqsort(void *_base, size_t nmemb, size_t size, EsCRTComparisonCallback compar);

Sorts the array in place using the comparison callback.

EsCRTrand

int EsCRTrand();

Returns a pseudo-random integer.

EsCRTrealloc

void *EsCRTrealloc(void *ptr, size_t size);

Resizes the block of memory to the given size.

EsCRTsin

double EsCRTsin(double x);

Returns the sine of the argument.

EsCRTsinf

float EsCRTsinf(float x);

Returns the sine of the argument.

EsCRTsnprintf

int EsCRTsnprintf(char *buffer, size_t bufferSize, EsCString format, ...);

Writes a formatted string to the buffer. Does not write more than bufferSize bytes.

EsCRTsprintf

int EsCRTsprintf(char *buffer, EsCString format, ...);

Writes a formatted string to the buffer. Returns the number of characters written.

EsCRTsqrt

double EsCRTsqrt(double x);

Returns the square root of the argument.

EsCRTsqrtf

float EsCRTsqrtf(float x);

Returns the square root of the argument.

EsCRTstrcat

char *EsCRTstrcat(char *dest, EsCString src);

Appends the source string to the end of the destination string. Returns the destination.

EsCRTstrchr

char *EsCRTstrchr(EsCString s, int c);

Returns a pointer to the first occurrence of the character in the string.

EsCRTstrcmp

int EsCRTstrcmp(EsCString s1, EsCString s2);

Compares two strings. Returns zero if they are equal.

EsCRTstrcpy

char *EsCRTstrcpy(char *dest, EsCString src);

Copies the source string to the destination. Returns the destination.

EsCRTstrdup

char *EsCRTstrdup(EsCString string);

Duplicates the string. Free the result with EsCRTfree.

EsCRTstrerror

char *EsCRTstrerror(int errnum);

Returns a string describing the error number.

EsCRTstrlen

size_t EsCRTstrlen(EsCString s);

Returns the number of characters in the string, excluding the terminator.

EsCRTstrncmp

int EsCRTstrncmp(EsCString s1, EsCString s2, size_t n);

Compares the first n characters of two strings.

EsCRTstrncpy

char *EsCRTstrncpy(char *dest, EsCString src, size_t n);

Copies the first n characters of the source to the destination. Returns the destination.

EsCRTstrnlen

size_t EsCRTstrnlen(EsCString s, size_t maxlen);

Returns the number of characters in the string, not more than the given maximum.

EsCRTstrstr

char *EsCRTstrstr(EsCString haystack, EsCString needle);

Returns a pointer to the first occurrence of the substring in the string.

EsCRTstrtod

double EsCRTstrtod(EsCString nptr, char **endptr);

Converts the string to a double value. Stores the end pointer if given.

EsCRTstrtof

float EsCRTstrtof(EsCString nptr, char **endptr);

Converts the string to a float value. Stores the end pointer if given.

EsCRTstrtol

long EsCRTstrtol(EsCString nptr, char **endptr, int base);

Converts the string to a long value in the given base.

EsCRTstrtoul

uint64_t EsCRTstrtoul(EsCString nptr, char **endptr, int base);

Converts the string to an unsigned long value in the given base.

EsCRTtolower

int EsCRTtolower(int c);

Returns the lowercase form of the character.

EsCRTvsnprintf

int EsCRTvsnprintf(char *buffer, size_t bufferSize, EsCString format, va_list arguments);

Writes a formatted string to the buffer using a va_list. Does not write more than bufferSize bytes.