Wireshark 4.7.0
The Wireshark network protocol analyzer
Loading...
Searching...
No Matches
strtoi.h
Go to the documentation of this file.
1
13#ifndef _WS_STRTOI_H
14#define _WS_STRTOI_H
15
16#include <stdbool.h>
17#include <inttypes.h>
18
19#include "ws_symbol_export.h"
20
21#ifdef __cplusplus
22extern "C" {
23#endif /* __cplusplus */
24
37WS_DLL_PUBLIC bool ws_strtoi64(const char* str, const char** endptr, int64_t* cint);
38
49WS_DLL_PUBLIC bool ws_strtoi32(const char* str, const char** endptr, int32_t* cint);
50
61WS_DLL_PUBLIC bool ws_strtoi16(const char* str, const char** endptr, int16_t* cint);
62
73WS_DLL_PUBLIC bool ws_strtoi8 (const char* str, const char** endptr, int8_t* cint);
74
85WS_DLL_PUBLIC bool ws_strtoi (const char* str, const char** endptr, int* cint);
86
94WS_DLL_PUBLIC bool ws_strtou64(const char* str, const char** endptr, uint64_t* cint);
95
103WS_DLL_PUBLIC bool ws_strtou32(const char* str, const char** endptr, uint32_t* cint);
104
111WS_DLL_PUBLIC bool ws_strtou16(const char* str, const char** endptr, uint16_t* cint);
112
122WS_DLL_PUBLIC bool ws_strtou8 (const char* str, const char** endptr, uint8_t* cint);
123
132WS_DLL_PUBLIC bool ws_strtou (const char* str, const char** endptr, unsigned* cint);
133
146WS_DLL_PUBLIC bool ws_hexstrtou64(const char* str, const char** endptr, uint64_t* cint);
147
156WS_DLL_PUBLIC bool ws_hexstrtou32(const char* str, const char** endptr, uint32_t* cint);
157
166WS_DLL_PUBLIC bool ws_hexstrtou16(const char* str, const char** endptr, uint16_t* cint);
167
176WS_DLL_PUBLIC bool ws_hexstrtou8 (const char* str, const char** endptr, uint8_t* cint);
177
186WS_DLL_PUBLIC bool ws_hexstrtou (const char* str, const char** endptr, unsigned* cint);
187
204WS_DLL_PUBLIC bool ws_basestrtou64(const char* str, const char** endptr, uint64_t* cint, int base);
205
222WS_DLL_PUBLIC bool ws_basestrtou32(const char* str, const char** endptr, uint32_t* cint, int base);
223
240WS_DLL_PUBLIC bool ws_basestrtou16(const char* str, const char** endptr, uint16_t* cint, int base);
241
258WS_DLL_PUBLIC bool ws_basestrtou8 (const char* str, const char** endptr, uint8_t* cint, int base);
259
276WS_DLL_PUBLIC bool ws_basestrtou (const char* str, const char** endptr, unsigned* cint, int base);
277
304WS_DLL_PUBLIC bool ws_basebuftou64(const uint8_t* buf, size_t len, const uint8_t** endptr, uint64_t* cint, int base);
305
325WS_DLL_PUBLIC bool ws_buftou64(const uint8_t* buf, size_t len, const uint8_t** endptr, uint64_t* cint);
326
346WS_DLL_PUBLIC bool ws_hexbuftou64(const uint8_t* buf, size_t len, const uint8_t** endptr, uint64_t* cint);
347
363WS_DLL_PUBLIC bool ws_basebuftou32(const uint8_t* buf, size_t len, const uint8_t** endptr, uint32_t* cint, int base);
364
365
377WS_DLL_PUBLIC bool ws_buftou32(const uint8_t* buf, size_t len, const uint8_t** endptr, uint32_t* cint);
378
390WS_DLL_PUBLIC bool ws_hexbuftou32(const uint8_t* buf, size_t len, const uint8_t** endptr, uint32_t* cint);
391
402WS_DLL_PUBLIC bool ws_basebuftou16(const uint8_t* buf, size_t len, const uint8_t** endptr, uint16_t* cint, int base);
403
415WS_DLL_PUBLIC bool ws_buftou16(const uint8_t* buf, size_t len, const uint8_t** endptr, uint16_t* cint);
416
428WS_DLL_PUBLIC bool ws_hexbuftou16(const uint8_t* buf, size_t len, const uint8_t** endptr, uint16_t* cint);
429
440WS_DLL_PUBLIC bool ws_basebuftou8(const uint8_t* buf, size_t len, const uint8_t** endptr, uint8_t* cint, int base);
441
453WS_DLL_PUBLIC bool ws_buftou8(const uint8_t* buf, size_t len, const uint8_t** endptr, uint8_t* cint);
454
466WS_DLL_PUBLIC bool ws_hexbuftou8(const uint8_t* buf, size_t len, const uint8_t** endptr, uint8_t* cint);
467
492WS_DLL_PUBLIC bool ws_basebuftoi64(const uint8_t* buf, size_t len, const uint8_t** endptr, int64_t* cint, int base);
493
514WS_DLL_PUBLIC bool ws_buftoi64(const uint8_t* buf, size_t len, const uint8_t** endptr, int64_t* cint);
515
536WS_DLL_PUBLIC bool ws_hexbuftoi64(const uint8_t* buf, size_t len, const uint8_t** endptr, int64_t* cint);
537
549WS_DLL_PUBLIC bool ws_basebuftoi32(const uint8_t* buf, size_t len, const uint8_t** endptr, int32_t* cint, int base);
550
560WS_DLL_PUBLIC bool ws_buftoi32(const uint8_t* buf, size_t len, const uint8_t** endptr, int32_t* cint);
561
571WS_DLL_PUBLIC bool ws_hexbuftoi32(const uint8_t* buf, size_t len, const uint8_t** endptr, int32_t* cint);
572
583WS_DLL_PUBLIC bool ws_basebuftoi16(const uint8_t* buf, size_t len, const uint8_t** endptr, int16_t* cint, int base);
584
594WS_DLL_PUBLIC bool ws_buftoi16(const uint8_t* buf, size_t len, const uint8_t** endptr, int16_t* cint);
595
605WS_DLL_PUBLIC bool ws_hexbuftoi16(const uint8_t* buf, size_t len, const uint8_t** endptr, int16_t* cint);
606
617WS_DLL_PUBLIC bool ws_basebuftoi8(const uint8_t* buf, size_t len, const uint8_t** endptr, int8_t* cint, int base);
618
628WS_DLL_PUBLIC bool ws_buftoi8(const uint8_t* buf, size_t len, const uint8_t** endptr, int8_t* cint);
629
639WS_DLL_PUBLIC bool ws_hexbuftoi8(const uint8_t* buf, size_t len, const uint8_t** endptr, int8_t* cint);
640
641#ifdef __cplusplus
642}
643#endif /* __cplusplus */
644
645#endif
646
647/*
648 * Editor modelines - https://www.wireshark.org/tools/modelines.html
649 *
650 * Local variables:
651 * c-basic-offset: 4
652 * tab-width: 8
653 * indent-tabs-mode: t
654 * End:
655 *
656 * vi: set shiftwidth=4 tabstop=8 noexpandtab:
657 * :indentSize=4:tabSize=8:noTabs=false:
658 */
WS_DLL_PUBLIC bool ws_strtou32(const char *str, const char **endptr, uint32_t *cint)
Convert a decimal string to a 32-bit unsigned int, with error checks.
Definition strtoi.c:229
WS_DLL_PUBLIC bool ws_basebuftou64(const uint8_t *buf, size_t len, const uint8_t **endptr, uint64_t *cint, int base)
Convert a counted string (not necessarily null terminated, of the given length) in the specified base...
Definition strtoi.c:375
WS_DLL_PUBLIC bool ws_basebuftou32(const uint8_t *buf, size_t len, const uint8_t **endptr, uint32_t *cint, int base)
Parse a uint32_t from a byte buffer using a specified numeric base.
Definition strtoi.c:479
WS_DLL_PUBLIC bool ws_basebuftoi32(const uint8_t *buf, size_t len, const uint8_t **endptr, int32_t *cint, int base)
Parse an int32_t from a byte buffer using a specified numeric base.
Definition strtoi.c:612
WS_DLL_PUBLIC bool ws_basestrtou16(const char *str, const char **endptr, uint16_t *cint, int base)
Convert a string in the specified base to a 16-bit unsigned int, with error checks.
Definition strtoi.c:230
WS_DLL_PUBLIC bool ws_hexstrtou16(const char *str, const char **endptr, uint16_t *cint)
Convert a hexadecimal string to an 16-bit unsigned int, with error checks.
Definition strtoi.c:230
WS_DLL_PUBLIC bool ws_buftou8(const uint8_t *buf, size_t len, const uint8_t **endptr, uint8_t *cint)
Parse a uint8_t from a byte buffer in base 10.
Definition strtoi.c:481
WS_DLL_PUBLIC bool ws_hexbuftou32(const uint8_t *buf, size_t len, const uint8_t **endptr, uint32_t *cint)
Parse a uint32_t from a byte buffer in base 16 (hexadecimal).
Definition strtoi.c:479
WS_DLL_PUBLIC bool ws_strtoi64(const char *str, const char **endptr, int64_t *cint)
Convert a decimal string to a signed/unsigned int, with error checks.
Definition strtoi.c:23
WS_DLL_PUBLIC bool ws_basebuftou16(const uint8_t *buf, size_t len, const uint8_t **endptr, uint16_t *cint, int base)
Parse a uint16_t from a byte buffer using a specified numeric base.
Definition strtoi.c:480
WS_DLL_PUBLIC bool ws_buftoi16(const uint8_t *buf, size_t len, const uint8_t **endptr, int16_t *cint)
Parse an int16_t from a byte buffer in base 10.
Definition strtoi.c:613
WS_DLL_PUBLIC bool ws_strtoi16(const char *str, const char **endptr, int16_t *cint)
Convert a string to a 16-bit integer.
Definition strtoi.c:93
WS_DLL_PUBLIC bool ws_hexbuftoi8(const uint8_t *buf, size_t len, const uint8_t **endptr, int8_t *cint)
Parse an int8_t from a byte buffer in base 16 (hexadecimal).
Definition strtoi.c:614
WS_DLL_PUBLIC bool ws_basestrtou8(const char *str, const char **endptr, uint8_t *cint, int base)
Convert a string in the specified base to an 8-bit unsigned int, with error checks.
Definition strtoi.c:231
WS_DLL_PUBLIC bool ws_strtou8(const char *str, const char **endptr, uint8_t *cint)
Convert a decimal string to an unsigned int, with error checks.
Definition strtoi.c:231
WS_DLL_PUBLIC bool ws_buftoi32(const uint8_t *buf, size_t len, const uint8_t **endptr, int32_t *cint)
Parse an int32_t from a byte buffer in base 10.
Definition strtoi.c:612
WS_DLL_PUBLIC bool ws_basebuftoi8(const uint8_t *buf, size_t len, const uint8_t **endptr, int8_t *cint, int base)
Parse an int8_t from a byte buffer using a specified numeric base.
Definition strtoi.c:614
WS_DLL_PUBLIC bool ws_basestrtou(const char *str, const char **endptr, unsigned *cint, int base)
Convert a string in the specified base to an unsigned int, with error checks.
Definition strtoi.c:233
WS_DLL_PUBLIC bool ws_basebuftoi64(const uint8_t *buf, size_t len, const uint8_t **endptr, int64_t *cint, int base)
Convert a counted string (not necessarily null terminated, of the given length) in the specified base...
Definition strtoi.c:483
WS_DLL_PUBLIC bool ws_strtou(const char *str, const char **endptr, unsigned *cint)
Convert a decimal string to an unsigned int, with error checks.
Definition strtoi.c:263
WS_DLL_PUBLIC bool ws_hexbuftoi64(const uint8_t *buf, size_t len, const uint8_t **endptr, int64_t *cint)
Convert a counted hexadecimal string (not necessarily null terminated, of the given length) to a sign...
Definition strtoi.c:566
WS_DLL_PUBLIC bool ws_strtou16(const char *str, const char **endptr, uint16_t *cint)
Convert a decimal string to an unsigned int, with error checks.
Definition strtoi.c:230
WS_DLL_PUBLIC bool ws_strtoi(const char *str, const char **endptr, int *cint)
Convert a string to an integer.
Definition strtoi.c:96
WS_DLL_PUBLIC bool ws_hexbuftou64(const uint8_t *buf, size_t len, const uint8_t **endptr, uint64_t *cint)
Convert a counted hexadecimal string (not necessarily null terminated, of the given length) to an uns...
Definition strtoi.c:442
WS_DLL_PUBLIC bool ws_basebuftoi16(const uint8_t *buf, size_t len, const uint8_t **endptr, int16_t *cint, int base)
Parse an int16_t from a byte buffer using a specified numeric base.
Definition strtoi.c:613
WS_DLL_PUBLIC bool ws_hexstrtou8(const char *str, const char **endptr, uint8_t *cint)
Convert a hexadecimal string in the specified base to an 8-bit unsigned int, with error checks.
Definition strtoi.c:231
WS_DLL_PUBLIC bool ws_hexbuftou8(const uint8_t *buf, size_t len, const uint8_t **endptr, uint8_t *cint)
Parse a uint8_t from a byte buffer in base 16 (hexadecimal).
Definition strtoi.c:481
WS_DLL_PUBLIC bool ws_basestrtou32(const char *str, const char **endptr, uint32_t *cint, int base)
Convert a string in the specified base to a 32-bit unsigned int, with error checks.
Definition strtoi.c:229
WS_DLL_PUBLIC bool ws_hexbuftoi16(const uint8_t *buf, size_t len, const uint8_t **endptr, int16_t *cint)
Parse an int16_t from a byte buffer in base 16 (hexadecimal).
Definition strtoi.c:613
WS_DLL_PUBLIC bool ws_hexstrtou(const char *str, const char **endptr, unsigned *cint)
Convert a hexadecimal string to an unsigned int, with error checks.
Definition strtoi.c:268
WS_DLL_PUBLIC bool ws_basebuftou8(const uint8_t *buf, size_t len, const uint8_t **endptr, uint8_t *cint, int base)
Parse a uint8_t from a byte buffer using a specified numeric base.
Definition strtoi.c:481
WS_DLL_PUBLIC bool ws_strtoi32(const char *str, const char **endptr, int32_t *cint)
Convert a string to an integer of specified size.
Definition strtoi.c:92
WS_DLL_PUBLIC bool ws_buftou32(const uint8_t *buf, size_t len, const uint8_t **endptr, uint32_t *cint)
Parse a uint32_t from a byte buffer in base 10.
Definition strtoi.c:479
WS_DLL_PUBLIC bool ws_hexstrtou32(const char *str, const char **endptr, uint32_t *cint)
Convert a hexadecimal string to an 32-bit unsigned int, with error checks.
Definition strtoi.c:229
WS_DLL_PUBLIC bool ws_buftoi64(const uint8_t *buf, size_t len, const uint8_t **endptr, int64_t *cint)
Convert a counted decimal string (not necessarily null terminated, of the given length) to a signed 6...
Definition strtoi.c:561
WS_DLL_PUBLIC bool ws_buftoi8(const uint8_t *buf, size_t len, const uint8_t **endptr, int8_t *cint)
Parse an int8_t from a byte buffer in base 10.
Definition strtoi.c:614
WS_DLL_PUBLIC bool ws_hexbuftoi32(const uint8_t *buf, size_t len, const uint8_t **endptr, int32_t *cint)
Parse an int32_t from a byte buffer in base 16 (hexadecimal).
Definition strtoi.c:612
WS_DLL_PUBLIC bool ws_hexstrtou64(const char *str, const char **endptr, uint64_t *cint)
Convert a hexadecimal string to an unsigned int, with error checks.
Definition strtoi.c:192
WS_DLL_PUBLIC bool ws_basestrtou64(const char *str, const char **endptr, uint64_t *cint, int base)
Convert a string in the specified base to a 64-bit unsigned int, with error checks.
Definition strtoi.c:140
WS_DLL_PUBLIC bool ws_hexbuftou16(const uint8_t *buf, size_t len, const uint8_t **endptr, uint16_t *cint)
Parse a uint16_t from a byte buffer in base 16 (hexadecimal).
Definition strtoi.c:480
WS_DLL_PUBLIC bool ws_strtou64(const char *str, const char **endptr, uint64_t *cint)
Convert a decimal string to a 64-bit unsigned int, with error checks.
Definition strtoi.c:187
WS_DLL_PUBLIC bool ws_strtoi8(const char *str, const char **endptr, int8_t *cint)
Convert a string to an 8-bit integer.
Definition strtoi.c:94
WS_DLL_PUBLIC bool ws_buftou16(const uint8_t *buf, size_t len, const uint8_t **endptr, uint16_t *cint)
Parse a uint16_t from a byte buffer in base 10.
Definition strtoi.c:480
WS_DLL_PUBLIC bool ws_buftou64(const uint8_t *buf, size_t len, const uint8_t **endptr, uint64_t *cint)
Convert a counted decimal string (not necessarily null terminated, of the given length) to an unsigne...
Definition strtoi.c:437