FreeRDP
trio.c File Reference
#include "triodef.h"
#include "trio.h"
#include "triop.h"
#include "trionan.h"
#include "triostr.h"
#include <limits.h>
#include <math.h>
#include <float.h>
#include <assert.h>
#include <ctype.h>
#include <varargs.h>
#include <stddef.h>
#include <errno.h>

Macros

#define NDEBUG
 
#define NULL   0
 
#define NIL   ((char)0)
 
#define FALSE   (1 == 0)
 
#define TRUE   (! FALSE)
 
#define BOOLEAN_T   int
 
#define VALID(x)   (NULL != (x))
 
#define TRIO_ERROR_RETURN(x, y)   (- ((x) + ((y) << 8)))
 
#define trio_floor(x)   floor((double)(x))
 
#define trio_ceil(x)   ceil((double)(x))
 
#define trio_fmod(x, y)   fmod((double)(x),(double)(y))
 
#define trio_pow(x, y)   pow((double)(x),(double)(y))
 
#define trio_log10(x)   log10((double)(x))
 
#define TRIO_FABS(x)   (((x) < 0.0) ? -(x) : (x))
 
#define DECIMAL_DIG   DBL_DIG
 
#define MAX_MANTISSA_DIGITS   DECIMAL_DIG
 
#define MAX_EXPONENT_DIGITS   3
 
#define MAX_DOUBLE_DIGITS   DBL_MAX_10_EXP
 
#define LDBL_DIG   DBL_DIG
 
#define LDBL_MANT_DIG   DBL_MANT_DIG
 
#define LDBL_EPSILON   DBL_EPSILON
 
#define MAX_CHARS_IN(x)   (sizeof(x) * CHAR_BIT)
 
#define POINTER_WIDTH   ((sizeof("0x") - 1) + sizeof(trio_pointer_t) * CHAR_BIT / 4)
 
#define INFINITE_LOWER   "inf"
 
#define INFINITE_UPPER   "INF"
 
#define LONG_INFINITE_LOWER   "infinite"
 
#define LONG_INFINITE_UPPER   "INFINITE"
 
#define NAN_LOWER   "nan"
 
#define NAN_UPPER   "NAN"
 
#define NO_GROUPING   ((int)CHAR_MAX)
 
#define FORMAT_SENTINEL   -1 /* marks end of parameters array */
 
#define FORMAT_UNKNOWN   0
 
#define FORMAT_INT   1
 
#define FORMAT_DOUBLE   2
 
#define FORMAT_CHAR   3
 
#define FORMAT_STRING   4
 
#define FORMAT_POINTER   5
 
#define FORMAT_COUNT   6
 
#define FORMAT_PARAMETER   7
 
#define FORMAT_GROUP   8
 
#define FORMAT_ERRNO   9
 
#define FORMAT_USER_DEFINED   10
 
#define CHAR_IDENTIFIER   '%'
 
#define CHAR_ALT_IDENTIFIER   '$'
 
#define CHAR_BACKSLASH   '\\'
 
#define CHAR_QUOTE   '\"'
 
#define CHAR_ADJUST   ' '
 
#define CLASS_ALNUM   "[:alnum:]"
 
#define CLASS_ALPHA   "[:alpha:]"
 
#define CLASS_BLANK   "[:blank:]"
 
#define CLASS_CNTRL   "[:cntrl:]"
 
#define CLASS_DIGIT   "[:digit:]"
 
#define CLASS_GRAPH   "[:graph:]"
 
#define CLASS_LOWER   "[:lower:]"
 
#define CLASS_PRINT   "[:print:]"
 
#define CLASS_PUNCT   "[:punct:]"
 
#define CLASS_SPACE   "[:space:]"
 
#define CLASS_UPPER   "[:upper:]"
 
#define CLASS_XDIGIT   "[:xdigit:]"
 
#define SPECIFIER_CHAR   'c'
 
#define SPECIFIER_STRING   's'
 
#define SPECIFIER_DECIMAL   'd'
 
#define SPECIFIER_INTEGER   'i'
 
#define SPECIFIER_UNSIGNED   'u'
 
#define SPECIFIER_OCTAL   'o'
 
#define SPECIFIER_HEX   'x'
 
#define SPECIFIER_HEX_UPPER   'X'
 
#define SPECIFIER_FLOAT_E   'e'
 
#define SPECIFIER_FLOAT_E_UPPER   'E'
 
#define SPECIFIER_FLOAT_F   'f'
 
#define SPECIFIER_FLOAT_F_UPPER   'F'
 
#define SPECIFIER_FLOAT_G   'g'
 
#define SPECIFIER_FLOAT_G_UPPER   'G'
 
#define SPECIFIER_POINTER   'p'
 
#define SPECIFIER_GROUP   '['
 
#define SPECIFIER_UNGROUP   ']'
 
#define SPECIFIER_COUNT   'n'
 
#define SPECIFIER_CHAR_UPPER   'C'
 
#define SPECIFIER_STRING_UPPER   'S'
 
#define SPECIFIER_HEXFLOAT   'a'
 
#define SPECIFIER_HEXFLOAT_UPPER   'A'
 
#define SPECIFIER_ERRNO   'm'
 
#define SPECIFIER_BINARY   'b'
 
#define SPECIFIER_BINARY_UPPER   'B'
 
#define SPECIFIER_USER_DEFINED_BEGIN   '<'
 
#define SPECIFIER_USER_DEFINED_END   '>'
 
#define SPECIFIER_USER_DEFINED_SEPARATOR   ':'
 
#define SPECIFIER_USER_DEFINED_EXTRA   '|'
 
#define QUALIFIER_POSITION   '$'
 
#define QUALIFIER_SHORT   'h'
 
#define QUALIFIER_LONG   'l'
 
#define QUALIFIER_LONG_UPPER   'L'
 
