ReactOS  r74431
UserDefined

Functions

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)
 

Detailed Description

Function Documentation

void trio_unregister TRIO_ARGS1 ( (handle)  ,
trio_pointer_t  handle 
)

Unregister an existing user-defined specifier.

Parameters
handle

Definition at line 4359 of file trio.c.

4361 {
4363  trio_userdef_t *def;
4364  trio_userdef_t *prev = NULL;
4365 
4366  assert(VALID(self));
4367 
4368  if (self->name)
4369  {
4370  def = TrioFindNamespace(self->name, &prev);
4371  if (def)
4372  {
4375 
4376  if (prev == NULL)
4378  else
4379  prev->next = def->next;
4380 
4383  }
4384  trio_destroy(self->name);
4385  }
4386  TRIO_FREE(self);
4387 }
#define VALID(x)
Definition: trio.c:117
static TRIO_VOLATILE trio_callback_t internalLeaveCriticalRegion
Definition: trio.c:795
#define assert(x)
Definition: debug.h:53
static TRIO_VOLATILE trio_callback_t internalEnterCriticalRegion
Definition: trio.c:794
struct png_info_def **typedef void(__cdecl typeof(png_destroy_read_struct))(struct png_struct_def **
Definition: typeof.h:47
static trio_userdef_t * internalUserDef
Definition: trio.c:796
void * handle
Definition: lfs_wrap.c:88
#define TRIO_FREE(x)
Definition: triop.h:77
struct _trio_userdef_t * next
Definition: trio.c:745
#define NULL
Definition: trio.c:107
int trio_get_size TRIO_ARGS1 ( (ref ,
trio_pointer_t  ref 
)

Definition at line 4394 of file trio.c.

4396 {
4397 #if defined(FORMAT_USER_DEFINED)
4398  assert(((trio_reference_t *)ref)->parameter->type == FORMAT_USER_DEFINED);
4399 #endif
4400 
4401  return (((trio_reference_t *)ref)->parameter->user_data);
4402 }
#define assert(x)
Definition: debug.h:53
GLenum GLint ref
Definition: glext.h:6028
#define FORMAT_USER_DEFINED
Definition: trio.c:425
TRIO_PUBLIC trio_pointer_t trio_register TRIO_ARGS2 ( (callback, name ,
trio_callback_t  callback,
TRIO_CONST char name 
)

Register new user-defined specifier.

Parameters
callback
name
Returns
Handle.

Definition at line 4289 of file trio.c.

4292 {
4293  trio_userdef_t *def;
4294  trio_userdef_t *prev = NULL;
4295 
4296  if (callback == NULL)
4297  return NULL;
4298 
4299  if (name)
4300  {
4301  /* Handle built-in namespaces */
4302  if (name[0] == ':')
4303  {
4304  if (trio_equal(name, ":enter"))
4305  {
4307  }
4308  else if (trio_equal(name, ":leave"))
4309  {
4311  }
4312  return NULL;
4313  }
4314 
4315  /* Bail out if namespace is too long */
4316  if (trio_length(name) >= MAX_USER_NAME)
4317  return NULL;
4318 
4319  /* Bail out if namespace already is registered */
4320  def = TrioFindNamespace(name, &prev);
4321  if (def)
4322  return NULL;
4323  }
4324 
4325  def = (trio_userdef_t *)TRIO_MALLOC(sizeof(trio_userdef_t));
4326  if (def)
4327  {
4330 
4331  if (name)
4332  {
4333  /* Link into internal list */
4334  if (prev == NULL)
4335  internalUserDef = def;
4336  else
4337  prev->next = def;
4338  }
4339  /* Initialize */
4340  def->callback = callback;
4341  def->name = (name == NULL)
4342  ? NULL
4343  : trio_duplicate(name);
4344  def->next = NULL;
4345 
4348  }
4349  return (trio_pointer_t)def;
4350 }
char * trio_pointer_t
Definition: triodef.h:133
static TRIO_VOLATILE trio_callback_t internalLeaveCriticalRegion
Definition: trio.c:795
char * name
Definition: trio.c:747
trio_callback_t callback
Definition: trio.c:746
static TRIO_VOLATILE trio_callback_t internalEnterCriticalRegion
Definition: trio.c:794
struct png_info_def **typedef void(__cdecl typeof(png_destroy_read_struct))(struct png_struct_def **
Definition: typeof.h:47
MmuTrapHandler callback[0x30]
Definition: mmuobject.c:44
static trio_userdef_t * internalUserDef
Definition: trio.c:796
#define TRIO_MALLOC(n)
Definition: triop.h:71
struct _trio_userdef_t * next
Definition: trio.c:745
Definition: name.c:23
#define NULL
Definition: trio.c:107
void trio_set_width TRIO_ARGS2 ( (ref, width ,
trio_pointer_t  ref,
int  width 
)

Definition at line 4432 of file trio.c.

4435 {
4436  ((trio_reference_t *)ref)->parameter->width = width;
4437 }
GLenum GLint ref
Definition: glext.h:6028
GLint GLint GLsizei width
Definition: gl.h:1546
void trio_set_precision TRIO_ARGS2 ( (ref, precision ,
trio_pointer_t  ref,
int  precision 
)

Definition at line 4452 of file trio.c.

4455 {
4456  ((trio_reference_t *)ref)->parameter->precision = precision;
4457 }
GLenum GLint ref
Definition: glext.h:6028
GLenum GLint GLint * precision
Definition: glext.h:7539
void trio_set_base TRIO_ARGS2 ( (ref, base ,
trio_pointer_t  ref,
int  base 
)

Definition at line 4472 of file trio.c.

4475 {
4476  ((trio_reference_t *)ref)->parameter->base = base;
4477 }
const XML_Char int const XML_Char int const XML_Char * base
Definition: expat.h:331
GLenum GLint ref
Definition: glext.h:6028
void trio_set_long TRIO_ARGS2 ( (ref, is_long)  ,
trio_pointer_t  ref,
int  is_long 
)

Definition at line 4494 of file trio.c.

4497 {
4498  if (is_long)
4499  ((trio_reference_t *)ref)->parameter->flags |= FLAGS_LONG;
4500  else
4501  ((trio_reference_t *)ref)->parameter->flags &= ~FLAGS_LONG;
4502 }
GLenum GLint ref
Definition: glext.h:6028
void trio_set_longlong TRIO_ARGS2 ( (ref, is_longlong)  ,
trio_pointer_t  ref,
int  is_longlong 
)

Definition at line 4519 of file trio.c.

4522 {
4523  if (is_longlong)
4524  ((trio_reference_t *)ref)->parameter->flags |= FLAGS_QUAD;
4525  else
4526  ((trio_reference_t *)ref)->parameter->flags &= ~FLAGS_QUAD;
4527 }
GLenum GLint ref
Definition: glext.h:6028
void trio_set_longdouble TRIO_ARGS2 ( (ref, is_longdouble)  ,
trio_pointer_t  ref,
int  is_longdouble 
)

Definition at line 4544 of file trio.c.

4547 {
4548  if (is_longdouble)
4549  ((trio_reference_t *)ref)->parameter->flags |= FLAGS_LONGDOUBLE;
4550  else
4551  ((trio_reference_t *)ref)->parameter->flags &= ~FLAGS_LONGDOUBLE;
4552 }
GLenum GLint ref
Definition: glext.h:6028
void trio_set_short TRIO_ARGS2 ( (ref, is_short)  ,
trio_pointer_t  ref,
int  is_short 
)

Definition at line 4569 of file trio.c.

4572 {
4573  if (is_short)
4574  ((trio_reference_t *)ref)->parameter->flags |= FLAGS_SHORT;
4575  else
4576  ((trio_reference_t *)ref)->parameter->flags &= ~FLAGS_SHORT;
4577 }
GLenum GLint ref
Definition: glext.h:6028
void trio_set_shortshort TRIO_ARGS2 ( (ref, is_shortshort)  ,
trio_pointer_t  ref,
int  is_shortshort 
)

Definition at line 4594 of file trio.c.

4597 {
4598  if (is_shortshort)
4599  ((trio_reference_t *)ref)->parameter->flags |= FLAGS_SHORTSHORT;
4600  else
4601  ((trio_reference_t *)ref)->parameter->flags &= ~FLAGS_SHORTSHORT;
4602 }
GLenum GLint ref
Definition: glext.h:6028
void trio_set_alternative TRIO_ARGS2 ( (ref, is_alternative)  ,
trio_pointer_t  ref,
int  is_alternative 
)

Definition at line 4619 of file trio.c.

4622 {
4623  if (is_alternative)
4624  ((trio_reference_t *)ref)->parameter->flags |= FLAGS_ALTERNATIVE;
4625  else
4626  ((trio_reference_t *)ref)->parameter->flags &= ~FLAGS_ALTERNATIVE;
4627 }
GLenum GLint ref
Definition: glext.h:6028
void trio_set_alignment TRIO_ARGS2 ( (ref, is_leftaligned)  ,
trio_pointer_t  ref,
int  is_leftaligned 
)

Definition at line 4644 of file trio.c.

4647 {
4648  if (is_leftaligned)
4649  ((trio_reference_t *)ref)->parameter->flags |= FLAGS_LEFTADJUST;
4650  else
4651  ((trio_reference_t *)ref)->parameter->flags &= ~FLAGS_LEFTADJUST;
4652 }
GLenum GLint ref
Definition: glext.h:6028
void trio_set_spacing TRIO_ARGS2 ( (ref, is_space ,
trio_pointer_t  ref,
int  is_space 
)

Definition at line 4669 of file trio.c.

4672 {
4673  if (is_space)
4674  ((trio_reference_t *)ref)->parameter->flags |= FLAGS_SPACE;
4675  else
4676  ((trio_reference_t *)ref)->parameter->flags &= ~FLAGS_SPACE;
4677 }
GLenum GLint ref
Definition: glext.h:6028
#define is_space(c)
Definition: astoll.c:38
void trio_set_sign TRIO_ARGS2 ( (ref, is_sign)  ,
trio_pointer_t  ref,
int  is_sign 
)

Definition at line 4694 of file trio.c.

4697 {
4698  if (is_sign)
4699  ((trio_reference_t *)ref)->parameter->flags |= FLAGS_SHOWSIGN;
4700  else
4701  ((trio_reference_t *)ref)->parameter->flags &= ~FLAGS_SHOWSIGN;
4702 }
GLenum GLint ref
Definition: glext.h:6028
void trio_set_padding TRIO_ARGS2 ( (ref, is_padding)  ,
trio_pointer_t  ref,
int  is_padding 
)

Definition at line 4719 of file trio.c.

4722 {
4723  if (is_padding)
4724  ((trio_reference_t *)ref)->parameter->flags |= FLAGS_NILPADDING;
4725  else
4726  ((trio_reference_t *)ref)->parameter->flags &= ~FLAGS_NILPADDING;
4727 }
GLenum GLint ref
Definition: glext.h:6028
void trio_set_quote TRIO_ARGS2 ( (ref, is_quote)  ,
trio_pointer_t  ref,
int  is_quote 
)

Definition at line 4744 of file trio.c.

4747 {
4748  if (is_quote)
4749  ((trio_reference_t *)ref)->parameter->flags |= FLAGS_QUOTE;
4750  else
4751  ((trio_reference_t *)ref)->parameter->flags &= ~FLAGS_QUOTE;
4752 }
GLenum GLint ref
Definition: glext.h:6028
void trio_set_upper TRIO_ARGS2 ( (ref, is_upper ,
trio_pointer_t  ref,
int  is_upper 
)

Definition at line 4769 of file trio.c.

4772 {
4773  if (is_upper)
4774  ((trio_reference_t *)ref)->parameter->flags |= FLAGS_UPPER;
4775  else
4776  ((trio_reference_t *)ref)->parameter->flags &= ~FLAGS_UPPER;
4777 }
GLenum GLint ref
Definition: glext.h:6028
#define is_upper(c)
Definition: astoll.c:45
void trio_set_largest TRIO_ARGS2 ( (ref, is_largest)  ,
trio_pointer_t  ref,
int  is_largest 
)

Definition at line 4795 of file trio.c.

4798 {
4799  if (is_largest)
4800  ((trio_reference_t *)ref)->parameter->flags |= FLAGS_INTMAX_T;
4801  else
4802  ((trio_reference_t *)ref)->parameter->flags &= ~FLAGS_INTMAX_T;
4803 }
GLenum GLint ref
Definition: glext.h:6028
void trio_set_ptrdiff TRIO_ARGS2 ( (ref, is_ptrdiff)  ,
trio_pointer_t  ref,
int  is_ptrdiff 
)

Definition at line 4821 of file trio.c.

4824 {
4825  if (is_ptrdiff)
4826  ((trio_reference_t *)ref)->parameter->flags |= FLAGS_PTRDIFF_T;
4827  else
4828  ((trio_reference_t *)ref)->parameter->flags &= ~FLAGS_PTRDIFF_T;
4829 }
GLenum GLint ref
Definition: glext.h:6028
void trio_set_size TRIO_ARGS2 ( (ref, is_size)  ,
trio_pointer_t  ref,
int  is_size 
)

Definition at line 4847 of file trio.c.

4850 {
4851  if (is_size)
4852  ((trio_reference_t *)ref)->parameter->flags |= FLAGS_SIZE_T;
4853  else
4854  ((trio_reference_t *)ref)->parameter->flags &= ~FLAGS_SIZE_T;
4855 }
GLenum GLint ref
Definition: glext.h:6028
void trio_print_int TRIO_ARGS2 ( (ref, number ,
trio_pointer_t  ref,
int  number 
)

Definition at line 4863 of file trio.c.

4866 {
4868 
4869  TrioWriteNumber(self->data,
4871  self->parameter->flags,
4872  self->parameter->width,
4873  self->parameter->precision,
4874  self->parameter->base);
4875 }
static size_t double number
Definition: printf.c:63
GLenum GLint ref
Definition: glext.h:6028
trio_ulonglong_t trio_uintmax_t
Definition: trio.c:250
void trio_print_uint TRIO_ARGS2 ( (ref, number ,
trio_pointer_t  ref,
unsigned int  number 
)

Definition at line 4882 of file trio.c.

4885 {
4887 
4888  TrioWriteNumber(self->data,
4890  self->parameter->flags | FLAGS_UNSIGNED,
4891  self->parameter->width,
4892  self->parameter->precision,
4893  self->parameter->base);
4894 }
static size_t double number
Definition: printf.c:63
GLenum GLint ref
Definition: glext.h:6028
trio_ulonglong_t trio_uintmax_t
Definition: trio.c:250
void trio_print_double TRIO_ARGS2 ( (ref, number ,
trio_pointer_t  ref,
double  number 
)

Definition at line 4901 of file trio.c.

4904 {
4906 
4907  TrioWriteDouble(self->data,
4908  number,
4909  self->parameter->flags,
4910  self->parameter->width,
4911  self->parameter->precision,
4912  self->parameter->base);
4913 }
static size_t double number
Definition: printf.c:63
GLenum GLint ref
Definition: glext.h:6028
void trio_print_string TRIO_ARGS2 ( (ref, string ,
trio_pointer_t  ref,
char string 
)

Definition at line 4920 of file trio.c.

4923 {
4925 
4926  TrioWriteString(self->data,
4927  string,
4928  self->parameter->flags,
4929  self->parameter->width,
4930  self->parameter->precision);
4931 }
GLenum GLint ref
Definition: glext.h:6028
void trio_print_pointer TRIO_ARGS2 ( (ref, pointer ,
trio_pointer_t  ref,
trio_pointer_t  pointer 
)

Definition at line 4991 of file trio.c.

4994 {
4998 
4999  if (NULL == pointer)
5000  {
5001  TRIO_CONST char *string = internalNullString;
5002  while (*string)
5003  self->data->OutStream(self->data, *string++);
5004  }
5005  else
5006  {
5007  /*
5008  * The subtraction of the null pointer is a workaround
5009  * to avoid a compiler warning. The performance overhead
5010  * is negligible (and likely to be removed by an
5011  * optimizing compiler). The (char *) casting is done
5012  * to please ANSI C++.
5013  */
5014  number = (trio_uintmax_t)((char *)pointer - (char *)0);
5015  /* Shrink to size of pointer */
5016  number &= (trio_uintmax_t)-1;
5017  flags = self->parameter->flags;
5018  flags |= (FLAGS_UNSIGNED | FLAGS_ALTERNATIVE |
5020  TrioWriteNumber(self->data,
5021  number,
5022  flags,
5023  POINTER_WIDTH,
5024  NO_PRECISION,
5025  BASE_HEX);
5026  }
5027 }
unsigned long trio_flags_t
Definition: trio.c:139
GLsizei const GLvoid * pointer
Definition: glext.h:5848
#define TRIO_CONST
Definition: triodef.h:129
static size_t double number
Definition: printf.c:63
GLenum GLint ref
Definition: glext.h:6028
GLbitfield flags
Definition: glext.h:7161
Definition: trio.c:389
#define POINTER_WIDTH
Definition: trio.c:314
static TRIO_CONST char internalNullString[]
Definition: trio.c:767
trio_ulonglong_t trio_uintmax_t
Definition: trio.c:250
#define NULL
Definition: trio.c:107
int trio_vprint_ref TRIO_ARGS3 ( (ref, format, arglist ,
trio_pointer_t  ref,
TRIO_CONST char format,
va_list  arglist 
)

Definition at line 4959 of file trio.c.

4963 {
4964  assert(VALID(format));
4965 
4966  return TrioFormatRef((trio_reference_t *)ref, format, TRIO_VA_LIST_ADDR(arglist), NULL);
4967 }
#define VALID(x)
Definition: trio.c:117
#define assert(x)
Definition: debug.h:53
GLenum GLint ref
Definition: glext.h:6028
GLint GLint GLsizei GLsizei GLsizei GLint GLenum format
Definition: gl.h:1546
#define TRIO_VA_LIST_ADDR(l)
Definition: trio.c:131
#define NULL
Definition: trio.c:107
va_lists_t arglist[FMT_ARGMAX+1]
Definition: format.c:284
int trio_printv_ref TRIO_ARGS3 ( (ref, format, argarray)  ,
trio_pointer_t  ref,
TRIO_CONST char format,
trio_pointer_t argarray 
)

Definition at line 4974 of file trio.c.

4978 {
4979  assert(VALID(format));
4980 
4981  return TrioFormatRef((trio_reference_t *)ref, format, NULL, argarray);
4982 }
#define VALID(x)
Definition: trio.c:117
#define assert(x)
Definition: debug.h:53
GLenum GLint ref
Definition: glext.h:6028
GLint GLint GLsizei GLsizei GLsizei GLint GLenum format
Definition: gl.h:1546
#define NULL
Definition: trio.c:107
int trio_print_ref TRIO_VARGS3 ( (ref, format, va_alist)  ,
trio_pointer_t  ref,
TRIO_CONST char format,
TRIO_VA_DECL   
)

Definition at line 4938 of file trio.c.

4942 {
4943  int status;
4944  va_list arglist;
4945 
4946  assert(VALID(format));
4947 
4948  TRIO_VA_START(arglist, format);
4949  status = TrioFormatRef((trio_reference_t *)ref, format, TRIO_VA_LIST_ADDR(arglist), NULL);
4950  TRIO_VA_END(arglist);
4951  return status;
4952 }
#define VALID(x)
Definition: trio.c:117
#define assert(x)
Definition: debug.h:53
GLenum GLint ref
Definition: glext.h:6028
char * va_list
Definition: acmsvcex.h:78
#define TRIO_VA_END(x)
Definition: triodef.h:149
GLint GLint GLsizei GLsizei GLsizei GLint GLenum format
Definition: gl.h:1546
#define TRIO_VA_LIST_ADDR(l)
Definition: trio.c:131
static SERVICE_STATUS status
Definition: service.c:26
#define TRIO_VA_START(x, y)
Definition: triodef.h:148
#define NULL
Definition: trio.c:107
va_lists_t arglist[FMT_ARGMAX+1]
Definition: format.c:284