1
/*************************************************************************
3
* $Id: triop.h 1886 2003-04-03 15:28:28Z veillard $
5
* Copyright (C) 2000 Bjorn Reese and Daniel Stenberg.
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.
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.
16
************************************************************************
18
* Private functions, types, etc. used for callback functions.
20
* The ref pointer is an opaque type and should remain as such.
21
* Private data must only be accessible through the getter and
24
************************************************************************/
32
#if defined(TRIO_COMPILER_ANCIENT)
55
# define TRIO_UNIX98 1
57
#ifndef TRIO_MICROSOFT
58
# define TRIO_MICROSOFT 1
60
#ifndef TRIO_EXTENSION
61
# define TRIO_EXTENSION 1
63
#ifndef TRIO_WIDECHAR /* Does not work yet. Do not enable */
64
# define TRIO_WIDECHAR 0
67
# define TRIO_ERRORS 1
71
# define TRIO_MALLOC(n) malloc(n)
74
# define TRIO_REALLOC(x,n) realloc((x),(n))
77
# define TRIO_FREE(x) free(x)
81
/*************************************************************************
82
* User-defined specifiers
85
typedef int (*trio_callback_t) TRIO_PROTO((trio_pointer_t));
87
trio_pointer_t trio_register TRIO_PROTO((trio_callback_t callback, const char *name));
88
void trio_unregister TRIO_PROTO((trio_pointer_t handle));
90
TRIO_CONST char *trio_get_format TRIO_PROTO((trio_pointer_t ref));
91
trio_pointer_t trio_get_argument TRIO_PROTO((trio_pointer_t ref));
94
int trio_get_width TRIO_PROTO((trio_pointer_t ref));
95
void trio_set_width TRIO_PROTO((trio_pointer_t ref, int width));
96
int trio_get_precision TRIO_PROTO((trio_pointer_t ref));
97
void trio_set_precision TRIO_PROTO((trio_pointer_t ref, int precision));
98
int trio_get_base TRIO_PROTO((trio_pointer_t ref));
99
void trio_set_base TRIO_PROTO((trio_pointer_t ref, int base));
100
int trio_get_padding TRIO_PROTO((trio_pointer_t ref));
101
void trio_set_padding TRIO_PROTO((trio_pointer_t ref, int is_padding));
102
int trio_get_short TRIO_PROTO((trio_pointer_t ref)); /* h */
103
void trio_set_shortshort TRIO_PROTO((trio_pointer_t ref, int is_shortshort));
104
int trio_get_shortshort TRIO_PROTO((trio_pointer_t ref)); /* hh */
105
void trio_set_short TRIO_PROTO((trio_pointer_t ref, int is_short));
106
int trio_get_long TRIO_PROTO((trio_pointer_t ref)); /* l */
107
void trio_set_long TRIO_PROTO((trio_pointer_t ref, int is_long));
108
int trio_get_longlong TRIO_PROTO((trio_pointer_t ref)); /* ll */
109
void trio_set_longlong TRIO_PROTO((trio_pointer_t ref, int is_longlong));
110
int trio_get_longdouble TRIO_PROTO((trio_pointer_t ref)); /* L */
111
void trio_set_longdouble TRIO_PROTO((trio_pointer_t ref, int is_longdouble));
112
int trio_get_alternative TRIO_PROTO((trio_pointer_t ref)); /* # */
113
void trio_set_alternative TRIO_PROTO((trio_pointer_t ref, int is_alternative));
114
int trio_get_alignment TRIO_PROTO((trio_pointer_t ref)); /* - */
115
void trio_set_alignment TRIO_PROTO((trio_pointer_t ref, int is_leftaligned));
116
int trio_get_spacing TRIO_PROTO((trio_pointer_t ref)); /* TRIO_PROTO((space) */
117
void trio_set_spacing TRIO_PROTO((trio_pointer_t ref, int is_space));
118
int trio_get_sign TRIO_PROTO((trio_pointer_t ref)); /* + */
119
void trio_set_sign TRIO_PROTO((trio_pointer_t ref, int is_showsign));
120
int trio_get_quote TRIO_PROTO((trio_pointer_t ref)); /* ' */
121
void trio_set_quote TRIO_PROTO((trio_pointer_t ref, int is_quote));
122
int trio_get_upper TRIO_PROTO((trio_pointer_t ref));
123
void trio_set_upper TRIO_PROTO((trio_pointer_t ref, int is_upper));
125
int trio_get_largest TRIO_PROTO((trio_pointer_t ref)); /* j */
126
void trio_set_largest TRIO_PROTO((trio_pointer_t ref, int is_largest));
127
int trio_get_ptrdiff TRIO_PROTO((trio_pointer_t ref)); /* t */
128
void trio_set_ptrdiff TRIO_PROTO((trio_pointer_t ref, int is_ptrdiff));
129
int trio_get_size TRIO_PROTO((trio_pointer_t ref)); /* z / Z */
130
void trio_set_size TRIO_PROTO((trio_pointer_t ref, int is_size));
134
int trio_print_ref TRIO_PROTO((trio_pointer_t ref, const char *format, ...));
135
int trio_vprint_ref TRIO_PROTO((trio_pointer_t ref, const char *format, va_list args));
136
int trio_printv_ref TRIO_PROTO((trio_pointer_t ref, const char *format, trio_pointer_t *args));
138
void trio_print_int TRIO_PROTO((trio_pointer_t ref, int number));
139
void trio_print_uint TRIO_PROTO((trio_pointer_t ref, unsigned int number));
140
/* void trio_print_long TRIO_PROTO((trio_pointer_t ref, long number)); */
141
/* void trio_print_ulong TRIO_PROTO((trio_pointer_t ref, unsigned long number)); */
142
void trio_print_double TRIO_PROTO((trio_pointer_t ref, double number));
143
void trio_print_string TRIO_PROTO((trio_pointer_t ref, char *string));
144
void trio_print_pointer TRIO_PROTO((trio_pointer_t ref, trio_pointer_t pointer));
150
#endif /* TRIO_TRIOP_H */