TizenRT Libs&Environment  v2.0 M2

Provides APIs for Standard Library{. More...

Collaboration diagram for STDLIB:

Macros

#define atoi(nptr)   strtol((nptr), NULL, 10)
 convert a string to an integer More...
 
#define atol(nptr)   strtol((nptr), NULL, 10)
 convert a string to a long integer More...
 
#define atoll(nptr)   strtoll((nptr), NULL, 10)
 convert a string to a long integer More...
 
#define atof(nptr)   strtod((nptr), NULL)
 convert a string to a double-precision number More...
 

Functions

void srand (unsigned int seed)
 initialize random number generator More...
 
int rand (void)
 pseudo-random number generator More...
 
long random (void)
 pseudo-random number generator More...
 
FAR char * get_environ_ptr (size_t *envsize)
 Return a pointer to the thread specific environ variable. More...
 
FAR char * getenv (FAR const char *name)
 get value of an environment variable More...
 
int putenv (FAR const char *string)
 change or add a value to an environment More...
 
int clearenv (void)
 clears the environment of all name-value pairs and sets the value of the external variable environ to NULL More...
 
int setenv (const char *name, const char *value, int overwrite)
 add or change environment variable More...
 
int unsetenv (const char *name)
 remove an environment variable More...
 
void exit (int status) noreturn_function
 terminate a process More...
 
void abort (void) noreturn_function
 generate an abnormal process abort More...
 
int atexit (CODE void(*func)(void))
 register a function to run at process termination More...
 
int on_exit (CODE void(*func)(int, FAR void *), FAR void *arg)
 register a function to be called at program exit More...
 
long strtol (const char *, char **, int)
 convert a string to a long integer More...
 
unsigned long strtoul (const char *, char **, int)
 convert a string to an unsigned long More...
 
long long strtoll (const char *, char **, int)
 convert a string to a long integer More...
 
unsigned long long strtoull (const char *, char **, int)
 convert a string to an unsigned long More...
 
double strtod (FAR const char *str, FAR char **endptr)
 convert a string to a double-precision number More...
 
char * itoa (int value, char *str, int base)
 convert integer to string More...
 
FAR void * malloc (size_t)
 a memory allocator More...
 
void free (FAR void *)
 free allocated memory More...
 
FAR void * realloc (FAR void *, size_t)
 memory reallocator More...
 
FAR void * memalign (size_t, size_t)
 allocates size bytes and returns a pointer to the allocated memory More...
 
FAR void * zalloc (size_t)
 Allocate and zero memory from the user heap. More...
 
FAR void * calloc (size_t, size_t)
 a memory allocator More...
 
int abs (int j)
 return an integer absolute value More...
 
long int labs (long int j)
 return a long integer absolute value More...
 
long long int llabs (long long int j)
 return a long integer absolute value More...
 
div_t div (int numer, int denom)
 compute the quotient and remainder of an integer division More...
 
FAR char * mktemp (FAR char *path_template)
 generates a unique temporary filename from template. More...
 
int mkstemp (FAR char *path_template)
 create a regular file with a unique name derived from template and return a file descriptor for the file open for reading and writing. More...
 
void qsort (void *base, size_t nmemb, size_t size, int(*compar)(const void *, const void *))
 sort a table of data More...
 
FAR void * bsearch (FAR const void *key, FAR const void *base, size_t nel, size_t width, CODE int(*compar)(FAR const void *, FAR const void *))
 binary search a sorted table More...
 
struct mallinfo mallinfo (void)
 returns a copy of updated current heap information for the user heap More...
 
int access (FAR const char *path, int amode)
 determine accessibility of a file descriptor More...
 

Detailed Description

Provides APIs for Standard Library

{.

Macro Definition Documentation

#define atof (   nptr)    strtod((nptr), NULL)

convert a string to a double-precision number

#include <stdlib.h>
POSIX API (refer to : http://pubs.opengroup.org/onlinepubs/9699919799/)

Since
TizenRT v1.0

Definition at line 412 of file stdlib.h.

#define atoi (   nptr)    strtol((nptr), NULL, 10)

convert a string to an integer

#include <stdlib.h>
POSIX API (refer to : http://pubs.opengroup.org/onlinepubs/9699919799/)

Since
TizenRT v1.0

Definition at line 386 of file stdlib.h.

#define atol (   nptr)    strtol((nptr), NULL, 10)

convert a string to a long integer

#include <stdlib.h>
POSIX API (refer to : http://pubs.opengroup.org/onlinepubs/9699919799/)

Since
TizenRT v1.0

Definition at line 394 of file stdlib.h.

#define atoll (   nptr)    strtoll((nptr), NULL, 10)

convert a string to a long integer

#include <stdlib.h>
POSIX API (refer to : http://pubs.opengroup.org/onlinepubs/9699919799/)

Since
TizenRT v1.0

Definition at line 403 of file stdlib.h.

Function Documentation

void abort ( void  )

generate an abnormal process abort

#include <stdlib.h>
POSIX API (refer to : http://pubs.opengroup.org/onlinepubs/9699919799/)

Since
TizenRT v1.0
int abs ( int  j)

return an integer absolute value

#include <stdlib.h>
POSIX API (refer to : http://pubs.opengroup.org/onlinepubs/9699919799/)

Since
TizenRT v1.0
int access ( FAR const char *  path,
int  amode 
)

determine accessibility of a file descriptor

#include <unistd.h>
POSIX API (refer to : http://pubs.opengroup.org/onlinepubs/9699919799/)

Since
TizenRT v1.1
int atexit ( CODE void(*)(void)  func)

register a function to run at process termination

#include <stdlib.h>
SYSTEM CALL API
POSIX API (refer to : http://pubs.opengroup.org/onlinepubs/9699919799/)

Since
TizenRT v1.0
FAR void* bsearch ( FAR const void *  key,
FAR const void *  base,
size_t  nel,
size_t  width,
CODE int(*)(FAR const void *, FAR const void *)  compar 
)

binary search a sorted table

#include <stdlib.h>
POSIX API (refer to : http://pubs.opengroup.org/onlinepubs/9699919799/)

Since
TizenRT v1.1
FAR void* calloc ( size_t  ,
size_t   
)

a memory allocator

#include <stdlib.h>
POSIX API (refer to : http://pubs.opengroup.org/onlinepubs/9699919799/)

Since
TizenRT v1.0
int clearenv ( void  )

clears the environment of all name-value pairs and sets the value of the external variable environ to NULL

#include <stdlib.h>
SYSTEM CALL API

Since
TizenRT v1.0
div_t div ( int  numer,
int  denom 
)

compute the quotient and remainder of an integer division

#include <stdlib.h>
POSIX API (refer to : http://pubs.opengroup.org/onlinepubs/9699919799/)

Since
TizenRT v1.1
void exit ( int  status)

terminate a process

#include <stdlib.h>
SYSTEM CALL API
POSIX API (refer to : http://pubs.opengroup.org/onlinepubs/9699919799/)

Since
TizenRT v1.0
void free ( FAR void *  )

free allocated memory

#include <stdlib.h>
POSIX API (refer to : http://pubs.opengroup.org/onlinepubs/9699919799/)

Since
TizenRT v1.0
FAR char* get_environ_ptr ( size_t *  envsize)

Return a pointer to the thread specific environ variable.

#include <stdlib.h>
This API is not a standard API. But another APIs which are related to ENV are in Stdlib, so this API is in Stdlib for ease.

Parameters
[in]envsizeA pointer to notify a size of environ variable
Returns
A pointer to the current thread environ variable
Since
TizenRT v1.0
FAR char* getenv ( FAR const char *  name)

get value of an environment variable

#include <stdlib.h>
SYSTEM CALL API
POSIX API (refer to : http://pubs.opengroup.org/onlinepubs/9699919799/)

Since
TizenRT v1.0
char* itoa ( int  value,
char *  str,
int  base 
)

convert integer to string

#include <stdlib.h>

Parameters
[in]valueInteger value
[out]strString where store the result
[in]baseNumerical base
Returns
A pointer to the resulting null-terminated string, same as parameter str.
Since
TizenRT v1.0
long int labs ( long int  j)

return a long integer absolute value

#include <stdlib.h>
POSIX API (refer to : http://pubs.opengroup.org/onlinepubs/9699919799/)

Since
TizenRT v1.0
long long int llabs ( long long int  j)

return a long integer absolute value

#include <stdlib.h>
POSIX API (refer to : http://pubs.opengroup.org/onlinepubs/9699919799/)

Since
TizenRT v1.0
struct mallinfo mallinfo ( void  )

returns a copy of updated current heap information for the user heap

#include <stdlib.h>

Returns
Current mallinfo structure returned.
Since
TizenRT v1.0
FAR void* malloc ( size_t  )

a memory allocator

#include <stdlib.h>
POSIX API (refer to : http://pubs.opengroup.org/onlinepubs/9699919799/)

Since
TizenRT v1.0
FAR void* memalign ( size_t  ,
size_t   
)

allocates size bytes and returns a pointer to the allocated memory

#include <stdlib.h>

Parameters
[in]alignmentA power of two
[in]sizeAllocated memory size
Returns
On success, A pointer to the allocated memory is returned. On failure, NULL is returned.
Since
TizenRT v1.0
int mkstemp ( FAR char *  path_template)

create a regular file with a unique name derived from template and return a file descriptor for the file open for reading and writing.

#include <stdlib.h>
POSIX API (refer to : http://pubs.opengroup.org/onlinepubs/9699919799/)

Since
TizenRT v2.0
FAR char* mktemp ( FAR char *  path_template)

generates a unique temporary filename from template.

#include <stdlib.h>

Returns
always returns template.
Since
TizenRT v2.0
int on_exit ( CODE void(*)(int, FAR void *)  func,
FAR void *  arg 
)

register a function to be called at program exit

#include <stdlib.h>
SYSTEM CALL API

Parameters
[in]funcA pointer to the function to be called when the task exits.
[in]argAn argument that will be provided to the on_exit() function when the task exits.
Returns
On success, 0 is returned. On failure, none-zero is returned.
Since
TizenRT v1.0
int putenv ( FAR const char *  string)

change or add a value to an environment

#include <stdlib.h>
SYSTEM CALL API
POSIX API (refer to : http://pubs.opengroup.org/onlinepubs/9699919799/)

Since
TizenRT v1.0
void qsort ( void *  base,
size_t  nmemb,
size_t  size,
int(*)(const void *, const void *)  compar 
)

sort a table of data

#include <stdlib.h>
POSIX API (refer to : http://pubs.opengroup.org/onlinepubs/9699919799/)

Since
TizenRT v1.0
int rand ( void  )

pseudo-random number generator

#include <stdlib.h>
POSIX API (refer to : http://pubs.opengroup.org/onlinepubs/9699919799/)

Since
TizenRT v1.0
long random ( void  )

pseudo-random number generator

#include <stdlib.h>
POSIX API (refer to : http://pubs.opengroup.org/onlinepubs/9699919799/)

Since
TizenRT v2.0
FAR void* realloc ( FAR void *  ,
size_t   
)

memory reallocator

#include <stdlib.h>
POSIX API (refer to : http://pubs.opengroup.org/onlinepubs/9699919799/)

Since
TizenRT v1.0
int setenv ( const char *  name,
const char *  value,
int  overwrite 
)

add or change environment variable

#include <stdlib.h>
SYSTEM CALL API
POSIX API (refer to : http://pubs.opengroup.org/onlinepubs/9699919799/)

Since
TizenRT v1.0
void srand ( unsigned int  seed)

initialize random number generator

#include <stdlib.h>

Parameters
[in]seedAn integer value to be used as seed
Returns
none
Since
TizenRT v1.0
double strtod ( FAR const char *  str,
FAR char **  endptr 
)

convert a string to a double-precision number

#include <stdlib.h>
POSIX API (refer to : http://pubs.opengroup.org/onlinepubs/9699919799/)

Since
TizenRT v1.0
long strtol ( const char *  ,
char **  ,
int   
)

convert a string to a long integer

#include <stdlib.h>
POSIX API (refer to : http://pubs.opengroup.org/onlinepubs/9699919799/)

Since
TizenRT v1.0
long long strtoll ( const char *  ,
char **  ,
int   
)

convert a string to a long integer

#include <stdlib.h>
POSIX API (refer to : http://pubs.opengroup.org/onlinepubs/9699919799/)

Since
TizenRT v1.0
unsigned long strtoul ( const char *  ,
char **  ,
int   
)

convert a string to an unsigned long

#include <stdlib.h>
POSIX API (refer to : http://pubs.opengroup.org/onlinepubs/9699919799/)

Since
TizenRT v1.0
unsigned long long strtoull ( const char *  ,
char **  ,
int   
)

convert a string to an unsigned long

#include <stdlib.h>
POSIX API (refer to : http://pubs.opengroup.org/onlinepubs/9699919799/)

Since
TizenRT v1.0
int unsetenv ( const char *  name)

remove an environment variable

#include <stdlib.h>
SYSTEM CALL API
POSIX API (refer to : http://pubs.opengroup.org/onlinepubs/9699919799/)

Since
TizenRT v1.0
FAR void* zalloc ( size_t  )

Allocate and zero memory from the user heap.

#include <stdlib.h>

Parameters
[in]sizeSize (in bytes) of the memory region to be allocated.
Returns
On success, A pointer to the allocated memory is returned. On failure, NULL is returned.
Since
TizenRT v1.0