From ecd25633bdc3e491a0eca44c63c158eeff388f13 Mon Sep 17 00:00:00 2001 From: Pavel Machek Date: Mon, 17 Apr 2000 10:54:01 +0000 Subject: Use printing routine from nest/ instead of our own. --- filter/filter.c | 52 +++------------------------------------------------- 1 file changed, 3 insertions(+), 49 deletions(-) diff --git a/filter/filter.c b/filter/filter.c index a20076f..768ff93 100644 --- a/filter/filter.c +++ b/filter/filter.c @@ -124,6 +124,7 @@ void val_print(struct f_val v) { char buf[2048]; + char buf2[1024]; #define PRINTF(a...) bsnprintf( buf, 2040, a ) buf[0] = 0; switch (v.type) { @@ -136,8 +137,8 @@ val_print(struct f_val v) case T_PAIR: PRINTF( "(%d,%d)", v.val.i >> 16, v.val.i & 0xffff ); break; case T_SET: tree_print( v.val.t ); PRINTF( "\n" ); break; case T_ENUM: PRINTF( "(enum %x)%d", v.type, v.val.i ); break; - case T_PATH: PRINTF( "%s", path_format(v.val.ad->data, v.val.ad->length)); break; - case T_PATH_MASK: debug( "(path " ); { struct f_path_mask *p = v.val.s; while (p) { debug("%d ", p->val); p=p->next; } debug(")" ); } break; + case T_PATH: as_path_format(v.val.ad, buf2, 1020); PRINTF( "(path %s)", buf2 ); break; + case T_PATH_MASK: debug( "(pathmask " ); { struct f_path_mask *p = v.val.s; while (p) { debug("%d ", p->val); p=p->next; } debug(")" ); } break; default: PRINTF( "[unknown type %x]", v.type ); #undef PRINTF } @@ -626,53 +627,6 @@ path_getlen(u8 *p, int len) return res; } - -#define PRINTF(a...) { int l; bsnprintf( s, bigbuf+4090-s, a ); s += strlen(s); } -#define COMMA if (first) first = 0; else PRINTF( ", " ); -char * -path_format(u8 *p, int len) -{ - char bigbuf[4096]; /* Keep it smaller than buf */ - char *s = bigbuf; - int first = 1; - int i; - u8 *q = p+len; - while (pnext; if (!mask) return next == q; \ asterix = (mask->val == PM_ANY); \ if (asterix) { mask = mask->next; if (!mask) { return 1; } } \ -- cgit v1.2.3