#define QUALIFIER_ALTERNATIVE   '#'
 
#define QUALIFIER_SPACE   ' '
 
#define QUALIFIER_PLUS   '+'
 
#define QUALIFIER_MINUS   '-'
 
#define QUALIFIER_DOT   '.'
 
#define QUALIFIER_STAR   '*'
 
#define QUALIFIER_CIRCUMFLEX   '^' /* For scanlists */
 
#define QUALIFIER_SIZE_T   'z'
 
#define QUALIFIER_PTRDIFF_T   't'
 
#define QUALIFIER_INTMAX_T   'j'
 
#define QUALIFIER_QUAD   'q'
 
#define QUALIFIER_SIZE_T_UPPER   'Z'
 
#define QUALIFIER_WIDECHAR   'w'
 
#define QUALIFIER_FIXED_SIZE   'I'
 
#define QUALIFIER_QUOTE   '\''
 
#define QUALIFIER_STICKY   '!'
 
#define QUALIFIER_VARSIZE   '&' /* This should remain undocumented */
 
#define QUALIFIER_ROUNDING_UPPER   'R'
 
#define QUALIFIER_PARAM   '@' /* Experimental */
 
#define QUALIFIER_COLON   ':' /* For scanlists */
 
#define QUALIFIER_EQUAL   '=' /* For scanlists */
 

Typedefs

typedef unsigned long trio_flags_t
 
typedef TRIO_SIGNED long int trio_longlong_t
 
typedef unsigned long int trio_ulonglong_t
 
typedef trio_longlong_t trio_intmax_t
 
typedef trio_ulonglong_t trio_uintmax_t
 
typedef TRIO_SIGNED char trio_int8_t
 
typedef TRIO_SIGNED short trio_int16_t
 
typedef TRIO_SIGNED int trio_int32_t
 
typedef trio_longlong_t trio_int64_t
 

Enumerations

enum  {
  TYPE_PRINT = 1, TYPE_SCAN = 2, FLAGS_NEW = 0, FLAGS_STICKY = 1,
  FLAGS_SPACE = 2 * FLAGS_STICKY, FLAGS_SHOWSIGN = 2 * FLAGS_SPACE, FLAGS_LEFTADJUST = 2 * FLAGS_SHOWSIGN, FLAGS_ALTERNATIVE = 2 * FLAGS_LEFTADJUST,
  FLAGS_SHORT = 2 * FLAGS_ALTERNATIVE, FLAGS_SHORTSHORT = 2 * FLAGS_SHORT, FLAGS_LONG = 2 * FLAGS_SHORTSHORT, FLAGS_QUAD = 2 * FLAGS_LONG,
  FLAGS_LONGDOUBLE = 2 * FLAGS_QUAD, FLAGS_SIZE_T = 2 * FLAGS_LONGDOUBLE, FLAGS_PTRDIFF_T = 2 * FLAGS_SIZE_T, FLAGS_INTMAX_T = 2 * FLAGS_PTRDIFF_T,
  FLAGS_NILPADDING = 2 * FLAGS_INTMAX_T, FLAGS_UNSIGNED = 2 * FLAGS_NILPADDING, FLAGS_UPPER = 2 * FLAGS_UNSIGNED, FLAGS_WIDTH = 2 * FLAGS_UPPER,
  FLAGS_WIDTH_PARAMETER = 2 * FLAGS_WIDTH, FLAGS_PRECISION = 2 * FLAGS_WIDTH_PARAMETER, FLAGS_PRECISION_PARAMETER = 2 * FLAGS_PRECISION, FLAGS_BASE = 2 * FLAGS_PRECISION_PARAMETER,
  FLAGS_BASE_PARAMETER = 2 * FLAGS_BASE, FLAGS_FLOAT_E = 2 * FLAGS_BASE_PARAMETER, FLAGS_FLOAT_G = 2 * FLAGS_FLOAT_E, FLAGS_QUOTE = 2 * FLAGS_FLOAT_G,
  FLAGS_WIDECHAR = 2 * FLAGS_QUOTE, FLAGS_IGNORE = 2 * FLAGS_WIDECHAR, FLAGS_IGNORE_PARAMETER = 2 * FLAGS_IGNORE, FLAGS_VARSIZE_PARAMETER = 2 * FLAGS_IGNORE_PARAMETER,
  FLAGS_FIXED_SIZE = 2 * FLAGS_VARSIZE_PARAMETER, FLAGS_LAST = FLAGS_FIXED_SIZE, FLAGS_EXCLUDE = FLAGS_SHORT, FLAGS_USER_DEFINED = FLAGS_IGNORE,
  FLAGS_USER_DEFINED_PARAMETER = FLAGS_IGNORE_PARAMETER, FLAGS_ROUNDING = FLAGS_INTMAX_T, FLAGS_ALL_VARSIZES = FLAGS_LONG | FLAGS_QUAD | FLAGS_INTMAX_T | FLAGS_PTRDIFF_T | FLAGS_SIZE_T, FLAGS_ALL_SIZES = FLAGS_ALL_VARSIZES | FLAGS_SHORTSHORT | FLAGS_SHORT,
  NO_POSITION = -1, NO_WIDTH = 0, NO_PRECISION = -1, NO_SIZE = -1,
  NO_BASE = -1, MIN_BASE = 2, MAX_BASE = 36, BASE_BINARY = 2,
  BASE_OCTAL = 8, BASE_DECIMAL = 10, BASE_HEX = 16, MAX_PARAMETERS = 64,
  MAX_CHARACTER_CLASS = UCHAR_MAX + 1, MAX_USER_NAME = 64, MAX_USER_DATA = 256, MAX_LOCALE_SEPARATOR_LENGTH = MB_LEN_MAX,
  MAX_LOCALE_GROUPS = 64
}
 

Functions

