Ne.app NeANT
The Ne.app NeANT User module of the NeANT distribution.
Data Structures | Macros | Typedefs | Enumerations | Functions | Variables
printf.cpp File Reference
#include "fmt_defs.h"
#include <rw_printf.h>
#include <rw_environ.h>
#include <ctype.h>
#include <errno.h>
#include <float.h>
#include <locale.h>
#include <signal.h>
#include <stdarg.h>
#include <stddef.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <time.h>
#include <wchar.h>
#include <wctype.h>
#include <dlfcn.h>
#include <ios>
#include <iostream>
#include <locale>
#include <string>
Include dependency graph for printf.cpp:

Go to the source code of this file.

Data Structures

struct  VarArgs
 

Macros

#define _RWSTD_TEST_SRC
 
#define WEOF   -1
 
#define VA_ARG(va, T)
 
#define PARAM(name, pva)
 
#define varg   DONT_TOUCH_ME
 
#define vacpy   DONT_TOUCH_ME
 

Typedefs

typedef int _rw_usr_cb_t(char **, size_t *, const char *,...)
 

Enumerations

enum  { A_ESC = 1 , A_CHAR = 1 << 1 , A_WCHAR = 1 << 2 , A_ARRAY = 1 << 3 }
 

Functions

 _RWSTD_NAMESPACE (__rw)
 
_RWSTD_INTERNAL int _rw_fmtlong (const FmtSpec &, Buffer &, long)
 
_RWSTD_INTERNAL int _rw_fmtptr (const FmtSpec &, Buffer &, const void *)
 
_RWSTD_INTERNAL int _rw_fmtbadaddr (const FmtSpec &, Buffer &, const void *, size_t=0)
 
_RWSTD_INTERNAL char * _rw_bufcat (Buffer &buf, const char *str, size_t len)
 
_TEST_EXPORT int rw_vasnprintf (char **pbuf, size_t *pbufsize, const char *fmt, va_list varg)
 
template<class IntT >
int rw_fmtinteger (const FmtSpec &spec, Buffer &buf, IntT val)
 
template<class charT >
int _rw_quotechar (char *buf, charT wc, int noesc)
 
template<class elemT >
int _rw_fmtarray (const FmtSpec &spec, Buffer &buf, const elemT *array, size_t nelems, int flags)
 
template int _rw_quotechar (char *, UChar, int)
 
template int _rw_quotechar (char *, char, int)
 
template int _rw_quotechar (char *, UShrt, int)
 
template int _rw_quotechar (char *, UInt, int)
 
template int _rw_quotechar (char *, ULong, int)
 
template int _rw_fmtarray (const FmtSpec &, Buffer &, const UChar *, size_t, int)
 
template int _rw_fmtarray (const FmtSpec &, Buffer &, const char *, size_t, int)
 
template int _rw_fmtarray (const FmtSpec &, Buffer &, const UShrt *, size_t, int)
 
template int _rw_fmtarray (const FmtSpec &, Buffer &, const UInt *, size_t, int)
 
template int _rw_fmtarray (const FmtSpec &, Buffer &, const ULong *, size_t, int)
 
int _rw_fmtstr (const FmtSpec &spec, Buffer &buf, const char *str, size_t len)
 
_TEST_EXPORT int rw_asnprintf (char **pbuf, size_t *pbufsize, const char *fmt,...)
 
_TEST_EXPORT char * rw_snprintfa (char *buf, size_t bufsize, const char *fmt,...)
 
_TEST_EXPORT char * rw_sprintfa (const char *fmt,...)
 
_TEST_EXPORT int rw_sprintf (char *buf, const char *fmt,...)
 
_TEST_EXPORT int rw_snprintf (char *buf, size_t bufsize, const char *fmt,...)
 
_TEST_EXPORT int rw_fprintf (rw_file *file, const char *fmt,...)
 
_TEST_EXPORT int rw_printf (const char *fmt,...)
 

Variables

rw_file *const rw_stdout = _RWSTD_REINTERPRET_CAST (rw_file*, stdout)
 
rw_file *const rw_stderr = _RWSTD_REINTERPRET_CAST (rw_file*, stderr)
 

Macro Definition Documentation

◆ _RWSTD_TEST_SRC

#define _RWSTD_TEST_SRC

printf.cpp - definitions of the snprintfa family of functions

$Id$

Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Copyright 2005-2008 Rogue Wave Software, Inc.

Definition at line 30 of file printf.cpp.

◆ PARAM

