stdlib.h(3avr)
π stdlib.h π
okay bestie, gather round, because today we're doing stdlib.h from the AVR-LibC manual (that's the 3avr section, iykyk). this is the standard library header that's basically the utility belt of your AVR C adventures β memory, math-ish conversions, random numbers, exiting with drama. it's giving backbone of your program, no cap. π«Ά
β¨ NAME β¨
stdlib.h β the header. that's it. that's the name. iconic, minimal, slay. π
π SYNOPSIS π
π Data Structures
struct div_tstruct ldiv_t
π Macros
#define RAND_MAX 0x7FFF
π¦ Typedefs
typedef int(* __compar_fn_t) (const void *, const void *)
π Functions
the whole squad, fr fr:
void abort (void)
int abs (int __i)
long labs (long __i)
void * bsearch (const void *__key, const void *__base, size_t __nmemb, size_t __size, int(*__compar)(const void *, const void *))
div_t div (int __num, int __denom) __asm__('__divmodhi4')
ldiv_t ldiv (long __num, long __denom) __asm__('__divmodsi4')
void qsort (void *__base, size_t __nmemb, size_t __size, __compar_fn_t __compar)
long strtol (const char *__nptr, char **__endptr, int __base)
unsigned long strtoul (const char *__nptr, char **__endptr, int __base)
long atol (const char *__s)
int atoi (const char *__s)
void exit (int __status)
void * malloc (size_t __size)
void free (void *__ptr)
void * calloc (size_t __nele, size_t __size)
void * realloc (void *__ptr, size_t __size)
float strtof (const char *__nptr, char **__endptr)
double strtod (const char *__nptr, char **__endptr)
long double strtold (const char *__nptr, char **__endptr)
int atexit (void(*func)(void))
float atoff (const char *__nptr)
double atof (const char *__nptr)
long double atofl (const char *__nptr)
int rand (void)
void srand (unsigned int __seed)
int rand_r (unsigned long *__ctx)
π Variables
size_t __malloc_marginchar * __malloc_heap_startchar * __malloc_heap_end
π₯ Non-standard (i.e. non-ISO C) functions.
bestie these are the extra ones, the bonus tracks, the deluxe edition π:
#define RANDOM_MAX 0x7FFFFFFF
char * itoa (int val, char *s, int radix)
char * ltoa (long val, char *s, int radix)
char * utoa (unsigned int val, char *s, int radix)
char * ultoa (unsigned long val, char *s, int radix)
long random (void)
void srandom (unsigned long __seed)
long random_r (unsigned long *__ctx)
π§ Conversion functions for double arguments.
the float-to-string girlies, plus the flags that control their whole vibe β¨:
#define DTOSTR_ALWAYS_SIGN 0x01 /* put '+' or ' ' for positives */
#define DTOSTR_PLUS_SIGN 0x02 /* put '+' rather than ' ' */
#define DTOSTR_UPPERCASE 0x04 /* put 'E' rather 'e' */
#define EXIT_SUCCESS 0
#define EXIT_FAILURE 1
char * ftostre (float __val, char *__s, unsigned char __prec, unsigned char __flags)
char * dtostre (double __val, char *__s, unsigned char __prec, unsigned char __flags)
char * ldtostre (long double __val, char *__s, unsigned char __prec, unsigned char __flags)
char * ftostrf (float __val, signed char __width, unsigned char __prec, char *__s)
char * dtostrf (double __val, signed char __width, unsigned char __prec, char *__s)
char * ldtostrf (long double __val, signed char __width, unsigned char __prec, char *__s)
lowkey obsessed with howDTOSTR_ALWAYS_SIGNputs'+'or' 'for positives,DTOSTR_PLUS_SIGNputs'+'rather than' ', andDTOSTR_UPPERCASEputs'E'rather'e'. three tiny flags, maximum control. periodt. π
πΈ Author πΈ
Generated automatically by Doxygen for AVR-LibC from the source code. so technically the author is a robot π€ but honestly? she ate.
and that's the whole page, bestie!! go forth and malloc responsibly π«Άβ¨
this was AVR-LibC, Version 2.2.1, serving stdlib.h in section 3avr β catch you in the next manpage, mwah πππ¦
π¦ where this page comes from
- debian trixie: avr-libc 1:2.2.1-1 Β· BSD-3-Clause
- ubuntu questing: avr-libc 1:2.2.1-1
- ubuntu resolute: avr-libc 1:2.2.1-1build1 Β· BSD-3-Clause
- ubuntu stonking: avr-libc 1:2.2.1-1build1 Β· BSD-3-Clause
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms