Blame winpr/libwinpr/utils/trio/triop.h

Packit 1fb8d4
/*************************************************************************
Packit 1fb8d4
 *
Packit 1fb8d4
 * $Id: triop.h,v 1.19 2010/09/12 11:08:08 breese Exp $
Packit 1fb8d4
 *
Packit 1fb8d4
 * Copyright (C) 2000 Bjorn Reese and Daniel Stenberg.
Packit 1fb8d4
 *
Packit 1fb8d4
 * Permission to use, copy, modify, and distribute this software for any
Packit 1fb8d4
 * purpose with or without fee is hereby granted, provided that the above
Packit 1fb8d4
 * copyright notice and this permission notice appear in all copies.
Packit 1fb8d4
 *
Packit 1fb8d4
 * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED
Packit 1fb8d4
 * WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
Packit 1fb8d4
 * MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE AUTHORS AND
Packit 1fb8d4
 * CONTRIBUTORS ACCEPT NO RESPONSIBILITY IN ANY CONCEIVABLE MANNER.
Packit 1fb8d4
 *
Packit 1fb8d4
 ************************************************************************
Packit 1fb8d4
 *
Packit 1fb8d4
 * Private functions, types, etc. used for callback functions.
Packit 1fb8d4
 *
Packit 1fb8d4
 * The ref pointer is an opaque type and should remain as such.
Packit 1fb8d4
 * Private data must only be accessible through the getter and
Packit 1fb8d4
 * setter functions.
Packit 1fb8d4
 *
Packit 1fb8d4
 ************************************************************************/
