File: itoa_ljust.h

package info (click to toggle)
memcached 1.5.6-1.1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, buster, sid
  • size: 2,696 kB
  • sloc: ansic: 16,931; perl: 5,523; sh: 4,302; xml: 1,638; python: 393; makefile: 170
file content (28 lines) | stat: -rw-r--r-- 822 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#ifndef ITOA_LJUST_H
#define ITOA_LJUST_H

//=== itoa_ljust.h - Fast integer to ascii conversion
//
// Fast and simple integer to ASCII conversion:
//
//   - 32 and 64-bit integers
//   - signed and unsigned
//   - user supplied buffer must be large enough for all decimal digits
//     in value plus minus sign if negative
//   - left-justified
//   - NUL terminated
//   - return value is pointer to NUL terminator
//
// Copyright (c) 2016 Arturo Martin-de-Nicolas
// arturomdn@gmail.com
// https://github.com/amdn/itoa_ljust/
//===----------------------------------------------------------------------===//

#include <stdint.h>

char* itoa_u32(uint32_t u, char* buffer);
char* itoa_32( int32_t i, char* buffer);
char* itoa_u64(uint64_t u, char* buffer);
char* itoa_64( int64_t i, char* buffer);

#endif // ITOA_LJUST_H