aboutsummaryrefslogtreecommitdiffstats
path: root/common.h
blob: d33a9249da8cc540e1591c6c8e9baf3b28f46e19 (plain) (blame)
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
/* See LICENSE file for copyright and license details. */
#include "libcharconv.h"
#include <errno.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>

#ifdef main
# define LIBSIMPLY_CONFIG_MULTICALL_BINARY
#endif
#include <libsimple-arg.h>


void writeall(const char *s, size_t n);
void writechar(uint_least32_t cp);
int convert(enum libcharconv_result (*conv)(const char *, size_t, size_t *, uint_least32_t *, size_t *));


#define SIMPLE(FUNCTION)\
	USAGE("");\
	\
	int\
	main(int argc, char *argv[])\
	{\
		ARGBEGIN {\
		default:\
			usage();\
		} ARGEND;\
		if (argc)\
			usage();\
		\
		return convert(&FUNCTION);\
	}