-
-
Notifications
You must be signed in to change notification settings - Fork 45
/
append.h
143 lines (123 loc) · 4.3 KB
/
append.h
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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
/*
* Header file for string appending functions.
*
* Copyright 2020 by Gray Watson
*
* This file is part of the dmalloc package.
*
* Permission to use, copy, modify, and distribute this software for
* any purpose and without fee is hereby granted, provided that the
* above copyright notice and this permission notice appear in all
* copies, and that the name of Gray Watson not be used in advertising
* or publicity pertaining to distribution of the document or software
* without specific, written prior permission.
*
* Gray Watson makes no representations about the suitability of the
* software described herein for any purpose. It is provided "as is"
* without express or implied warranty.
*
* The author may be contacted via https://dmalloc.com/
*/
#ifndef __APPENDER_H__
#define __APPENDER_H__
#if HAVE_STDARG_H
# include <stdarg.h> /* for ... */
#endif
#if HAVE_STDIO_H
# include <stdio.h> /* for FILE */
#endif
#include "conf.h"
/*<<<<<<<<<< The below prototypes are auto-generated by fillproto */
/*
* Append string argument to destination up to limit pointer. Pointer
* to the end of the characters added will be returned. No \0
* character will be added.
*/
extern
char *append_string(char *dest, const char *limit, const char *value);
/*
* Append long value argument to destination up to limit pointer.
* Pointer to the end of the added characters will be returned. No \0
* character will be added. Variant of itoa() written by Lukas
* Chmela which is released under GPLv3.
*/
extern
char *append_long(char *dest, char *limit, long value, int base);
/*
* Append unsigned long value argument to destination up to limit
* pointer. Pointer to the end of the added characters will be
* returned. No \0 character will be added. Variant of itoa()
* written by Lukas Chmela. Released under GPLv3.
*/
extern
char *append_ulong(char *dest, char *limit, unsigned long value, int base);
/*
* Append pointer value argument to destination up to limit pointer.
* Pointer to the end of the added characters will be returned. No \0
* character will be added. Variant of itoa() written by Lukas
* Chmela which is released under GPLv3.
*/
extern
char *append_pointer(char *dest, char *limit, PNT_ARITH_TYPE value, int base);
/*
* Append a varargs format to destination. Pointer to the end of the
* characters added will be returned. No \0 character will be added.
*/
extern
char *append_vformat(char *dest, char *limit, const char *format,
va_list args);
/*
* Append a varargs format to destination. Pointer to the end of the
* added characters will be returned. No \0 character will be added.
*/
extern
char *append_format(char *dest, char *limit, const char *format, ...);
/*
* Append \0 character to destination. If dest is => limit then \0
* will be written one character before the limit. Pointer past the
* end of the \0 character will be returned.
*/
extern
char *append_null(char *dest, char *limit);
/*
* Local implementation of snprintf. We are doing this trying to not
* use the system version which often can allocate memory itself
* causing the library to go recursive.
*/
extern
int loc_vsnprintf(char *buf, const int size, const char *format,
va_list args);
/*
* Local implementation of snprintf. We are doing this trying to not
* use the system version which often can allocate memory itself
* causing the library to go recursive.
*/
extern
int loc_snprintf(char *buf, const int size, const char *format, ...);
/*
* Local implementation of printf so we can use %p and other non-standard formats.
*/
extern
void loc_printf(const char *format, ...);
/*
* Local implementation of fprintf so we can use %p and other non-standard formats.
*/
extern
void loc_fprintf(FILE *file, const char *format, ...);
/*
* Local implementation of vfprintf so we can use %p and other non-standard formats.
*/
extern
void loc_vfprintf(FILE *file, const char *format, va_list args);
/*
* Local implementation of dprintf so we can use %p and other non-standard formats.
*/
extern
void loc_dprintf(int fd, const char *format, ...);
/*
* Local implementation of vdprintf so we can use %p and other non-standard formats.
*/
extern
void loc_vdprintf(int fd, const char *format, va_list args);
/*<<<<<<<<<< This is end of the auto-generated output from fillproto. */
#endif /* ! __APPENDER_H__ */