| Wireshark 4.7.3 The Wireshark network protocol analyzer

Loading...
Searching...
No Matches
strtoi.h
Go to the documentation of this file.
1
12
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
22 extern "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_strtou32
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_basebuftou64
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_basebuftou32
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_basebuftoi32
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_basestrtou16
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_hexstrtou16
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_buftou8
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_hexbuftou32
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_strtoi64
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_basebuftou16
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_buftoi16
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_strtoi16
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_hexbuftoi8
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_basestrtou8
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_strtou8
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_buftoi32
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_basebuftoi8
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_basestrtou
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_basebuftoi64
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_strtou
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_hexbuftoi64
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_strtou16
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_strtoi
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_hexbuftou64
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_basebuftoi16
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_hexstrtou8
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_hexbuftou8
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_basestrtou32
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_hexbuftoi16
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_hexstrtou
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_basebuftou8
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_strtoi32
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_buftou32
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_hexstrtou32
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_buftoi64
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_buftoi8
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_hexbuftoi32
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_hexstrtou64
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_basestrtou64
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_hexbuftou16
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_strtou64
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_strtoi8
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_buftou16
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_buftou64
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