Ne.app NeANT
The Ne.app NeANT User module of the NeANT distribution.
Functions | Variables
rw_printf.h File Reference
#include <rw_testdefs.h>
Include dependency graph for rw_printf.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

_TEST_EXPORT int rw_printf (const char *,...)
 
_TEST_EXPORT int rw_fprintf (rw_file *, const char *,...)
 
_TEST_EXPORT int rw_sprintf (char *, const char *,...)
 
_TEST_EXPORT int rw_snprintf (char *, _RWSTD_SIZE_T, const char *,...)
 
_TEST_EXPORT char * rw_sprintfa (const char *fmt,...)
 
_TEST_EXPORT char * rw_snprintfa (char *buf, _RWSTD_SIZE_T bufsize, const char *fmt,...)
 
_TEST_EXPORT int rw_asnprintf (char **pbuf, _RWSTD_SIZE_T *pbufsize, const char *fmt,...)
 

Variables

_TEST_EXPORT rw_file *const rw_stdout
 
_TEST_EXPORT rw_file *const rw_stderr
 

Function Documentation

◆ rw_asnprintf()

_TEST_EXPORT int rw_asnprintf ( char **  pbuf,
_RWSTD_SIZE_T *  pbufsize,
const char *  fmt,
  ... 
)

Prints to a dynamically allocated character buffer of sufficient size. Provided for portability with the BSD and GNU C libraries:

http://www.freebsd.org/cgi/man.cgi?query=asprintf http://www.openbsd.org/cgi-bin/man.cgi?query=asprintf http://netbsd.gw.com/cgi-bin/man-cgi?asprintf++NetBSD-current http://www.gnu.org/software/libc/manual/html_node/Dynamic-Output.html

Parameters
pbufPointer to a pointer to character set by the caller to to address of the inital character buffer, or 0 of no such buffer exists. The function sets the pointer to a the address of the dynamically allocated character buffer, or leaves it unchanged if it doesn't allocate any buffer.
pbufsizePointer to a size_t set by the caller to the size of the inital character buffer. The function sets the value pointed to by this argument to the size of the dynamically allocated character buffer, or leaves it unchanged if it doesn't allocate any buffer.
fmtFormat specifier. See rwtest-fmtspec page for details.
Returns
On success, returns the number of characters formatted into the buffer, otherwise -1.

◆ rw_fprintf()

_TEST_EXPORT int rw_fprintf ( rw_file *  file,
const char *  fmt,
  ... 
)

Prints to a file.

Definition at line 3397 of file printf.cpp.

◆ rw_printf()

_TEST_EXPORT int rw_printf ( const char *  fmt,
  ... 
)

Formatted file output. Prints to rw_stdout.

Definition at line 3412 of file printf.cpp.

◆ rw_snprintf()

_TEST_EXPORT int rw_snprintf ( char *  ,
_RWSTD_SIZE_T  ,
const char *  ,
  ... 
)

Prints to a character buffer of given size.

◆ rw_snprintfa()

_TEST_EXPORT char * rw_snprintfa ( char *  buf,
_RWSTD_SIZE_T  bufsize,
const char *  fmt,
  ... 
)

Prints to a dynamically allocated character buffer.

Parameters
bufA pointer to character buffer where the function should store its output.
bufiseThe size of the character buffer in bytes.
fmtFormat specifier. See rwtest-fmtspec page for details.
Returns
On success, if the size of the supplied buffer was sufficient to format all characters including the terminating NUL, returns buf. Otherwise, if the size of the supplied buffer was not sufficient, returns a pointer to the newly allocated character buffer of sufficient size. Returns 0 on failure.

◆ rw_sprintf()

_TEST_EXPORT int rw_sprintf ( char *  buf,
const char *  fmt,
  ... 
)

Formatted string output. Prints to a character buffer.

Definition at line 3284 of file printf.cpp.

◆ rw_sprintfa()

_TEST_EXPORT char * rw_sprintfa ( const char *  fmt,
  ... 
)

Formatted string output into a dynamically allocated buffer. Prints to a dynamically allocated character buffer.

Parameters
fmtFormat specifier. See rwtest-fmtspec page for details.
Returns
On success, returns a pointer to the dynamically allocated character buffer. Otherwise, returns 0.

Definition at line 3258 of file printf.cpp.

Variable Documentation

◆ rw_stderr

_TEST_EXPORT rw_file* const rw_stderr
extern

Definition at line 3348 of file printf.cpp.

◆ rw_stdout

_TEST_EXPORT rw_file* const rw_stdout
extern

Definition at line 3345 of file printf.cpp.