diff --git a/qse/cmd/awk/awk.c b/qse/cmd/awk/awk.c index 674f59d3..ea442718 100644 --- a/qse/cmd/awk/awk.c +++ b/qse/cmd/awk/awk.c @@ -1,5 +1,5 @@ /* - * $Id: awk.c 85 2009-02-26 10:56:12Z hyunghwan.chung $ + * $Id: awk.c 86 2009-02-26 12:55:05Z hyunghwan.chung $ * Copyright 2006-2009 Chung, Hyung-Hwan. @@ -644,7 +644,7 @@ static int awk_main (int argc, qse_char_t* argv[]) rcb.data = &ao; rtx = qse_awk_rtx_openstd ( - awk, ao.icf, QSE_AWK_RTX_OPENSTD_STDIO); + awk, 0, ao.icf, QSE_AWK_RTX_OPENSTD_STDIO); if (rtx == QSE_NULL) { qse_printf ( diff --git a/qse/include/qse/awk/std.h b/qse/include/qse/awk/std.h index 6218fe58..89a81f43 100644 --- a/qse/include/qse/awk/std.h +++ b/qse/include/qse/awk/std.h @@ -1,5 +1,5 @@ /* - * $Id: std.h 85 2009-02-26 10:56:12Z hyunghwan.chung $ + * $Id: std.h 86 2009-02-26 12:55:05Z hyunghwan.chung $ * Copyright 2006-2009 Chung, Hyung-Hwan. @@ -138,16 +138,26 @@ int qse_awk_parsestd ( * The caller should keep the contents of icf and ocf valid throughout * the lifetime of the runtime context created. The runtime context * remembers the pointers without copying in the contents. - * * SYNOPSIS */ qse_awk_rtx_t* qse_awk_rtx_openstd ( qse_awk_t* awk, + qse_size_t xtnsize, const qse_char_t*const icf[], const qse_char_t*const ocf[] ); /******/ +/****f* AWK/qse_awk_rtx_getxtnstd + * NAME + * qse_awk_rtx_getxtnstd - get the pointer to extension space + * SYNOPSIS + */ +void* qse_awk_rtx_getxtnstd ( + qse_awk_rtx_t* rtx +); +/******/ + #ifdef __cplusplus } #endif diff --git a/qse/lib/awk/std.c b/qse/lib/awk/std.c index a85b4bde..148ed322 100644 --- a/qse/lib/awk/std.c +++ b/qse/lib/awk/std.c @@ -1,5 +1,5 @@ /* - * $Id: std.c 85 2009-02-26 10:56:12Z hyunghwan.chung $ + * $Id: std.c 86 2009-02-26 12:55:05Z hyunghwan.chung $ * Copyright 2006-2009 Chung, Hyung-Hwan. @@ -881,6 +881,7 @@ static qse_ssize_t awk_rio_console ( qse_awk_rtx_t* qse_awk_rtx_openstd ( qse_awk_t* awk, + qse_size_t xtnsize, const qse_char_t*const icf[], const qse_char_t*const ocf[]) { @@ -895,7 +896,7 @@ qse_awk_rtx_t* qse_awk_rtx_openstd ( rtx = qse_awk_rtx_open ( awk, - QSE_SIZEOF(rxtn_t), + QSE_SIZEOF(rxtn_t) + xtnsize, &rio, QSE_NULL/*runarg*/ ); @@ -916,6 +917,11 @@ qse_awk_rtx_t* qse_awk_rtx_openstd ( return rtx; } +void* qse_awk_rtx_getxtnstd (qse_awk_rtx_t* rtx) +{ + return (void*)((rxtn_t*)QSE_XTN(rtx) + 1); +} + /*** EXTRA BUILTIN FUNCTIONS ***/ enum { diff --git a/qse/test/awk/awk01.c b/qse/test/awk/awk01.c index 73c6b90b..b73048a0 100644 --- a/qse/test/awk/awk01.c +++ b/qse/test/awk/awk01.c @@ -1,5 +1,5 @@ /* - * $Id: awk01.c 85 2009-02-26 10:56:12Z hyunghwan.chung $ + * $Id: awk01.c 86 2009-02-26 12:55:05Z hyunghwan.chung $ * Copyright 2006-2009 Chung, Hyung-Hwan. @@ -63,7 +63,7 @@ int main () } rtx = qse_awk_rtx_openstd ( - awk, + awk, 0, QSE_NULL, /* no console input */ QSE_AWK_RTX_OPENSTD_STDIO /* stdout for console output */ ); diff --git a/qse/test/awk/awk02.c b/qse/test/awk/awk02.c index 31559892..16582958 100644 --- a/qse/test/awk/awk02.c +++ b/qse/test/awk/awk02.c @@ -1,5 +1,5 @@ /* - * $Id: awk02.c 85 2009-02-26 10:56:12Z hyunghwan.chung $ + * $Id: awk02.c 86 2009-02-26 12:55:05Z hyunghwan.chung $ * Copyright 2006-2009 Chung, Hyung-Hwan. @@ -78,7 +78,7 @@ int main () qse_fflush (QSE_STDOUT); rtx = qse_awk_rtx_openstd ( - awk, + awk, 0, QSE_NULL, /* no console input */ QSE_AWK_RTX_OPENSTD_STDIO /* stdout for console output */ ); diff --git a/qse/test/awk/awk03.c b/qse/test/awk/awk03.c index 60d2f0c6..e7162a65 100644 --- a/qse/test/awk/awk03.c +++ b/qse/test/awk/awk03.c @@ -1,5 +1,5 @@ /* - * $Id: awk03.c 85 2009-02-26 10:56:12Z hyunghwan.chung $ + * $Id: awk03.c 86 2009-02-26 12:55:05Z hyunghwan.chung $ * Copyright 2006-2009 Chung, Hyung-Hwan. @@ -77,7 +77,7 @@ int main () /* create a runtime context */ rtx = qse_awk_rtx_openstd ( - awk, + awk, 0, QSE_NULL, /* no console input */ QSE_AWK_RTX_OPENSTD_STDIO /* stdout for console output */ ); diff --git a/qse/test/awk/awk04.c b/qse/test/awk/awk04.c index 91be4c5a..3b38fa0d 100644 --- a/qse/test/awk/awk04.c +++ b/qse/test/awk/awk04.c @@ -1,5 +1,5 @@ /* - * $Id: awk04.c 85 2009-02-26 10:56:12Z hyunghwan.chung $ + * $Id: awk04.c 86 2009-02-26 12:55:05Z hyunghwan.chung $ * Copyright 2006-2009 Chung, Hyung-Hwan. @@ -67,7 +67,7 @@ int main () /* create a runtime context */ rtx = qse_awk_rtx_openstd ( - awk, + awk, 0, QSE_NULL, /* no console input */ QSE_AWK_RTX_OPENSTD_STDIO /* stdout for console output */ );