1 /*BEGIN_LEGAL
2 
3 Copyright (c) 2018 Intel Corporation
4 
5   Licensed under the Apache License, Version 2.0 (the "License");
6   you may not use this file except in compliance with the License.
7   You may obtain a copy of the License at
8 
9       http://www.apache.org/licenses/LICENSE-2.0
10 
11   Unless required by applicable law or agreed to in writing, software
12   distributed under the License is distributed on an "AS IS" BASIS,
13   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14   See the License for the specific language governing permissions and
15   limitations under the License.
16 
17 END_LEGAL */
18 /// @file xed-util.h
19 ///
20 
21 
22 
23 #ifndef XED_UTIL_PRIVATE_H
24 # define XED_UTIL_PRIVATE_H
25 
26 #include "xed-common-hdrs.h"
27 #include "xed-types.h"
28 #include "xed-portability.h"
29 #include "xed-util.h"
30 
31 /* copy from src to dst, downcasing bytes as the copy proceeds. len is the
32  * available space in the buffer*/
33 int xed_strncat_lower(char* dst, const char* src, int len);
34 
35 int xed_itoa_signed(char* buf, xed_int64_t f, int buflen);
36 
37 char xed_to_ascii_hex_nibble(xed_uint_t x, xed_bool_t lowercase);
38 
39 int xed_sprintf_uint8_hex(char* buf, xed_uint8_t x, int buflen);
40 int xed_sprintf_uint16_hex(char* buf, xed_uint16_t x, int buflen);
41 int xed_sprintf_uint32_hex(char* buf, xed_uint32_t x, int buflen);
42 int xed_sprintf_uint64_hex(char* buf, xed_uint64_t x, int buflen);
43 int xed_sprintf_uint8(char* buf, xed_uint8_t x, int buflen);
44 int xed_sprintf_uint16(char* buf, xed_uint16_t x, int buflen);
45 int xed_sprintf_uint32(char* buf, xed_uint32_t x, int buflen);
46 int xed_sprintf_uint64(char* buf, xed_uint64_t x, int buflen);
47 int xed_sprintf_int8(char* buf, xed_int8_t x, int buflen);
48 int xed_sprintf_int16(char* buf, xed_int16_t x, int buflen);
49 int xed_sprintf_int32(char* buf, xed_int32_t x, int buflen);
50 int xed_sprintf_int64(char* buf, xed_int64_t x, int buflen);
51 
52 void xed_derror(const char* s);
53 void xed_dwarn(const char* s);
54 
55 
56 #endif
57