3 #ifndef RUDIMENTS_NODE_H 4 #define RUDIMENTS_NODE_H 6 #include <rudiments/charstring.h> 7 #include <rudiments/stdio.h> 8 #include <rudiments/private/rudimentsinlines.h> 13 RUDIMENTS_TEMPLATE_INLINE
14 int32_t node_compare(
char *value1,
char *value2) {
18 RUDIMENTS_TEMPLATE_INLINE
19 int32_t node_compare(
const char *value1,
const char *value2) {
23 RUDIMENTS_TEMPLATE_INLINE
24 int32_t node_compare(
const unsigned char *value1,
25 const unsigned char *value2) {
29 RUDIMENTS_TEMPLATE_INLINE
30 int32_t node_compare(
unsigned char *value1,
unsigned char *value2) {
34 RUDIMENTS_TEMPLATE_INLINE
35 int32_t node_compare(
char value1,
char value2) {
38 }
else if (value1==value2) {
45 RUDIMENTS_TEMPLATE_INLINE
46 int32_t node_compare(int16_t value1, int16_t value2) {
49 }
else if (value1==value2) {
56 RUDIMENTS_TEMPLATE_INLINE
57 int32_t node_compare(int32_t value1, int32_t value2) {
60 }
else if (value1==value2) {
67 RUDIMENTS_TEMPLATE_INLINE
68 int32_t node_compare(int64_t value1, int64_t value2) {
71 }
else if (value1==value2) {
78 RUDIMENTS_TEMPLATE_INLINE
79 int32_t node_compare(
unsigned char value1,
unsigned char value2) {
82 }
else if (value1==value2) {
89 RUDIMENTS_TEMPLATE_INLINE
90 int32_t node_compare(uint16_t value1, uint16_t value2) {
93 }
else if (value1==value2) {
100 RUDIMENTS_TEMPLATE_INLINE
101 int32_t node_compare(uint32_t value1, uint32_t value2) {
104 }
else if (value1==value2) {
111 RUDIMENTS_TEMPLATE_INLINE
112 int32_t node_compare(uint64_t value1, uint64_t value2) {
115 }
else if (value1==value2) {
122 RUDIMENTS_TEMPLATE_INLINE
123 int32_t node_compare(
float value1,
float value2) {
126 }
else if (value1==value2) {
133 RUDIMENTS_TEMPLATE_INLINE
134 int32_t node_compare(
double value1,
double value2) {
137 }
else if (value1==value2) {
144 RUDIMENTS_TEMPLATE_INLINE
145 int32_t node_compare(
long double value1,
long double value2) {
148 }
else if (value1==value2) {
155 RUDIMENTS_TEMPLATE_INLINE
156 int32_t node_compare(
void *value1,
void *value2) {
159 }
else if (value1==value2) {
166 RUDIMENTS_TEMPLATE_INLINE
167 void node_print(
const char *value) {
168 stdoutput.
printf(
"%s",value);
171 RUDIMENTS_TEMPLATE_INLINE
172 void node_print(
char *value) {
173 stdoutput.
printf(
"%s",value);
176 RUDIMENTS_TEMPLATE_INLINE
177 void node_print(
char value) {
178 stdoutput.
printf(
"%c",value);
181 RUDIMENTS_TEMPLATE_INLINE
182 void node_print(int16_t value) {
183 stdoutput.
printf(
"%hd",value);
186 RUDIMENTS_TEMPLATE_INLINE
187 void node_print(int32_t value) {
188 stdoutput.
printf(
"%d",(
int)value);
191 RUDIMENTS_TEMPLATE_INLINE
192 void node_print(int64_t value) {
193 #ifdef RUDIMENTS_HAVE_LONG_LONG 194 stdoutput.
printf(
"%lld",(
long long)value);
196 stdoutput.
printf(
"%ld",(
long)value);
200 RUDIMENTS_TEMPLATE_INLINE
201 void node_print(
unsigned const char *value) {
202 stdoutput.
printf(
"%s",value);
205 RUDIMENTS_TEMPLATE_INLINE
206 void node_print(
unsigned char *value) {
207 stdoutput.
printf(
"%s",value);
210 RUDIMENTS_TEMPLATE_INLINE
211 void node_print(
unsigned char value) {
212 stdoutput.
printf(
"%c",value);
215 RUDIMENTS_TEMPLATE_INLINE
216 void node_print(uint16_t value) {
217 stdoutput.
printf(
"%hd",value);
220 RUDIMENTS_TEMPLATE_INLINE
221 void node_print(uint32_t value) {
222 stdoutput.
printf(
"%d",(
unsigned int)value);
225 RUDIMENTS_TEMPLATE_INLINE
226 void node_print(uint64_t value) {
227 #ifdef RUDIMENTS_HAVE_LONG_LONG 228 stdoutput.
printf(
"%lld",(
unsigned long long)value);
230 stdoutput.
printf(
"%ld",(
unsigned long)value);
234 RUDIMENTS_TEMPLATE_INLINE
235 void node_print(
float value) {
236 stdoutput.
printf(
"%f",value);
239 RUDIMENTS_TEMPLATE_INLINE
240 void node_print(
double value) {
241 stdoutput.
printf(
"%f",value);
244 RUDIMENTS_TEMPLATE_INLINE
245 void node_print(
long double value) {
246 stdoutput.
printf(
"%Lf",value);
249 RUDIMENTS_TEMPLATE_INLINE
250 void node_print(
void *value) {
251 stdoutput.
printf(
"%08x",value);
size_t printf(const char *format,...)
static int32_t compare(const char *str1, const char *str2)