#define PARAM (   name,
  pva 
)
Value:
(0 < spec.paramno \
? pspec [spec.paramno - 1].param.name \
: VA_ARG (*pva, FmtSpec::name ## t))
#define t
Definition 17.names.cpp:136
#define VA_ARG(va, T)
Definition printf.cpp:113

◆ VA_ARG

#define VA_ARG (   va,
  T 
)
Value:
(VarArgs::VA_list == (va).kind_ ? va_arg (*(va).arg_.pva_, T) \
: *((T*&)(va).arg_.pargs_)++)
#define T
Definition 17.names.cpp:163
#define va_arg(va, T)
@ VA_list
Definition printf.cpp:109

Definition at line 113 of file printf.cpp.

◆ vacpy

#define vacpy   DONT_TOUCH_ME

◆ varg

#define varg   DONT_TOUCH_ME

◆ WEOF

#define WEOF   -1

Definition at line 68 of file printf.cpp.

Typedef Documentation

◆ _rw_usr_cb_t

typedef int _rw_usr_cb_t(char **, size_t *, const char *,...)

Definition at line 168 of file printf.cpp.

Enumeration Type Documentation

◆ anonymous enum

anonymous enum
Enumerator
A_ESC 
A_CHAR 
A_WCHAR 
A_ARRAY 

Definition at line 1863 of file printf.cpp.

Function Documentation

◆ _rw_bufcat()

_RWSTD_INTERNAL char * _rw_bufcat ( Buffer &  buf,
const char *  str,
size_t  len 
)

Definition at line 438 of file printf.cpp.

◆ _rw_fmtarray() [1/6]

template int _rw_fmtarray ( const FmtSpec &  ,
Buffer &  ,
const char *  ,
size_t  ,
int   
)

◆ _rw_fmtarray() [2/6]

template int _rw_fmtarray ( const FmtSpec &  ,
Buffer &  ,
const UChar *  ,
size_t  ,
int   
)

◆ _rw_fmtarray() [3/6]

template int _rw_fmtarray ( const FmtSpec &  ,
Buffer &  ,
const UInt *  ,
size_t  ,
int   
)

◆ _rw_fmtarray() [4/6]

template int _rw_fmtarray ( const FmtSpec &  ,
Buffer &  ,
const ULong *  ,
size_t  ,
int   
)

◆ _rw_fmtarray() [5/6]

template int _rw_fmtarray ( const FmtSpec &  ,
Buffer &  ,
const UShrt *  ,
size_t  ,
int   
)

◆ _rw_fmtarray() [6/6]

template<class elemT >
int _rw_fmtarray ( const FmtSpec &  spec,
Buffer &  buf,
const elemT *  array,
size_t  nelems,
int  flags 
)

Definition at line 1871 of file printf.cpp.

◆ _rw_fmtbadaddr()

_RWSTD_INTERNAL int _rw_fmtbadaddr ( const FmtSpec &  spec,
Buffer &  buf,
const void *  addr,
size_t  objsize = 0 
)

Definition at line 1576 of file printf.cpp.

◆ _rw_fmtlong()

_RWSTD_INTERNAL int _rw_fmtlong ( const FmtSpec &  spec,
Buffer &  buf,
long  val 
)

Definition at line 1054 of file printf.cpp.

◆ _rw_fmtptr()

_RWSTD_INTERNAL int _rw_fmtptr ( const FmtSpec &  spec,
Buffer &  buf,
const void *  val 
)

Definition at line 1567 of file printf.cpp.

◆ _rw_fmtstr()

int _rw_fmtstr ( const FmtSpec &  spec,
Buffer &  buf,
const char *  str,
size_t  len 
)

Definition at line 2316 of file printf.cpp.

◆ _rw_quotechar() [1/6]

template int _rw_quotechar ( char *  ,
char  ,
int   
)

◆ _rw_quotechar() [2/6]

template int _rw_quotechar ( char *  ,
UChar  ,
int   
)

◆ _rw_quotechar() [3/6]

template int _rw_quotechar ( char *  ,
UInt  ,
int   
)

◆ _rw_quotechar() [4/6]

template int _rw_quotechar ( char *  ,
ULong  ,
int   
)

◆ _rw_quotechar() [5/6]

template int _rw_quotechar ( char *  ,
UShrt  ,
int   
)

◆ _rw_quotechar() [6/6]

template<class charT >
int _rw_quotechar ( char *  buf,
charT  wc,
int  noesc 
)

Definition at line 1802 of file printf.cpp.

◆ _RWSTD_NAMESPACE()

_RWSTD_NAMESPACE ( __rw  )

Definition at line 72 of file printf.cpp.

◆ rw_asnprintf()

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

Definition at line 3191 of file printf.cpp.

◆ rw_fmtinteger()

template<class IntT >
int rw_fmtinteger ( const FmtSpec &  spec,
Buffer &  buf,
IntT  val 
)
inline

Definition at line 1190 of file printf.cpp.

◆ 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 *  buf,
size_t  bufsize,
const char *  fmt,
  ... 
)

Definition at line 3308 of file printf.cpp.

◆ rw_snprintfa()

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

Definition at line 3233 of file printf.cpp.

◆ 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.

◆ rw_vasnprintf()

_TEST_EXPORT int rw_vasnprintf ( char **  pbuf,
size_t *  pbufsize,
const char *  fmt,
va_list  varg 
)

Definition at line 946 of file printf.cpp.

Variable Documentation

◆ bytes

UChar bytes[sizeof(int)]

Definition at line 83 of file printf.cpp.

◆ ival

int ival

Definition at line 82 of file printf.cpp.

◆ rw_stderr

rw_file* const rw_stderr = _RWSTD_REINTERPRET_CAST (rw_file*, stderr)

Definition at line 3348 of file printf.cpp.

◆ rw_stdout

rw_file* const rw_stdout = _RWSTD_REINTERPRET_CAST (rw_file*, stdout)

Definition at line 3345 of file printf.cpp.