ReactOS  0.4.14-dev-50-g13bb5e2
trio.c File Reference
#include "triodef.h"
#include "trio.h"
#include "triop.h"
#include "trionan.h"
#include "triostr.h"
#include <math.h>
#include <limits.h>
#include <float.h>
#include <assert.h>
#include <ctype.h>
#include <varargs.h>
#include <stddef.h>
Include dependency graph for trio.c:

Go to the source code of this file.

Classes

struct  trio_parameter_t
 
struct  trio_custom_t
 
struct  _trio_class_t
 
struct  _trio_reference_t
 
struct  _trio_userdef_t
 

Macros

#define NDEBUG
 
#define isblank(x)   (((x)==32) || ((x)==9))
 
#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_VA_LIST_PTR   va_list *
 
#define TRIO_VA_LIST_ADDR(l)   (&(l))
 
#define TRIO_VA_LIST_DEREF(l)   (*(l))
 
#define floorl(x)   floor((double)(x))
 
#define fmodl(x, y)   fmod((double)(x),(double)(y))
 
#define powl(x, y)   pow((double)(x),(double)(y))
 
#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 isascii(x)   ((unsigned int)(x) < 128)
 
#define NO_GROUPING   ((int)CHAR_MAX)
 
#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_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 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_PARAM   '@' /* Experimental */
 
#define QUALIFIER_COLON   ':' /* For scanlists */
 
#define QUALIFIER_EQUAL   '=' /* For scanlists */
 
#define QUALIFIER_ROUNDING_UPPER   'R'
 

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
 
typedef struct _trio_class_t trio_class_t
 
typedef struct _trio_reference_t trio_reference_t
 
typedef struct _trio_userdef_t trio_userdef_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_ALLOC = 2 * FLAGS_WIDECHAR, FLAGS_IGNORE = 2 * FLAGS_ALLOC, 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_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, DYNAMIC_START_SIZE = 32
}
 

Functions

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, indexPointer), TRIO_CONST char *format, int *indexPointer)
 
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 double TrioLogarithm TRIO_ARGS2 ((number, base), double number, int base)
 
TRIO_PRIVATE double TrioLogarithmBase TRIO_ARGS1 ((base), int base)
 
TRIO_PRIVATE int TrioParse TRIO_ARGS5 ((type, format, parameters, arglist, argarray), int type, TRIO_CONST char *format, trio_parameter_t *parameters, TRIO_VA_LIST_PTR arglist, 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_ARGS4 ((reference, format, arglist, argarray), trio_reference_t *reference, TRIO_CONST char *format, TRIO_VA_LIST_PTR arglist, trio_pointer_t *argarray)
 
TRIO_PRIVATE int TrioFormat TRIO_ARGS6 ((destination, destinationSize, OutStream, format, arglist, argarray), trio_pointer_t destination, size_t destinationSize, void(*OutStream) TRIO_PROTO((trio_class_t *, int)), TRIO_CONST char *format, TRIO_VA_LIST_PTR arglist, trio_pointer_t *argarray)
 
TRIO_PRIVATE void TrioOutStreamFile TRIO_ARGS2 ((self, output), trio_class_t *self, int output)
 
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, void **args)
 
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 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, 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, indexPointer, flagsPointer, characterclass), TRIO_CONST char *format, int *indexPointer, 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 TrioReadDouble TRIO_ARGS4 ((self, target, flags, width), trio_class_t *self, trio_pointer_t target, 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_ARGS6 ((source, sourceSize, InStream, format, arglist, argarray), trio_pointer_t source, size_t sourceSize, void(*InStream) TRIO_PROTO((trio_class_t *, int *)), TRIO_CONST char *format, TRIO_VA_LIST_PTR arglist, 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_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 rcsid [] = "@(#)$Id$"
 
static TRIO_CONST char internalNullString [] = "(nil)"
 
static int internalDecimalPointLength = 1
 
static int internalThousandSeparatorLength = 1
 
static char internalDecimalPoint = '.'
 
static char internalDecimalPointString [MAX_LOCALE_SEPARATOR_LENGTH+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_tinternalUserDef = NULL
 

Macro Definition Documentation

◆ BOOLEAN_T

#define BOOLEAN_T   int

Definition at line 114 of file trio.c.

◆ CHAR_ADJUST

#define CHAR_ADJUST   ' '

Definition at line 432 of file trio.c.

◆ CHAR_BACKSLASH

#define CHAR_BACKSLASH   '\\'

Definition at line 430 of file trio.c.

◆ CHAR_IDENTIFIER

#define CHAR_IDENTIFIER   '%'

Definition at line 429 of file trio.c.

◆ CHAR_QUOTE

#define CHAR_QUOTE   '\"'

Definition at line 431 of file trio.c.

◆ CLASS_ALNUM

#define CLASS_ALNUM   "[:alnum:]"

Definition at line 435 of file trio.c.

◆ CLASS_ALPHA

#define CLASS_ALPHA   "[:alpha:]"

Definition at line 436 of file trio.c.

◆ CLASS_BLANK

#define CLASS_BLANK   "[:blank:]"

Definition at line 437 of file trio.c.

◆ CLASS_CNTRL

#define CLASS_CNTRL   "[:cntrl:]"

Definition at line 438 of file trio.c.

◆ CLASS_DIGIT

#define CLASS_DIGIT   "[:digit:]"

Definition at line 439 of file trio.c.

◆ CLASS_GRAPH

#define CLASS_GRAPH   "[:graph:]"

Definition at line 440 of file trio.c.

◆ CLASS_LOWER

#define CLASS_LOWER   "[:lower:]"

Definition at line 441 of file trio.c.

◆ CLASS_PRINT

#define CLASS_PRINT   "[:print:]"

Definition at line 442 of file trio.c.

◆ CLASS_PUNCT

#define CLASS_PUNCT   "[:punct:]"

Definition at line 443 of file trio.c.

◆ CLASS_SPACE

#define CLASS_SPACE   "[:space:]"

Definition at line 444 of file trio.c.

◆ CLASS_UPPER

#define CLASS_UPPER   "[:upper:]"

Definition at line 445 of file trio.c.

◆ CLASS_XDIGIT

#define CLASS_XDIGIT   "[:xdigit:]"

Definition at line 446 of file trio.c.

◆ DECIMAL_DIG

#define DECIMAL_DIG   DBL_DIG

Definition at line 288 of file trio.c.

◆ FALSE

#define FALSE   (1 == 0)

Definition at line 111 of file trio.c.

◆ floorl

#define floorl (   x)    floor((double)(x))

Definition at line 276 of file trio.c.

◆ fmodl

#define fmodl (   x,
  y 
)    fmod((double)(x),(double)(y))

Definition at line 277 of file trio.c.

◆ FORMAT_CHAR

#define FORMAT_CHAR   3

Definition at line 415 of file trio.c.

◆ FORMAT_COUNT

#define FORMAT_COUNT   6

Definition at line 418 of file trio.c.

◆ FORMAT_DOUBLE

#define FORMAT_DOUBLE   2

Definition at line 414 of file trio.c.

◆ FORMAT_ERRNO

#define FORMAT_ERRNO   9

Definition at line 422 of file trio.c.

◆ FORMAT_GROUP

#define FORMAT_GROUP   8

Definition at line 420 of file trio.c.

◆ FORMAT_INT

#define FORMAT_INT   1

Definition at line 413 of file trio.c.

◆ FORMAT_PARAMETER

#define FORMAT_PARAMETER   7

Definition at line 419 of file trio.c.

◆ FORMAT_POINTER

#define FORMAT_POINTER   5

Definition at line 417 of file trio.c.

◆ FORMAT_STRING

#define FORMAT_STRING   4

Definition at line 416 of file trio.c.

◆ FORMAT_UNKNOWN

#define FORMAT_UNKNOWN   0

Definition at line 412 of file trio.c.

◆ FORMAT_USER_DEFINED

#define FORMAT_USER_DEFINED   10

Definition at line 425 of file trio.c.

◆ INFINITE_LOWER

#define INFINITE_LOWER   "inf"

Definition at line 317 of file trio.c.

◆ INFINITE_UPPER

#define INFINITE_UPPER   "INF"

Definition at line 318 of file trio.c.

◆ isascii

#define isascii (   x)    ((unsigned int)(x) < 128)

Definition at line 326 of file trio.c.

◆ isblank

#define isblank (   x)    (((x)==32) || ((x)==9))

Definition at line 93 of file trio.c.

◆ LDBL_DIG

#define LDBL_DIG   DBL_DIG

Definition at line 306 of file trio.c.

◆ LDBL_EPSILON

#define LDBL_EPSILON   DBL_EPSILON

Definition at line 308 of file trio.c.

◆ LDBL_MANT_DIG

#define LDBL_MANT_DIG   DBL_MANT_DIG

Definition at line 307 of file trio.c.

◆ LONG_INFINITE_LOWER

#define LONG_INFINITE_LOWER   "infinite"

Definition at line 319 of file trio.c.

◆ LONG_INFINITE_UPPER

#define LONG_INFINITE_UPPER   "INFINITE"

Definition at line 320 of file trio.c.

◆ MAX_CHARS_IN

#define MAX_CHARS_IN (   x)    (sizeof(x) * CHAR_BIT)

Definition at line 312 of file trio.c.

◆ MAX_DOUBLE_DIGITS

#define MAX_DOUBLE_DIGITS   DBL_MAX_10_EXP

Definition at line 299 of file trio.c.

◆ MAX_EXPONENT_DIGITS

#define MAX_EXPONENT_DIGITS   3

Definition at line 298 of file trio.c.

◆ MAX_MANTISSA_DIGITS

#define MAX_MANTISSA_DIGITS   DECIMAL_DIG

Definition at line 297 of file trio.c.

◆ NAN_LOWER

#define NAN_LOWER   "nan"

Definition at line 321 of file trio.c.

◆ NAN_UPPER

#define NAN_UPPER   "NAN"

Definition at line 322 of file trio.c.

◆ NDEBUG

#define NDEBUG

Definition at line 87 of file trio.c.

◆ NIL

#define NIL   ((char)0)

Definition at line 109 of file trio.c.

◆ NO_GROUPING

#define NO_GROUPING   ((int)CHAR_MAX)

Definition at line 409 of file trio.c.

◆ NULL

#define NULL   0

Definition at line 107 of file trio.c.

◆ POINTER_WIDTH

#define POINTER_WIDTH   ((sizeof("0x") - 1) + sizeof(trio_pointer_t) * CHAR_BIT / 4)

Definition at line 314 of file trio.c.

◆ powl

#define powl (   x,
  y 
)    pow((double)(x),(double)(y))

Definition at line 278 of file trio.c.

◆ QUALIFIER_ALTERNATIVE

#define QUALIFIER_ALTERNATIVE   '#'

Definition at line 610 of file trio.c.

◆ QUALIFIER_CIRCUMFLEX

#define QUALIFIER_CIRCUMFLEX   '^' /* For scanlists */

Definition at line 616 of file trio.c.

◆ QUALIFIER_COLON

#define QUALIFIER_COLON   ':' /* For scanlists */

Definition at line 639 of file trio.c.

◆ QUALIFIER_DOT

#define QUALIFIER_DOT   '.'

Definition at line 614 of file trio.c.

◆ QUALIFIER_EQUAL

#define QUALIFIER_EQUAL   '=' /* For scanlists */

Definition at line 640 of file trio.c.

◆ QUALIFIER_FIXED_SIZE

#define QUALIFIER_FIXED_SIZE   'I'

Definition at line 632 of file trio.c.

◆ QUALIFIER_INTMAX_T

#define QUALIFIER_INTMAX_T   'j'

Definition at line 620 of file trio.c.

◆ QUALIFIER_LONG

#define QUALIFIER_LONG   'l'

Definition at line 608 of file trio.c.

◆ QUALIFIER_LONG_UPPER

#define QUALIFIER_LONG_UPPER   'L'

Definition at line 609 of file trio.c.

◆ QUALIFIER_MINUS

#define QUALIFIER_MINUS   '-'

Definition at line 613 of file trio.c.

◆ QUALIFIER_PARAM

#define QUALIFIER_PARAM   '@' /* Experimental */

Definition at line 638 of file trio.c.

◆ QUALIFIER_PLUS

#define QUALIFIER_PLUS   '+'

Definition at line 612 of file trio.c.

◆ QUALIFIER_POSITION

#define QUALIFIER_POSITION   '$'

Definition at line 606 of file trio.c.

◆ QUALIFIER_PTRDIFF_T

#define QUALIFIER_PTRDIFF_T   't'

Definition at line 619 of file trio.c.

◆ QUALIFIER_QUAD

#define QUALIFIER_QUAD   'q'

Definition at line 623 of file trio.c.

◆ QUALIFIER_QUOTE

#define QUALIFIER_QUOTE   '\''

Definition at line 635 of file trio.c.

◆ QUALIFIER_ROUNDING_UPPER

#define QUALIFIER_ROUNDING_UPPER   'R'

Definition at line 641 of file trio.c.

◆ QUALIFIER_SHORT

#define QUALIFIER_SHORT   'h'

Definition at line 607 of file trio.c.

◆ QUALIFIER_SIZE_T

#define QUALIFIER_SIZE_T   'z'

Definition at line 618 of file trio.c.

◆ QUALIFIER_SIZE_T_UPPER

#define QUALIFIER_SIZE_T_UPPER   'Z'

Definition at line 626 of file trio.c.

◆ QUALIFIER_SPACE

#define QUALIFIER_SPACE   ' '

Definition at line 611 of file trio.c.

◆ QUALIFIER_STAR

#define QUALIFIER_STAR   '*'

Definition at line 615 of file trio.c.

◆ QUALIFIER_STICKY

#define QUALIFIER_STICKY   '!'

Definition at line 636 of file trio.c.

◆ QUALIFIER_VARSIZE

#define QUALIFIER_VARSIZE   '&' /* This should remain undocumented */

Definition at line 637 of file trio.c.

◆ QUALIFIER_WIDECHAR

#define QUALIFIER_WIDECHAR   'w'

Definition at line 629 of file trio.c.

◆ SPECIFIER_BINARY

#define SPECIFIER_BINARY   'b'

Definition at line 510 of file trio.c.

◆ SPECIFIER_BINARY_UPPER

#define SPECIFIER_BINARY_UPPER   'B'

Definition at line 511 of file trio.c.

◆ SPECIFIER_CHAR

#define SPECIFIER_CHAR   'c'

Definition at line 480 of file trio.c.

◆ SPECIFIER_CHAR_UPPER

#define SPECIFIER_CHAR_UPPER   'C'

Definition at line 499 of file trio.c.

◆ SPECIFIER_COUNT

#define SPECIFIER_COUNT   'n'

Definition at line 497 of file trio.c.

◆ SPECIFIER_DECIMAL

#define SPECIFIER_DECIMAL   'd'

Definition at line 482 of file trio.c.

◆ SPECIFIER_ERRNO

#define SPECIFIER_ERRNO   'm'

Definition at line 507 of file trio.c.

◆ SPECIFIER_FLOAT_E

#define SPECIFIER_FLOAT_E   'e'

Definition at line 488 of file trio.c.

◆ SPECIFIER_FLOAT_E_UPPER

#define SPECIFIER_FLOAT_E_UPPER   'E'

Definition at line 489 of file trio.c.

◆ SPECIFIER_FLOAT_F

#define SPECIFIER_FLOAT_F   'f'

Definition at line 490 of file trio.c.

◆ SPECIFIER_FLOAT_F_UPPER

#define SPECIFIER_FLOAT_F_UPPER   'F'

Definition at line 491 of file trio.c.

◆ SPECIFIER_FLOAT_G

#define SPECIFIER_FLOAT_G   'g'

Definition at line 492 of file trio.c.

◆ SPECIFIER_FLOAT_G_UPPER

#define SPECIFIER_FLOAT_G_UPPER   'G'

Definition at line 493 of file trio.c.

◆ SPECIFIER_GROUP

#define SPECIFIER_GROUP   '['

Definition at line 495 of file trio.c.

◆ SPECIFIER_HEX

#define SPECIFIER_HEX   'x'

Definition at line 486 of file trio.c.

◆ SPECIFIER_HEX_UPPER

#define SPECIFIER_HEX_UPPER   'X'

Definition at line 487 of file trio.c.

◆ SPECIFIER_HEXFLOAT

#define SPECIFIER_HEXFLOAT   'a'

Definition at line 503 of file trio.c.

◆ SPECIFIER_HEXFLOAT_UPPER

#define SPECIFIER_HEXFLOAT_UPPER   'A'

Definition at line 504 of file trio.c.

◆ SPECIFIER_INTEGER

#define SPECIFIER_INTEGER   'i'

Definition at line 483 of file trio.c.

◆ SPECIFIER_OCTAL

#define SPECIFIER_OCTAL   'o'

Definition at line 485 of file trio.c.

◆ SPECIFIER_POINTER

#define SPECIFIER_POINTER   'p'

Definition at line 494 of file trio.c.

◆ SPECIFIER_STRING

#define SPECIFIER_STRING   's'

Definition at line 481 of file trio.c.

◆ SPECIFIER_STRING_UPPER

#define SPECIFIER_STRING_UPPER   'S'

Definition at line 500 of file trio.c.

◆ SPECIFIER_UNGROUP

#define SPECIFIER_UNGROUP   ']'

Definition at line 496 of file trio.c.

◆ SPECIFIER_UNSIGNED

#define SPECIFIER_UNSIGNED   'u'

Definition at line 484 of file trio.c.

◆ SPECIFIER_USER_DEFINED_BEGIN

#define SPECIFIER_USER_DEFINED_BEGIN   '<'

Definition at line 512 of file trio.c.

◆ SPECIFIER_USER_DEFINED_END

#define SPECIFIER_USER_DEFINED_END   '>'

Definition at line 513 of file trio.c.

◆ SPECIFIER_USER_DEFINED_SEPARATOR

#define SPECIFIER_USER_DEFINED_SEPARATOR   ':'

Definition at line 514 of file trio.c.

◆ TRIO_ERROR_RETURN

#define TRIO_ERROR_RETURN (   x,
  y 
)    (- ((x) + ((y) << 8)))

