*** empty log message ***

This commit is contained in:
hyung-hwan 2007-03-06 14:51:51 +00:00
parent 8176d0c895
commit 8eab6e3349
3 changed files with 48 additions and 48 deletions

View File

@ -1,5 +1,5 @@
/* /*
* $Id: awk.c,v 1.115 2007-03-04 15:04:40 bacon Exp $ * $Id: awk.c,v 1.116 2007-03-06 14:51:51 bacon Exp $
* *
* {License} * {License}
*/ */
@ -36,9 +36,7 @@ ase_awk_t* ase_awk_open (
prmfns->ccls.to_lower == ASE_NULL || prmfns->ccls.to_lower == ASE_NULL ||
prmfns->misc.pow == ASE_NULL || prmfns->misc.pow == ASE_NULL ||
prmfns->misc.sprintf == ASE_NULL || prmfns->misc.sprintf == ASE_NULL ||
prmfns->misc.aprintf == ASE_NULL || prmfns->misc.dprintf == ASE_NULL)
prmfns->misc.dprintf == ASE_NULL ||
prmfns->misc.abort == ASE_NULL)
{ {
*errnum = ASE_AWK_EPRMFNS; *errnum = ASE_AWK_EPRMFNS;
return ASE_NULL; return ASE_NULL;
@ -223,14 +221,14 @@ int ase_awk_clear (ase_awk_t* awk)
if (awk->tree.begin != ASE_NULL) if (awk->tree.begin != ASE_NULL)
{ {
ASE_AWK_ASSERT (awk, awk->tree.begin->next == ASE_NULL); ASE_ASSERT (awk->tree.begin->next == ASE_NULL);
ase_awk_clrpt (awk, awk->tree.begin); ase_awk_clrpt (awk, awk->tree.begin);
awk->tree.begin = ASE_NULL; awk->tree.begin = ASE_NULL;
} }
if (awk->tree.end != ASE_NULL) if (awk->tree.end != ASE_NULL)
{ {
ASE_AWK_ASSERT (awk, awk->tree.end->next == ASE_NULL); ASE_ASSERT (awk->tree.end->next == ASE_NULL);
ase_awk_clrpt (awk, awk->tree.end); ase_awk_clrpt (awk, awk->tree.end);
awk->tree.end = ASE_NULL; awk->tree.end = ASE_NULL;
} }

View File

@ -1,5 +1,5 @@
/* /*
* $Id: awk.c,v 1.184 2007-03-04 15:12:13 bacon Exp $ * $Id: awk.c,v 1.185 2007-03-06 14:51:04 bacon Exp $
*/ */
#include <ase/awk/awk.h> #include <ase/awk/awk.h>
@ -52,6 +52,39 @@ struct mmgr_data_t
#include <ase/utl/main.c> #include <ase/utl/main.c>
#endif #endif
#ifndef NDEBUG
void ase_assert_abort (void)
{
abort ();
}
void ase_assert_printf (const ase_char_t* fmt, ...)
{
va_list ap;
#ifdef _WIN32
int n;
ase_char_t buf[1024];
#endif
va_start (ap, fmt);
#if defined(_WIN32)
n = _vsntprintf (buf, ASE_COUNTOF(buf), fmt, ap);
if (n < 0) buf[ASE_COUNTOF(buf)-1] = ASE_T('\0');
#if defined(_MSC_VER) && (_MSC_VER<1400)
MessageBox (NULL, buf,
ASE_T("Assertion Failure"), MB_OK|MB_ICONERROR);
#else
MessageBox (NULL, buf,
ASE_T("\uB2DD\uAE30\uB9AC \uC870\uB610"), MB_OK|MB_ICONERROR);
#endif
#else
ase_vprintf (fmt, ap);
#endif
va_end (ap);
}
#endif
static void dprintf (const ase_char_t* fmt, ...) static void dprintf (const ase_char_t* fmt, ...)
{ {
va_list ap; va_list ap;
@ -60,6 +93,15 @@ static void dprintf (const ase_char_t* fmt, ...)
va_end (ap); va_end (ap);
} }
static void custom_awk_dprintf (void* custom, const ase_char_t* fmt, ...)
{
va_list ap;
va_start (ap, fmt);
ase_vfprintf (stderr, fmt, ap);
va_end (ap);
}
/* custom memory management function */ /* custom memory management function */
static void* custom_awk_malloc (void* custom, ase_size_t n) static void* custom_awk_malloc (void* custom, ase_size_t n)
{ {
@ -166,10 +208,6 @@ static ase_real_t custom_awk_pow (void* custom, ase_real_t x, ase_real_t y)
return pow (x, y); return pow (x, y);
} }
static void custom_awk_abort (void* custom)
{
abort ();
}
static int custom_awk_sprintf ( static int custom_awk_sprintf (
void* custom, ase_char_t* buf, ase_size_t size, void* custom, ase_char_t* buf, ase_size_t size,
@ -185,40 +223,6 @@ static int custom_awk_sprintf (
return n; return n;
} }
static void custom_awk_aprintf (void* custom, const ase_char_t* fmt, ...)
{
va_list ap;
#ifdef _WIN32
int n;
ase_char_t buf[1024];
#endif
va_start (ap, fmt);
#if defined(_WIN32)
n = _vsntprintf (buf, ASE_COUNTOF(buf), fmt, ap);
if (n < 0) buf[ASE_COUNTOF(buf)-1] = ASE_T('\0');
#if defined(_MSC_VER) && (_MSC_VER<1400)
MessageBox (NULL, buf,
ASE_T("Assertion Failure"), MB_OK|MB_ICONERROR);
#else
MessageBox (NULL, buf,
ASE_T("\uB2DD\uAE30\uB9AC \uC870\uB610"), MB_OK|MB_ICONERROR);
#endif
#else
ase_vprintf (fmt, ap);
#endif
va_end (ap);
}
static void custom_awk_dprintf (void* custom, const ase_char_t* fmt, ...)
{
va_list ap;
va_start (ap, fmt);
ase_vfprintf (stderr, fmt, ap);
va_end (ap);
}
static ase_ssize_t awk_srcio_in ( static ase_ssize_t awk_srcio_in (
int cmd, void* arg, ase_char_t* data, ase_size_t size) int cmd, void* arg, ase_char_t* data, ase_size_t size)
@ -860,9 +864,7 @@ static int awk_main (int argc, ase_char_t* argv[])
prmfns.ccls.custom_data = NULL; prmfns.ccls.custom_data = NULL;
prmfns.misc.pow = custom_awk_pow; prmfns.misc.pow = custom_awk_pow;
prmfns.misc.abort = custom_awk_abort;
prmfns.misc.sprintf = custom_awk_sprintf; prmfns.misc.sprintf = custom_awk_sprintf;
prmfns.misc.aprintf = custom_awk_aprintf;
prmfns.misc.dprintf = custom_awk_dprintf; prmfns.misc.dprintf = custom_awk_dprintf;
prmfns.misc.custom_data = NULL; prmfns.misc.custom_data = NULL;

View File

@ -4,7 +4,7 @@ OBJS = $(SRCS:.c=.o)
CC = @CC@ CC = @CC@
CFLAGS = @CFLAGS@ -I@abs_top_builddir@/.. CFLAGS = @CFLAGS@ -I@abs_top_builddir@/..
LDFLAGS = @LDFLAGS@ -L@abs_top_builddir@/cmn -L@abs_top_builddir@/awk -L@abs_top_builddir@/utl LDFLAGS = @LDFLAGS@ -L@abs_top_builddir@/cmn -L@abs_top_builddir@/awk -L@abs_top_builddir@/utl
LIBS = @LIBS@ -lasecmn -laseawk -laseutl -lm LIBS = @LIBS@ -lasecmn -laseawk -lasecmn -laseutl -lm
all: aseawk all: aseawk