ReactOS 0.4.15-dev-7907-g95bf896
Printf

Functions

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)
 

Detailed Description

Function Documentation

◆ TRIO_ARGS2() [1/2]

TRIO_PUBLIC int trio_scanfv TRIO_ARGS2 ( (format, args ,
TRIO_CONST char format,
trio_pointer_t args 
)

Print to standard output stream.

Parameters
formatFormatting string.
argsArguments.
Returns
Number of printed characters.

Definition at line 3686 of file trio.c.

3689{
3691
3692 return TrioFormat(stdout, 0, TrioOutStreamFile, format, NULL, args);
3693}
#define assert(x)
Definition: debug.h:53
GLint GLint GLsizei GLsizei GLsizei GLint GLenum format
Definition: gl.h:1546
#define stdout
Definition: stdio.h:99
Definition: match.c:390
#define NULL
Definition: trio.c:104
#define VALID(x)
Definition: trio.c:114

◆ TRIO_ARGS2() [2/2]

TRIO_PUBLIC int trio_vscanf TRIO_ARGS2 ( (format, args ,
TRIO_CONST char format,
va_list  args 
)

Print to standard output stream.

Parameters
formatFormatting string.
argsArguments.
Returns
Number of printed characters.

Definition at line 3668 of file trio.c.

3671{
3673
3674 return TrioFormat(stdout, 0, TrioOutStreamFile, format, TRIO_VA_LIST_ADDR(args), NULL);
3675}
#define TRIO_VA_LIST_ADDR(l)
Definition: trio.c:128

◆ TRIO_ARGS3() [1/7]

TRIO_PUBLIC int trio_sprintfv TRIO_ARGS3 ( (buffer, format, args ,
char buffer,
TRIO_CONST char format,
trio_pointer_t args 
)

Print to string.

Parameters
bufferOutput string.
formatFormatting string.
argsArguments.
Returns
Number of printed characters.

Definition at line 3967 of file trio.c.

3971{
3972 int status;
3973
3976
3977 status = TrioFormat(&buffer, 0, TrioOutStreamString, format, NULL, args);
3978 *buffer = NIL;
3979 return status;
3980}
GLuint buffer
Definition: glext.h:5915
Definition: ps.c:97
#define NIL
Definition: trio.c:106

◆ TRIO_ARGS3() [2/7]

TRIO_PUBLIC int trio_vsprintf TRIO_ARGS3 ( (buffer, format, args ,
char buffer,
TRIO_CONST char format,
va_list  args 
)

Print to string.

Parameters
bufferOutput string.
formatFormatting string.
argsArguments.
Returns
Number of printed characters.

Definition at line 3942 of file trio.c.

3946{
3947 int status;
3948
3951
3952 status = TrioFormat(&buffer, 0, TrioOutStreamString, format, TRIO_VA_LIST_ADDR(args), NULL);
3953 *buffer = NIL;
3954 return status;
3955}

◆ TRIO_ARGS3() [3/7]

TRIO_PUBLIC int trio_dscanfv TRIO_ARGS3 ( (fd, format, args ,
int  fd,
TRIO_CONST char format,
trio_pointer_t args 
)

Print to file descriptor.

Parameters
fdFile descriptor.
formatFormatting string.
argsArguments.
Returns
Number of printed characters.

Definition at line 3828 of file trio.c.

3832{
3834
3835 return TrioFormat(&fd, 0, TrioOutStreamFileDescriptor, format, NULL, args);
3836}
static int fd
Definition: io.c:51

◆ TRIO_ARGS3() [4/7]

TRIO_PUBLIC int trio_vdscanf TRIO_ARGS3 ( (fd, format, args ,
int  fd,
TRIO_CONST char format,
va_list  args 
)

Print to file descriptor.

Parameters
fdFile descriptor.
formatFormatting string.
argsArguments.
Returns
Number of printed characters.

Definition at line 3808 of file trio.c.

3812{
3814
3815 return TrioFormat(&fd, 0, TrioOutStreamFileDescriptor, format, TRIO_VA_LIST_ADDR(args), NULL);
3816}

◆ TRIO_ARGS3() [5/7]

TRIO_PUBLIC int trio_fscanfv TRIO_ARGS3 ( (file, format, args ,
FILE file,
TRIO_CONST char format,
trio_pointer_t args 
)

Print to file.

Parameters
fileFile pointer.
formatFormatting string.
argsArguments.
Returns
Number of printed characters.

Definition at line 3757 of file trio.c.

3761{
3762 assert(VALID(file));
3764
3765 return TrioFormat(file, 0, TrioOutStreamFile, format, NULL, args);
3766}
Definition: fci.c:127

◆ TRIO_ARGS3() [6/7]

TRIO_PUBLIC int trio_vfscanf TRIO_ARGS3 ( (file, format, args ,
FILE file,
TRIO_CONST char format,
va_list  args 
)

Print to file.

Parameters
fileFile pointer.
formatFormatting string.
argsArguments.
Returns
Number of printed characters.

Definition at line 3736 of file trio.c.

3740{
3741 assert(VALID(file));
3743
3744 return TrioFormat(file, 0, TrioOutStreamFile, format, TRIO_VA_LIST_ADDR(args), NULL);
3745}

◆ TRIO_ARGS3() [7/7]

TRIO_PUBLIC int trio_vasprintf TRIO_ARGS3 ( (result, format, args ,
char **  result,
TRIO_CONST char format,
va_list  args 
)

Definition at line 4224 of file trio.c.

4228{
4229 int status;
4231
4233
4234 *result = NULL;
4235
4236 info = trio_xstring_duplicate("");
4237 if (info == NULL)
4238 {
4240 }
4241 else
4242 {
4243 status = TrioFormat(info, 0, TrioOutStreamStringDynamic,
4245 if (status >= 0)
4246 {
4247 trio_string_terminate(info);
4248 *result = trio_string_extract(info);
4249 }
4250 trio_string_destroy(info);
4251 }
4252 return status;
4253}
@ TRIO_ENOMEM
Definition: trio.h:60
GLuint64EXT * result
Definition: glext.h:11304
#define TRIO_ERROR_RETURN(x, y)
Definition: trio.c:121

◆ TRIO_ARGS4() [1/4]

TRIO_PUBLIC int trio_snprintfv TRIO_ARGS4 ( (buffer, max, format, args ,
char buffer,
size_t  max,
TRIO_CONST char format,
trio_pointer_t args 
)

Print at most max characters to string.

Parameters
bufferOutput string.
maxMaximum number of characters to print.
formatFormatting string.
argsArguments.
Returns
Number of printed characters.

Definition at line 4058 of file trio.c.

4063{
4064 int status;
4065
4068
4069 status = TrioFormat(&buffer, max > 0 ? max - 1 : 0,
4070 TrioOutStreamStringMax, format, NULL, args);
4071 if (max > 0)
4072 *buffer = NIL;
4073 return status;
4074}
#define max(a, b)
Definition: svc.c:63

◆ TRIO_ARGS4() [2/4]

TRIO_PUBLIC int trio_vsnprintfcat TRIO_ARGS4 ( (buffer, max, format, args ,
char buffer,
size_t  max,
TRIO_CONST char format,
va_list  args 
)

Print at most max characters to string.

Parameters
bufferOutput string.
maxMaximum number of characters to print.
formatFormatting string.
argsArguments.
Returns
Number of printed characters.

Definition at line 4029 of file trio.c.

4034{
4035 int status;
4036
4039
4040 status = TrioFormat(&buffer, max > 0 ? max - 1 : 0,
4041 TrioOutStreamStringMax, format, TRIO_VA_LIST_ADDR(args), NULL);
4042 if (max > 0)
4043 *buffer = NIL;
4044 return status;
4045}

◆ TRIO_ARGS4() [3/4]

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 
)

Definition at line 3866 of file trio.c.

3871{
3873
3876
3877 data.stream.out = stream;
3878 data.closure = closure;
3879 return TrioFormat(&data, 0, TrioOutStreamCustom, format, TRIO_VA_LIST_ADDR(args), NULL);
3880}
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
Definition: gl.h:1950
Definition: parse.h:23

◆ TRIO_ARGS4() [4/4]

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 
)

Definition at line 3884 of file trio.c.

3889{
3891
3894
3895 data.stream.out = stream;
3896 data.closure = closure;
3897 return TrioFormat(&data, 0, TrioOutStreamCustom, format, NULL, args);
3898}

◆ TRIO_VARGS2()

TRIO_PUBLIC int trio_scanf TRIO_VARGS2 ( (format, va_alist)  ,
TRIO_CONST char format,
TRIO_VA_DECL   
)

Print to standard output stream.

Parameters
formatFormatting string.
...Arguments.
Returns
Number of printed characters.

Scan characters from standard input stream.

Parameters
formatFormatting string.
...Arguments.
Returns
Number of scanned characters.

Definition at line 3644 of file trio.c.

3647{
3648 int status;
3649 va_list args;
3650
3652
3654 status = TrioFormat(stdout, 0, TrioOutStreamFile, format, TRIO_VA_LIST_ADDR(args), NULL);
3656 return status;
3657}
char * va_list
Definition: acmsvcex.h:78
#define TRIO_VA_START(x, y)
Definition: triodef.h:148
#define TRIO_VA_END(x)
Definition: triodef.h:149
#define args
Definition: format.c:66

◆ TRIO_VARGS3() [1/4]

TRIO_PUBLIC int trio_sprintf TRIO_VARGS3 ( (buffer, format, va_alist)  ,
char buffer,
TRIO_CONST char format,
TRIO_VA_DECL   
)

Print to string.

Parameters
bufferOutput string.
formatFormatting string.
...Arguments.
Returns
Number of printed characters.

Definition at line 3914 of file trio.c.

3918{
3919 int status;
3920 va_list args;
3921
3924
3926 status = TrioFormat(&buffer, 0, TrioOutStreamString, format, TRIO_VA_LIST_ADDR(args), NULL);
3927 *buffer = NIL; /* Terminate with NIL character */
3929 return status;
3930}

◆ TRIO_VARGS3() [2/4]

TRIO_PUBLIC int trio_dscanf TRIO_VARGS3 ( (fd, format, va_alist)  ,
int  fd,
TRIO_CONST char format,
TRIO_VA_DECL   
)

Print to file descriptor.

Parameters
fdFile descriptor.
formatFormatting string.
...Arguments.
Returns
Number of printed characters.

Definition at line 3782 of file trio.c.

3786{
3787 int status;
3788 va_list args;
3789
3791
3793 status = TrioFormat(&fd, 0, TrioOutStreamFileDescriptor, format, TRIO_VA_LIST_ADDR(args), NULL);
3795 return status;
3796}

◆ TRIO_VARGS3() [3/4]

TRIO_PUBLIC int trio_fscanf TRIO_VARGS3 ( (file, format, va_alist)  ,
FILE file,
TRIO_CONST char format,
TRIO_VA_DECL   
)

Print to file.

Parameters
fileFile pointer.
formatFormatting string.
...Arguments.
Returns
Number of printed characters.

Definition at line 3709 of file trio.c.

3713{
3714 int status;
3715 va_list args;
3716
3717 assert(VALID(file));
3719
3721 status = TrioFormat(file, 0, TrioOutStreamFile, format, TRIO_VA_LIST_ADDR(args), NULL);
3723 return status;
3724}

◆ TRIO_VARGS3() [4/4]

TRIO_PUBLIC int trio_asprintf TRIO_VARGS3 ( (result, format, va_alist)  ,
char **  result,
TRIO_CONST char format,
TRIO_VA_DECL   
)

Definition at line 4188 of file trio.c.

4192{
4193 va_list args;
4194 int status;
4196
4198
4199 *result = NULL;
4200
4201 info = trio_xstring_duplicate("");
4202 if (info == NULL)
4203 {
4205 }
4206 else
4207 {
4209 status = TrioFormat(info, 0, TrioOutStreamStringDynamic,
4212 if (status >= 0)
4213 {
4214 trio_string_terminate(info);
4215 *result = trio_string_extract(info);
4216 }
4217 trio_string_destroy(info);
4218 }
4219 return status;
4220}

◆ TRIO_VARGS4() [1/2]

TRIO_PUBLIC int trio_snprintfcat TRIO_VARGS4 ( (buffer, max, format, va_alist)  ,
char buffer,
size_t  max,
TRIO_CONST char format,
TRIO_VA_DECL   
)

Print at most max characters to string.

Parameters
bufferOutput string.
maxMaximum number of characters to print.
formatFormatting string.
...Arguments.
Returns
Number of printed characters.

Definition at line 3997 of file trio.c.

4002{
4003 int status;
4004 va_list args;
4005
4008
4010 status = TrioFormat(&buffer, max > 0 ? max - 1 : 0,
4011 TrioOutStreamStringMax, format, TRIO_VA_LIST_ADDR(args), NULL);
4012 if (max > 0)
4013 *buffer = NIL;
4015 return status;
4016}

◆ TRIO_VARGS4() [2/2]

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   
)

Definition at line 3843 of file trio.c.

3848{
3849 int status;
3850 va_list args;
3852
3855
3857 data.stream.out = stream;
3858 data.closure = closure;
3859 status = TrioFormat(&data, 0, TrioOutStreamCustom, format, TRIO_VA_LIST_ADDR(args), NULL);
3861 return status;
3862}