Packit 1fb8d4
Packit 1fb8d4
#ifndef TRIO_TRIOP_H
Packit 1fb8d4
#define TRIO_TRIOP_H
Packit 1fb8d4
Packit 1fb8d4
#include "triodef.h"
Packit 1fb8d4
Packit 1fb8d4
#include <stdlib.h>
Packit 1fb8d4
#if defined(TRIO_COMPILER_ANCIENT)
Packit Service 5a9772
#include <varargs.h>
Packit 1fb8d4
#else
Packit Service 5a9772
#include <stdarg.h>
Packit 1fb8d4
#endif
Packit 1fb8d4
Packit 1fb8d4
#ifdef __cplusplus
Packit Service 5a9772
extern "C"
Packit Service 5a9772
{
Packit 1fb8d4
#endif
Packit 1fb8d4
Packit 1fb8d4
/*************************************************************************
Packit 1fb8d4
 * Supported standards
Packit 1fb8d4
 */
Packit 1fb8d4
Packit 1fb8d4
/*
Packit 1fb8d4
 * TRIO_C99 (=0 or =1)
Packit 1fb8d4
 *
Packit 1fb8d4
 * Define this to 0 to disable C99 format specifier extensions, or
Packit 1fb8d4
 * define to 1 to enable them.  The format specifiers that are
Packit 1fb8d4
 * disabled by this switch are labelled with [C99] in the format
Packit 1fb8d4
 * specifier documentation.
Packit 1fb8d4
 */
Packit 1fb8d4
#if !defined(TRIO_C99)
Packit Service 5a9772
#define TRIO_C99 1
Packit 1fb8d4
#endif
Packit 1fb8d4
Packit 1fb8d4
/*
Packit 1fb8d4
 * TRIO_BSD (=0 or =1)
Packit 1fb8d4
 *
Packit 1fb8d4
 * Define this to 0 to disable BSD format specifier extensions, or
Packit 1fb8d4
 * define to 1 to enable them.  The format specifiers that are
Packit 1fb8d4
 * disabled by this switch are labelled with [BSD] in the format
Packit 1fb8d4
 * specifier documentation.
Packit 1fb8d4
 */
Packit 1fb8d4
#if !defined(TRIO_BSD)
Packit Service 5a9772
#define TRIO_BSD 1
Packit 1fb8d4
#endif
Packit 1fb8d4
Packit 1fb8d4
/*
Packit 1fb8d4
 * TRIO_GNU (=0 or =1)
Packit 1fb8d4
 *
Packit 1fb8d4
 * Define this to 0 to disable GNU format specifier extensions, or
Packit 1fb8d4
 * define to 1 to enable them.  The format specifiers that are
Packit 1fb8d4
 * disabled by this switch are labelled with [GNU] in the format
Packit 1fb8d4
 * specifier documentation.
Packit 1fb8d4
 */
Packit 1fb8d4
#if !defined(TRIO_GNU)
Packit Service 5a9772
#define TRIO_GNU 1
Packit 1fb8d4
#endif
Packit 1fb8d4
Packit 1fb8d4
/*
Packit 1fb8d4
 * TRIO_MISC (=0 or =1)
Packit 1fb8d4
 *
Packit 1fb8d4
 * Define this to 0 to disable miscellaneous format specifier
Packit 1fb8d4
 * extensions, or define to 1 to enable them.  The format specifiers
Packit 1fb8d4
 * that are disabled by this switch are labelled with [MISC] in the
Packit 1fb8d4
 * format specifier documentation.
Packit 1fb8d4
 */
Packit 1fb8d4
#if !defined(TRIO_MISC)
Packit Service 5a9772
#define TRIO_MISC 1
Packit 1fb8d4
#endif
Packit 1fb8d4
Packit 1fb8d4
/*
Packit 1fb8d4
 * TRIO_UNIX98 (=0 or =1)
Packit 1fb8d4
 *
Packit 1fb8d4
 * Define this to 0 to disable UNIX98 format specifier extensions,
Packit 1fb8d4
 * or define to 1 to enable them.  The format specifiers that are
Packit 1fb8d4
 * disabled by this switch are labelled with [UNIX98] in the format
Packit 1fb8d4
 * specifier documentation.
Packit 1fb8d4
 */
Packit 1fb8d4
#if !defined(TRIO_UNIX98)
Packit Service 5a9772
#define TRIO_UNIX98 1
Packit 1fb8d4
#endif
Packit Service 5a9772
Packit 1fb8d4
/*
Packit 1fb8d4
 * TRIO_MICROSOFT (=0 or =1)
Packit 1fb8d4
 *
Packit 1fb8d4
 * Define this to 0 to disable Microsoft Visual C format specifier
Packit 1fb8d4
 * extensions, or define to 1 to enable them.  The format specifiers
Packit 1fb8d4
 * that are disabled by this switch are labelled with [MSVC] in the
Packit 1fb8d4
 * format specifier documentation.
Packit 1fb8d4
 */
Packit 1fb8d4
#if !defined(TRIO_MICROSOFT)
Packit Service 5a9772
#define TRIO_MICROSOFT 1
Packit 1fb8d4
#endif
Packit 1fb8d4
Packit 1fb8d4
/*
Packit 1fb8d4
 * TRIO_EXTENSION (=0 or =1)
Packit 1fb8d4
 *
Packit 1fb8d4
 * Define this to 0 to disable Trio-specific extensions, or define
Packit 1fb8d4
 * to 1 to enable them.  This has two effects: it controls whether
Packit 1fb8d4
 * or not the Trio user-defined formating mechanism
Packit 1fb8d4
 * (trio_register() etc) is supported, and it enables or disables
Packit 1fb8d4
 * Trio's own format specifier extensions.  The format specifiers
Packit 1fb8d4
 * that are disabled by this switch are labelled with [TRIO] in
Packit 1fb8d4
 * the format specifier documentation.
Packit 1fb8d4
 */
Packit 1fb8d4
#if !defined(TRIO_EXTENSION)
Packit Service 5a9772
#define TRIO_EXTENSION 1
Packit 1fb8d4
#endif
Packit 1fb8d4
Packit 1fb8d4
/*
Packit 1fb8d4
 * TRIO_DEPRECATED (=0 or =1)
Packit 1fb8d4
 *
Packit 1fb8d4
 * Define this to 0 to disable deprecated functionality, or define
Packit 1fb8d4
 * to 1 to enable them.
Packit 1fb8d4
 */
Packit 1fb8d4
#if !defined(TRIO_DEPRECATED)
Packit Service 5a9772
#define TRIO_DEPRECATED 1
Packit 1fb8d4
#endif
Packit 1fb8d4
Packit Service 5a9772
	/*************************************************************************
Packit Service 5a9772
	 * Features
Packit Service 5a9772
	 */
Packit 1fb8d4
Packit 1fb8d4
#if defined(TRIO_SNPRINTF_ONLY)
Packit Service 5a9772
#define TRIO_FEATURE_SCANF 0
Packit Service 5a9772
#define TRIO_FEATURE_FILE 0
Packit Service 5a9772
#define TRIO_FEATURE_STDIO 0
Packit Service 5a9772
#define TRIO_FEATURE_FD 0
Packit Service 5a9772
#define TRIO_FEATURE_DYNAMICSTRING 0
Packit Service 5a9772
#define TRIO_FEATURE_CLOSURE 0
Packit Service 5a9772
#define TRIO_FEATURE_ARGFUNC 0
Packit Service 5a9772
#define TRIO_FEATURE_STRERR 0
Packit Service 5a9772
#define TRIO_FEATURE_LOCALE 0
Packit Service 5a9772
#define TRIO_EMBED_NAN 1
Packit Service 5a9772
#define TRIO_EMBED_STRING 1
Packit Service 5a9772
#endif
Packit Service 5a9772
Packit 1fb8d4
/*
Packit 1fb8d4
 * TRIO_FEATURE_SCANF (=0 or =1)
Packit 1fb8d4
 *
Packit 1fb8d4
 * Define this to 0 to disable all the scanf() variants, or define to 1
Packit 1fb8d4
 * to enable them.
Packit 1fb8d4
 */
Packit 1fb8d4
#if !defined(TRIO_FEATURE_SCANF)
Packit Service 5a9772
#define TRIO_FEATURE_SCANF 1
Packit 1fb8d4
#endif
Packit Service 5a9772
Packit 1fb8d4
/*
Packit 1fb8d4
 * TRIO_FEATURE_FILE (=0 or =1)
Packit 1fb8d4
 *
Packit 1fb8d4
 * Define this to 0 to disable compilation of the trio_fprintf() and
Packit 1fb8d4
 * trio_fscanf() family of functions, or define to 1 to enable them.
Packit 1fb8d4
 *
Packit 1fb8d4
 * This may be useful on an embedded platform with no filesystem.
Packit 1fb8d4
 * Note that trio_printf() uses fwrite to write to stdout, so if you
Packit 1fb8d4
 * do not have an implementation of fwrite() at all then you must also
Packit 1fb8d4
 * define TRIO_FEATURE_STDIO to 0.
Packit 1fb8d4
 */
Packit 1fb8d4
#if !defined(TRIO_FEATURE_FILE)
Packit Service 5a9772
#define TRIO_FEATURE_FILE 1
Packit 1fb8d4
#endif
Packit 1fb8d4
Packit 1fb8d4
/*
Packit 1fb8d4
 * TRIO_FEATURE_STDIO (=0 or =1)
Packit 1fb8d4
 *
Packit 1fb8d4
 * Define this to 0 to disable compilation of the trio_printf() and
Packit 1fb8d4
 * trio_scanf() family of functions, or define to 1 to enable them.
Packit 1fb8d4
 *
Packit 1fb8d4
 * This may be useful on an embedded platform with no standard I/O.
Packit 1fb8d4
 */
Packit 1fb8d4
#if !defined(TRIO_FEATURE_STDIO)
Packit Service 5a9772
#define TRIO_FEATURE_STDIO 1
Packit 1fb8d4
#endif
Packit 1fb8d4
Packit 1fb8d4
/*
Packit 1fb8d4
 * TRIO_FEATURE_FD (=0 or =1)
Packit 1fb8d4
 *
Packit 1fb8d4
 * Define this to 0 to disable compilation of the trio_dprintf() and
Packit 1fb8d4
 * trio_dscanf() family of functions, or define to 1 to enable them.
Packit 1fb8d4
 *
Packit 1fb8d4
 * This may be useful on an embedded platform with no filesystem, or on
Packit 1fb8d4
 * a platform that supports file I/O using FILE* but not using raw file
Packit 1fb8d4
 * descriptors.
Packit 1fb8d4
 */
Packit 1fb8d4
#if !defined(TRIO_FEATURE_FD)
Packit Service 5a9772
#define TRIO_FEATURE_FD 1
Packit 1fb8d4
#endif
Packit 1fb8d4
Packit 1fb8d4
/*
Packit 1fb8d4
 * TRIO_FEATURE_DYNAMICSTRING (=0 or =1)
Packit 1fb8d4
 *
Packit Service 5a9772
 * Define this to 0 to disable compilation of the trio_aprintf()
Packit 1fb8d4
 * family of functions, or define to 1 to enable them.
Packit 1fb8d4
 *
Packit 1fb8d4
 * If you define both this and TRIO_MINIMAL to 0, then Trio will never
Packit 1fb8d4
 * call malloc or free.
Packit 1fb8d4
 */
Packit 1fb8d4
#if !defined(TRIO_FEATURE_DYNAMICSTRING)
Packit Service 5a9772
#define TRIO_FEATURE_DYNAMICSTRING 1
Packit 1fb8d4
#endif
Packit 1fb8d4
Packit 1fb8d4
/*
Packit 1fb8d4
 * TRIO_FEATURE_CLOSURE (=0 or =1)
Packit 1fb8d4
 *
Packit 1fb8d4
 * Define this to 0 to disable compilation of the trio_cprintf() and
Packit 1fb8d4
 * trio_cscanf() family of functions, or define to 1 to enable them.
Packit 1fb8d4
 *
Packit 1fb8d4
 * These functions are rarely needed. This saves a (small) amount of code.
Packit 1fb8d4
 */
Packit 1fb8d4
#if !defined(TRIO_FEATURE_CLOSURE)
Packit Service 5a9772
#define TRIO_FEATURE_CLOSURE 1
Packit 1fb8d4
#endif
Packit 1fb8d4
Packit 1fb8d4
/*
Packit 1fb8d4
 * TRIO_FEATURE_ARGFUNC (=0 or =1)
Packit 1fb8d4
 *
Packit 1fb8d4
 * Define this to 0 to disable compilation of trio_cprintff() and
Packit 1fb8d4
 * trio_cscanff() functions and related code (might have a tiny
Packit 1fb8d4
 * performance gain), or define to 1 to enable them.
Packit 1fb8d4
 *
Packit 1fb8d4
 * This functionality is needed only if you have to fetch the arguments using
Packit 1fb8d4
 * a pull model instead of passing them all at once (for example if you plan
Packit 1fb8d4
 * to plug the library into a script interpreter or validate the types).
Packit 1fb8d4
 *
Packit 1fb8d4
 * Only the closure family of functions are available with this interface,
Packit 1fb8d4
 * because if you need this, you usually provide custom input/output
Packit 1fb8d4
 * handling too (and so this forces TRIO_FEATURE_CLOSURE to enabled).
Packit 1fb8d4
 */
Packit 1fb8d4
#if !defined(TRIO_FEATURE_ARGFUNC)
Packit Service 5a9772
#define TRIO_FEATURE_ARGFUNC 1
Packit 1fb8d4
#endif
Packit 1fb8d4
#if TRIO_FEATURE_ARGFUNC
Packit Service 5a9772
#undef TRIO_FEATURE_CLOSURE
Packit Service 5a9772
#define TRIO_FEATURE_CLOSURE 1
Packit 1fb8d4
#endif
Packit 1fb8d4
Packit 1fb8d4
/*
Packit 1fb8d4
 * TRIO_FEATURE_ERRORCODE (=0 or =1)
Packit 1fb8d4
 *
Packit 1fb8d4
 * Define this to 0 to return -1 from the print and scan function on
Packit 1fb8d4
 * error, or define to 1 to return a negative number with debugging
Packit 1fb8d4
 * information as part of the return code.
Packit 1fb8d4
 *
Packit 1fb8d4
 * If enabled, the return code will be a negative number, which encodes
Packit 1fb8d4
 * an error code and an error location. These can be decoded with the
Packit 1fb8d4
 * TRIO_ERROR_CODE and TRIO_ERROR_POSITION macros.
Packit 1fb8d4
 */
Packit 1fb8d4
#if defined(TRIO_ERRORS)
Packit Service 5a9772
#define TRIO_FEATURE_ERRORCODE TRIO_ERRORS
Packit 1fb8d4
#endif
Packit 1fb8d4
#if !defined(TRIO_FEATURE_ERRORCODE)
Packit Service 5a9772
#define TRIO_FEATURE_ERRORCODE 1
Packit 1fb8d4
#endif
Packit 1fb8d4
Packit 1fb8d4
/*
Packit 1fb8d4
 * TRIO_FEATURE_STRERR (=0 or =1)
Packit 1fb8d4
 *
Packit 1fb8d4
 * Define this to 0 if you do not use trio_strerror(), or define to 1 if
Packit 1fb8d4
 * you do use it.
Packit 1fb8d4
 *
Packit 1fb8d4
 * This saves a (small) amount of code.
Packit 1fb8d4
 */
Packit 1fb8d4
#if !defined(TRIO_FEATURE_STRERR)
Packit Service 5a9772
#define TRIO_FEATURE_STRERR 1
Packit 1fb8d4
#endif
Packit 1fb8d4
Packit 1fb8d4
/*
Packit 1fb8d4
 * TRIO_FEATURE_FLOAT (=0 or =1)
Packit 1fb8d4
 *
Packit 1fb8d4
 * Define this to 0 to disable all floating-point support, or define
Packit 1fb8d4
 * to 1 to enable it.
Packit 1fb8d4
 *
Packit 1fb8d4
 * This is useful in restricted embedded platforms that do not support
Packit 1fb8d4
 * floating-point.  Obviously you cannot use floating-point format
Packit 1fb8d4
 * specifiers if you define this.
Packit 1fb8d4
 *
Packit 1fb8d4
 * Do not compile trionan.c if you disable this.
Packit 1fb8d4
 */
Packit 1fb8d4
#if !defined(TRIO_FEATURE_FLOAT)
Packit Service 5a9772
#define TRIO_FEATURE_FLOAT 1
Packit 1fb8d4
#endif
Packit 1fb8d4
Packit 1fb8d4
/*
Packit 1fb8d4
 * TRIO_FEATURE_LOCALE (=0 or =1)
Packit 1fb8d4
 *
Packit 1fb8d4
 * Define this to 0 to disable customized locale support, or define
Packit 1fb8d4
 * to 1 to enable it.
Packit 1fb8d4
 *
Packit 1fb8d4
 * This saves a (small) amount of code.
Packit 1fb8d4
 */
Packit 1fb8d4
#if !defined(TRIO_FEATURE_LOCALE)
Packit Service 5a9772
#define TRIO_FEATURE_LOCALE 1
Packit 1fb8d4
#endif
Packit 1fb8d4
Packit 1fb8d4
/*
Packit 1fb8d4
 * TRIO_MINIMAL
Packit 1fb8d4
 *
Packit 1fb8d4
 * Define this to disable building the public trionan.h and triostr.h.
Packit 1fb8d4
 * If you define this, then you must not compile trionan.c and triostr.c
Packit 1fb8d4
 * separately.
Packit 1fb8d4
 */
Packit 1fb8d4
#if defined(TRIO_MINIMAL)
Packit Service 5a9772
#if !defined(TRIO_EMBED_NAN)
Packit Service 5a9772
#define TRIO_EMBED_NAN
Packit Service 5a9772
#endif
Packit Service 5a9772
#if !defined(TRIO_EMBED_STRING)
Packit Service 5a9772
#define TRIO_EMBED_STRING
Packit Service 5a9772
#endif
Packit Service 5a9772
#endif
Packit Service 5a9772
Packit 1fb8d4
/* Does not work yet. Do not enable */
Packit 1fb8d4
#ifndef TRIO_FEATURE_WIDECHAR
Packit Service 5a9772
#define TRIO_FEATURE_WIDECHAR 0
Packit 1fb8d4
#endif
Packit 1fb8d4
Packit Service 5a9772
	/*************************************************************************
Packit Service 5a9772
	 * Mapping standards to internal features
Packit Service 5a9772
	 */
Packit 1fb8d4
Packit 1fb8d4
#if !defined(TRIO_FEATURE_HEXFLOAT)
Packit Service 5a9772
#define TRIO_FEATURE_HEXFLOAT (TRIO_C99 && TRIO_FEATURE_FLOAT)
Packit 1fb8d4
#endif
Packit 1fb8d4
Packit 1fb8d4
#if !defined(TRIO_FEATURE_LONGDOUBLE)
Packit Service 5a9772
#define TRIO_FEATURE_LONGDOUBLE TRIO_FEATURE_FLOAT
Packit 1fb8d4
#endif
Packit 1fb8d4
Packit 1fb8d4
#if !defined(TRIO_FEATURE_ERRNO)
Packit Service 5a9772
#define TRIO_FEATURE_ERRNO TRIO_GNU
Packit 1fb8d4
#endif
Packit 1fb8d4
Packit 1fb8d4
#if !defined(TRIO_FEATURE_QUAD)
Packit Service 5a9772
#define TRIO_FEATURE_QUAD (TRIO_BSD || TRIO_GNU)
Packit 1fb8d4
#endif
Packit 1fb8d4
Packit 1fb8d4
#if !defined(TRIO_FEATURE_SIZE_T)
Packit Service 5a9772
#define TRIO_FEATURE_SIZE_T TRIO_C99
Packit 1fb8d4
#endif
Packit 1fb8d4
Packit 1fb8d4
#if !defined(TRIO_FEATURE_SIZE_T_UPPER)
Packit Service 5a9772
#define TRIO_FEATURE_SIZE_T_UPPER TRIO_GNU
Packit 1fb8d4
#endif
Packit Service 5a9772
Packit 1fb8d4
#if !defined(TRIO_FEATURE_PTRDIFF_T)
Packit Service 5a9772
#define TRIO_FEATURE_PTRDIFF_T TRIO_C99
Packit 1fb8d4
#endif
Packit 1fb8d4
Packit 1fb8d4
#if !defined(TRIO_FEATURE_INTMAX_T)
Packit Service 5a9772
#define TRIO_FEATURE_INTMAX_T TRIO_C99
Packit 1fb8d4
#endif
Packit 1fb8d4
Packit 1fb8d4
#if !defined(TRIO_FEATURE_FIXED_SIZE)
Packit Service 5a9772
#define TRIO_FEATURE_FIXED_SIZE TRIO_MICROSOFT
Packit 1fb8d4
#endif
Packit 1fb8d4
Packit 1fb8d4
#if !defined(TRIO_FEATURE_POSITIONAL)
Packit Service 5a9772
#define TRIO_FEATURE_POSITIONAL TRIO_UNIX98
Packit 1fb8d4
#endif
Packit 1fb8d4
Packit 1fb8d4
#if !defined(TRIO_FEATURE_USER_DEFINED)
Packit Service 5a9772
#define TRIO_FEATURE_USER_DEFINED TRIO_EXTENSION
Packit 1fb8d4
#endif
Packit 1fb8d4
Packit 1fb8d4
#if !defined(TRIO_FEATURE_BINARY)
Packit Service 5a9772
#define TRIO_FEATURE_BINARY TRIO_EXTENSION
Packit 1fb8d4
#endif
Packit 1fb8d4
Packit 1fb8d4
#if !defined(TRIO_FEATURE_QUOTE)
Packit Service 5a9772
#define TRIO_FEATURE_QUOTE TRIO_EXTENSION
Packit 1fb8d4
#endif
Packit Service 5a9772
Packit 1fb8d4
#if !defined(TRIO_FEATURE_STICKY)
Packit Service 5a9772
#define TRIO_FEATURE_STICKY TRIO_EXTENSION
Packit 1fb8d4
#endif
Packit Service 5a9772
Packit 1fb8d4
#if !defined(TRIO_FEATURE_VARSIZE)
Packit Service 5a9772
#define TRIO_FEATURE_VARSIZE TRIO_EXTENSION
Packit 1fb8d4
#endif
Packit 1fb8d4
Packit 1fb8d4
#if !defined(TRIO_FEATURE_ROUNDING)
Packit Service 5a9772
#define TRIO_FEATURE_ROUNDING TRIO_EXTENSION
Packit 1fb8d4
#endif
Packit Service 5a9772
Packit 1fb8d4
/*************************************************************************
Packit 1fb8d4
 * Memory handling
Packit 1fb8d4
 */
Packit 1fb8d4
#ifndef TRIO_MALLOC
Packit Service 5a9772
#define TRIO_MALLOC(n) malloc(n)
Packit 1fb8d4
#endif
Packit 1fb8d4
#ifndef TRIO_REALLOC
Packit Service 5a9772
#define TRIO_REALLOC(x, n) realloc((x), (n))
Packit 1fb8d4
#endif
Packit 1fb8d4
#ifndef TRIO_FREE
Packit Service 5a9772
#define TRIO_FREE(x) free(x)
Packit Service 5a9772
#endif
Packit Service 5a9772
Packit Service 5a9772
	/*************************************************************************
Packit Service 5a9772
	 * User-defined specifiers
Packit Service 5a9772
	 */
Packit Service 5a9772
Packit Service 5a9772
	typedef int(*trio_callback_t) TRIO_PROTO((trio_pointer_t));
Packit Service 5a9772
Packit Service 5a9772
	trio_pointer_t trio_register TRIO_PROTO((trio_callback_t callback, const char* name));
Packit Service 5a9772
	void trio_unregister TRIO_PROTO((trio_pointer_t handle));
Packit Service 5a9772
Packit Service 5a9772
	TRIO_CONST char* trio_get_format TRIO_PROTO((trio_pointer_t ref));
Packit Service 5a9772
	trio_pointer_t trio_get_argument TRIO_PROTO((trio_pointer_t ref));
Packit Service 5a9772
Packit Service 5a9772
	/* Modifiers */
Packit Service 5a9772
	int trio_get_width TRIO_PROTO((trio_pointer_t ref));
Packit Service 5a9772
	void trio_set_width TRIO_PROTO((trio_pointer_t ref, int width));
Packit Service 5a9772
	int trio_get_precision TRIO_PROTO((trio_pointer_t ref));
Packit Service 5a9772
	void trio_set_precision TRIO_PROTO((trio_pointer_t ref, int precision));
Packit Service 5a9772
	int trio_get_base TRIO_PROTO((trio_pointer_t ref));
Packit Service 5a9772
	void trio_set_base TRIO_PROTO((trio_pointer_t ref, int base));
Packit Service 5a9772
	int trio_get_padding TRIO_PROTO((trio_pointer_t ref));
Packit Service 5a9772
	void trio_set_padding TRIO_PROTO((trio_pointer_t ref, int is_padding));
Packit Service 5a9772
	int trio_get_short TRIO_PROTO((trio_pointer_t ref)); /* h */
Packit Service 5a9772
	void trio_set_shortshort TRIO_PROTO((trio_pointer_t ref, int is_shortshort));
Packit Service 5a9772
	int trio_get_shortshort TRIO_PROTO((trio_pointer_t ref)); /* hh */
Packit Service 5a9772
	void trio_set_short TRIO_PROTO((trio_pointer_t ref, int is_short));
Packit Service 5a9772
	int trio_get_long TRIO_PROTO((trio_pointer_t ref)); /* l */
Packit Service 5a9772
	void trio_set_long TRIO_PROTO((trio_pointer_t ref, int is_long));
Packit Service 5a9772
	int trio_get_longlong TRIO_PROTO((trio_pointer_t ref)); /* ll */
Packit Service 5a9772
	void trio_set_longlong TRIO_PROTO((trio_pointer_t ref, int is_longlong));
Packit Service 5a9772
	int trio_get_longdouble TRIO_PROTO((trio_pointer_t ref)); /* L */
Packit Service 5a9772
	void trio_set_longdouble TRIO_PROTO((trio_pointer_t ref, int is_longdouble));
Packit Service 5a9772
	int trio_get_alternative TRIO_PROTO((trio_pointer_t ref)); /* # */
Packit Service 5a9772
	void trio_set_alternative TRIO_PROTO((trio_pointer_t ref, int is_alternative));
Packit Service 5a9772
	int trio_get_alignment TRIO_PROTO((trio_pointer_t ref)); /* - */
Packit Service 5a9772
	void trio_set_alignment TRIO_PROTO((trio_pointer_t ref, int is_leftaligned));
Packit Service 5a9772
	int trio_get_spacing TRIO_PROTO((trio_pointer_t ref)); /* (space) */
Packit Service 5a9772
	void trio_set_spacing TRIO_PROTO((trio_pointer_t ref, int is_space));
Packit Service 5a9772
	int trio_get_sign TRIO_PROTO((trio_pointer_t ref)); /* + */
Packit Service 5a9772
	void trio_set_sign TRIO_PROTO((trio_pointer_t ref, int is_showsign));
Packit 1fb8d4
#if TRIO_FEATURE_QUOTE
Packit Service 5a9772
	int trio_get_quote TRIO_PROTO((trio_pointer_t ref)); /* ' */
Packit Service 5a9772
	void trio_set_quote TRIO_PROTO((trio_pointer_t ref, int is_quote));
Packit 1fb8d4
#endif
Packit Service 5a9772
	int trio_get_upper TRIO_PROTO((trio_pointer_t ref));
Packit Service 5a9772
	void trio_set_upper TRIO_PROTO((trio_pointer_t ref, int is_upper));
Packit 1fb8d4
#if TRIO_FEATURE_INTMAX_T
Packit Service 5a9772
	int trio_get_largest TRIO_PROTO((trio_pointer_t ref)); /* j */
Packit Service 5a9772
	void trio_set_largest TRIO_PROTO((trio_pointer_t ref, int is_largest));
Packit 1fb8d4
#endif
Packit 1fb8d4
#if TRIO_FEATURE_PTRDIFF_T
Packit Service 5a9772
	int trio_get_ptrdiff TRIO_PROTO((trio_pointer_t ref)); /* t */
Packit Service 5a9772
	void trio_set_ptrdiff TRIO_PROTO((trio_pointer_t ref, int is_ptrdiff));
Packit 1fb8d4
#endif
Packit 1fb8d4
#if TRIO_FEATURE_SIZE_T
Packit Service 5a9772
	int trio_get_size TRIO_PROTO((trio_pointer_t ref)); /* z / Z */
Packit Service 5a9772
	void trio_set_size TRIO_PROTO((trio_pointer_t ref, int is_size));
Packit Service 5a9772
#endif
Packit Service 5a9772
Packit Service 5a9772
	/* Printing */
Packit Service 5a9772
	int trio_print_ref TRIO_PROTO((trio_pointer_t ref, const char* format, ...));
Packit Service 5a9772
	int trio_vprint_ref TRIO_PROTO((trio_pointer_t ref, const char* format, va_list args));
Packit Service 5a9772
	int trio_printv_ref TRIO_PROTO((trio_pointer_t ref, const char* format, trio_pointer_t* args));
Packit Service 5a9772
Packit Service 5a9772
	void trio_print_int TRIO_PROTO((trio_pointer_t ref, int number));
Packit Service 5a9772
	void trio_print_uint TRIO_PROTO((trio_pointer_t ref, unsigned int number));
Packit Service 5a9772
	/*  void trio_print_long TRIO_PROTO((trio_pointer_t ref, long number)); */
Packit Service 5a9772
	/*  void trio_print_ulong TRIO_PROTO((trio_pointer_t ref, unsigned long number)); */
Packit Service 5a9772
	void trio_print_double TRIO_PROTO((trio_pointer_t ref, double number));
Packit Service 5a9772
	void trio_print_string TRIO_PROTO((trio_pointer_t ref, TRIO_CONST char* string));
Packit Service 5a9772
	void trio_print_pointer TRIO_PROTO((trio_pointer_t ref, trio_pointer_t pointer));
Packit 1fb8d4
Packit 1fb8d4
#ifdef __cplusplus
Packit 1fb8d4
} /* extern "C" */
Packit 1fb8d4
#endif
Packit 1fb8d4
Packit 1fb8d4
#endif /* TRIO_TRIOP_H */