Recovered from cvs revision 2007-05-05 10:43:00

This commit is contained in:
hyung-hwan 2007-05-06 01:34:00 +00:00
parent e42e318a13
commit ec40ad8648
2 changed files with 20 additions and 3 deletions

View File

@ -1,5 +1,5 @@
/* /*
* $Id: Awk.cpp,v 1.5 2007/05/03 15:14:02 bacon Exp $ * $Id: Awk.cpp,v 1.6 2007/05/04 10:25:14 bacon Exp $
*/ */
#include <ase/awk/Awk.hpp> #include <ase/awk/Awk.hpp>
@ -64,6 +64,11 @@ namespace ASE
prmfns.ccls.to_lower = toLower; prmfns.ccls.to_lower = toLower;
prmfns.ccls.custom_data = this; prmfns.ccls.custom_data = this;
/*
int (Awk::*ptr) (void*, ase_char_t*, ase_size_t, const ase_char_t*, ...) = &Awk::sprintf;
(this->*ptr) (ASE_NULL, ASE_NULL, 0, ASE_NULL);
*/
prmfns.misc.pow = pow; prmfns.misc.pow = pow;
prmfns.misc.sprintf = sprintf; prmfns.misc.sprintf = sprintf;
prmfns.misc.dprintf = dprintf; prmfns.misc.dprintf = dprintf;
@ -218,11 +223,19 @@ namespace ASE
int Awk::sprintf (void* custom, char_t* buf, size_t size, int Awk::sprintf (void* custom, char_t* buf, size_t size,
const char_t* fmt, ...) const char_t* fmt, ...)
{ {
return 0; va_list ap;
va_start (ap, fmt);
int n = ((Awk*)custom)->vsprintf (buf, size, fmt, ap);
va_end (ap);
return n;
} }
void Awk::dprintf (void* custom, const char_t* fmt, ...) void Awk::dprintf (void* custom, const char_t* fmt, ...)
{ {
va_list ap;
va_start (ap, fmt);
((Awk*)custom)->vdprintf (fmt, ap);
va_end (ap);
} }
} }

View File

@ -1,11 +1,12 @@
/* /*
* $Id: Awk.hpp,v 1.4 2007/05/03 15:14:02 bacon Exp $ * $Id: Awk.hpp,v 1.5 2007/05/04 10:25:14 bacon Exp $
*/ */
#ifndef _ASE_AWK_AWK_HPP_ #ifndef _ASE_AWK_AWK_HPP_
#define _ASE_AWK_AWK_HPP_ #define _ASE_AWK_AWK_HPP_
#include <ase/awk/awk.h> #include <ase/awk/awk.h>
#include <stdarg.h>
namespace ASE namespace ASE
{ {
@ -60,6 +61,9 @@ namespace ASE
virtual cint_t toLower (cint_t c) = 0; virtual cint_t toLower (cint_t c) = 0;
virtual real_t pow (real_t x, real_t y) = 0; virtual real_t pow (real_t x, real_t y) = 0;
virtual int vsprintf (char_t* buf, size_t size,
const char_t* fmt, va_list arg) = 0;
virtual void vdprintf (const char_t* fmt, va_list arg) = 0;
static ssize_t sourceReader ( static ssize_t sourceReader (
int cmd, void* arg, char_t* data, size_t count); int cmd, void* arg, char_t* data, size_t count);