TRIO_PRIVATE void TrioInitializeParameter TRIO_ARGS1 ((parameter), trio_parameter_t *parameter)
 
TRIO_PRIVATE void TrioCopyParameter TRIO_ARGS2 ((target, source), trio_parameter_t *target, TRIO_CONST trio_parameter_t *source)
 
TRIO_PRIVATE BOOLEAN_T TrioIsQualifier TRIO_ARGS1 ((character), TRIO_CONST char character)
 
TRIO_PRIVATE int TrioCalcThousandSeparatorLength TRIO_ARGS1 ((digits), int digits)
 
TRIO_PRIVATE BOOLEAN_T TrioFollowedBySeparator TRIO_ARGS1 ((position), int position)
 
TRIO_PRIVATE int TrioGetPosition TRIO_ARGS2 ((format, offsetPointer), TRIO_CONST char *format, int *offsetPointer)
 
TRIO_PRIVATE trio_userdef_t *TrioFindNamespace TRIO_ARGS2 ((name, prev), TRIO_CONST char *name, trio_userdef_t **prev)
 
TRIO_PRIVATE trio_long_double_t TrioPower TRIO_ARGS2 ((number, exponent), int number, int exponent)
 
TRIO_PRIVATE trio_long_double_t TrioLogarithm TRIO_ARGS2 ((number, base), trio_long_double_t number, int base)
 
TRIO_PRIVATE double TrioLogarithmBase TRIO_ARGS1 ((base), int base)
 
TRIO_PRIVATE int TrioParseQualifiers TRIO_ARGS4 ((type, format, offset, parameter), int type, TRIO_CONST char *format, int offset, trio_parameter_t *parameter)
 
TRIO_PRIVATE int TrioParse TRIO_ARGS6 ((type, format, parameters, arglist, argfunc, argarray), int type, TRIO_CONST char *format, trio_parameter_t *parameters, va_list arglist, trio_argfunc_t argfunc, trio_pointer_t *argarray)
 
TRIO_PRIVATE void TrioWriteNumber TRIO_ARGS6 ((self, number, flags, width, precision, base), trio_class_t *self, trio_uintmax_t number, trio_flags_t flags, int width, int precision, int base)
 
TRIO_PRIVATE void TrioWriteStringCharacter TRIO_ARGS3 ((self, ch, flags), trio_class_t *self, int ch, trio_flags_t flags)
 
TRIO_PRIVATE void TrioWriteString TRIO_ARGS5 ((self, string, flags, width, precision), trio_class_t *self, TRIO_CONST char *string, trio_flags_t flags, int width, int precision)
 
TRIO_PRIVATE void TrioWriteDouble TRIO_ARGS6 ((self, number, flags, width, precision, base), trio_class_t *self, trio_long_double_t number, trio_flags_t flags, int width, int precision, int base)
 
TRIO_PRIVATE int TrioFormatProcess TRIO_ARGS3 ((data, format, parameters), trio_class_t *data, TRIO_CONST char *format, trio_parameter_t *parameters)
 
TRIO_PRIVATE int TrioFormatRef TRIO_ARGS5 ((reference, format, arglist, argfunc, argarray), trio_reference_t *reference, TRIO_CONST char *format, va_list arglist, trio_argfunc_t argfunc, trio_pointer_t *argarray)
 
TRIO_PRIVATE int TrioFormat TRIO_ARGS7 ((destination, destinationSize, OutStream, format, arglist, argfunc, argarray), trio_pointer_t destination, size_t destinationSize, void(*OutStream) TRIO_PROTO((trio_class_t *, int)), TRIO_CONST char *format, va_list arglist, trio_argfunc_t argfunc, trio_pointer_t *argarray)
 
TRIO_PRIVATE void TrioOutStreamFile TRIO_ARGS2 ((self, output), trio_class_t *self, int output)
 
trio_pointer_t TrioArrayGetter (trio_pointer_t context, int index, int type)
 
TRIO_PUBLIC int trio_printf TRIO_VARGS2 ((format, va_alist), TRIO_CONST char *format, TRIO_VA_DECL)
 
TRIO_PUBLIC int trio_vprintf TRIO_ARGS2 ((format, args), TRIO_CONST char *format, va_list args)
 
TRIO_PUBLIC int trio_printfv TRIO_ARGS2 ((format, args), TRIO_CONST char *format, trio_pointer_t *args)
 
TRIO_PUBLIC int trio_fprintf TRIO_VARGS3 ((file, format, va_alist), FILE *file, TRIO_CONST char *format, TRIO_VA_DECL)
 
TRIO_PUBLIC int trio_vfprintf TRIO_ARGS3 ((file, format, args), FILE *file, TRIO_CONST char *format, va_list args)
 
TRIO_PUBLIC int trio_fprintfv TRIO_ARGS3 ((file, format, args), FILE *file, TRIO_CONST char *format, trio_pointer_t *args)
 
TRIO_PUBLIC int trio_dprintf TRIO_VARGS3 ((fd, format, va_alist), int fd, TRIO_CONST char *format, TRIO_VA_DECL)
 
TRIO_PUBLIC int trio_vdprintf TRIO_ARGS3 ((fd, format, args), int fd, TRIO_CONST char *format, va_list args)
 
TRIO_PUBLIC int trio_dprintfv TRIO_ARGS3 ((fd, format, args), int fd, TRIO_CONST char *format, trio_pointer_t *args)
 
TRIO_PUBLIC int trio_cprintf TRIO_VARGS4 ((stream, closure, format, va_alist), trio_outstream_t stream, trio_pointer_t closure, TRIO_CONST char *format, TRIO_VA_DECL)
 
TRIO_PUBLIC int trio_vcprintf TRIO_ARGS4 ((stream, closure, format, args), trio_outstream_t stream, trio_pointer_t closure, TRIO_CONST char *format, va_list args)
 
