SyterKit 0.4.0.x
SyterKit is a bare-metal framework
Loading...
Searching...
No Matches
Functions
sstdlib.h File Reference
#include <types.h>
Include dependency graph for sstdlib.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

unsigned long simple_strtoul (const char *cp, char **endp, unsigned int base)
 Convert a string to an unsigned long integer, with optional base detection.
 
unsigned long long simple_strtoull (const char *cp, char **endp, unsigned int base)
 Convert a string to an unsigned long long integer, with optional base detection.
 
unsigned long simple_hextoul (const char *cp, char **endp)
 Convert a string in hexadecimal format to an unsigned long integer.
 
unsigned long simple_dectoul (const char *cp, char **endp)
 Convert a string in decimal format to an unsigned long integer.
 
long simple_strtol (const char *cp, char **endp, unsigned int base)
 Convert a string to a long integer, with optional base detection.
 
unsigned long simple_ustrtoul (const char *cp, char **endp, unsigned int base)
 Convert a string to an unsigned long integer, with optional base detection, for unsigned strings.
 
unsigned long long simple_ustrtoull (const char *cp, char **endp, unsigned int base)
 Convert a string to an unsigned long long integer, with optional base detection, for unsigned strings.
 
long long simple_strtoll (const char *cp, char **endp, unsigned int base)
 Convert a string to a long long integer, with optional base detection.
 
long trailing_strtoln_end (const char *str, const char *end, char const **endp)
 Convert a string to a long integer, with trailing string checking.
 
long trailing_strtoln (const char *str, const char *end)
 Convert a string to a long integer, with trailing string checking.
 
long trailing_strtol (const char *str)
 Convert a string to a long integer.
 
void str_to_upper (const char *in, char *out, size_t len)
 Convert a string to uppercase.
 
char * ltoa (long int num, char *str, int base)
 Convert a long integer to a string representation.
 
int simple_atoi (const char *nptr)
 Convert a string to an integer.
 
long long simple_atoll (const char *nptr)
 Convert a string to a long long integer.
 
int simple_abs (int n)
 Calculate the absolute value of an integer.
 

Function Documentation

◆ ltoa()

char * ltoa ( long int  num,
char *  str,
int  base 
)

Convert a long integer to a string representation.

Parameters
numThe input long integer value.
strThe output string to store the converted value.
baseThe number base to use for conversion.
Returns
A pointer to the output string.

◆ simple_abs()

int simple_abs ( int  n)

Calculate the absolute value of an integer.

Parameters
nThe input integer.
Returns
The absolute value of the input integer.

◆ simple_atoi()

int simple_atoi ( const char *  nptr)

Convert a string to an integer.

Parameters
nptrThe input string.
Returns
The converted integer value.

◆ simple_atoll()

long long simple_atoll ( const char *  nptr)

Convert a string to a long long integer.

Parameters
nptrThe input string.
Returns
The converted long long integer value.

◆ simple_dectoul()

unsigned long simple_dectoul ( const char *  cp,
char **  endp 
)

Convert a string in decimal format to an unsigned long integer.

Parameters
cpThe input string.
endpA pointer to the character after the last parsed character.
Returns
The converted unsigned long integer value.

◆ simple_hextoul()

unsigned long simple_hextoul ( const char *  cp,
char **  endp 
)

Convert a string in hexadecimal format to an unsigned long integer.

Parameters
cpThe input string.
endpA pointer to the character after the last parsed character.
Returns
The converted unsigned long integer value.

◆ simple_strtol()

long simple_strtol ( const char *  cp,
char **  endp,
unsigned int  base 
)

Convert a string to a long integer, with optional base detection.

Parameters
cpThe input string.
endpA pointer to the character after the last parsed character.
baseThe number base to use for conversion.
Returns
The converted long integer value.

◆ simple_strtoll()

long long simple_strtoll ( const char *  cp,
char **  endp,
unsigned int  base 
)

Convert a string to a long long integer, with optional base detection.

Parameters
cpThe input string.
endpA pointer to the character after the last parsed character.
baseThe number base to use for conversion.
Returns
The converted long long integer value.

◆ simple_strtoul()

unsigned long simple_strtoul ( const char *  cp,
char **  endp,
unsigned int  base 
)

Convert a string to an unsigned long integer, with optional base detection.

Parameters
cpThe input string.
endpA pointer to the character after the last parsed character.
baseThe number base to use for conversion.
Returns
The converted unsigned long integer value.

◆ simple_strtoull()

unsigned long long simple_strtoull ( const char *  cp,
char **  endp,
unsigned int  base 
)

Convert a string to an unsigned long long integer, with optional base detection.

Parameters
cpThe input string.
endpA pointer to the character after the last parsed character.
baseThe number base to use for conversion.
Returns
The converted unsigned long long integer value.

◆ simple_ustrtoul()

unsigned long simple_ustrtoul ( const char *  cp,
char **  endp,
unsigned int  base 
)

Convert a string to an unsigned long integer, with optional base detection, for unsigned strings.

Parameters
cpThe input string.
endpA pointer to the character after the last parsed character.
baseThe number base to use for conversion.
Returns
The converted unsigned long integer value.

◆ simple_ustrtoull()

unsigned long long simple_ustrtoull ( const char *  cp,
char **  endp,
unsigned int  base 
)

Convert a string to an unsigned long long integer, with optional base detection, for unsigned strings.

Parameters
cpThe input string.
endpA pointer to the character after the last parsed character.
baseThe number base to use for conversion.
Returns
The converted unsigned long long integer value.

◆ str_to_upper()

void str_to_upper ( const char *  in,
char *  out,
size_t  len 
)

Convert a string to uppercase.

Parameters
inThe input string.
outThe output string to store the uppercase characters.
lenThe length of the input string.

◆ trailing_strtol()

long trailing_strtol ( const char *  str)

Convert a string to a long integer.

Parameters
strThe input string.
Returns
The converted long integer value.

◆ trailing_strtoln()

long trailing_strtoln ( const char *  str,
const char *  end 
)

Convert a string to a long integer, with trailing string checking.

Parameters
strThe input string.
endThe trailing string to check for.
Returns
The converted long integer value.

◆ trailing_strtoln_end()

long trailing_strtoln_end ( const char *  str,
const char *  end,
char const **  endp 
)

Convert a string to a long integer, with trailing string checking.

Parameters
strThe input string.
endThe trailing string to check for.
endpA pointer to the character after the last parsed character.
Returns
The converted long integer value.