*** empty log message ***
This commit is contained in:
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* $Id: extio.c,v 1.12 2006-06-28 03:44:39 bacon Exp $
|
||||
* $Id: extio.c,v 1.13 2006-06-28 08:56:59 bacon Exp $
|
||||
*/
|
||||
|
||||
#include <xp/awk/awk_i.h>
|
||||
@ -133,6 +133,7 @@ int xp_awk_writeextio (
|
||||
xp_assert (out_type >= 0 && out_type <= xp_countof(__out_type_map));
|
||||
xp_assert (out_type >= 0 && out_type <= xp_countof(__out_opt_map));
|
||||
|
||||
/* translate the out_type into the relevant extio type and option */
|
||||
extio_type = __out_type_map[out_type];
|
||||
extio_opt = __out_opt_map[out_type];
|
||||
|
||||
@ -161,7 +162,17 @@ int xp_awk_writeextio (
|
||||
/* look for the corresponding extio for name */
|
||||
while (p != XP_NULL)
|
||||
{
|
||||
/* TODO: should it be extio_type or out_type???? */
|
||||
/* the file "1.tmp", in the following code snippets,
|
||||
* would be opened by the first print statement, but not by
|
||||
* the second print statement. this is because
|
||||
* both XP_AWK_OUT_FILE and XP_AWK_OUT_FILE_APPEND are
|
||||
* translated to XP_AWK_EXTIO_FILE and it is used to
|
||||
* keep track of file handles..
|
||||
*
|
||||
* print "1111" >> "1.tmp"
|
||||
* print "1111" > "1.tmp"
|
||||
*/
|
||||
|
||||
if (p->type == extio_type &&
|
||||
xp_strcmp(p->name,name) == 0) break;
|
||||
p = p->next;
|
||||
@ -187,11 +198,6 @@ int xp_awk_writeextio (
|
||||
return -1;
|
||||
}
|
||||
|
||||
/* TODO: should it be extio_type or out_type???? */
|
||||
/* TODO: should it be extio_type or out_type???? */
|
||||
/* TODO: should it be extio_type or out_type???? */
|
||||
/* TODO: should it be extio_type or out_type???? */
|
||||
/* TODO: should it be extio_type or out_type???? */
|
||||
p->type = extio_type;
|
||||
p->handle = XP_NULL;
|
||||
p->next = XP_NULL;
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* $Id: sa.c,v 1.22 2006-06-23 11:48:19 bacon Exp $
|
||||
* $Id: sa.c,v 1.23 2006-06-28 08:56:59 bacon Exp $
|
||||
*/
|
||||
|
||||
#include <xp/awk/awk_i.h>
|
||||
@ -72,7 +72,7 @@ int xp_strcmp (const xp_char_t* s1, const xp_char_t* s2)
|
||||
{
|
||||
while (*s1 == *s2)
|
||||
{
|
||||
if (*s1 == XP_CHAR('\0')) return 0;
|
||||
if (*s1 == XP_C('\0')) return 0;
|
||||
s1++, s2++;
|
||||
}
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* $Id: val.c,v 1.32 2006-06-26 15:09:28 bacon Exp $
|
||||
* $Id: val.c,v 1.33 2006-06-28 08:56:59 bacon Exp $
|
||||
*/
|
||||
|
||||
#include <xp/awk/awk_i.h>
|
||||
@ -328,6 +328,22 @@ xp_bool_t xp_awk_valtobool (xp_awk_val_t* val)
|
||||
|
||||
xp_char_t* xp_awk_valtostr (xp_awk_val_t* v, int* errnum, xp_str_t* buf)
|
||||
{
|
||||
if (v->type == XP_AWK_VAL_NIL)
|
||||
{
|
||||
if (buf == XP_NULL)
|
||||
{
|
||||
xp_char_t* tmp;
|
||||
tmp = xp_strdup (XP_T(""));
|
||||
if (tmp == XP_NULL) *errnum = XP_AWK_ENOMEM;
|
||||
return tmp;
|
||||
}
|
||||
else
|
||||
{
|
||||
xp_str_clear (buf);
|
||||
return XP_STR_BUF(buf);
|
||||
}
|
||||
}
|
||||
|
||||
if (v->type == XP_AWK_VAL_INT)
|
||||
{
|
||||
xp_char_t* tmp;
|
||||
|
Reference in New Issue
Block a user