TRIO_PUBLIC int trio_cprintfv TRIO_ARGS4 ((stream, closure, format, args), trio_outstream_t stream, trio_pointer_t closure, TRIO_CONST char *format, trio_pointer_t *args)
 
TRIO_PUBLIC int trio_cprintff TRIO_ARGS5 ((stream, closure, format, argfunc, context), trio_outstream_t stream, trio_pointer_t closure, TRIO_CONST char *format, trio_argfunc_t argfunc, trio_pointer_t context)
 
TRIO_PUBLIC int trio_sprintf TRIO_VARGS3 ((buffer, format, va_alist), char *buffer, TRIO_CONST char *format, TRIO_VA_DECL)
 
TRIO_PUBLIC int trio_vsprintf TRIO_ARGS3 ((buffer, format, args), char *buffer, TRIO_CONST char *format, va_list args)
 
TRIO_PUBLIC int trio_sprintfv TRIO_ARGS3 ((buffer, format, args), char *buffer, TRIO_CONST char *format, trio_pointer_t *args)
 
TRIO_PUBLIC int trio_snprintf TRIO_VARGS4 ((buffer, max, format, va_alist), char *buffer, size_t max, TRIO_CONST char *format, TRIO_VA_DECL)
 
TRIO_PUBLIC int trio_vsnprintf TRIO_ARGS4 ((buffer, max, format, args), char *buffer, size_t max, TRIO_CONST char *format, va_list args)
 
TRIO_PUBLIC int trio_snprintfv TRIO_ARGS4 ((buffer, max, format, args), char *buffer, size_t max, TRIO_CONST char *format, trio_pointer_t *args)
 
TRIO_PUBLIC int trio_asprintf TRIO_VARGS3 ((result, format, va_alist), char **result, TRIO_CONST char *format, TRIO_VA_DECL)
 
TRIO_PUBLIC int trio_vasprintf TRIO_ARGS3 ((result, format, args), char **result, TRIO_CONST char *format, va_list args)
 
TRIO_PUBLIC int trio_asprintfv TRIO_ARGS3 ((result, format, args), char **result, TRIO_CONST char *format, trio_pointer_t *args)
 
TRIO_PUBLIC trio_pointer_t trio_register TRIO_ARGS2 ((callback, name), trio_callback_t callback, TRIO_CONST char *name)
 
void trio_unregister TRIO_ARGS1 ((handle), trio_pointer_t handle)
 
TRIO_CONST char *trio_get_format TRIO_ARGS1 ((ref), trio_pointer_t ref)
 
void trio_set_width TRIO_ARGS2 ((ref, width), trio_pointer_t ref, int width)
 
void trio_set_precision TRIO_ARGS2 ((ref, precision), trio_pointer_t ref, int precision)
 
void trio_set_base TRIO_ARGS2 ((ref, base), trio_pointer_t ref, int base)
 
void trio_set_long TRIO_ARGS2 ((ref, is_long), trio_pointer_t ref, int is_long)
 
void trio_set_longlong TRIO_ARGS2 ((ref, is_longlong), trio_pointer_t ref, int is_longlong)
 
void trio_set_longdouble TRIO_ARGS2 ((ref, is_longdouble), trio_pointer_t ref, int is_longdouble)
 
void trio_set_short TRIO_ARGS2 ((ref, is_short), trio_pointer_t ref, int is_short)
 
void trio_set_shortshort TRIO_ARGS2 ((ref, is_shortshort), trio_pointer_t ref, int is_shortshort)
 
void trio_set_alternative TRIO_ARGS2 ((ref, is_alternative), trio_pointer_t ref, int is_alternative)
 
void trio_set_alignment TRIO_ARGS2 ((ref, is_leftaligned), trio_pointer_t ref, int is_leftaligned)
 
void trio_set_spacing TRIO_ARGS2 ((ref, is_space), trio_pointer_t ref, int is_space)
 
void trio_set_sign TRIO_ARGS2 ((ref, is_sign), trio_pointer_t ref, int is_sign)
 
void trio_set_padding TRIO_ARGS2 ((ref, is_padding), trio_pointer_t ref, int is_padding)
 
void trio_set_quote TRIO_ARGS2 ((ref, is_quote), trio_pointer_t ref, int is_quote)
 
void trio_set_upper TRIO_ARGS2 ((ref, is_upper), trio_pointer_t ref, int is_upper)
 
void trio_set_largest TRIO_ARGS2 ((ref, is_largest), trio_pointer_t ref, int is_largest)
 
void trio_set_ptrdiff TRIO_ARGS2 ((ref, is_ptrdiff), trio_pointer_t ref, int is_ptrdiff)
 
void trio_set_size TRIO_ARGS2 ((ref, is_size), trio_pointer_t ref, int is_size)
 
void trio_print_int TRIO_ARGS2 ((ref, number), trio_pointer_t ref, int number)
 
void trio_print_uint TRIO_ARGS2 ((ref, number), trio_pointer_t ref, unsigned int number)
 
void trio_print_double TRIO_ARGS2 ((ref, number), trio_pointer_t ref, double number)
 
void trio_print_string TRIO_ARGS2 ((ref, string), trio_pointer_t ref, TRIO_CONST char *string)
 
int trio_print_ref TRIO_VARGS3 ((ref, format, va_alist), trio_pointer_t ref, TRIO_CONST char *format, TRIO_VA_DECL)
 
int trio_vprint_ref TRIO_ARGS3 ((ref, format, arglist), trio_pointer_t ref, TRIO_CONST char *format, va_list arglist)
 
int trio_printv_ref TRIO_ARGS3 ((ref, format, argarray), trio_pointer_t ref, TRIO_CONST char *format, trio_pointer_t *argarray)
 
