NeoMutt  2024-12-12-14-g7b49f7
Teaching an old dog new tricks
DOXYGEN
Loading...
Searching...
No Matches
atoi.h
Go to the documentation of this file.
1
24#ifndef MUTT_MUTT_ATOI_H
25#define MUTT_MUTT_ATOI_H
26
27#include <stdbool.h>
28
29const char *mutt_str_atoi (const char *str, int *dst);
30const char *mutt_str_atol (const char *str, long *dst);
31const char *mutt_str_atos (const char *str, short *dst);
32const char *mutt_str_atoui (const char *str, unsigned int *dst);
33const char *mutt_str_atoul (const char *str, unsigned long *dst);
34const char *mutt_str_atoull(const char *str, unsigned long long *dst);
35const char *mutt_str_atous (const char *str, unsigned short *dst);
36
37#define make_str_ato_wrappers(flavour, type) \
38 static inline bool mutt_str_ato ## flavour ## _full(const char *src, type *dst) \
39 { \
40 const char * end = mutt_str_ato ## flavour(src, dst); \
41 return end && !*end; \
42 } \
43
47make_str_ato_wrappers(ui, unsigned int)
48make_str_ato_wrappers(ul, unsigned long)
49make_str_ato_wrappers(ull, unsigned long long)
50make_str_ato_wrappers(us, unsigned short)
51
52#endif /* MUTT_MUTT_ATOI_H */
const char * mutt_str_atoull(const char *str, unsigned long long *dst)
Convert ASCII string to an unsigned long long.
Definition: atoi.c:296
const char * mutt_str_atous(const char *str, unsigned short *dst)
Convert ASCII string to an unsigned short.
Definition: atoi.c:270
#define make_str_ato_wrappers(flavour, type)
Definition: atoi.h:37
const char * mutt_str_atol(const char *str, long *dst)
Convert ASCII string to a long.
Definition: atoi.c:143
const char * mutt_str_atoul(const char *str, unsigned long *dst)
Convert ASCII string to an unsigned long.
Definition: atoi.c:244
const char * mutt_str_atos(const char *str, short *dst)
Convert ASCII string to a short.
Definition: atoi.c:165
const char * mutt_str_atoui(const char *str, unsigned int *dst)
Convert ASCII string to an unsigned integer.
Definition: atoi.c:218
const char * mutt_str_atoi(const char *str, int *dst)
Convert ASCII string to an integer.
Definition: atoi.c:192