Definition at line 124 of file trio.c.

◆ TRIO_FABS

#define TRIO_FABS (   x)    (((x) < 0.0) ? -(x) : (x))

Definition at line 281 of file trio.c.

◆ TRIO_VA_LIST_ADDR

#define TRIO_VA_LIST_ADDR (   l)    (&(l))

Definition at line 131 of file trio.c.

◆ TRIO_VA_LIST_DEREF

#define TRIO_VA_LIST_DEREF (   l)    (*(l))

Definition at line 132 of file trio.c.

◆ TRIO_VA_LIST_PTR

#define TRIO_VA_LIST_PTR   va_list *

Definition at line 130 of file trio.c.

◆ TRUE

#define TRUE   (! FALSE)

Definition at line 112 of file trio.c.

◆ VALID

#define VALID (   x)    (NULL != (x))

Definition at line 117 of file trio.c.

Typedef Documentation

◆ trio_class_t

◆ trio_flags_t

typedef unsigned long trio_flags_t

Definition at line 139 of file trio.c.

◆ trio_int16_t

Definition at line 259 of file trio.c.

◆ trio_int32_t

Definition at line 264 of file trio.c.

◆ trio_int64_t

Definition at line 269 of file trio.c.

◆ trio_int8_t

Definition at line 254 of file trio.c.

◆ trio_intmax_t

Definition at line 249 of file trio.c.

◆ trio_longlong_t

Definition at line 216 of file trio.c.

◆ trio_reference_t

◆ trio_uintmax_t

Definition at line 250 of file trio.c.

◆ trio_ulonglong_t

typedef unsigned long int trio_ulonglong_t

Definition at line 217 of file trio.c.

◆ trio_userdef_t

Enumeration Type Documentation

◆ anonymous enum

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_ALLOC 
FLAGS_IGNORE 
FLAGS_IGNORE_PARAMETER 
FLAGS_VARSIZE_PARAMETER 
FLAGS_FIXED_SIZE 
FLAGS_LAST 
FLAGS_EXCLUDE 
FLAGS_USER_DEFINED 
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 
DYNAMIC_START_SIZE 

Definition at line 331 of file trio.c.

331  {
332  TYPE_PRINT = 1,
333  TYPE_SCAN = 2,
334 
335  /* Flags. FLAGS_LAST must be less than ULONG_MAX */
336  FLAGS_NEW = 0,
337  FLAGS_STICKY = 1,
345  FLAGS_QUAD = 2 * FLAGS_LONG,
353  FLAGS_WIDTH = 2 * FLAGS_UPPER,
369  /* Reused flags */
373  /* Compounded flags */
376 
377  NO_POSITION = -1,
378  NO_WIDTH = 0,
379  NO_PRECISION = -1,
380  NO_SIZE = -1,
381 
382  /* Do not change these */
383  NO_BASE = -1,
384  MIN_BASE = 2,
385  MAX_BASE = 36,
386  BASE_BINARY = 2,
387  BASE_OCTAL = 8,
388  BASE_DECIMAL = 10,
389  BASE_HEX = 16,
390 
391  /* Maximal number of allowed parameters */
392  MAX_PARAMETERS = 64,
393  /* Maximal number of characters in class */
395 
396  /* Maximal string lengths for user-defined specifiers */
397  MAX_USER_NAME = 64,
398  MAX_USER_DATA = 256,
399 
400  /* Maximal length of locale separator strings */
402  /* Maximal number of integers in grouping */
403  MAX_LOCALE_GROUPS = 64,
404 
405  /* Initial size of asprintf buffer */
406  DYNAMIC_START_SIZE = 32
407 };
Definition: trio.c:385
Definition: trio.c:380
Definition: trio.c:383
Definition: trio.c:384
#define UCHAR_MAX
Definition: limits.h:25
Definition: trio.c:378
Definition: trio.c:389
#define MB_LEN_MAX
Definition: limits.h:35

Function Documentation

◆ TRIO_ARGS1() [1/9]

TRIO_PRIVATE BOOLEAN_T TrioIsQualifier TRIO_ARGS1 ( (character)  ,
TRIO_CONST char  character 
)

Definition at line 820 of file trio.c.

822 {
823  /* QUALIFIER_POSITION is not included */
824  switch (character)
825  {
826  case '0': case '1': case '2': case '3': case '4':
827  case '5': case '6': case '7': case '8': case '9':
828  case QUALIFIER_PLUS:
829  case QUALIFIER_MINUS:
830  case QUALIFIER_SPACE:
831  case QUALIFIER_DOT:
832  case QUALIFIER_STAR:
834  case QUALIFIER_SHORT:
835  case QUALIFIER_LONG:
838 #if defined(QUALIFIER_SIZE_T)
839  case QUALIFIER_SIZE_T:
840 #endif
841 #if defined(QUALIFIER_PTRDIFF_T)
842  case QUALIFIER_PTRDIFF_T:
843 #endif
844 #if defined(QUALIFIER_INTMAX_T)
845  case QUALIFIER_INTMAX_T:
846 #endif
847 #if defined(QUALIFIER_QUAD)
848  case QUALIFIER_QUAD:
849 #endif
850 #if defined(QUALIFIER_SIZE_T_UPPER)
852 #endif
853 #if defined(QUALIFIER_WIDECHAR)
854  case QUALIFIER_WIDECHAR:
855 #endif
856 #if defined(QUALIFIER_QUOTE)
857  case QUALIFIER_QUOTE:
858 #endif
859 #if defined(QUALIFIER_STICKY)
860  case QUALIFIER_STICKY:
861 #endif
862 #if defined(QUALIFIER_VARSIZE)
863  case QUALIFIER_VARSIZE:
864 #endif
865 #if defined(QUALIFIER_PARAM)
866  case QUALIFIER_PARAM:
867 #endif
868 #if defined(QUALIFIER_FIXED_SIZE)
870 #endif
871 #if defined(QUALIFIER_ROUNDING_UPPER)
873 #endif
874  return TRUE;
875  default:
876  return FALSE;
877  }
878 }
#define QUALIFIER_WIDECHAR
Definition: trio.c:629
#define QUALIFIER_ROUNDING_UPPER
Definition: trio.c:641
#define QUALIFIER_ALTERNATIVE
Definition: trio.c:610
#define QUALIFIER_CIRCUMFLEX
Definition: trio.c:616
#define QUALIFIER_SIZE_T_UPPER
Definition: trio.c:626
#define QUALIFIER_QUOTE
Definition: trio.c:635
#define QUALIFIER_MINUS
Definition: trio.c:613
#define QUALIFIER_STAR
Definition: trio.c:615
#define QUALIFIER_PLUS
Definition: trio.c:612
#define QUALIFIER_STICKY
Definition: trio.c:636
#define QUALIFIER_FIXED_SIZE
Definition: trio.c:632
#define QUALIFIER_SIZE_T
Definition: trio.c:618
#define QUALIFIER_QUAD
Definition: trio.c:623
#define QUALIFIER_VARSIZE
Definition: trio.c:637
#define QUALIFIER_SHORT
Definition: trio.c:607
#define QUALIFIER_INTMAX_T
Definition: trio.c:620
#define QUALIFIER_LONG_UPPER
Definition: trio.c:609
#define FALSE
Definition: trio.c:111
#define QUALIFIER_SPACE
Definition: trio.c:611
#define QUALIFIER_LONG
Definition: trio.c:608
#define QUALIFIER_DOT
Definition: trio.c:614
#define QUALIFIER_PARAM
Definition: trio.c:638
#define TRUE
Definition: trio.c:112
#define QUALIFIER_PTRDIFF_T
Definition: trio.c:619

◆ TRIO_ARGS1() [2/9]

