*** empty log message ***
This commit is contained in:
parent
3a1861ad3b
commit
c58af358c9
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* $Id: extio.c,v 1.49 2006-09-29 11:18:13 bacon Exp $
|
* $Id: extio.c,v 1.50 2006-10-09 14:37:14 bacon Exp $
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <xp/awk/awk_i.h>
|
#include <xp/awk/awk_i.h>
|
||||||
@ -104,7 +104,7 @@ int xp_awk_readextio (
|
|||||||
while (p != XP_NULL)
|
while (p != XP_NULL)
|
||||||
{
|
{
|
||||||
if (p->type == (extio_type | extio_mask) &&
|
if (p->type == (extio_type | extio_mask) &&
|
||||||
xp_awk_strcmp(p->name,name) == 0) break;
|
xp_awk_strcmp (p->name,name) == 0) break;
|
||||||
p = p->next;
|
p = p->next;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -582,7 +582,7 @@ int xp_awk_nextextio_read (
|
|||||||
while (p != XP_NULL)
|
while (p != XP_NULL)
|
||||||
{
|
{
|
||||||
if (p->type == (extio_type | extio_mask) &&
|
if (p->type == (extio_type | extio_mask) &&
|
||||||
xp_awk_strcmp(p->name,name) == 0) break;
|
xp_awk_strcmp (p->name,name) == 0) break;
|
||||||
p = p->next;
|
p = p->next;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* $Id: misc.c,v 1.25 2006-10-06 14:34:37 bacon Exp $
|
* $Id: misc.c,v 1.26 2006-10-09 14:37:14 bacon Exp $
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <xp/awk/awk_i.h>
|
#include <xp/awk/awk_i.h>
|
||||||
@ -677,13 +677,24 @@ int xp_awk_strxncmp (
|
|||||||
const xp_char_t* s1, xp_size_t len1,
|
const xp_char_t* s1, xp_size_t len1,
|
||||||
const xp_char_t* s2, xp_size_t len2)
|
const xp_char_t* s2, xp_size_t len2)
|
||||||
{
|
{
|
||||||
|
xp_char_t c1, c2;
|
||||||
const xp_char_t* end1 = s1 + len1;
|
const xp_char_t* end1 = s1 + len1;
|
||||||
const xp_char_t* end2 = s2 + len2;
|
const xp_char_t* end2 = s2 + len2;
|
||||||
|
|
||||||
while (s1 < end1 && s2 < end2 && *s1 == *s2) s1++, s2++;
|
while (s1 < end1)
|
||||||
if (s1 == end1 && s2 == end2) return 0;
|
{
|
||||||
if (*s1 == *s2) return (s1 < end1)? 1: -1;
|
c1 = *s1;
|
||||||
return (*s1 > *s2)? 1: -1;
|
if (s2 < end2)
|
||||||
|
{
|
||||||
|
c2 = *s2;
|
||||||
|
if (c1 > c2) return 1;
|
||||||
|
if (c1 < c2) return -1;
|
||||||
|
}
|
||||||
|
else return 1;
|
||||||
|
s1++; s2++;
|
||||||
|
}
|
||||||
|
|
||||||
|
return (s2 < end2)? -1: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
int xp_awk_strxncasecmp (
|
int xp_awk_strxncasecmp (
|
||||||
@ -695,17 +706,20 @@ int xp_awk_strxncasecmp (
|
|||||||
const xp_char_t* end1 = s1 + len1;
|
const xp_char_t* end1 = s1 + len1;
|
||||||
const xp_char_t* end2 = s2 + len2;
|
const xp_char_t* end2 = s2 + len2;
|
||||||
|
|
||||||
c1 = XP_AWK_TOUPPER (awk, *s1);
|
while (s1 < end1)
|
||||||
c2 = XP_AWK_TOUPPER (awk, *s2);
|
|
||||||
while (s1 < end1 && s2 < end2 && c1 == c2)
|
|
||||||
{
|
{
|
||||||
s1++, s2++;
|
|
||||||
c1 = XP_AWK_TOUPPER (awk, *s1);
|
c1 = XP_AWK_TOUPPER (awk, *s1);
|
||||||
c2 = XP_AWK_TOUPPER (awk, *s2);
|
if (s2 < end2)
|
||||||
|
{
|
||||||
|
c2 = XP_AWK_TOUPPER (awk, *s2);
|
||||||
|
if (c1 > c2) return 1;
|
||||||
|
if (c1 < c2) return -1;
|
||||||
|
}
|
||||||
|
else return 1;
|
||||||
|
s1++; s2++;
|
||||||
}
|
}
|
||||||
if (s1 == end1 && s2 == end2) return 0;
|
|
||||||
if (c1 == c2) return (s1 < end1)? 1: -1;
|
return (s2 < end2)? -1: 0;
|
||||||
return (c1 > c2)? 1: -1;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
xp_char_t* xp_awk_strxnstr (
|
xp_char_t* xp_awk_strxnstr (
|
||||||
|
@ -1,9 +1,8 @@
|
|||||||
/*
|
/*
|
||||||
* $Id: awk.c,v 1.91 2006-09-25 06:17:19 bacon Exp $
|
* $Id: awk.c,v 1.92 2006-10-09 14:37:41 bacon Exp $
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <xp/awk/awk.h>
|
#include <xp/awk/awk.h>
|
||||||
#include <xp/bas/stdio.h>
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <signal.h>
|
#include <signal.h>
|
||||||
@ -15,6 +14,7 @@
|
|||||||
|
|
||||||
#ifndef __STAND_ALONE
|
#ifndef __STAND_ALONE
|
||||||
#include <xp/bas/stdio.h>
|
#include <xp/bas/stdio.h>
|
||||||
|
#include <xp/bas/stdlib.h>
|
||||||
#include <xp/bas/string.h>
|
#include <xp/bas/string.h>
|
||||||
#include <xp/bas/memory.h>
|
#include <xp/bas/memory.h>
|
||||||
#include <xp/bas/sysapi.h>
|
#include <xp/bas/sysapi.h>
|
||||||
@ -27,6 +27,10 @@
|
|||||||
#else
|
#else
|
||||||
#define XP_PATH_MAX PATH_MAX
|
#define XP_PATH_MAX PATH_MAX
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef _WIN32
|
||||||
|
#define xp_sprintf _sntprintf
|
||||||
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
|
@ -90,6 +90,22 @@ BEGIN {
|
|||||||
print "10.0 > \"10\"", (10.0 > "10");
|
print "10.0 > \"10\"", (10.0 > "10");
|
||||||
print "10.0 < \"10\"", (10.0 < "10");
|
print "10.0 < \"10\"", (10.0 < "10");
|
||||||
|
|
||||||
|
print "--------------------------";
|
||||||
|
print "\"10\" == 10.0", ("10" == 10.0);
|
||||||
|
print "\"10\" != 10.0", ("10" != 10.0);
|
||||||
|
print "\"10\" >= 10.0", ("10" >= 10.0);
|
||||||
|
print "\"10\" <= 10.0", ("10" <= 10.0);
|
||||||
|
print "\"10\" > 10.0", ("10" > 10.0);
|
||||||
|
print "\"10\" < 10.0", ("10" < 10.0);
|
||||||
|
|
||||||
|
print "--------------------------";
|
||||||
|
print "\"10\" == 10.1", ("10" == 10.1);
|
||||||
|
print "\"10\" != 10.1", ("10" != 10.1);
|
||||||
|
print "\"10\" >= 10.1", ("10" >= 10.1);
|
||||||
|
print "\"10\" <= 10.1", ("10" <= 10.1);
|
||||||
|
print "\"10\" > 10.1", ("10" > 10.1);
|
||||||
|
print "\"10\" < 10.1", ("10" < 10.1);
|
||||||
|
|
||||||
#a[10] = 2;
|
#a[10] = 2;
|
||||||
#print a == 1;
|
#print a == 1;
|
||||||
|
|
||||||
|
@ -6,12 +6,11 @@ LIBS = xpawk.lib
|
|||||||
all: awk
|
all: awk
|
||||||
|
|
||||||
awk: awk.obj
|
awk: awk.obj
|
||||||
tcc $(LDFLAGS) -mh -eawk.exe awk.obj $(LIBS)
|
$(CC) $(LDFLAGS) -mh -eawk.exe awk.obj $(LIBS)
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
del $(OBJS) *.obj $(OUT)
|
del $(OBJS) *.obj $(OUT)
|
||||||
|
|
||||||
.SUFFIXES: .c .obj
|
|
||||||
.c.obj:
|
.c.obj:
|
||||||
$(CC) $(CFLAGS) -c $<
|
$(CC) $(CFLAGS) -c $<
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user