*** empty log message ***

This commit is contained in:
hyung-hwan 2006-01-20 16:31:58 +00:00
parent 4fe6827ce0
commit 53fbdf1620
2 changed files with 9 additions and 31 deletions

View File

@ -1,5 +1,5 @@
/* /*
* $Id: sa.c,v 1.3 2006-01-20 16:28:57 bacon Exp $ * $Id: sa.c,v 1.4 2006-01-20 16:31:58 bacon Exp $
*/ */
#include <xp/awk/sa.h> #include <xp/awk/sa.h>
@ -30,37 +30,11 @@ int xp_printf (const xp_char_t* fmt, ...)
return n; return n;
} }
int xp_fprintf (XP_FILE* file, const xp_char_t* fmt, ...)
{
int n;
xp_va_list ap;
xp_va_start (ap, fmt);
n = xp_vfprintf (file, fmt, ap);
xp_va_end (ap);
return n;
}
int xp_vprintf (const xp_char_t* fmt, xp_va_list ap) int xp_vprintf (const xp_char_t* fmt, xp_va_list ap)
{ {
return xp_vfprintf (xp_stdout, fmt, ap); return xp_vfprintf (xp_stdout, fmt, ap);
} }
int xp_vfprintf (XP_FILE *stream, const xp_char_t* fmt, xp_va_list ap)
{
int n;
xp_char_t* nf = __adjust_format (fmt);
if (nf == XP_NULL) return -1;
#ifdef XP_CHAR_IS_MCHAR
n = vfprintf (stream, nf, ap);
#else
n = vfwprintf (stream, nf, ap);
#endif
xp_free (nf);
return n;
}
int xp_sprintf (xp_char_t* buf, xp_size_t size, const xp_char_t* fmt, ...) int xp_sprintf (xp_char_t* buf, xp_size_t size, const xp_char_t* fmt, ...)
{ {
int n; int n;

View File

@ -1,5 +1,5 @@
/* /*
* $Id: sa.h,v 1.4 2006-01-20 16:28:57 bacon Exp $ * $Id: sa.h,v 1.5 2006-01-20 16:31:58 bacon Exp $
*/ */
#ifndef _XP_AWK_SA_H_ #ifndef _XP_AWK_SA_H_
@ -12,6 +12,7 @@
#include <wctype.h> #include <wctype.h>
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>
#include <stdarg.h>
#include <assert.h> #include <assert.h>
#define xp_malloc malloc #define xp_malloc malloc
@ -28,6 +29,11 @@
#define xp_strcmp wcscmp #define xp_strcmp wcscmp
#define xp_strlen wcslen #define xp_strlen wcslen
#define xp_va_start(pvar,param) va_start(pvar,param)
#define xp_va_list va_list
#define xp_va_end(pvar) va_end(pvar)
#define xp_va_arg(pvar,type) va_arg(pvar,type)
#define xp_main main #define xp_main main
#define XP_CHAR(c) L##c #define XP_CHAR(c) L##c
@ -75,10 +81,8 @@ extern "C" {
xp_char_t* xp_strdup (const xp_char_t* str); xp_char_t* xp_strdup (const xp_char_t* str);
int xp_printf (const xp_char_t* fmt, ...); int xp_printf (const xp_char_t* fmt, ...);
int xp_fprintf (XP_FILE* file, const xp_char_t* fmt, ...);
int xp_vprintf (const xp_char_t* fmt, xp_va_list ap); int xp_vprintf (const xp_char_t* fmt, xp_va_list ap);
int xp_vfprintf (XP_FILE *stream, const xp_char_t* fmt, xp_va_list ap); int xp_sprint (xp_char_t* buf, xp_size_t size, const xp_char_t* fmt, ...);
int xp_sprint* buf, xp_size_t size, const xp_char_t* fmt, ...);
int xp_vsprintf ( int xp_vsprintf (
xp_char_t* buf, xp_size_t size, const xp_char_t* fmt, xp_va_list ap); xp_char_t* buf, xp_size_t size, const xp_char_t* fmt, xp_va_list ap);