TRIO_PRIVATE int TrioCalcThousandSeparatorLength TRIO_ARGS1 ( (digits ,
int  digits 
)

Definition at line 927 of file trio.c.

929 {
930 #if TRIO_EXTENSION
931  int count = 0;
932  int step = NO_GROUPING;
933  char *groupingPointer = internalGrouping;
934 
935  while (digits > 0)
936  {
937  if (*groupingPointer == CHAR_MAX)
938  {
939  /* Disable grouping */
940  break; /* while */
941  }
942  else if (*groupingPointer == 0)
943  {
944  /* Repeat last group */
945  if (step == NO_GROUPING)
946  {
947  /* Error in locale */
948  break; /* while */
949  }
950  }
951  else
952  {
953  step = *groupingPointer++;
954  }
955  if (digits > step)
957  digits -= step;
958  }
959  return count;
960 #else
961  return 0;
962 #endif
963 }
static char internalGrouping[MAX_LOCALE_GROUPS]
Definition: trio.c:782
GLuint GLuint GLsizei count
Definition: gl.h:1545
static int internalThousandSeparatorLength
Definition: trio.c:778
#define NO_GROUPING
Definition: trio.c:409
static const int digits[]
Definition: decode.c:71
#define CHAR_MAX
Definition: limits.h:32

◆ TRIO_ARGS1() [3/9]

TRIO_PRIVATE BOOLEAN_T TrioFollowedBySeparator TRIO_ARGS1 ( (position)  ,
int  position 
)

Definition at line 967 of file trio.c.

969 {
970 #if TRIO_EXTENSION
971  int step = 0;
972  char *groupingPointer = internalGrouping;
973 
974  position--;
975  if (position == 0)
976  return FALSE;
977  while (position > 0)
978  {
979  if (*groupingPointer == CHAR_MAX)
980  {
981  /* Disable grouping */
982  break; /* while */
983  }
984  else if (*groupingPointer != 0)
985  {
986  step = *groupingPointer++;
987  }
988  if (step == 0)
989  break;
990  position -= step;
991  }
992  return (position == 0);
993 #else
994  return FALSE;
995 #endif
996 }
static char internalGrouping[MAX_LOCALE_GROUPS]
Definition: trio.c:782
#define FALSE
Definition: trio.c:111
#define CHAR_MAX
Definition: limits.h:32

◆ TRIO_ARGS1() [4/9]

TRIO_PRIVATE double TrioLogarithmBase TRIO_ARGS1 ( (base ,
int  base 
)

Definition at line 1161 of file trio.c.

1163 {
1164  switch (base)
1165  {
1166  case BASE_BINARY : return 1.0;
1167  case BASE_OCTAL : return 3.0;
1168  case BASE_DECIMAL: return 3.321928094887362345;
1169  case BASE_HEX : return 4.0;
1170  default : return TrioLogarithm((double)base, 2);
1171  }
1172 }
Definition: trio.c:389

◆ TRIO_ARGS1() [5/9]

TRIO_PUBLIC void trio_locale_set_decimal_point TRIO_ARGS1 ( (decimalPoint)  ,
char decimalPoint 
)

Definition at line 5046 of file trio.c.

5048 {
5049 #if defined(USE_LOCALE)
5050  if (NULL == internalLocaleValues)
5051  {
5052  TrioSetLocale();
5053  }
5054 #endif
5055  internalDecimalPointLength = trio_length(decimalPoint);
5056  if (internalDecimalPointLength == 1)
5057  {
5058  internalDecimalPoint = *decimalPoint;
5059  }
5060  else
5061  {
5063  trio_copy_max(internalDecimalPointString,
5065  decimalPoint);
5066  }
5067 }
static int internalDecimalPointLength
Definition: trio.c:777
static char internalDecimalPointString[MAX_LOCALE_SEPARATOR_LENGTH+1]
Definition: trio.c:780
static char internalDecimalPoint
Definition: trio.c:779
#define NIL
Definition: trio.c:109
#define NULL
Definition: trio.c:107

◆ TRIO_ARGS1() [6/9]

TRIO_PUBLIC void trio_locale_set_thousand_separator TRIO_ARGS1 ( (thousandSeparator)  ,
char thousandSeparator 
)

Definition at line 5076 of file trio.c.

5078 {
5079 #if defined(USE_LOCALE)
5080  if (NULL == internalLocaleValues)
5081  {
5082  TrioSetLocale();
5083  }
5084 #endif
5085  trio_copy_max(internalThousandSeparator,
5086  sizeof(internalThousandSeparator),
5087  thousandSeparator);
5089 }
static int internalThousandSeparatorLength
Definition: trio.c:778
static char internalThousandSeparator[MAX_LOCALE_SEPARATOR_LENGTH+1]
Definition: trio.c:781
#define NULL
Definition: trio.c:107

◆ TRIO_ARGS1() [7/9]

TRIO_PUBLIC void trio_locale_set_grouping TRIO_ARGS1 ( (grouping)  ,
char grouping 
)

Definition at line 5105 of file trio.c.

5107 {
5108 #if defined(USE_LOCALE)
5109  if (NULL == internalLocaleValues)
5110  {
5111  TrioSetLocale();
5112  }
5113 #endif
5114  trio_copy_max(internalGrouping,
5115  sizeof(internalGrouping),
5116  grouping);
5117 }
static char internalGrouping[MAX_LOCALE_GROUPS]
Definition: trio.c:782
#define NULL
Definition: trio.c:107

◆ TRIO_ARGS1() [8/9]

TRIO_PRIVATE int TrioSkipWhitespaces TRIO_ARGS1 ( (self)  ,
trio_class_t self 
)

Definition at line 5131 of file trio.c.

5133 {
5134  int ch;
5135 
5136  ch = self->current;
5137  while (isspace(ch))
5138  {
5139  self->InStream(self, &ch);
5140  }
5141  return ch;
5142 }
#define isspace(c)
Definition: acclib.h:69

◆ TRIO_ARGS1() [9/9]

TRIO_PUBLIC TRIO_CONST char* trio_strerror TRIO_ARGS1 ( (errorcode)  ,
int  errorcode 
)

Definition at line 6870 of file trio.c.

6872 {
6873  /* Textual versions of the error codes */
6874  switch (TRIO_ERROR_CODE(errorcode))
6875  {
6876  case TRIO_EOF:
6877  return "End of file";
6878  case TRIO_EINVAL:
6879  return "Invalid argument";
6880  case TRIO_ETOOMANY:
6881  return "Too many arguments";
6882  case TRIO_EDBLREF:
6883  return "Double reference";
6884  case TRIO_EGAP:
6885  return "Reference gap";
6886  case TRIO_ENOMEM:
6887  return "Out of memory";
6888  case TRIO_ERANGE:
6889  return "Invalid range";
6890  case TRIO_ECUSTOM:
6891  return "Custom error";
6892  default:
6893  return "Unknown";
6894  }
6895 }
#define TRIO_ERROR_CODE(x)
Definition: trio.h:67
Definition: trio.h:59
Definition: trio.h:55

◆ TRIO_ARGS2() [1/6]

TRIO_PRIVATE int TrioGetPosition TRIO_ARGS2 ( (format, indexPointer)  ,
TRIO_CONST char format,
int indexPointer 
)

Definition at line 1005 of file trio.c.

1008 {
1009 #if TRIO_UNIX98
1010  char *tmpformat;
1011  int number = 0;
1012  int index = *indexPointer;
1013 
1014  number = (int)trio_to_long(&format[index], &tmpformat, BASE_DECIMAL);
1015  index = (int)(tmpformat - format);
1016  if ((number != 0) && (QUALIFIER_POSITION == format[index++]))
1017  {
1018  *indexPointer = index;
1019  /*
1020  * number is decreased by 1, because n$ starts from 1, whereas
1021  * the array it is indexing starts from 0.
1022  */
1023  return number - 1;
1024  }
1025 #endif
1026  return NO_POSITION;
1027 }
GLint GLint GLsizei GLsizei GLsizei GLint GLenum format
Definition: gl.h:1546
static size_t double number
Definition: printf.c:64
GLuint index
Definition: glext.h:6031
#define index(s, c)
Definition: various.h:29
#define QUALIFIER_POSITION
Definition: trio.c:606
unsigned int(__cdecl typeof(jpeg_read_scanlines))(struct jpeg_decompress_struct *
Definition: typeof.h:31

◆ TRIO_ARGS2() [2/6]

TRIO_PRIVATE trio_userdef_t* TrioFindNamespace TRIO_ARGS2 ( (name, prev)  ,
TRIO_CONST char name,
trio_userdef_t **  prev 
)

Definition at line 1038 of file trio.c.

1041 {
1042  trio_userdef_t *def;
1043 
1046 
1047  for (def = internalUserDef; def; def = def->next)
1048  {
1049  /* Case-sensitive string comparison */
1050  if (trio_equal_case(def->name, name))
1051  break;
1052 
1053  if (prev)
1054  *prev = def;
1055  }
1056 
1059 
1060  return def;
1061 }
static TRIO_VOLATILE trio_callback_t internalLeaveCriticalRegion
Definition: trio.c:795
struct png_info_def **typedef void(__cdecl typeof(png_destroy_read_struct))(struct png_struct_def **
Definition: typeof.h:49
char * name
Definition: trio.c:747
static TRIO_VOLATILE trio_callback_t internalEnterCriticalRegion
Definition: trio.c:794
static trio_userdef_t * internalUserDef
Definition: trio.c:796
struct _trio_userdef_t * next
Definition: trio.c:745
Definition: name.c:36
#define NULL
Definition: trio.c:107

◆ TRIO_ARGS2() [3/6]

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

Definition at line 1072 of file trio.c.

1075 {
1077 
1078  if (number == 10)
1079  {
1080  switch (exponent)
1081  {
1082  /* Speed up calculation of common cases */
1083  case 0:
1085  break;
1086  case 1:
1088  break;
1089  case 2:
1091  break;
1092  case 3:
1094  break;
1095  case 4:
1097  break;
1098  case 5:
1100  break;
1101  case 6:
1103  break;
1104  case 7:
1106  break;
1107  case 8:
1109  break;
1110  case 9:
1112  break;
1113  default:
1115  (trio_long_double_t)exponent);
1116  break;
1117  }
1118  }
1119  else
1120  {
1121  return powl((trio_long_double_t)number, (trio_long_double_t)exponent);
1122  }
1123  return result;
1124 }
#define TRIO_SUFFIX_LONG(x)
Definition: triodef.h:134
double trio_long_double_t
Definition: triodef.h:132
#define powl(x, y)
Definition: trio.c:278
static size_t double number
Definition: printf.c:64
static const WCHAR E[]
Definition: oid.c:1253
GLuint64EXT * result
Definition: glext.h:11304

◆ TRIO_ARGS2() [4/6]

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

Definition at line 1131 of file trio.c.

1134 {
1135  double result;
1136 
1137  if (number <= 0.0)
1138  {
1139  /* xlC crashes on log(0) */
1140  result = (number == 0.0) ? trio_ninf() : trio_nan();
1141  }
1142  else
1143  {
1144  if (base == 10)
1145  {
1146  result = log10(number);
1147  }
1148  else
1149  {
1150  result = log10(number) / log10((double)base);
1151  }
1152  }
1153  return result;
1154 }
static size_t double number
Definition: printf.c:64
_STLP_DECLSPEC complex< float > _STLP_CALL log10(const complex< float > &)
Definition: complex.cpp:230
TRIO_PUBLIC double trio_ninf(TRIO_NOARGS)
Definition: trionan.c:302
TRIO_PUBLIC double trio_nan(TRIO_NOARGS)
Definition: trionan.c:323
GLuint64EXT * result
Definition: glext.h:11304

◆ TRIO_ARGS2() [5/6]

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

Definition at line 3471 of file trio.c.

3474 {
3475  FILE *file;
3476 
3477  assert(VALID(self));
3478  assert(VALID(self->location));
3479 
3480  file = (FILE *)self->location;
3481  self->processed++;
3482  if (fputc(output, file) == EOF)
3483  {
3484  self->error = TRIO_ERROR_RETURN(TRIO_EOF, 0);
3485  }
3486  else
3487  {
3488  self->committed++;
3489  }
3490 }
#define VALID(x)
Definition: trio.c:117
_Check_return_opt_ _CRTIMP int __cdecl fputc(_In_ int _Ch, _Inout_ FILE *_File)
static UCHAR ULONG UCHAR ULONG UCHAR * output
Definition: bcrypt.c:29
#define TRIO_ERROR_RETURN(x, y)
Definition: trio.c:124
#define assert(x)
Definition: debug.h:53
trio_pointer_t location
Definition: trio.c:711
if(!(yy_init))
Definition: macro.lex.yy.c:714
const char file[]
Definition: icontest.c:11
int processed
Definition: trio.c:720
Definition: trio.h:55
#define EOF
Definition: stdio.h:24
Definition: fci.c:126

◆ TRIO_ARGS2() [6/6]

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

Definition at line 6433 of file trio.c.

6436 {
6437  FILE *file;
6438 
6439  assert(VALID(self));
6440  assert(VALID(self->location));
6441  assert(VALID(file));
6442 
6443  file = (FILE *)self->location;
6444 
6445  self->current = fgetc(file);
6446  if (self->current == EOF)
6447  {
6448  self->error = (ferror(file))
6451  }
6452  else
6453  {
6454  self->processed++;
6455  self->committed++;
6456  }
6457 
6458  if (VALID(intPointer))
6459  {
6460  *intPointer = self->current;
6461  }
6462 }
#define VALID(x)
Definition: trio.c:117
_Check_return_ _CRTIMP int __cdecl ferror(_In_ FILE *_File)
#define TRIO_ERROR_RETURN(x, y)
Definition: trio.c:124
int current
Definition: trio.c:715
#define assert(x)
Definition: debug.h:53
trio_pointer_t location
Definition: trio.c:711
const char file[]
Definition: icontest.c:11
Definition: trio.h:55
#define EOF
Definition: stdio.h:24
_Check_return_opt_ _CRTIMP int __cdecl fgetc(_Inout_ FILE *_File)
Definition: fci.c:126

◆ TRIO_ARGS3() [1/3]

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

Definition at line 2382 of file trio.c.

2386 {
2387  if (flags & FLAGS_ALTERNATIVE)
2388  {
2389  if (! isprint(ch))
2390  {
2391  /*
2392  * Non-printable characters are converted to C escapes or
2393  * \number, if no C escape exists.
2394  */
2395  self->OutStream(self, CHAR_BACKSLASH);
2396  switch (ch)
2397  {
2398  case '\007': self->OutStream(self, 'a'); break;
2399  case '\b': self->OutStream(self, 'b'); break;
2400  case '\f': self->OutStream(self, 'f'); break;
2401  case '\n': self->OutStream(self, 'n'); break;
2402  case '\r': self->OutStream(self, 'r'); break;
2403  case '\t': self->OutStream(self, 't'); break;
2404  case '\v': self->OutStream(self, 'v'); break;
2405  case '\\': self->OutStream(self, '\\'); break;
2406  default:
2407  self->OutStream(self, 'x');
2408  TrioWriteNumber(self, (trio_uintmax_t)ch,
2410  2, 2, BASE_HEX);
2411  break;
2412  }
2413  }
2414  else if (ch == CHAR_BACKSLASH)
2415  {
2416  self->OutStream(self, CHAR_BACKSLASH);
2417  self->OutStream(self, CHAR_BACKSLASH);
2418  }
2419  else
2420  {
2421  self->OutStream(self, ch);
2422  }
2423  }
2424  else
2425  {
2426  self->OutStream(self, ch);
2427  }
2428 }
#define CHAR_BACKSLASH
Definition: trio.c:430
GLbitfield flags
Definition: glext.h:7161
#define isprint(c)
Definition: acclib.h:73
Definition: trio.c:389
trio_ulonglong_t trio_uintmax_t
Definition: trio.c:250

◆ TRIO_ARGS3() [2/3]

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

Definition at line 3087 of file trio.c.

3091 {
3092 #if defined(TRIO_COMPILER_SUPPORTS_MULTIBYTE)
3093  int charlen;
3094 #endif
3095  int i;
3096  TRIO_CONST char *string;
3099  int width;
3100  int precision;
3101  int base;
3102  int index;
3103 
3104  index = 0;
3105  i = 0;
3106 #if defined(TRIO_COMPILER_SUPPORTS_MULTIBYTE)
3107  (void)mblen(NULL, 0);
3108 #endif
3109 
3110  while (format[index])
3111  {
3112 #if defined(TRIO_COMPILER_SUPPORTS_MULTIBYTE)
3113  if (! isascii(format[index]))
3114  {
3115  charlen = mblen(&format[index], MB_LEN_MAX);
3116  /*
3117  * Only valid multibyte characters are handled here. Invalid
3118  * multibyte characters (charlen == -1) are handled as normal
3119  * characters.
3120  */
3121  if (charlen != -1)
3122  {
3123  while (charlen-- > 0)
3124  {
3125  data->OutStream(data, format[index++]);
3126  }
3127  continue; /* while characters left in formatting string */
3128  }
3129  }
3130 #endif /* TRIO_COMPILER_SUPPORTS_MULTIBYTE */
3131  if (CHAR_IDENTIFIER == format[index])
3132  {
3133  if (CHAR_IDENTIFIER == format[index + 1])
3134  {
3135  data->OutStream(data, CHAR_IDENTIFIER);
3136  index += 2;
3137  }
3138  else
3139  {
3140  /* Skip the parameter entries */
3141  while (parameters[i].type == FORMAT_PARAMETER)
3142  i++;
3143 
3144  flags = parameters[i].flags;
3145 
3146  /* Find width */
3147  width = parameters[i].width;
3149  {
3150  /* Get width from parameter list */
3151  width = (int)parameters[width].data.number.as_signed;
3152  if (width < 0)
3153  {
3154  /*
3155  * A negative width is the same as the - flag and
3156  * a positive width.
3157  */
3159  flags &= ~FLAGS_NILPADDING;
3160  width = -width;
3161  }
3162  }
3163 
3164  /* Find precision */
3165  if (flags & FLAGS_PRECISION)
3166  {
3167  precision = parameters[i].precision;
3169  {
3170  /* Get precision from parameter list */
3171  precision = (int)parameters[precision].data.number.as_signed;
3172  if (precision < 0)
3173  {
3174  /*
3175  * A negative precision is the same as no
3176  * precision
3177  */
3179  }
3180  }
3181  }
3182  else
3183  {
3185  }
3186 
3187  /* Find base */
3188  base = parameters[i].base;
3190  {
3191  /* Get base from parameter list */
3192  base = (int)parameters[base].data.number.as_signed;
3193  }
3194 
3195  switch (parameters[i].type)
3196  {
3197  case FORMAT_CHAR:
3198  if (flags & FLAGS_QUOTE)
3199  data->OutStream(data, CHAR_QUOTE);
3200  if (! (flags & FLAGS_LEFTADJUST))
3201  {
3202  while (--width > 0)
3203  data->OutStream(data, CHAR_ADJUST);
3204  }
3205 #if TRIO_WIDECHAR
3206  if (flags & FLAGS_WIDECHAR)
3207  {
3208  TrioWriteWideStringCharacter(data,
3209  (trio_wchar_t)parameters[i].data.number.as_signed,
3210  flags,
3211  NO_WIDTH);
3212  }
3213  else
3214 #endif
3215  {
3216  TrioWriteStringCharacter(data,
3217  (int)parameters[i].data.number.as_signed,
3218  flags);
3219  }
3220 
3221  if (flags & FLAGS_LEFTADJUST)
3222  {
3223  while(--width > 0)
3224  data->OutStream(data, CHAR_ADJUST);
3225  }
3226  if (flags & FLAGS_QUOTE)
3227  data->OutStream(data, CHAR_QUOTE);
3228 
3229  break; /* FORMAT_CHAR */
3230 
3231  case FORMAT_INT:
3232  TrioWriteNumber(data,
3233  parameters[i].data.number.as_unsigned,
3234  flags,
3235  width,
3236  precision,
3237  base);
3238 
3239  break; /* FORMAT_INT */
3240 
3241  case FORMAT_DOUBLE:
3242  TrioWriteDouble(data,
3243  parameters[i].data.longdoubleNumber,
3244  flags,
3245  width,
3246  precision,
3247  base);
3248  break; /* FORMAT_DOUBLE */
3249 
3250  case FORMAT_STRING:
3251 #if TRIO_WIDECHAR
3252  if (flags & FLAGS_WIDECHAR)
3253  {
3254  TrioWriteWideString(data,
3255  parameters[i].data.wstring,
3256  flags,
3257  width,
3258  precision);
3259  }
3260  else
3261 #endif
3262  {
3263  TrioWriteString(data,
3264  parameters[i].data.string,
3265  flags,
3266  width,
3267  precision);
3268  }
3269  break; /* FORMAT_STRING */
3270 
3271  case FORMAT_POINTER:
3272  {
3274 
3275  reference.data = data;
3276  reference.parameter = &parameters[i];
3277  trio_print_pointer(&reference, parameters[i].data.pointer);
3278  }
3279  break; /* FORMAT_POINTER */
3280 
3281  case FORMAT_COUNT:
3282  pointer = parameters[i].data.pointer;
3283  if (NULL != pointer)
3284  {
3285  /*
3286  * C99 paragraph 7.19.6.1.8 says "the number of
3287  * characters written to the output stream so far by
3288  * this call", which is data->committed
3289  */
3290 #if defined(QUALIFIER_SIZE_T) || defined(QUALIFIER_SIZE_T_UPPER)
3291  if (flags & FLAGS_SIZE_T)
3292  *(size_t *)pointer = (size_t)data->committed;
3293  else
3294 #endif
3295 #if defined(QUALIFIER_PTRDIFF_T)
3296  if (flags & FLAGS_PTRDIFF_T)
3297  *(ptrdiff_t *)pointer = (ptrdiff_t)data->committed;
3298  else
3299 #endif
3300 #if defined(QUALIFIER_INTMAX_T)
3301  if (flags & FLAGS_INTMAX_T)
3302  *(trio_intmax_t *)pointer = (trio_intmax_t)data->committed;
3303  else
3304 #endif
3305  if (flags & FLAGS_QUAD)
3306  {
3307  *(trio_ulonglong_t *)pointer = (trio_ulonglong_t)data->committed;
3308  }
3309  else if (flags & FLAGS_LONG)
3310  {
3311  *(long int *)pointer = (long int)data->committed;
3312  }
3313  else if (flags & FLAGS_SHORT)
3314  {
3315  *(short int *)pointer = (short int)data->committed;
3316  }
3317  else
3318  {
3319  *(int *)pointer = (int)data->committed;
3320  }
3321  }
3322  break; /* FORMAT_COUNT */
3323 
3324  case FORMAT_PARAMETER:
3325  break; /* FORMAT_PARAMETER */
3326 
3327 #if defined(FORMAT_ERRNO)
3328  case FORMAT_ERRNO:
3329  string = trio_error(parameters[i].data.errorNumber);
3330  if (string)
3331  {
3332  TrioWriteString(data,
3333  string,
3334  flags,
3335  width,
3336  precision);
3337  }
3338  else
3339  {
3340  data->OutStream(data, '#');
3341  TrioWriteNumber(data,
3342  (trio_uintmax_t)parameters[i].data.errorNumber,
3343  flags,
3344  width,
3345  precision,
3346  BASE_DECIMAL);
3347  }
3348  break; /* FORMAT_ERRNO */
3349 #endif /* defined(FORMAT_ERRNO) */
3350 
3351 #if defined(FORMAT_USER_DEFINED)
3352  case FORMAT_USER_DEFINED:
3353  {
3355  trio_userdef_t *def = NULL;
3356 
3357  if (parameters[i].user_name[0] == NIL)
3358  {
3359  /* Use handle */
3360  if ((i > 0) ||
3361  (parameters[i - 1].type == FORMAT_PARAMETER))
3362  def = (trio_userdef_t *)parameters[i - 1].data.pointer;
3363  }
3364  else
3365  {
3366  /* Look up namespace */
3367  def = TrioFindNamespace(parameters[i].user_name, NULL);
3368  }
3369  if (def) {
3370  reference.data = data;
3371  reference.parameter = &parameters[i];
3372  def->callback(&reference);
3373  }
3374  }
3375  break;
3376 #endif /* defined(FORMAT_USER_DEFINED) */
3377 
3378  default:
3379  break;
3380  } /* switch parameter type */
3381 
3382  /* Prepare for next */
3383  index = parameters[i].indexAfterSpecifier;
3384  i++;
3385  }
3386  }
3387  else /* not identifier */
3388  {
3389  data->OutStream(data, format[index++]);
3390  }
3391  }
3392  return data->processed;
3393 }
#define CHAR_IDENTIFIER
Definition: trio.c:429
char * trio_pointer_t
Definition: triodef.h:133
unsigned long trio_flags_t
Definition: trio.c:139
GLint GLint GLsizei width
Definition: gl.h:1546
#define FORMAT_PARAMETER
Definition: trio.c:419
#define FORMAT_DOUBLE
Definition: trio.c:414
struct png_info_def **typedef void(__cdecl typeof(png_destroy_read_struct))(struct png_struct_def **
Definition: typeof.h:49
int indexAfterSpecifier
Definition: trio.c:666
GLsizei const GLvoid * pointer
Definition: glext.h:5848
#define CHAR_ADJUST
Definition: trio.c:432
#define FORMAT_ERRNO
Definition: trio.c:422
#define TRIO_CONST
Definition: triodef.h:129
GLuint GLuint GLsizei GLenum type
Definition: gl.h:1545
trio_callback_t callback
Definition: trio.c:746
trio_pointer_t pointer
Definition: trio.c:673
#define FORMAT_STRING
Definition: trio.c:416
#define FORMAT_POINTER
Definition: trio.c:417
GLint GLint GLsizei GLsizei GLsizei GLint GLenum format
Definition: gl.h:1546
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
GLuint base
Definition: 3dtext.c:35
int precision
Definition: trio.c:660
GLuint index
Definition: glext.h:6031
GLenum GLint GLint * precision
Definition: glext.h:7539
if(!(yy_init))
Definition: macro.lex.yy.c:714
union trio_parameter_t::@3871 data
#define FORMAT_CHAR
Definition: trio.c:415
#define CHAR_QUOTE
Definition: trio.c:431
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
Definition: gl.h:1950
GLbitfield flags
Definition: glext.h:7161
#define index(s, c)
Definition: various.h:29
GLint reference
Definition: glext.h:11729
unsigned long int trio_ulonglong_t
Definition: trio.c:217
char string[160]
Definition: util.h:11
#define isascii(x)
Definition: trio.c:326
_Check_return_ int __cdecl mblen(_In_reads_bytes_opt_(_MaxCount) _Pre_opt_z_ const char *_Ch, _In_ size_t _MaxCount)
#define NIL
Definition: trio.c:109
__kernel_ptrdiff_t ptrdiff_t
Definition: linux.h:247
Definition: trio.c:378
trio_ulonglong_t trio_uintmax_t
Definition: trio.c:250
#define FORMAT_COUNT
Definition: trio.c:418
trio_flags_t flags
Definition: trio.c:656
#define FORMAT_INT
Definition: trio.c:413
#define MB_LEN_MAX
Definition: limits.h:35
#define NULL
Definition: trio.c:107
trio_longlong_t trio_intmax_t
Definition: trio.c:249
unsigned int(__cdecl typeof(jpeg_read_scanlines))(struct jpeg_decompress_struct *
Definition: typeof.h:31
#define FORMAT_USER_DEFINED
Definition: trio.c:425
static WCHAR user_name[UNLEN+1]
Definition: access.c:32

◆ TRIO_ARGS3() [3/3]

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

Definition at line 6006 of file trio.c.

6010 {
6012  char buffer[sizeof(internalNullString)];
6013 
6015 
6016  if (TrioReadNumber(self,
6017  &number,
6018  flags,
6019  POINTER_WIDTH,
6020  BASE_HEX))
6021  {
6022  /*
6023  * The strange assignment of number is a workaround for a compiler
6024  * warning
6025  */
6026  if (target)
6027  *target = (char *)0 + number;
6028  return TRUE;
6029  }
6030  else if (TrioReadString(self,
6031  (flags & FLAGS_IGNORE)
6032  ? NULL
6033  : buffer,
6034  0,
6035  sizeof(internalNullString) - 1))
6036  {
6037  if (trio_equal_case(buffer, internalNullString))
6038  {
6039  if (target)
6040  *target = NULL;
6041  return TRUE;
6042  }
6043  }
6044  return FALSE;
6045 }
GLuint buffer
Definition: glext.h:5915
static size_t double number
Definition: printf.c:64
GLbitfield flags
Definition: glext.h:7161
#define POINTER_WIDTH
Definition: trio.c:314
#define FALSE
Definition: trio.c:111
Definition: trio.c:389
GLenum target
Definition: glext.h:7315
static TRIO_CONST char internalNullString[]
Definition: trio.c:767
trio_ulonglong_t trio_uintmax_t
Definition: trio.c:250
#define TRUE
Definition: trio.c:112
#define NULL
Definition: trio.c:107

◆ TRIO_ARGS4() [1/4]

TRIO_PRIVATE int TrioFormatRef TRIO_ARGS4 ( (reference, format, arglist, argarray)  ,
trio_reference_t reference,
TRIO_CONST char format,
TRIO_VA_LIST_PTR  arglist,
trio_pointer_t argarray 
)

Definition at line 3400 of file trio.c.

3405 {
3406  int status;
3407  trio_parameter_t parameters[MAX_PARAMETERS];
3408 
3409  status = TrioParse(TYPE_PRINT, format, parameters, arglist, argarray);
3410  if (status < 0)
3411  return status;
3412 
3413  status = TrioFormatProcess(reference->data, format, parameters);
3414  if (reference->data->error != 0)
3415  {
3416  status = reference->data->error;
3417  }
3418  return status;
3419 }
GLint GLint GLsizei GLsizei GLsizei GLint GLenum format
Definition: gl.h:1546
GLint reference
Definition: glext.h:11729
static SERVICE_STATUS status
Definition: service.c:31
va_lists_t arglist[FMT_ARGMAX+1]
Definition: format.c:284
Definition: ps.c:97

◆ TRIO_ARGS4() [2/4]

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

Definition at line 5183 of file trio.c.

5188 {
5189  int index = *indexPointer;
5190  int i;
5191  char ch;
5192  char range_begin;
5193  char range_end;
5194 
5195  *flagsPointer &= ~FLAGS_EXCLUDE;
5196 
5198  {
5199  *flagsPointer |= FLAGS_EXCLUDE;
5200  index++;
5201  }
5202  /*
5203  * If the ungroup character is at the beginning of the scanlist,
5204  * it will be part of the class, and a second ungroup character
5205  * must follow to end the group.
5206  */
5207  if (format[index] == SPECIFIER_UNGROUP)
5208  {
5209  characterclass[(int)SPECIFIER_UNGROUP]++;
5210  index++;
5211  }
5212  /*
5213  * Minus is used to specify ranges. To include minus in the class,
5214  * it must be at the beginning of the list
5215  */
5216  if (format[index] == QUALIFIER_MINUS)
5217  {
5218  characterclass[(int)QUALIFIER_MINUS]++;
5219  index++;
5220  }
5221  /* Collect characters */
5222  for (ch = format[index];
5223  (ch != SPECIFIER_UNGROUP) && (ch != NIL);
5224  ch = format[++index])
5225  {
5226  switch (ch)
5227  {
5228  case QUALIFIER_MINUS: /* Scanlist ranges */
5229 
5230  /*
5231  * Both C99 and UNIX98 describes ranges as implementation-
5232  * defined.
5233  *
5234  * We support the following behaviour (although this may
5235  * change as we become wiser)
5236  * - only increasing ranges, ie. [a-b] but not [b-a]
5237  * - transitive ranges, ie. [a-b-c] == [a-c]
5238  * - trailing minus, ie. [a-] is interpreted as an 'a'
5239  * and a '-'
5240  * - duplicates (although we can easily convert these
5241  * into errors)
5242  */
5243  range_begin = format[index - 1];
5244  range_end = format[++index];
5245  if (range_end == SPECIFIER_UNGROUP)
5246  {
5247  /* Trailing minus is included */
5248  characterclass[(int)ch]++;
5249  ch = range_end;
5250  break; /* for */
5251  }
5252  if (range_end == NIL)
5254  if (range_begin > range_end)
5256 
5257  for (i = (int)range_begin; i <= (int)range_end; i++)
5258  characterclass[i]++;
5259 
5260  ch = range_end;
5261  break;
5262 
5263 #if TRIO_EXTENSION
5264 
5265  case SPECIFIER_GROUP:
5266 
5267  switch (format[index + 1])
5268  {
5269  case QUALIFIER_DOT: /* Collating symbol */
5270  /*
5271  * FIXME: This will be easier to implement when multibyte
5272  * characters have been implemented. Until now, we ignore
5273  * this feature.
5274  */
5275  for (i = index + 2; ; i++)
5276  {
5277  if (format[i] == NIL)
5278  /* Error in syntax */
5279  return -1;
5280  else if (format[i] == QUALIFIER_DOT)
5281  break; /* for */
5282  }
5283  if (format[++i] != SPECIFIER_UNGROUP)
5284  return -1;
5285 
5286  index = i;
5287  break;
5288 
5289  case QUALIFIER_EQUAL: /* Equivalence class expressions */
5290  {
5291  unsigned int j;
5292  unsigned int k;
5293 
5295  {
5296  /* Lazy evaluation of collation array */
5297  TrioGetCollation();
5299  }
5300  for (i = index + 2; ; i++)
5301  {
5302  if (format[i] == NIL)
5303  /* Error in syntax */
5304  return -1;
5305  else if (format[i] == QUALIFIER_EQUAL)
5306  break; /* for */
5307  else
5308  {
5309  /* Mark any equivalent character */
5310  k = (unsigned int)format[i];
5311  for (j = 0; internalCollationArray[k][j] != NIL; j++)
5312  characterclass[(int)internalCollationArray[k][j]]++;
5313  }
5314  }
5315  if (format[++i] != SPECIFIER_UNGROUP)
5316  return -1;
5317 
5318  index = i;
5319  }
5320  break;
5321 
5322  case QUALIFIER_COLON: /* Character class expressions */
5323 
5324  if (trio_equal_max(CLASS_ALNUM, sizeof(CLASS_ALNUM) - 1,
5325  &format[index]))
5326  {
5327  for (i = 0; i < MAX_CHARACTER_CLASS; i++)
5328  if (isalnum(i))
5329  characterclass[i]++;
5330  index += sizeof(CLASS_ALNUM) - 1;
5331  }
5332  else if (trio_equal_max(CLASS_ALPHA, sizeof(CLASS_ALPHA) - 1,
5333  &format[index]))
5334  {
5335  for (i = 0; i < MAX_CHARACTER_CLASS; i++)
5336  if (isalpha(i))
5337  characterclass[i]++;
5338  index += sizeof(CLASS_ALPHA) - 1;
5339  }
5340  else if (trio_equal_max(CLASS_CNTRL, sizeof(CLASS_CNTRL) - 1,
5341  &format[index]))
5342  {
5343  for (i = 0; i < MAX_CHARACTER_CLASS; i++)
5344  if (iscntrl(i))
5345  characterclass[i]++;
5346  index += sizeof(CLASS_CNTRL) - 1;
5347  }
5348  else if (trio_equal_max(CLASS_DIGIT, sizeof(CLASS_DIGIT) - 1,
5349  &format[index]))
5350  {
5351  for (i = 0; i < MAX_CHARACTER_CLASS; i++)
5352  if (isdigit(i))
5353  characterclass[i]++;
5354  index += sizeof(CLASS_DIGIT) - 1;
5355  }
5356  else if (trio_equal_max(CLASS_GRAPH, sizeof(CLASS_GRAPH) - 1,
5357  &format[index]))
5358  {
5359  for (i = 0; i < MAX_CHARACTER_CLASS; i++)
5360  if (isgraph(i))
5361  characterclass[i]++;
5362  index += sizeof(CLASS_GRAPH) - 1;
5363  }
5364  else if (trio_equal_max(CLASS_LOWER, sizeof(CLASS_LOWER) - 1,
5365  &format[index]))
5366  {
5367  for (i = 0; i < MAX_CHARACTER_CLASS; i++)
5368  if (islower(i))
5369  characterclass[i]++;
5370  index += sizeof(CLASS_LOWER) - 1;
5371  }
5372  else if (trio_equal_max(CLASS_PRINT, sizeof(CLASS_PRINT) - 1,
5373  &format[index]))
5374  {
5375  for (i = 0; i < MAX_CHARACTER_CLASS; i++)
5376  if (isprint(i))
5377  characterclass[i]++;
5378  index += sizeof(CLASS_PRINT) - 1;
5379  }
5380  else if (trio_equal_max(CLASS_PUNCT, sizeof(CLASS_PUNCT) - 1,
5381  &format[index]))
5382  {
5383  for (i = 0; i < MAX_CHARACTER_CLASS; i++)
5384  if (ispunct(i))
5385  characterclass[i]++;
5386  index += sizeof(CLASS_PUNCT) - 1;
5387  }
5388  else if (trio_equal_max(CLASS_SPACE, sizeof(CLASS_SPACE) - 1,
5389  &format[index]))
5390  {
5391  for (i = 0; i < MAX_CHARACTER_CLASS; i++)
5392  if (isspace(i))
5393  characterclass[i]++;
5394  index += sizeof(CLASS_SPACE) - 1;
5395  }
5396  else if (trio_equal_max(CLASS_UPPER, sizeof(CLASS_UPPER) - 1,
5397  &format[index]))
5398  {
5399  for (i = 0; i < MAX_CHARACTER_CLASS; i++)
5400  if (isupper(i))
5401  characterclass[i]++;
5402  index += sizeof(CLASS_UPPER) - 1;
5403  }
5404  else if (trio_equal_max(CLASS_XDIGIT, sizeof(CLASS_XDIGIT) - 1,
5405  &format[index]))
5406  {
5407  for (i = 0; i < MAX_CHARACTER_CLASS; i++)
5408  if (isxdigit(i))
5409  characterclass[i]++;
5410  index += sizeof(CLASS_XDIGIT) - 1;
5411  }
5412  else
5413  {
5414  characterclass[(int)ch]++;
5415  }
5416  break;
5417 
5418  default:
5419  characterclass[(int)ch]++;
5420  break;
5421  }
5422  break;
5423 
5424 #endif /* TRIO_EXTENSION */
5425 
5426  default:
5427  characterclass[(int)ch]++;
5428  break;
5429  }
5430  }
5431  return 0;
5432 }
#define CLASS_PRINT
Definition: trio.c:442
#define isspace(c)
Definition: acclib.h:69
#define QUALIFIER_EQUAL
Definition: trio.c:640
#define QUALIFIER_CIRCUMFLEX
Definition: trio.c:616
#define TRIO_ERROR_RETURN(x, y)
Definition: trio.c:124
static char internalCollationArray[MAX_CHARACTER_CLASS][MAX_CHARACTER_CLASS]
Definition: trio.c:790
#define CLASS_CNTRL
Definition: trio.c:438
#define CLASS_LOWER
Definition: trio.c:441
#define CLASS_PUNCT
Definition: trio.c:443
#define isalpha(c)
Definition: acclib.h:74
#define CLASS_XDIGIT
Definition: trio.c:446
_Check_return_ _CRTIMP int __cdecl isalnum(_In_ int _C)
GLint GLint GLsizei GLsizei GLsizei GLint GLenum format
Definition: gl.h:1546
#define CLASS_ALPHA
Definition: trio.c:436
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
TRIO_PRIVATE void TrioGetCollation(TRIO_NOARGS)
Definition: trio.c:5149
#define QUALIFIER_MINUS
Definition: trio.c:613
GLuint index
Definition: glext.h:6031
#define CLASS_DIGIT
Definition: trio.c:439
#define isdigit(c)
Definition: acclib.h:68
static BOOLEAN_T internalCollationUnconverted
Definition: trio.c:789
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint GLint GLint j
Definition: glfuncs.h:250
#define CLASS_SPACE
Definition: trio.c:444
#define isupper(c)
Definition: acclib.h:71
#define CLASS_GRAPH
Definition: trio.c:440
#define SPECIFIER_UNGROUP
Definition: trio.c:496
_Check_return_ _CRTIMP int __cdecl isgraph(_In_ int _C)
#define index(s, c)
Definition: various.h:29
#define islower(c)
Definition: acclib.h:72
#define CLASS_UPPER
Definition: trio.c:445
_Check_return_ _CRTIMP int __cdecl iscntrl(_In_ int _C)
#define QUALIFIER_COLON
Definition: trio.c:639
#define SPECIFIER_GROUP
Definition: trio.c:495
#define CLASS_ALNUM
Definition: trio.c:435
#define NIL
Definition: trio.c:109
#define isprint(c)
Definition: acclib.h:73
#define isxdigit(c)
Definition: acclib.h:70
#define FALSE
Definition: trio.c:111
#define QUALIFIER_DOT
Definition: trio.c:614
_Check_return_ _CRTIMP int __cdecl ispunct(_In_ int _C)
int k
Definition: mpi.c:3369
unsigned int(__cdecl typeof(jpeg_read_scanlines))(struct jpeg_decompress_struct *
Definition: typeof.h:31

◆ TRIO_ARGS4() [3/4]

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

Definition at line 5572 of file trio.c.

5577 {
5578  int i;
5579  char ch;
5581 
5582  assert(VALID(self));
5583  assert(VALID(self->InStream));
5584 
5585  for (i = 0;
5586  (self->current != EOF) && (i < width);
5587  i++)
5588  {
5589  ch = (char)self->current;
5590  self->InStream(self, NULL);
5591  if ((flags & FLAGS_ALTERNATIVE) && (ch == CHAR_BACKSLASH))
5592  {
5593  switch (self->current)
5594  {
5595  case '\\': ch = '\\'; break;
5596  case 'a': ch = '\007'; break;
5597  case 'b': ch = '\b'; break;
5598  case 'f': ch = '\f'; break;
5599  case 'n': ch = '\n'; break;
5600  case 'r': ch = '\r'; break;
5601  case 't': ch = '\t'; break;
5602  case 'v': ch = '\v'; break;
5603  default:
5604  if (isdigit(self->current))
5605  {
5606  /* Read octal number */
5607  if (!TrioReadNumber(self, &number, 0, 3, BASE_OCTAL))
5608  return 0;
5609  ch = (char)number;
5610  }
5611  else if (trio_to_upper(self->current) == 'X')
5612  {
5613  /* Read hexadecimal number */
5614  self->InStream(self, NULL);
5615  if (!TrioReadNumber(self, &number, 0, 2, BASE_HEX))
5616  return 0;
5617  ch = (char)number;
5618  }
5619  else
5620  {
5621  ch = (char)self->current;
5622  }
5623  break;
5624  }
5625  }
5626 
5627  if (target)
5628  target[i] = ch;
5629  }
5630  return i + 1;
5631 }
#define VALID(x)
Definition: trio.c:117
GLint GLint GLsizei width
Definition: gl.h:1546
int current
Definition: trio.c:715
#define assert(x)
Definition: debug.h:53
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
static size_t double number
Definition: printf.c:64
unsigned char
Definition: typeof.h:29
#define isdigit(c)
Definition: acclib.h:68
#define CHAR_BACKSLASH
Definition: trio.c:430
GLbitfield flags
Definition: glext.h:7161
#define EOF
Definition: stdio.h:24
Definition: trio.c:389
GLenum target
Definition: glext.h:7315
trio_ulonglong_t trio_uintmax_t
Definition: trio.c:250
#define NULL
Definition: trio.c:107

◆ TRIO_ARGS4() [4/4]

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

Definition at line 5820 of file trio.c.

5825 {
5826  int ch;
5827  char doubleString[512];
5828  int index = 0;
5829  int start;
5830  int j;
5831  BOOLEAN_T isHex = FALSE;
5832 
5833  doubleString[0] = 0;
5834 
5835  if ((width == NO_WIDTH) || (width > (int)sizeof(doubleString) - 1))
5836  width = sizeof(doubleString) - 1;
5837 
5838  TrioSkipWhitespaces(self);
5839 
5840  /*
5841  * Read entire double number from stream. trio_to_double requires
5842  * a string as input, but InStream can be anything, so we have to
5843  * collect all characters.
5844  */
5845  ch = self->current;
5846  if ((ch == '+') || (ch == '-'))
5847  {
5848  doubleString[index++] = (char)ch;
5849  self->InStream(self, &ch);
5850  width--;
5851  }
5852 
5853  start = index;
5854  switch (ch)
5855  {
5856  case 'n':
5857  case 'N':
5858  /* Not-a-number */
5859  if (index != 0)
5860  break;
5861  /* FALLTHROUGH */
5862  case 'i':
5863  case 'I':
5864  /* Infinity */
5865  while (isalpha(ch) && (index - start < width))
5866  {
5867  doubleString[index++] = (char)ch;
5868  self->InStream(self, &ch);
5869  }
5870  doubleString[index] = NIL;
5871 
5872  /* Case insensitive string comparison */
5873  if (trio_equal(&doubleString[start], INFINITE_UPPER) ||
5874  trio_equal(&doubleString[start], LONG_INFINITE_UPPER))
5875  {
5876  if (flags & FLAGS_LONGDOUBLE)
5877  {
5878  if ((start == 1) && (doubleString[0] == '-'))
5879  {
5881  }
5882  else
5883  {
5885  }
5886  }
5887  else
5888  {
5889  if ((start == 1) && (doubleString[0] == '-'))
5890  {
5891  *((double *)target) = trio_ninf();
5892  }
5893  else
5894  {
5895  *((double *)target) = trio_pinf();
5896  }
5897  }
5898  return TRUE;
5899  }
5900  if (trio_equal(doubleString, NAN_UPPER))
5901  {
5902  /* NaN must not have a preceeding + nor - */
5903  if (flags & FLAGS_LONGDOUBLE)
5904  {
5906  }
5907  else
5908  {
5909  *((double *)target) = trio_nan();
5910  }
5911  return TRUE;
5912  }
5913  return FALSE;
5914 
5915  case '0':
5916  doubleString[index++] = (char)ch;
5917  self->InStream(self, &ch);
5918  if (trio_to_upper(ch) == 'X')
5919  {
5920  isHex = TRUE;
5921  doubleString[index++] = (char)ch;
5922  self->InStream(self, &ch);
5923  }
5924  break;
5925 
5926  default:
5927  break;
5928  }
5929 
5930  while ((ch != EOF) && (index - start < width))
5931  {
5932  /* Integer part */
5933  if (isHex ? isxdigit(ch) : isdigit(ch))
5934  {
5935  doubleString[index++] = (char)ch;
5936  self->InStream(self, &ch);
5937  }
5938  else if (flags & FLAGS_QUOTE)
5939  {
5940  /* Compare with thousands separator */
5941  for (j = 0; internalThousandSeparator[j] && self->current; j++)
5942  {
5943  if (internalThousandSeparator[j] != self->current)
5944  break;
5945 
5946  self->InStream(self, &ch);
5947  }
5949  break; /* Mismatch */
5950  else
5951  continue; /* Match */
5952  }
5953  else
5954  break; /* while */
5955  }
5956  if (ch == '.')
5957  {
5958  /* Decimal part */
5959  doubleString[index++] = (char)ch;
5960  self->InStream(self, &ch);
5961  while ((isHex ? isxdigit(ch) : isdigit(ch)) &&
5962  (index - start < width))
5963  {
5964  doubleString[index++] = (char)ch;
5965  self->InStream(self, &ch);
5966  }
5967  if (isHex ? (trio_to_upper(ch) == 'P') : (trio_to_upper(ch) == 'E'))
5968  {
5969  /* Exponent */
5970  doubleString[index++] = (char)ch;
5971  self->InStream(self, &ch);
5972  if ((ch == '+') || (ch == '-'))
5973  {
5974  doubleString[index++] = (char)ch;
5975  self->InStream(self, &ch);
5976  }
5977  while (isdigit(ch) && (index - start < width))
5978  {
5979  doubleString[index++] = (char)ch;
5980  self->InStream(self, &ch);
5981  }
5982  }
5983  }
5984 
5985  if ((index == start) || (*doubleString == NIL))
5986  return FALSE;
5987 
5988  doubleString[index] = 0;
5989 
5990  if (flags & FLAGS_LONGDOUBLE)
5991  {
5992  *((trio_long_double_t *)target) = trio_to_long_double(doubleString, NULL);
5993  }
5994  else
5995  {
5996  *((double *)target) = trio_to_double(doubleString, NULL);
5997  }
5998  return TRUE;
5999 }
GLint GLint GLsizei width
Definition: gl.h:1546
double trio_long_double_t
Definition: triodef.h:132
int current
Definition: trio.c:715
#define isalpha(c)
Definition: acclib.h:74
TRIO_PUBLIC double trio_pinf(TRIO_NOARGS)
Definition: trionan.c:258
unsigned char
Definition: typeof.h:29
#define BOOLEAN_T
Definition: trio.c:114
GLuint index
Definition: glext.h:6031
#define isdigit(c)
Definition: acclib.h:68
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint GLint GLint j
Definition: glfuncs.h:250
#define NAN_UPPER
Definition: trio.c:322
TRIO_PUBLIC double trio_ninf(TRIO_NOARGS)
Definition: trionan.c:302
GLbitfield flags
Definition: glext.h:7161
#define INFINITE_UPPER
Definition: trio.c:318
static char internalThousandSeparator[MAX_LOCALE_SEPARATOR_LENGTH+1]
Definition: trio.c:781
#define index(s, c)
Definition: various.h:29
TRIO_PUBLIC double trio_nan(TRIO_NOARGS)
Definition: trionan.c:323
#define LONG_INFINITE_UPPER
Definition: trio.c:320
GLuint start
Definition: gl.h:1545
#define NIL
Definition: trio.c:109
Definition: trio.c:378
#define isxdigit(c)
Definition: acclib.h:70
#define FALSE
Definition: trio.c:111
#define EOF
Definition: stdio.h:24
GLenum target
Definition: glext.h:7315
#define TRUE
Definition: trio.c:112
#define NULL
Definition: trio.c:107

◆ TRIO_ARGS5() [1/4]

TRIO_PRIVATE int TrioParse TRIO_ARGS5 ( (type, format, parameters, arglist, argarray)  ,
int  type,
TRIO_CONST char format,
trio_parameter_t parameters,
TRIO_VA_LIST_PTR  arglist,
trio_pointer_t argarray 
)

Definition at line 1182 of file trio.c.

1188 {
1189  /* Count the number of times a parameter is referenced */
1190  unsigned short usedEntries[MAX_PARAMETERS];
1191  /* Parameter counters */
1192  int parameterPosition;
1193  int currentParam;
1194  int maxParam = -1;
1195  /* Utility variables */
1197  int width;
1198  int precision;
1199  int varsize;
1200  int base;
1201  int index; /* Index into formatting string */
1202  int dots; /* Count number of dots in modifier part */
1203  BOOLEAN_T positional; /* Does the specifier have a positional? */
1204  BOOLEAN_T gotSticky = FALSE; /* Are there any sticky modifiers at all? */
1205  /*
1206  * indices specifies the order in which the parameters must be
1207  * read from the va_args (this is necessary to handle positionals)
1208  */
1209  int indices[MAX_PARAMETERS];
1210  int pos = 0;
1211  /* Various variables */
1212  char ch;
1213 #if defined(TRIO_COMPILER_SUPPORTS_MULTIBYTE)
1214  int charlen;
1215 #endif
1216  int save_errno;
1217  int i = -1;
1218  int num;
1219  char *tmpformat;
1220 
1221  /* One and only one of arglist and argarray must be used */
1222  assert((arglist != NULL) ^ (argarray != NULL));
1223 
1224  /*
1225  * The 'parameters' array is not initialized, but we need to
1226  * know which entries we have used.
1227  */
1228  memset(usedEntries, 0, sizeof(usedEntries));
1229 
1230  save_errno = errno;
1231  index = 0;
1232  parameterPosition = 0;
1233 #if defined(TRIO_COMPILER_SUPPORTS_MULTIBYTE)
1234  (void)mblen(NULL, 0);
1235 #endif
1236 
1237  while (format[index])
1238  {
1239 #if defined(TRIO_COMPILER_SUPPORTS_MULTIBYTE)
1240  if (! isascii(format[index]))
1241  {
1242  /*
1243  * Multibyte characters cannot be legal specifiers or
1244  * modifiers, so we skip over them.
1245  */
1246  charlen = mblen(&format[index], MB_LEN_MAX);
1247  index += (charlen > 0) ? charlen : 1;
1248  continue; /* while */
1249  }
1250 #endif /* TRIO_COMPILER_SUPPORTS_MULTIBYTE */
1251  if (CHAR_IDENTIFIER == format[index++])
1252  {
1253  if (CHAR_IDENTIFIER == format[index])
1254  {
1255  index++;
1256  continue; /* while */
1257  }
1258 
1259  flags = FLAGS_NEW;
1260  dots = 0;
1261  currentParam = TrioGetPosition(format, &index);
1262  positional = (NO_POSITION != currentParam);
1263  if (!positional)
1264  {
1265  /* We have no positional, get the next counter */
1266  currentParam = parameterPosition;
1267  }
1268  if(currentParam >= MAX_PARAMETERS)
1269  {
1270  /* Bail out completely to make the error more obvious */
1272  }
1273 
1274  if (currentParam > maxParam)
1275  maxParam = currentParam;
1276 
1277  /* Default values */
1278  width = NO_WIDTH;
1280  base = NO_BASE;
1281  varsize = NO_SIZE;
1282 
1283  while (TrioIsQualifier(format[index]))
1284  {
1285  ch = format[index++];
1286 
1287  switch (ch)
1288  {
1289  case QUALIFIER_SPACE:
1290  flags |= FLAGS_SPACE;
1291  break;
1292 
1293  case QUALIFIER_PLUS:
1294  flags |= FLAGS_SHOWSIGN;
1295  break;
1296 
1297  case QUALIFIER_MINUS:
1299  flags &= ~FLAGS_NILPADDING;
1300  break;
1301 
1302  case QUALIFIER_ALTERNATIVE:
1304  break;
1305 
1306  case QUALIFIER_DOT:
1307  if (dots == 0) /* Precision */
1308  {
1309  dots++;
1310 
1311  /* Skip if no precision */
1312  if (QUALIFIER_DOT == format[index])
1313  break;
1314 
1315  /* After the first dot we have the precision */
1317  if ((QUALIFIER_STAR == format[index])
1318 #if defined(QUALIFIER_PARAM)
1319  || (QUALIFIER_PARAM == format[index])
1320 #endif
1321  )
1322  {
1323  index++;
1325 
1326  precision = TrioGetPosition(format, &index);
1327  if (precision == NO_POSITION)
1328  {
1329  parameterPosition++;
1330  if (positional)
1331  precision = parameterPosition;
1332  else
1333  {
1334  precision = currentParam;
1335  currentParam = precision + 1;
1336  }
1337  }
1338  else
1339  {
1340  if (! positional)
1341  currentParam = precision + 1;
1342  if (width > maxParam)
1343  maxParam = precision;
1344  }
1345  if (currentParam > maxParam)
1346  maxParam = currentParam;
1347  }
1348  else
1349  {
1350  precision = trio_to_long(&format[index],
1351  &tmpformat,
1352  BASE_DECIMAL);
1353  index = (int)(tmpformat - format);
1354  }
1355  }
1356  else if (dots == 1) /* Base */
1357  {
1358  dots++;
1359 
1360  /* After the second dot we have the base */
1361  flags |= FLAGS_BASE;
1362  if ((QUALIFIER_STAR == format[index])
1363 #if defined(QUALIFIER_PARAM)
1364  || (QUALIFIER_PARAM == format[index])
1365 #endif
1366  )
1367  {
1368  index++;
1370  base = TrioGetPosition(format, &index);
1371  if (base == NO_POSITION)
1372  {
1373  parameterPosition++;
1374  if (positional)
1375  base = parameterPosition;
1376  else
1377  {
1378  base = currentParam;
1379  currentParam = base + 1;
1380  }
1381  }
1382  else
1383  {
1384  if (! positional)
1385  currentParam = base + 1;
1386  if (base > maxParam)
1387  maxParam = base;
1388  }
1389  if (currentParam > maxParam)
1390  maxParam = currentParam;
1391  }
1392  else
1393  {
1394  base = trio_to_long(&format[index],
1395  &tmpformat,
1396  BASE_DECIMAL);
1397  if (base > MAX_BASE)
1399  index = (int)(tmpformat - format);
1400  }
1401  }
1402  else
1403  {
1405  }
1406  break; /* QUALIFIER_DOT */
1407 
1408 #if defined(QUALIFIER_PARAM)
1409  case QUALIFIER_PARAM:
1410  type = TYPE_PRINT;
1411  /* FALLTHROUGH */
1412 #endif
1413  case QUALIFIER_STAR:
1414  /* This has different meanings for print and scan */
1415  if (TYPE_PRINT == type)
1416  {
1417  /* Read with from parameter */
1419  width = TrioGetPosition(format, &index);
1420  if (width == NO_POSITION)
1421  {
1422  parameterPosition++;
1423  if (positional)
1424  width = parameterPosition;
1425  else
1426  {
1427  width = currentParam;
1428  currentParam = width + 1;
1429  }
1430  }
1431  else
1432  {
1433  if (! positional)
1434  currentParam = width + 1;
1435  if (width > maxParam)
1436  maxParam = width;
1437  }
1438  if (currentParam > maxParam)
1439  maxParam = currentParam;
1440  }
1441  else
1442  {
1443  /* Scan, but do not store result */
1444  flags |= FLAGS_IGNORE;
1445  }
1446 
1447  break; /* QUALIFIER_STAR */
1448 
1449  case '0':
1450  if (! (flags & FLAGS_LEFTADJUST))
1452  /* FALLTHROUGH */
1453  case '1': case '2': case '3': case '4':
1454  case '5': case '6': case '7': case '8': case '9':
1455  flags |= FLAGS_WIDTH;
1456  /* &format[index - 1] is used to "rewind" the read
1457  * character from format
1458  */
1459  width = trio_to_long(&format[index - 1],
1460  &tmpformat,
1461  BASE_DECIMAL);
1462  index = (int)(tmpformat - format);
1463  break;
1464 
1465  case QUALIFIER_SHORT:
1466  if (flags & FLAGS_SHORTSHORT)
1468  else if (flags & FLAGS_SHORT)
1470  else
1471  flags |= FLAGS_SHORT;
1472  break;
1473 
1474  case QUALIFIER_LONG:
1475  if (flags & FLAGS_QUAD)
1477  else if (flags & FLAGS_LONG)
1478  flags |= FLAGS_QUAD;
1479  else
1480  flags |= FLAGS_LONG;
1481  break;
1482 
1483  case QUALIFIER_LONG_UPPER:
1485  break;
1486 
1487 #if defined(QUALIFIER_SIZE_T)
1488  case QUALIFIER_SIZE_T:
1489  flags |= FLAGS_SIZE_T;
1490  /* Modify flags for later truncation of number */
1491  if (sizeof(size_t) == sizeof(trio_ulonglong_t))
1492  flags |= FLAGS_QUAD;
1493  else if (sizeof(size_t) == sizeof(long))
1494  flags |= FLAGS_LONG;
1495  break;
1496 #endif
1497 
1498 #if defined(QUALIFIER_PTRDIFF_T)
1499  case QUALIFIER_PTRDIFF_T:
1501  if (sizeof(ptrdiff_t) == sizeof(trio_ulonglong_t))
1502  flags |= FLAGS_QUAD;
1503  else if (sizeof(ptrdiff_t) == sizeof(long))
1504  flags |= FLAGS_LONG;
1505  break;
1506 #endif
1507 
1508 #if defined(QUALIFIER_INTMAX_T)
1509  case QUALIFIER_INTMAX_T:
1510  flags |= FLAGS_INTMAX_T;
1511  if (sizeof(trio_intmax_t) == sizeof(trio_ulonglong_t))
1512  flags |= FLAGS_QUAD;
1513  else if (sizeof(trio_intmax_t) == sizeof(long))
1514  flags |= FLAGS_LONG;
1515  break;
1516 #endif
1517 
1518 #if defined(QUALIFIER_QUAD)
1519  case QUALIFIER_QUAD:
1520  flags |= FLAGS_QUAD;
1521  break;
1522 #endif
1523 
1524 #if defined(QUALIFIER_FIXED_SIZE)
1525  case QUALIFIER_FIXED_SIZE:
1526  if (flags & FLAGS_FIXED_SIZE)
1528 
1532 
1533  if ((format[index] == '6') &&
1534  (format[index + 1] == '4'))
1535  {
1536  varsize = sizeof(trio_int64_t);
1537  index += 2;
1538  }
1539  else if ((format[index] == '3') &&
1540  (format[index + 1] == '2'))
1541  {
1542  varsize = sizeof(trio_int32_t);
1543  index += 2;
1544  }
1545  else if ((format[index] == '1') &&
1546  (format[index + 1] == '6'))
1547  {
1548  varsize = sizeof(trio_int16_t);
1549  index += 2;
1550  }
1551  else if (format[index] == '8')
1552  {
1553  varsize = sizeof(trio_int8_t);
1554  index++;
1555  }
1556  else
1558 
1560  break;
1561 #endif
1562 
1563 #if defined(QUALIFIER_WIDECHAR)
1564  case QUALIFIER_WIDECHAR:
1565  flags |= FLAGS_WIDECHAR;
1566  break;
1567 #endif
1568 
1569 #if defined(QUALIFIER_SIZE_T_UPPER)
1571  break;
1572 #endif
1573 
1574 #if defined(QUALIFIER_QUOTE)
1575  case QUALIFIER_QUOTE:
1576  flags |= FLAGS_QUOTE;
1577  break;
1578 #endif
1579 
1580 #if defined(QUALIFIER_STICKY)
1581  case QUALIFIER_STICKY:
1582  flags |= FLAGS_STICKY;
1583  gotSticky = TRUE;
1584  break;
1585 #endif
1586 
1587 #if defined(QUALIFIER_VARSIZE)
1588  case QUALIFIER_VARSIZE:
1590  parameterPosition++;
1591  if (positional)
1592  varsize = parameterPosition;
1593  else
1594  {
1595  varsize = currentParam;
1596  currentParam = varsize + 1;
1597  }
1598  if (currentParam > maxParam)
1599  maxParam = currentParam;
1600  break;
1601 #endif
1602 
1603 #if defined(QUALIFIER_ROUNDING_UPPER)
1605  flags |= FLAGS_ROUNDING;
1606  break;
1607 #endif
1608 
1609  default:
1610  /* Bail out completely to make the error more obvious */
1612  }
1613  } /* while qualifier */
1614 
1615  /*
1616  * Parameters only need the type and value. The value is
1617  * read later.
1618  */
1620  {
1621  usedEntries[width] += 1;
1622  parameters[pos].type = FORMAT_PARAMETER;
1623  parameters[pos].flags = 0;
1624  indices[width] = pos;
1625  width = pos++;
1626  }
1628  {
1629  usedEntries[precision] += 1;
1630  parameters[pos].type = FORMAT_PARAMETER;
1631  parameters[pos].flags = 0;
1632  indices[precision] = pos;
1633  precision = pos++;
1634  }
1636  {
1637  usedEntries[base] += 1;
1638  parameters[pos].type = FORMAT_PARAMETER;
1639  parameters[pos].flags = 0;
1640  indices[base] = pos;
1641  base = pos++;
1642  }
1644  {
1645  usedEntries[varsize] += 1;
1646  parameters[pos].type = FORMAT_PARAMETER;
1647  parameters[pos].flags = 0;
1648  indices[varsize] = pos;
1649  varsize = pos++;
1650  }
1651 
1652  indices[currentParam] = pos;
1653 
1654  switch (format[index++])
1655  {
1656 #if defined(SPECIFIER_CHAR_UPPER)
1657  case SPECIFIER_CHAR_UPPER:
1658  flags |= FLAGS_WIDECHAR;
1659  /* FALLTHROUGH */
1660 #endif
1661  case SPECIFIER_CHAR:
1662  if (flags & FLAGS_LONG)
1663  flags |= FLAGS_WIDECHAR;
1664  else if (flags & FLAGS_SHORT)
1665  flags &= ~FLAGS_WIDECHAR;
1666  parameters[pos].type = FORMAT_CHAR;
1667  break;
1668 
1669 #if defined(SPECIFIER_STRING_UPPER)
1671  flags |= FLAGS_WIDECHAR;
1672  /* FALLTHROUGH */
1673 #endif
1674  case SPECIFIER_STRING:
1675  if (flags & FLAGS_LONG)
1676  flags |= FLAGS_WIDECHAR;
1677  else if (flags & FLAGS_SHORT)
1678  flags &= ~FLAGS_WIDECHAR;
1679  parameters[pos].type = FORMAT_STRING;
1680  break;
1681 
1682  case SPECIFIER_GROUP:
1683  if (TYPE_SCAN == type)
1684  {
1685  int depth = 1;
1686  parameters[pos].type = FORMAT_GROUP;
1688  index++;
1689  if (format[index] == SPECIFIER_UNGROUP)
1690  index++;
1691  if (format[index] == QUALIFIER_MINUS)
1692  index++;
1693  /* Skip nested brackets */
1694  while (format[index] != NIL)
1695  {
1696  if (format[index] == SPECIFIER_GROUP)
1697  {
1698  depth++;
1699  }
1700  else if (format[index] == SPECIFIER_UNGROUP)
1701  {
1702  if (--depth <= 0)
1703  {
1704  index++;
1705  break;
1706  }
1707  }
1708  index++;
1709  }
1710  }
1711  break;
1712 
1713  case SPECIFIER_INTEGER:
1714  parameters[pos].type = FORMAT_INT;
1715  break;
1716 
1717  case SPECIFIER_UNSIGNED:
1718  flags |= FLAGS_UNSIGNED;
1719  parameters[pos].type = FORMAT_INT;
1720  break;
1721 
1722  case SPECIFIER_DECIMAL:
1723  /* Disable base modifier */
1725  base = BASE_DECIMAL;
1726  parameters[pos].type = FORMAT_INT;
1727  break;
1728 
1729  case SPECIFIER_OCTAL:
1730  flags |= FLAGS_UNSIGNED;
1732  base = BASE_OCTAL;
1733  parameters[pos].type = FORMAT_INT;
1734  break;
1735 
1736 #if defined(SPECIFIER_BINARY)
1738  flags |= FLAGS_UPPER;
1739  /* FALLTHROUGH */
1740  case SPECIFIER_BINARY:
1743  base = BASE_BINARY;
1744  parameters[pos].type = FORMAT_INT;
1745  break;
1746 #endif
1747 
1748  case SPECIFIER_HEX_UPPER:
1749  flags |= FLAGS_UPPER;
1750  /* FALLTHROUGH */
1751  case SPECIFIER_HEX:
1752  flags |= FLAGS_UNSIGNED;
1754  base = BASE_HEX;
1755  parameters[pos].type = FORMAT_INT;
1756  break;
1757 
1759  flags |= FLAGS_UPPER;
1760  /* FALLTHROUGH */
1761  case SPECIFIER_FLOAT_E:
1762  flags |= FLAGS_FLOAT_E;
1763  parameters[pos].type = FORMAT_DOUBLE;
1764  break;
1765 
1767  flags |= FLAGS_UPPER;
1768  /* FALLTHROUGH */
1769  case SPECIFIER_FLOAT_G:
1770  flags |= FLAGS_FLOAT_G;
1771  parameters[pos].type = FORMAT_DOUBLE;
1772  break;
1773 
1775  flags |= FLAGS_UPPER;
1776  /* FALLTHROUGH */
1777  case SPECIFIER_FLOAT_F:
1778  parameters[pos].type = FORMAT_DOUBLE;
1779  break;
1780 
1781  case SPECIFIER_POINTER:
1782  if (sizeof(trio_pointer_t) == sizeof(trio_ulonglong_t))
1783  flags |= FLAGS_QUAD;
1784  else if (sizeof(trio_pointer_t) == sizeof(long))
1785  flags |= FLAGS_LONG;
1786  parameters[pos].type = FORMAT_POINTER;
1787  break;
1788 
1789  case SPECIFIER_COUNT:
1790  parameters[pos].type = FORMAT_COUNT;
1791  break;
1792 
1793 #if defined(SPECIFIER_HEXFLOAT)
1794 # if defined(SPECIFIER_HEXFLOAT_UPPER)
1796  flags |= FLAGS_UPPER;
1797  /* FALLTHROUGH */
1798 # endif
1799  case SPECIFIER_HEXFLOAT:
1800  base = BASE_HEX;
1801  parameters[pos].type = FORMAT_DOUBLE;
1802  break;
1803 #endif
1804 
1805 #if defined(FORMAT_ERRNO)
1806  case SPECIFIER_ERRNO:
1807  parameters[pos].type = FORMAT_ERRNO;
1808  break;
1809 #endif
1810 
1811 #if defined(SPECIFIER_USER_DEFINED_BEGIN)
1813  {
1814  unsigned int max;
1815  int without_namespace = TRUE;
1816 
1817  parameters[pos].type = FORMAT_USER_DEFINED;
1818  parameters[pos].user_name[0] = NIL;
1819  tmpformat = (char *)&format[index];
1820 
1821  while ((ch = format[index]))
1822  {
1823  index++;
1824  if (ch == SPECIFIER_USER_DEFINED_END)
1825  {
1826  if (without_namespace)
1827  {
1828  /* We must get the handle first */
1829  parameters[pos].type = FORMAT_PARAMETER;
1830  parameters[pos].indexAfterSpecifier = index;
1831  parameters[pos].flags = FLAGS_USER_DEFINED;
1832  /* Adjust parameters for insertion of new one */
1833  pos++;
1834  usedEntries[currentParam] += 1;
1835  parameters[pos].type = FORMAT_USER_DEFINED;
1836  currentParam++;
1837  indices[currentParam] = pos;
1838  if (currentParam > maxParam)
1839  maxParam = currentParam;
1840  }
1841  /* Copy the user data */
1842  max = (unsigned int)(&format[index] - tmpformat);
1843  if (max > MAX_USER_DATA)
1844  max = MAX_USER_DATA;
1845  trio_copy_max(parameters[pos].user_data,
1846  max,
1847  tmpformat);
1848  break; /* while */
1849  }
1851  {
1852  without_namespace = FALSE;
1853  /* Copy the namespace for later looking-up */
1854  max = (int)(&format[index] - tmpformat);
1855  if (max > MAX_USER_NAME)
1856  max = MAX_USER_NAME;
1857  trio_copy_max(parameters[pos].user_name,
1858  max,
1859  tmpformat);
1860  tmpformat = (char *)&format[index];
1861  }
1862  }
1863  if (ch != SPECIFIER_USER_DEFINED_END)
1865  }
1866  break;
1867 #endif /* defined(SPECIFIER_USER_DEFINED_BEGIN) */
1868 
1869  default:
1870  /* Bail out completely to make the error more obvious */
1872  }
1873 
1874  /* Count the number of times this entry has been used */
1875  usedEntries[currentParam] += 1;
1876 
1877  /* Find last sticky parameters */
1878  if (gotSticky && !(flags & FLAGS_STICKY))
1879  {
1880  for (i = pos - 1; i >= 0; i--)
1881  {
1882  if (parameters[i].type == FORMAT_PARAMETER)
1883  continue;
1884  if ((parameters[i].flags & FLAGS_STICKY) &&
1885  (parameters[i].type == parameters[pos].type))
1886  {
1887  /* Do not overwrite current qualifiers */
1888  flags |= (parameters[i].flags & (unsigned long)~FLAGS_STICKY);
1889  if (width == NO_WIDTH)
1890  width = parameters[i].width;
1891  if (precision == NO_PRECISION)
1892  precision = parameters[i].precision;
1893  if (base == NO_BASE)
1894  base = parameters[i].base;
1895  break;
1896  }
1897  }
1898  }
1899 
1900  parameters[pos].indexAfterSpecifier = index;
1901  parameters[pos].flags = flags;
1902  parameters[pos].width = width;
1903  parameters[pos].precision = precision;
1904  parameters[pos].base = (base == NO_BASE) ? BASE_DECIMAL : base;
1905  parameters[pos].varsize = varsize;
1906  pos++;
1907 
1908  if (! positional)
1909  parameterPosition++;
1910 
1911  } /* if identifier */
1912 
1913  } /* while format characters left */
1914 
1915  for (num = 0; num <= maxParam; num++)
1916  {
1917  if (usedEntries[num] != 1)
1918  {
1919  if (usedEntries[num] == 0) /* gap detected */
1920  return TRIO_ERROR_RETURN(TRIO_EGAP, num);
1921  else /* double references detected */
1923  }
1924 
1925  i = indices[num];
1926 
1927  /*
1928  * FORMAT_PARAMETERS are only present if they must be read,
1929  * so it makes no sense to check the ignore flag (besides,
1930  * the flags variable is not set for that particular type)
1931  */
1932  if ((parameters[i].type != FORMAT_PARAMETER) &&
1933  (parameters[i].flags & FLAGS_IGNORE))
1934  continue; /* for all arguments */
1935 
1936  /*
1937  * The stack arguments are read according to ANSI C89
1938  * default argument promotions:
1939  *
1940  * char = int
1941  * short = int
1942  * unsigned char = unsigned int
1943  * unsigned short = unsigned int
1944  * float = double
1945  *
1946  * In addition to the ANSI C89 these types are read (the
1947  * default argument promotions of C99 has not been
1948  * considered yet)
1949  *
1950  * long long
1951  * long double
1952  * size_t
1953  * ptrdiff_t
1954  * intmax_t
1955  */
1956  switch (parameters[i].type)
1957  {
1958  case FORMAT_GROUP:
1959  case FORMAT_STRING:
1960 #if TRIO_WIDECHAR
1961  if (flags & FLAGS_WIDECHAR)
1962  {
1963  parameters[i].data.wstring = (argarray == NULL)
1964  ? va_arg(TRIO_VA_LIST_DEREF(arglist), trio_wchar_t *)
1965  : (trio_wchar_t *)(argarray[num]);
1966  }
1967  else
1968 #endif
1969  {
1970  parameters[i].data.string = (argarray == NULL)
1971  ? va_arg(TRIO_VA_LIST_DEREF(arglist), char *)
1972  : (char *)(argarray[num]);
1973  }
1974  break;
1975 
1976 #if defined(FORMAT_USER_DEFINED)
1977  case FORMAT_USER_DEFINED:
1978 #endif
1979  case FORMAT_POINTER:
1980  case FORMAT_COUNT:
1981  case FORMAT_UNKNOWN:
1982  parameters[i].data.pointer = (argarray == NULL)
1984  : argarray[num];
1985  break;
1986 
1987  case FORMAT_CHAR:
1988  case FORMAT_INT:
1989  if (TYPE_SCAN == type)
1990  {
1991  if (argarray == NULL)
1992  parameters[i].data.pointer =
1994  else
1995  {
1996  if (parameters[i].type == FORMAT_CHAR)
1997  parameters[i].data.pointer =
1998  (trio_pointer_t)((char *)argarray[num]);
1999  else if (parameters[i].flags & FLAGS_SHORT)
2000  parameters[i].data.pointer =
2001  (trio_pointer_t)((short *)argarray[num]);
2002  else
2003  parameters[i].data.pointer =
2004  (trio_pointer_t)((int *)argarray[num]);
2005  }
2006  }
2007  else
2008  {
2009 #if defined(QUALIFIER_VARSIZE) || defined(QUALIFIER_FIXED_SIZE)
2010  if (parameters[i].flags
2012  {
2013  if (parameters[i].flags & FLAGS_VARSIZE_PARAMETER)
2014  {
2015  /*
2016  * Variable sizes are mapped onto the fixed sizes, in
2017  * accordance with integer promotion.
2018  *
2019  * Please note that this may not be portable, as we
2020  * only guess the size, not the layout of the numbers.
2021  * For example, if int is little-endian, and long is
2022  * big-endian, then this will fail.
2023  */
2024  varsize = (int)parameters[parameters[i].varsize].data.number.as_unsigned;
2025  }
2026  else
2027  {
2028  /* Used for the I<bits> modifiers */
2029  varsize = parameters[i].varsize;
2030  }
2031  parameters[i].flags &= ~FLAGS_ALL_VARSIZES;
2032 
2033  if (varsize <= (int)sizeof(int))
2034  ;
2035  else if (varsize <= (int)sizeof(long))
2036  parameters[i].flags |= FLAGS_LONG;
2037 #if defined(QUALIFIER_INTMAX_T)
2038  else if (varsize <= (int)sizeof(trio_longlong_t))
2039  parameters[i].flags |= FLAGS_QUAD;
2040  else
2041  parameters[i].flags |= FLAGS_INTMAX_T;
2042 #else
2043  else
2044  parameters[i].flags |= FLAGS_QUAD;
2045 #endif
2046  }
2047 #endif /* defined(QUALIFIER_VARSIZE) */
2048 #if defined(QUALIFIER_SIZE_T) || defined(QUALIFIER_SIZE_T_UPPER)
2049  if (parameters[i].flags & FLAGS_SIZE_T)
2050  parameters[i].data.number.as_unsigned = (argarray == NULL)
2052  : (trio_uintmax_t)(*((size_t *)argarray[num]));
2053  else
2054 #endif
2055 #if defined(QUALIFIER_PTRDIFF_T)
2056  if (parameters[i].flags & FLAGS_PTRDIFF_T)
2057  parameters[i].data.number.as_unsigned = (argarray == NULL)
2059  : (trio_uintmax_t)(*((ptrdiff_t *)argarray[num]));
2060  else
2061 #endif
2062 #if defined(QUALIFIER_INTMAX_T)
2063  if (parameters[i].flags & FLAGS_INTMAX_T)
2064  parameters[i].data.number.as_unsigned = (argarray == NULL)
2066  : (trio_uintmax_t)(*((trio_intmax_t *)argarray[num]));
2067  else
2068 #endif
2069  if (parameters[i].flags & FLAGS_QUAD)
2070  parameters[i].data.number.as_unsigned = (argarray == NULL)
2072  : (trio_uintmax_t)(*((trio_ulonglong_t *)argarray[num]));
2073  else if (parameters[i].flags & FLAGS_LONG)
2074  parameters[i].data.number.as_unsigned = (argarray == NULL)
2076  : (trio_uintmax_t)(*((long *)argarray[num]));
2077  else
2078  {
2079  if (argarray == NULL)
2080  parameters[i].data.number.as_unsigned = (trio_uintmax_t)va_arg(TRIO_VA_LIST_DEREF(arglist), int);
2081  else
2082  {
2083  if (parameters[i].type == FORMAT_CHAR)
2084  parameters[i].data.number.as_unsigned = (trio_uintmax_t)(*((char *)argarray[num]));
2085  else if (parameters[i].flags & FLAGS_SHORT)
2086  parameters[i].data.number.as_unsigned = (trio_uintmax_t)(*((short *)argarray[num]));
2087  else
2088  parameters[i].data.number.as_unsigned = (trio_uintmax_t)(*((int *)argarray[num]));
2089  }
2090  }
2091  }
2092  break;
2093 
2094  case FORMAT_PARAMETER:
2095  /*
2096  * The parameter for the user-defined specifier is a pointer,
2097  * whereas the rest (width, precision, base) uses an integer.
2098  */
2099  if (parameters[i].flags & FLAGS_USER_DEFINED)
2100  parameters[i].data.pointer = (argarray == NULL)
2102  : argarray[num];
2103  else
2104  parameters[i].data.number.as_unsigned = (argarray == NULL)
2106  : (trio_uintmax_t)(*((int *)argarray[num]));
2107  break;
2108 
2109  case FORMAT_DOUBLE:
2110  if (TYPE_SCAN == type)
2111  {
2112  if (parameters[i].flags & FLAGS_LONGDOUBLE)
2113  parameters[i].data.longdoublePointer = (argarray == NULL)
2115  : (trio_long_double_t *)argarray[num];
2116  else
2117  {
2118  if (parameters[i].flags & FLAGS_LONG)
2119  parameters[i].data.doublePointer = (argarray == NULL)
2120  ? va_arg(TRIO_VA_LIST_DEREF(arglist), double *)
2121  : (double *)argarray[num];
2122  else
2123  parameters[i].data.doublePointer = (argarray == NULL)
2124  ? (double *)va_arg(TRIO_VA_LIST_DEREF(arglist), float *)
2125  : (double *)((float *)argarray[num]);
2126  }
2127  }
2128  else
2129  {
2130  if (parameters[i].flags & FLAGS_LONGDOUBLE)
2131  parameters[i].data.longdoubleNumber = (argarray == NULL)
2133  : (trio_long_double_t)(*((trio_long_double_t *)argarray[num]));
2134  else
2135  {
2136  if (argarray == NULL)
2137  parameters[i].data.longdoubleNumber =
2139  else
2140  {
2141  if (parameters[i].flags & FLAGS_SHORT)
2142  parameters[i].data.longdoubleNumber =
2143  (trio_long_double_t)(*((float *)argarray[num]));
2144  else
2145  parameters[i].data.longdoubleNumber =
2146  (trio_long_double_t)(*((double *)argarray[num]));
2147  }
2148  }
2149  }
2150  break;
2151 
2152 #if defined(FORMAT_ERRNO)
2153  case FORMAT_ERRNO:
2154  parameters[i].data.errorNumber = save_errno;
2155  break;
2156 #endif
2157 
2158  default:
2159  break;
2160  }
2161  } /* for all specifiers */
2162  return num;
2163 }
#define CHAR_IDENTIFIER
Definition: trio.c:429
#define QUALIFIER_WIDECHAR
Definition: trio.c:629
char * trio_pointer_t
Definition: triodef.h:133
unsigned long trio_flags_t
Definition: trio.c:139
#define SPECIFIER_FLOAT_G
Definition: trio.c:492
GLuint GLuint GLsizei GLenum const GLvoid * indices
Definition: gl.h:1545
GLint GLint GLsizei width
Definition: gl.h:1546
#define max(a, b)
Definition: svc.c:63
#define SPECIFIER_HEX_UPPER
Definition: trio.c:487
#define QUALIFIER_ROUNDING_UPPER
Definition: trio.c:641
#define FORMAT_PARAMETER
Definition: trio.c:419
#define QUALIFIER_ALTERNATIVE
Definition: trio.c:610
#define SPECIFIER_FLOAT_E
Definition: trio.c:488
#define FORMAT_DOUBLE
Definition: trio.c:414
struct png_info_def **typedef void(__cdecl typeof(png_destroy_read_struct))(struct png_struct_def **
Definition: typeof.h:49
#define FORMAT_GROUP
Definition: trio.c:420
double trio_long_double_t
Definition: triodef.h:132
#define SPECIFIER_INTEGER
Definition: trio.c:483
int indexAfterSpecifier
Definition: trio.c:666
#define QUALIFIER_CIRCUMFLEX
Definition: trio.c:616
#define TRIO_ERROR_RETURN(x, y)
Definition: trio.c:124
#define SPECIFIER_STRING
Definition: trio.c:481
#define SPECIFIER_BINARY_UPPER
Definition: trio.c:511
#define FORMAT_ERRNO
Definition: trio.c:422
#define SPECIFIER_CHAR
Definition: trio.c:480
GLuint GLuint GLsizei GLenum type
Definition: gl.h:1545
#define assert(x)
Definition: debug.h:53
trio_pointer_t pointer
Definition: trio.c:673
#define SPECIFIER_FLOAT_G_UPPER
Definition: trio.c:493
int errno
#define FORMAT_STRING
Definition: trio.c:416
#define QUALIFIER_SIZE_T_UPPER
Definition: trio.c:626
#define SPECIFIER_OCTAL
Definition: trio.c:485
#define QUALIFIER_QUOTE
Definition: trio.c:635
#define SPECIFIER_STRING_UPPER
Definition: trio.c:500
#define FORMAT_POINTER
Definition: trio.c:417
#define SPECIFIER_HEXFLOAT_UPPER
Definition: trio.c:504
GLint GLint GLsizei GLsizei GLsizei GLint GLenum format
Definition: gl.h:1546
#define SPECIFIER_FLOAT_E_UPPER
Definition: trio.c:489
TRIO_SIGNED long int trio_longlong_t
Definition: trio.c:216
#define SPECIFIER_USER_DEFINED_END
Definition: trio.c:513
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
char * string
Definition: trio.c:669
GLuint base
Definition: 3dtext.c:35
#define SPECIFIER_USER_DEFINED_SEPARATOR
Definition: trio.c:514
#define SPECIFIER_BINARY
Definition: trio.c:510
#define QUALIFIER_MINUS
Definition: trio.c:613
#define QUALIFIER_STAR
Definition: trio.c:615
#define QUALIFIER_PLUS
Definition: trio.c:612
#define SPECIFIER_DECIMAL
Definition: trio.c:482
static const char mbstate_t *static wchar_t const char mbstate_t *static const wchar_t int *static double
Definition: string.c:80
Definition: trio.c:385
#define QUALIFIER_STICKY
Definition: trio.c:636
Definition: trio.c:380
#define BOOLEAN_T
Definition: trio.c:114
int precision
Definition: trio.c:660
GLuint index
Definition: glext.h:6031
#define QUALIFIER_FIXED_SIZE
Definition: trio.c:632
GLenum GLint GLint * precision
Definition: glext.h:7539
#define QUALIFIER_SIZE_T
Definition: trio.c:618
TRIO_SIGNED char trio_int8_t
Definition: trio.c:254
int errorNumber
Definition: trio.c:682
__kernel_size_t size_t
Definition: linux.h:237
#define SPECIFIER_ERRNO
Definition: trio.c:507
double * doublePointer
Definition: trio.c:679
union trio_parameter_t::@3871 data
#define FORMAT_CHAR
Definition: trio.c:415
Definition: trio.c:383
unsigned long
Definition: typeof.h:101
#define SPECIFIER_UNGROUP
Definition: trio.c:496
#define QUALIFIER_QUAD
Definition: trio.c:623
GLuint GLuint num
Definition: glext.h:9618
#define QUALIFIER_VARSIZE
Definition: trio.c:637
#define SPECIFIER_FLOAT_F_UPPER
Definition: trio.c:491
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
Definition: gl.h:1950
GLbitfield flags
Definition: glext.h:7161
#define QUALIFIER_SHORT
Definition: trio.c:607
GLint GLint GLsizei GLsizei GLsizei depth
Definition: gl.h:1546
#define index(s, c)
Definition: various.h:29
#define QUALIFIER_INTMAX_T
Definition: trio.c:620
#define SPECIFIER_CHAR_UPPER
Definition: trio.c:499
unsigned long int trio_ulonglong_t
Definition: trio.c:217
#define QUALIFIER_LONG_UPPER
Definition: trio.c:609
Definition: trio.h:59
trio_longlong_t trio_int64_t
Definition: trio.c:269
TRIO_SIGNED short trio_int16_t
Definition: trio.c:259
#define SPECIFIER_GROUP
Definition: trio.c:495
#define va_arg(ap, T)
Definition: acmsvcex.h:89
#define SPECIFIER_UNSIGNED
Definition: trio.c:484
TRIO_SIGNED int trio_int32_t
Definition: trio.c:264
trio_long_double_t * longdoublePointer
Definition: trio.c:681
union trio_parameter_t::@3871::@3872 number
#define isascii(x)
Definition: trio.c:326
_Check_return_ int __cdecl mblen(_In_reads_bytes_opt_(_MaxCount) _Pre_opt_z_ const char *_Ch, _In_ size_t _MaxCount)
#define TRIO_VA_LIST_DEREF(l)
Definition: trio.c:132
#define SPECIFIER_HEXFLOAT
Definition: trio.c:503
#define long
Definition: qsort.c:33
#define NIL
Definition: trio.c:109
__kernel_ptrdiff_t ptrdiff_t
Definition: linux.h:247
trio_long_double_t longdoubleNumber
Definition: trio.c:680
#define SPECIFIER_POINTER
Definition: trio.c:494
Definition: trio.c:378
#define SPECIFIER_HEX
Definition: trio.c:486