void trio_print_pointer TRIO_ARGS2 ((ref, pointer), trio_pointer_t ref, trio_pointer_t pointer)
 
TRIO_PUBLIC void trio_locale_set_decimal_point TRIO_ARGS1 ((decimalPoint), char *decimalPoint)
 
TRIO_PUBLIC void trio_locale_set_thousand_separator TRIO_ARGS1 ((thousandSeparator), char *thousandSeparator)
 
TRIO_PUBLIC void trio_locale_set_grouping TRIO_ARGS1 ((grouping), char *grouping)
 
TRIO_PRIVATE int TrioSkipWhitespaces TRIO_ARGS1 ((self), trio_class_t *self)
 
TRIO_PRIVATE void TrioGetCollation (TRIO_NOARGS)
 
TRIO_PRIVATE int TrioGetCharacterClass TRIO_ARGS4 ((format, offsetPointer, flagsPointer, characterclass), TRIO_CONST char *format, int *offsetPointer, trio_flags_t *flagsPointer, int *characterclass)
 
TRIO_PRIVATE BOOLEAN_T TrioReadNumber TRIO_ARGS5 ((self, target, flags, width, base), trio_class_t *self, trio_uintmax_t *target, trio_flags_t flags, int width, int base)
 
TRIO_PRIVATE int TrioReadChar TRIO_ARGS4 ((self, target, flags, width), trio_class_t *self, char *target, trio_flags_t flags, int width)
 
TRIO_PRIVATE BOOLEAN_T TrioReadGroup TRIO_ARGS5 ((self, target, characterclass, flags, width), trio_class_t *self, char *target, int *characterclass, trio_flags_t flags, int width)
 
TRIO_PRIVATE BOOLEAN_T TrioReadPointer TRIO_ARGS3 ((self, target, flags), trio_class_t *self, trio_pointer_t *target, trio_flags_t flags)
 
TRIO_PRIVATE int TrioScan TRIO_ARGS8 ((source, sourceSize, InStream, UndoStream, format, arglist, argfunc, argarray), trio_pointer_t source, size_t sourceSize, void(*InStream) TRIO_PROTO((trio_class_t *, int *)), void(*UndoStream) TRIO_PROTO((trio_class_t *)), TRIO_CONST char *format, va_list arglist, trio_argfunc_t argfunc, trio_pointer_t *argarray)
 
TRIO_PRIVATE void TrioInStreamFile TRIO_ARGS2 ((self, intPointer), trio_class_t *self, int *intPointer)
 
TRIO_PUBLIC int trio_cscanf TRIO_VARGS4 ((stream, closure, format, va_alist), trio_instream_t stream, trio_pointer_t closure, TRIO_CONST char *format, TRIO_VA_DECL)
 
TRIO_PUBLIC int trio_vcscanf TRIO_ARGS4 ((stream, closure, format, args), trio_instream_t stream, trio_pointer_t closure, TRIO_CONST char *format, va_list args)
 
TRIO_PUBLIC int trio_cscanfv TRIO_ARGS4 ((stream, closure, format, args), trio_instream_t stream, trio_pointer_t closure, TRIO_CONST char *format, trio_pointer_t *args)
 
TRIO_PUBLIC int trio_cscanff TRIO_ARGS5 ((stream, closure, format, argfunc, context), trio_instream_t stream, trio_pointer_t closure, TRIO_CONST char *format, trio_argfunc_t argfunc, trio_pointer_t context)
 
TRIO_PUBLIC int trio_sscanf TRIO_VARGS3 ((buffer, format, va_alist), TRIO_CONST char *buffer, TRIO_CONST char *format, TRIO_VA_DECL)
 
TRIO_PUBLIC int trio_vsscanf TRIO_ARGS3 ((buffer, format, args), TRIO_CONST char *buffer, TRIO_CONST char *format, va_list args)
 
TRIO_PUBLIC int trio_sscanfv TRIO_ARGS3 ((buffer, format, args), TRIO_CONST char *buffer, TRIO_CONST char *format, trio_pointer_t *args)
 
TRIO_PUBLIC TRIO_CONST char *trio_strerror TRIO_ARGS1 ((errorcode), int errorcode)
 

Variables

static TRIO_CONST char internalNullString [] = "(nil)"
 
static int internalDecimalPointLength = 1
 
static char internalDecimalPoint = '.'
 
static char internalDecimalPointString [MAX_LOCALE_SEPARATOR_LENGTH+1] = "."
 
static int internalThousandSeparatorLength = 1
 
static char internalThousandSeparator [MAX_LOCALE_SEPARATOR_LENGTH+1] = ","
 
static char internalGrouping [MAX_LOCALE_GROUPS] = { (char)NO_GROUPING }
 
static TRIO_CONST char internalDigitsLower [] = "0123456789abcdefghijklmnopqrstuvwxyz"
 
static TRIO_CONST char internalDigitsUpper [] = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"
 
static BOOLEAN_T internalDigitsUnconverted = TRUE
 
static int internalDigitArray [128]
 
static BOOLEAN_T internalCollationUnconverted = TRUE
 
static char internalCollationArray [MAX_CHARACTER_CLASS][MAX_CHARACTER_CLASS]
 
static TRIO_VOLATILE trio_callback_t internalEnterCriticalRegion = NULL
 
static TRIO_VOLATILE trio_callback_t internalLeaveCriticalRegion = NULL
 
static trio_userdef_t * internalUserDef = NULL
 

Macro Definition Documentation

