blob: 62ec0f9a527e8469c52cd69e286f31d31b486199 [file] [log] [blame]
Bjorn Reese70a9da52001-04-21 16:57:29 +00001/*************************************************************************
2 *
3 * $Id$
4 *
5 * Copyright (C) 2000 Bjorn Reese and Daniel Stenberg.
6 *
7 * Permission to use, copy, modify, and distribute this software for any
8 * purpose with or without fee is hereby granted, provided that the above
9 * copyright notice and this permission notice appear in all copies.
10 *
11 * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED
12 * WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
13 * MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE AUTHORS AND
14 * CONTRIBUTORS ACCEPT NO RESPONSIBILITY IN ANY CONCEIVABLE MANNER.
15 *
16 ************************************************************************
17 *
18 * Private functions, types, etc. used for callback functions.
19 *
20 * The ref pointer is an opaque type and should remain as such.
21 * Private data must only be accessible through the getter and
22 * setter functions.
23 *
24 ************************************************************************/
25
26#ifndef TRIO_TRIOP_H
27#define TRIO_TRIOP_H
28
29#if defined(__STDC__) && (__STDC_VERSION__ >= 199901L)
30# define TRIO_C99
31#endif
32#define TRIO_BSD
33#define TRIO_GNU
34#define TRIO_MISC
35#define TRIO_UNIX98
36#define TRIO_EXTENSION
37#define TRIO_ERRORS
38
39
40typedef int (*trio_callback_t)(void *ref);
41
42void *trio_register(trio_callback_t callback, const char *name);
43void trio_unregister(void *handle);
44
45const char *trio_get_format(void *ref);
46void *trio_get_argument(void *ref);
47
48/* Modifiers */
49int trio_get_width(void *ref);
50void trio_set_width(void *ref, int width);
51int trio_get_precision(void *ref);
52void trio_set_precision(void *ref, int precision);
53int trio_get_base(void *ref);
54void trio_set_base(void *ref, int base);
55int trio_get_padding(void *ref);
56void trio_set_padding(void *ref, int is_padding);
57int trio_get_short(void *ref); /* h */
58void trio_set_shortshort(void *ref, int is_shortshort);
59int trio_get_shortshort(void *ref); /* hh */
60void trio_set_short(void *ref, int is_short);
61int trio_get_long(void *ref); /* l */
62void trio_set_long(void *ref, int is_long);
63int trio_get_longlong(void *ref); /* ll */
64void trio_set_longlong(void *ref, int is_longlong);
65int trio_get_longdouble(void *ref); /* L */
66void trio_set_longdouble(void *ref, int is_longdouble);
67int trio_get_alternative(void *ref); /* # */
68void trio_set_alternative(void *ref, int is_alternative);
69int trio_get_alignment(void *ref); /* - */
70void trio_set_alignment(void *ref, int is_leftaligned);
71int trio_get_spacing(void *ref); /* (space) */
72void trio_set_spacing(void *ref, int is_space);
73int trio_get_sign(void *ref); /* + */
74void trio_set_sign(void *ref, int is_showsign);
75int trio_get_quote(void *ref); /* ' */
76void trio_set_quote(void *ref, int is_quote);
77int trio_get_upper(void *ref);
78void trio_set_upper(void *ref, int is_upper);
79#if defined(TRIO_C99)
80int trio_get_largest(void *ref); /* j */
81void trio_set_largest(void *ref, int is_largest);
82int trio_get_ptrdiff(void *ref); /* t */
83void trio_set_ptrdiff(void *ref, int is_ptrdiff);
84int trio_get_size(void *ref); /* z / Z */
85void trio_set_size(void *ref, int is_size);
86#endif
87
88/* Printing */
89int trio_print_ref(void *ref, const char *format, ...);
90int trio_vprint_ref(void *ref, const char *format, va_list args);
91int trio_printv_ref(void *ref, const char *format, void **args);
92
93void trio_print_int(void *ref, int number);
94void trio_print_uint(void *ref, unsigned int number);
95/* void trio_print_long(void *ref, long number); */
96/* void trio_print_ulong(void *ref, unsigned long number); */
97void trio_print_double(void *ref, double number);
98void trio_print_string(void *ref, char *string);
99void trio_print_pointer(void *ref, void *pointer);
100
101#endif /* TRIO_TRIOP_H */