• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 // Protocol Buffers - Google's data interchange format
2 // Copyright 2023 Google LLC.  All rights reserved.
3 //
4 // Use of this source code is governed by a BSD-style
5 // license that can be found in the LICENSE file or at
6 // https://developers.google.com/open-source/licenses/bsd
7 
8 #ifndef UPB_LEX_ATOI_H_
9 #define UPB_LEX_ATOI_H_
10 
11 #include <stdint.h>
12 
13 // Must be last.
14 #include "upb/port/def.inc"
15 
16 #ifdef __cplusplus
17 extern "C" {
18 #endif
19 
20 // We use these hand-written routines instead of strto[u]l() because the "long
21 // long" variants aren't in c89. Also our version allows setting a ptr limit.
22 // Return the new position of the pointer after parsing the int, or NULL on
23 // integer overflow.
24 
25 const char* upb_BufToUint64(const char* ptr, const char* end, uint64_t* val);
26 const char* upb_BufToInt64(const char* ptr, const char* end, int64_t* val,
27                            bool* is_neg);
28 
29 #ifdef __cplusplus
30 } /* extern "C" */
31 #endif
32 
33 #include "upb/port/undef.inc"
34 
35 #endif /* UPB_LEX_ATOI_H_ */
36