#define BOOLEAN_T   int
#define CHAR_ADJUST   ' '
#define CHAR_ALT_IDENTIFIER   '$'
#define CHAR_BACKSLASH   '\\'
#define CHAR_IDENTIFIER   '%'
#define CHAR_QUOTE   '\"'
#define CLASS_ALNUM   "[:alnum:]"
#define CLASS_ALPHA   "[:alpha:]"
#define CLASS_BLANK   "[:blank:]"
#define CLASS_CNTRL   "[:cntrl:]"
#define CLASS_DIGIT   "[:digit:]"
#define CLASS_GRAPH   "[:graph:]"
#define CLASS_LOWER   "[:lower:]"
#define CLASS_PRINT   "[:print:]"
#define CLASS_PUNCT   "[:punct:]"
#define CLASS_SPACE   "[:space:]"
#define CLASS_UPPER   "[:upper:]"
#define CLASS_XDIGIT   "[:xdigit:]"
#define DECIMAL_DIG   DBL_DIG
#define FALSE   (1 == 0)
#define FORMAT_CHAR   3
#define FORMAT_COUNT   6
#define FORMAT_DOUBLE   2
#define FORMAT_ERRNO   9
#define FORMAT_GROUP   8
#define FORMAT_INT   1
#define FORMAT_PARAMETER   7
#define FORMAT_POINTER   5
#define FORMAT_SENTINEL   -1 /* marks end of parameters array */
#define FORMAT_STRING   4
#define FORMAT_UNKNOWN   0
#define FORMAT_USER_DEFINED   10
#define INFINITE_LOWER   "inf"
#define INFINITE_UPPER   "INF"
#define LDBL_DIG   DBL_DIG
#define LDBL_EPSILON   DBL_EPSILON
#define LDBL_MANT_DIG   DBL_MANT_DIG
#define LONG_INFINITE_LOWER   "infinite"
#define LONG_INFINITE_UPPER   "INFINITE"
#define MAX_CHARS_IN (   x)    (sizeof(x) * CHAR_BIT)
#define MAX_DOUBLE_DIGITS   DBL_MAX_10_EXP
#define MAX_EXPONENT_DIGITS   3
#define MAX_MANTISSA_DIGITS   DECIMAL_DIG
#define NAN_LOWER   "nan"
#define NAN_UPPER   "NAN"
#define NDEBUG
#define NIL   ((char)0)
#define NO_GROUPING   ((int)CHAR_MAX)
if availableBytes return NULL   0
#define POINTER_WIDTH   ((sizeof("0x") - 1) + sizeof(trio_pointer_t) * CHAR_BIT / 4)
#define QUALIFIER_ALTERNATIVE   '#'
#define QUALIFIER_CIRCUMFLEX   '^' /* For scanlists */
#define QUALIFIER_COLON   ':' /* For scanlists */
#define QUALIFIER_DOT   '.'
#define QUALIFIER_EQUAL   '=' /* For scanlists */
#define QUALIFIER_FIXED_SIZE   'I'
#define QUALIFIER_INTMAX_T   'j'
#define QUALIFIER_LONG   'l'
#define QUALIFIER_LONG_UPPER   'L'
#define QUALIFIER_MINUS   '-'
#define QUALIFIER_PARAM   '@' /* Experimental */
#define QUALIFIER_PLUS   '+'
#define QUALIFIER_POSITION   '$'
#define QUALIFIER_PTRDIFF_T   't'
#define QUALIFIER_QUAD   'q'
#define QUALIFIER_QUOTE   '\''
#define QUALIFIER_ROUNDING_UPPER   'R'
#define QUALIFIER_SHORT   'h'
#define QUALIFIER_SIZE_T   'z'
#define QUALIFIER_SIZE_T_UPPER   'Z'
#define QUALIFIER_SPACE   ' '
#define QUALIFIER_STAR   '*'
#define QUALIFIER_STICKY   '!'
#define QUALIFIER_VARSIZE   '&' /* This should remain undocumented */
#define QUALIFIER_WIDECHAR   'w'
#define SPECIFIER_BINARY   'b'
#define SPECIFIER_BINARY_UPPER   'B'
#define SPECIFIER_CHAR   'c'
#define SPECIFIER_CHAR_UPPER   'C'
#define SPECIFIER_COUNT   'n'
#define SPECIFIER_DECIMAL   'd'
#define SPECIFIER_ERRNO   'm'
#define SPECIFIER_FLOAT_E   'e'
#define SPECIFIER_FLOAT_E_UPPER   'E'
#define SPECIFIER_FLOAT_F   'f'
#define SPECIFIER_FLOAT_F_UPPER   'F'
#define SPECIFIER_FLOAT_G   'g'
#define SPECIFIER_FLOAT_G_UPPER   'G'
#define SPECIFIER_GROUP   '['
#define SPECIFIER_HEX   'x'
#define SPECIFIER_HEX_UPPER   'X'
#define SPECIFIER_HEXFLOAT   'a'
#define SPECIFIER_HEXFLOAT_UPPER   'A'
#define SPECIFIER_INTEGER   'i'
#define SPECIFIER_OCTAL   'o'
#define SPECIFIER_POINTER   'p'
#define SPECIFIER_STRING   's'
#define SPECIFIER_STRING_UPPER   'S'
#define SPECIFIER_UNGROUP   ']'
#define SPECIFIER_UNSIGNED   'u'
#define SPECIFIER_USER_DEFINED_BEGIN   '<'
#define SPECIFIER_USER_DEFINED_END   '>'
#define SPECIFIER_USER_DEFINED_EXTRA   '|'
#define SPECIFIER_USER_DEFINED_SEPARATOR   ':'
#define trio_ceil (   x)    ceil((double)(x))
#define TRIO_ERROR_RETURN (   x,
  y 
)    (- ((x) + ((y) << 8)))
#define TRIO_FABS (   x)    (((x) < 0.0) ? -(x) : (x))
#define trio_floor (   x)    floor((double)(x))
#define trio_fmod (   x,
  y 
)    fmod((double)(x),(double)(y))
#define trio_log10 (   x)    log10((double)(x))
#define trio_pow (   x,
  y 
)    pow((double)(x),(double)(y))
#define TRUE   (! FALSE)
#define VALID (   x)    (NULL != (x))

Typedef Documentation

typedef unsigned long trio_flags_t
typedef TRIO_SIGNED short trio_int16_t
typedef TRIO_SIGNED char trio_int8_t
typedef TRIO_SIGNED long int trio_longlong_t
typedef unsigned long int trio_ulonglong_t

Enumeration Type Documentation

anonymous enum
Enumerator
TYPE_PRINT 
TYPE_SCAN 
FLAGS_NEW 
FLAGS_STICKY 
FLAGS_SPACE 
FLAGS_SHOWSIGN 
FLAGS_LEFTADJUST 
FLAGS_ALTERNATIVE 
FLAGS_SHORT 
FLAGS_SHORTSHORT 
FLAGS_LONG 
FLAGS_QUAD 
FLAGS_LONGDOUBLE 
FLAGS_SIZE_T 
FLAGS_PTRDIFF_T 
FLAGS_INTMAX_T 
FLAGS_NILPADDING 
FLAGS_UNSIGNED 
FLAGS_UPPER 
FLAGS_WIDTH 
FLAGS_WIDTH_PARAMETER 
FLAGS_PRECISION 
FLAGS_PRECISION_PARAMETER 
FLAGS_BASE 
FLAGS_BASE_PARAMETER 
FLAGS_FLOAT_E 
FLAGS_FLOAT_G 
FLAGS_QUOTE 
FLAGS_WIDECHAR 
FLAGS_IGNORE 
FLAGS_IGNORE_PARAMETER 
FLAGS_VARSIZE_PARAMETER 
FLAGS_FIXED_SIZE 
FLAGS_LAST 
FLAGS_EXCLUDE 
FLAGS_USER_DEFINED 
FLAGS_USER_DEFINED_PARAMETER 
FLAGS_ROUNDING 
FLAGS_ALL_VARSIZES 
FLAGS_ALL_SIZES 
NO_POSITION 
NO_WIDTH 
NO_PRECISION 
NO_SIZE 
NO_BASE 
MIN_BASE 
MAX_BASE 
BASE_BINARY 
BASE_OCTAL 
BASE_DECIMAL 
BASE_HEX 
MAX_PARAMETERS 
MAX_CHARACTER_CLASS 
MAX_USER_NAME 
MAX_USER_DATA 
MAX_LOCALE_SEPARATOR_LENGTH 
MAX_LOCALE_GROUPS 

Function Documentation

TRIO_PRIVATE void TrioInitializeParameter TRIO_ARGS1 ( (parameter)  ,
trio_parameter_t *  parameter 
)

Here is the caller graph for this function:

TRIO_PRIVATE BOOLEAN_T TrioIsQualifier TRIO_ARGS1 ( (character)  ,
TRIO_CONST char  character 
)
TRIO_PRIVATE int TrioCalcThousandSeparatorLength TRIO_ARGS1 ( (digits)  ,
int  digits 
)
TRIO_PRIVATE BOOLEAN_T TrioFollowedBySeparator TRIO_ARGS1 ( (position)  ,
int  position 
)
TRIO_PRIVATE double TrioLogarithmBase TRIO_ARGS1 ( (base)  ,
int  base 
)
TRIO_PUBLIC void trio_locale_set_decimal_point TRIO_ARGS1 ( (decimalPoint)  ,
char *  decimalPoint 
)
TRIO_PUBLIC void trio_locale_set_thousand_separator TRIO_ARGS1 ( (thousandSeparator)  ,
char *  thousandSeparator 
)
TRIO_PUBLIC void trio_locale_set_grouping TRIO_ARGS1 ( (grouping)  ,
char *  grouping 
)
TRIO_PRIVATE void TrioUndoStreamFile TRIO_ARGS1 ( (self)  ,
trio_class_t *  self 
)
TRIO_PUBLIC TRIO_CONST char* trio_strerror TRIO_ARGS1 ( (errorcode)  ,
int  errorcode 
)
TRIO_PRIVATE void TrioCopyParameter TRIO_ARGS2 ( (target, source)  ,
trio_parameter_t *  target,
TRIO_CONST trio_parameter_t *  source 
)

Here is the caller graph for this function:

TRIO_PRIVATE int TrioGetPosition TRIO_ARGS2 ( (format, offsetPointer)  ,
TRIO_CONST char *  format,
int *  offsetPointer 
)
TRIO_PRIVATE trio_userdef_t* TrioFindNamespace TRIO_ARGS2 ( (name, prev)  ,
TRIO_CONST char *  name,
trio_userdef_t **  prev 
)

Here is the call graph for this function:

TRIO_PRIVATE trio_long_double_t TrioPower TRIO_ARGS2 ( (number, exponent)  ,
int  number,
int  exponent 
)

Here is the call graph for this function:

TRIO_PRIVATE trio_long_double_t TrioLogarithm TRIO_ARGS2 ( (number, base)  ,
trio_long_double_t  number,
int  base 
)

Here is the call graph for this function:

TRIO_PRIVATE void TrioOutStreamStringDynamic TRIO_ARGS2 ( (self, output)  ,
trio_class_t *  self,
int  output 
)

Here is the call graph for this function:

TRIO_PRIVATE void TrioInStreamString TRIO_ARGS2 ( (self, intPointer)  ,
trio_class_t *  self,
int *  intPointer 
)

Here is the call graph for this function:

TRIO_PRIVATE void TrioWriteStringCharacter TRIO_ARGS3 ( (self, ch, flags ,
trio_class_t *  self,
int  ch,
trio_flags_t  flags 
)

Here is the caller graph for this function:

TRIO_PRIVATE int TrioScanProcess TRIO_ARGS3 ( (data, format, parameters)  ,
trio_class_t *  data,
TRIO_CONST char *  format,
trio_parameter_t *  parameters 
)

Here is the call graph for this function:

TRIO_PRIVATE BOOLEAN_T TrioReadPointer TRIO_ARGS3 ( (self, target, flags ,
trio_class_t *  self,
trio_pointer_t target,
trio_flags_t  flags 
)

Here is the call graph for this function:

TRIO_PRIVATE int TrioParseSpecifier TRIO_ARGS4 ( (type, format, offset, parameter)  ,
int  type,
TRIO_CONST char *  format,
int  offset,
trio_parameter_t *  parameter 
)

Here is the call graph for this function:

Here is the caller graph for this function:

TRIO_PRIVATE int TrioGetCharacterClass TRIO_ARGS4 ( (format, offsetPointer, flagsPointer, characterclass)  ,
TRIO_CONST char *  format,
int *  offsetPointer,
trio_flags_t flagsPointer,
int *  characterclass 
)

Here is the call graph for this function:

TRIO_PRIVATE BOOLEAN_T TrioReadDouble TRIO_ARGS4 ( (self, target, flags, width ,
trio_class_t *  self,
char *  target,
trio_flags_t  flags,
int  width 
)

Here is the call graph for this function:

TRIO_PRIVATE void TrioWriteString TRIO_ARGS5 ( (self, string, flags, width, precision)  ,
trio_class_t *  self,
TRIO_CONST char *  string,
trio_flags_t  flags,
int  width,
int  precision 
)

Here is the call graph for this function:

TRIO_PRIVATE int TrioFormatRef TRIO_ARGS5 ( (reference, format, arglist, argfunc, argarray)  ,
trio_reference_t *  reference,
TRIO_CONST char *  format,
va_list  arglist,
trio_argfunc_t  argfunc,
trio_pointer_t argarray 
)
TRIO_PRIVATE BOOLEAN_T TrioReadNumber TRIO_ARGS5 ( (self, target, flags, width, base)  ,
trio_class_t *  self,
trio_uintmax_t target,
trio_flags_t  flags,
int  width,
int  base 
)

Here is the call graph for this function:

TRIO_PRIVATE BOOLEAN_T TrioReadGroup TRIO_ARGS5 ( (self, target, characterclass, flags, width ,
trio_class_t *  self,
char *  target,
int *  characterclass,
trio_flags_t  flags,
int  width 
)

Here is the call graph for this function:

TRIO_PRIVATE int TrioParse TRIO_ARGS6 ( (type, format, parameters, arglist, argfunc, argarray)  ,
int  type,
TRIO_CONST char *  format,
trio_parameter_t *  parameters,
va_list  arglist,
trio_argfunc_t  argfunc,
trio_pointer_t argarray 
)

Here is the call graph for this function:

TRIO_PRIVATE void TrioWriteNumber TRIO_ARGS6 ( (self, number, flags, width, precision, base)  ,
trio_class_t *  self,
trio_uintmax_t  number,
trio_flags_t  flags,
int  width,
int  precision,
int  base 
)

Here is the call graph for this function:

TRIO_PRIVATE void TrioWriteDouble TRIO_ARGS6 ( (self, number, flags, width, precision, base)  ,
trio_class_t *  self,
trio_long_double_t  number,
trio_flags_t  flags,
int  width,
int  precision,
int  base 
)

Here is the call graph for this function:

TRIO_PRIVATE int TrioFormat TRIO_ARGS7 ( (destination, destinationSize, OutStream, format, arglist, argfunc, argarray)  ,
trio_pointer_t  destination,
size_t  destinationSize,
void *OutStream   TRIO_PROTO(trio_class_t *, int),
TRIO_CONST char *  format,
va_list  arglist,
trio_argfunc_t  argfunc,
trio_pointer_t argarray 
)

Here is the call graph for this function:

TRIO_PRIVATE int TrioScan TRIO_ARGS8 ( (source, sourceSize, InStream, UndoStream, format, arglist, argfunc, argarray)  ,
trio_pointer_t  source,
size_t  sourceSize,
void *InStream   TRIO_PROTO(trio_class_t *, int *),
void *UndoStream   TRIO_PROTO(trio_class_t *),
TRIO_CONST char *  format,
va_list  arglist,
trio_argfunc_t  argfunc,
trio_pointer_t argarray 
)

Here is the call graph for this function:

trio_pointer_t TrioArrayGetter ( trio_pointer_t  context,
int  index,
int  type 
)

Here is the caller graph for this function:

TRIO_PRIVATE void TrioGetCollation ( TRIO_NOARGS  )

Here is the caller graph for this function:

Variable Documentation

char internalCollationArray[MAX_CHARACTER_CLASS][MAX_CHARACTER_CLASS]
static
BOOLEAN_T internalCollationUnconverted = TRUE
static
char internalDecimalPoint = '.'
static
int internalDecimalPointLength = 1
static
char internalDecimalPointString[MAX_LOCALE_SEPARATOR_LENGTH+1] = "."
static
int internalDigitArray[128]
static
TRIO_CONST char internalDigitsLower[] = "0123456789abcdefghijklmnopqrstuvwxyz"
static
BOOLEAN_T internalDigitsUnconverted = TRUE
static
TRIO_CONST char internalDigitsUpper[] = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"
static
TRIO_VOLATILE trio_callback_t internalEnterCriticalRegion = NULL
static
char internalGrouping[MAX_LOCALE_GROUPS] = { (char)NO_GROUPING }
static
TRIO_VOLATILE trio_callback_t internalLeaveCriticalRegion = NULL
static
TRIO_CONST char internalNullString[] = "(nil)"
static
char internalThousandSeparator[MAX_LOCALE_SEPARATOR_LENGTH+1] = ","
static
int internalThousandSeparatorLength = 1
static
trio_userdef_t* internalUserDef = NULL
static