Index: kit/CHANGELOG
diff -u kit/CHANGELOG:1.9 kit/CHANGELOG:removed
--- kit/CHANGELOG:1.9	Sat Sep  5 00:11:21 1998
+++ kit/CHANGELOG	Mon May 29 05:10:01 2006
@@ -1,51 +0,0 @@
-CHANGELOG for magicpoint
-$Id: CHANGELOG,v 1.9 1998/09/04 15:11:21 onoe Exp $
-
-Fri Sep  5 1998  onoe@sm.sony.co.jp
-	* handle key inputs from invoked terminal as pressed on Xserver,
-	  even if the Xserver is running on a remote host.
-
-Mon Aug 26 1998  itojun@iijlab.net
-	* new copyright. (BSDish copyright without clause 3)
-
-Mon Aug 25 1998  itojun@iijlab.net
-	* print.c: better x11/freetype/vflib -> postscript font mapping.
-
-Mon Aug 23 1998  kato@wide.ad.jp
-	* embedded image support (added mgpembed.pl and embed.c)
-
-Mon Aug 22 1998  itojun@iijlab.net
-	* added contrib/xmindpath, MindPath PocketPoint user-level driver.
-
-Fri Jul 10 11:57:59 JST 1998  itojun@iijlab.net
-	* cache gs-generated image file.
-	  Suggested by: luigi@FreeBSD.org
-
-Mon Jul  6 11:38:32 JST 1998  itojun@iijlab.net
-	* capable of handling GB2312 and KSC5601 encoding.
-	  they must be encoded by using iso-2022 like escape sequences.
-	  EUC-cn or EUC-kr does not work.
-	* -x option is added.
-
-Thu Jul  2 18:04:16 JST 1998  itojun@iijlab.net
-	* eliminate gsview.
-	* revamp "xfont" directive. (see SYNTAX for detail)
-
-Thu Jun 25 13:10:28 JST 1998  itojun@iijlab.net
-	* print.c: color postscript support by "mgp2ps -c".
-
-changes between 1.02a and 1.03a:
-	* To allow color name that has space inbetween ("dark blue"), 
-	  color name after directives SHOULD come with doublequote.
-	  Therefore,
-		%fore blue
-	  should be
-		%fore "blue"
-	  At this moment, doublequote can be ommitted for backward
-	  compatibility.  We may require to have doublequote in the future.
-	  Font names and other string parameter obeys the same rule.
-	* %image is now capable of rendering encapsulated postscript files
-	  (*.eps).
-		%image foo.eps
-	  should work fine.
-	  By using -X option, you can specify device name for ghostscript.
Index: kit/ctlwords.pl
diff -u kit/ctlwords.pl:1.2 kit/ctlwords.pl:removed
--- kit/ctlwords.pl:1.2	Sat Sep  5 06:05:08 1998
+++ kit/ctlwords.pl	Mon May 29 05:10:01 2006
@@ -1,12 +0,0 @@
-#! /usr/bin/perl
-$counter = 0;	# 0 origin
-print "/* generated by ctlwords.awk. do not edit by hand. */\n";
-
-while (<>) {
-	next if (!/^\/\*CTL\*\//);
-	next if ($_ !~ /(CTL_[A-Z0-9]+)/);
-
-	$word = $1;
-	print "#define $word\t$counter\n";
-	$counter++;
-}
Index: kit/draw.c
diff -u kit/draw.c:1.227 kit/draw.c:1.229
--- kit/draw.c:1.227	Fri May 20 01:30:03 2005
+++ kit/draw.c	Sun May 28 18:59:34 2006
@@ -26,7 +26,7 @@
  * SUCH DAMAGE.
  */
 /*
- * $Id: draw.c,v 1.227 2005/05/19 16:30:03 nishida Exp $
+ * $Id: draw.c,v 1.229 2006/05/28 09:59:34 nishida Exp $
  */
 
 #include "mgp.h"
@@ -111,7 +111,10 @@
 static void draw_bar __P((struct render_state *, struct ctrl *));
 static void process_system __P((struct render_state *, struct ctrl *));
 static void process_xsystem __P((struct render_state *, struct ctrl *));
+static void process_tsystem __P((struct render_state *, struct ctrl *));
 static Window search_child_window __P(());
+static Window tsearch_child_window __P((const char *name));
+static Window getNamedWindow __P((const char *name, Window top));
 static void reparent_child_window __P((Window, int, int));
 static char *epstoimage __P((struct render_state *, char *, int, int, int,
 	int, int, int));
@@ -834,6 +837,11 @@
 		process_xsystem(state, cp);
 		break;
 
+	case CTL_TSYSTEM:
+		CHECK_CACHE;
+		process_tsystem(state, cp);
+		break;
+
 	case CTL_ICON:
 		process_icon(state, cp);
 		break;
@@ -1091,6 +1099,16 @@
 	Window cutinWin, junkwin;
 	XImage *copywin; 
 	static XWindowAttributes xa;
+	XWindowAttributes wa;
+	Pixmap ghostWin;
+	GC saveGC = gc_cache;
+
+	XGetWindowAttributes(display, window, &wa);
+	ghostWin = XCreatePixmap(display, window, wa.width, wa.height, wa.depth);
+	/* all drawing should be done on the image */
+	gc_cache = XCreateGC(display, ghostWin, 0, 0);
+	XCopyArea(display, state->target, ghostWin, gc_cache,
+			0, 0, wa.width, wa.height, 0, 0);
 
 	if (state->repaint)
 		return;
@@ -1139,23 +1157,42 @@
 
 	x = sx;
 	for (i = 0; i < round; i++) {
-		if (use_copy && state->obj) 
-				obj_draw(state, state->target, x + xoff, ly + yoff);
-		else 
-				XMoveWindow(display, cutinWin, x + xoff, ly + yoff);
+		if (use_copy && state->obj) {
+				obj_draw(state, ghostWin, x + xoff, ly + yoff);
+                                XCopyArea(display, ghostWin, state->target, 
+                                    saveGC,
+                                    xoff + min(sx, lx),
+                                    ly + yoff,
+                                    state->linewidth + abs(lx - sx),
+                                    state->maxascent + state->maxdescent,
+                                    xoff + min(sx, lx),
+                                    ly + yoff);
+		} else 
+			XMoveWindow(display, cutinWin, x + xoff, ly + yoff);
+
 		XFlush(display);
 		usleep(CUTIN_DELAY);
 		if (use_copy && state->obj) {
-			XPutImage(display, state->target, gc_cache, copywin, 
+			XPutImage(display, ghostWin, gc_cache, copywin, 
 				x - min(sx, lx) , 0, x + xoff, ly + yoff, 
 				state->linewidth, state->maxascent + state->maxdescent);
 		}
-		x += step;
+		x = sx + ((i+1)*(lx - sx)) / round;
 	}
+	XCopyArea(display, ghostWin, state->target, saveGC,
+		0, 0, wa.width, wa.height, 0, 0);
 
 	if (!use_copy) XDestroyWindow(display, cutinWin);
 	state->xoff = xoff;	
 	state->yoff = yoff;	
+
+	/* freeing images */
+	if(use_copy) XFree(copywin);
+
+	/* restoring tho old GC */
+	XFreeGC(display, gc_cache);
+	XFreePixmap(display, ghostWin);
+	gc_cache = saveGC;
 }
 
 #if 0
@@ -3449,6 +3486,13 @@
 	int i;
 	char **argv;
 	char buf[BUFSIZ];
+   
+        if (state->repaint) {
+	        if (mgp_flag & FL_VERBOSE) {
+		       fprintf(stderr, "WARN: %%system directive skipping during repaint of same page\n");
+		}
+	        return; /* don't relaunch on repaint */
+	}
 
 	if (mgp_flag & FL_NOFORK) {
 		if (mgp_flag & FL_VERBOSE) {
@@ -3572,6 +3616,14 @@
 	char buf[BUFSIZ];
 	Window window_id, dumwin;
 
+        if (state->repaint) {
+	        if (mgp_flag & FL_VERBOSE) {
+		       fprintf(stderr, "WARN: %%system directive skipping during repaint of same page\n");
+		}
+	        return; /* don't relaunch on repaint */
+	}
+
+   
 	if (mgp_flag & FL_NOFORK) {
 		if (mgp_flag & FL_VERBOSE) {
 			fprintf(stderr, "WARN: %%system ");
@@ -3600,7 +3652,7 @@
 		char *q;
 		int mode;
 
-		argv = (char **)malloc((cp->cta_argc + 1) * sizeof(char *));
+		argv = (char **)malloc((cp->cta_argc + 1) * sizeof(char *)); /* XXX seems to be never freed */
 		memcpy(argv, cp->cta_argv, (cp->cta_argc + 1) * sizeof(char *));
 		p = argv[i];
 		if (*p == '%') p++;	/*drop percent char*/
@@ -3647,6 +3699,11 @@
 
 		argv[cp->cta_argc] = geom_arg1;
 		argv[cp->cta_argc+1] = geom_arg2;
+                /*
+                ** XXX argv is now not generally NULL-terminated
+                ** the maximal allowed size of argv is ganatied to be
+                ** argc+2 so no NULL can appended
+                */
 	}
 
 	if ((window_id = checkchildwin(cp)) != (Window)-1)
@@ -3704,6 +3761,211 @@
 }
 
 
+/*
+ * tsystem does mostly the same like xsystem, but identifies the created
+ * window by its name
+ *
+ * this hack is done because at some windowmanagers occures additional
+ * xreparentevents, which cause xsystem to fail
+ *
+ * it is possible, that the title of some applications is reseted, than
+ * tsystem will fail
+ */
+static void
+process_tsystem(state, cp)
+	struct render_state *state;
+	struct ctrl *cp;
+{
+	pid_t pid;
+	int i, dumint, argc;
+	int xloc, yloc;
+	int xsiz, ysiz;
+	char **argv;
+	char buf[BUFSIZ];
+	char title_arg1[] = "-title";
+	char title_arg2[BUFSIZ];
+	static unsigned int magicCnt=0;
+	Window window_id, dumwin;
+
+	if (mgp_flag & FL_NOFORK) {
+		if (mgp_flag & FL_VERBOSE) {
+			fprintf(stderr, "WARN: %%system ");
+			for (i = 0; i < cp->cta_argc; i++) {
+				fprintf(stderr, "%c%s", (i == 0) ? '"' : ' ',
+					cp->cta_argv[i]);
+			}
+			fprintf(stderr, "\": directive skipped\n");
+		}
+		return;
+	}
+
+
+	/*
+	 * edit argument.
+	 * allways copy the argument vector, for adding -title magictitle
+	 * it's assumed, that there is not -title in the argument vector
+	 */
+	argc=cp->cta_argc;
+	argv = (char **)malloc((argc + 5) * sizeof(char *)); 
+		/* +5 for NULL, title and potentally geometry */
+	memcpy(argv, cp->cta_argv, (argc + 1) * sizeof(char *));
+
+	/*
+	 * search for X11 geometry string 
+	 */
+	for (i = 0; i < argc; i++) {
+		if (!strncmp(argv[i], "-geom", 5))
+			break;
+	}
+	i ++;
+	if (i < argc) {
+	/*
+	 * we have X11 geometry string 
+	 */
+		char *p;
+		char *q;
+		int mode;
+
+		p = argv[i];
+		if (*p == '%') p++;	/*drop percent char*/
+		q = buf;
+		*q = '\0';
+
+		mode = XParseGeometry(p, &xloc, &yloc, &xsiz, &ysiz);
+		if (mode == 0)
+			goto fail;
+		if ((mode & WidthValue) && (mode & HeightValue)) {
+			xsiz = xsiz * state->width / 100;
+			ysiz = ysiz * state->height / 100;
+			sprintf(q, "%dx%d", xsiz, ysiz);
+			q += strlen(q);
+		}
+		/* make window raise outside of display */
+		/* XXX potentially overflow, but BUFSIZ should be alway large enough*/
+		sprintf(q, "+%d+%d", DisplayWidth(display, DefaultScreen(display)),
+					DisplayHeight(display, DefaultScreen(display)));
+
+		if (mgp_flag & FL_VERBOSE) {
+			fprintf(stderr, "relative geometry: "
+				"%s (presentation %dx%d+%d+%d)\n",
+				argv[i], state->width, state->height,
+				xloc, yloc);
+			fprintf(stderr, "\t-> %s\n", buf);
+		}
+		argv[i] = buf;
+
+		if (0) {
+fail:
+			if (mgp_flag & FL_VERBOSE) {
+				fprintf(stderr,
+					"relative geometry: %s failed\n",
+					argv[i]);
+			}
+		}
+	} else {
+ 	    /*
+	     * we do not have X11 geometry string 
+	     */
+		char geom_arg1[] = "-geometry";
+		char geom_arg2[512];
+
+		sprintf(geom_arg2, "+%d+%d", DisplayWidth(display, 
+			DefaultScreen(display)),
+			DisplayHeight(display, DefaultScreen(display)));
+
+		argv[argc] = geom_arg1;
+		argv[argc+1] = geom_arg2;
+                argc += 2;
+	}
+
+	/*
+	 * adding magic title and incrementing magicCnt
+	 * guaranteeing the NULL-termination of argv
+	 */
+	snprintf(title_arg2, BUFSIZ, "magictitle %u", magicCnt++);
+	argv[argc] = title_arg1;
+	argv[argc+1] = title_arg2;
+	argv[argc+2] = NULL;
+	argc += 2; /* seems not to be nessesary */
+
+	if ((window_id = checkchildwin(cp)) != (Window)-1)
+		goto finish;	/*already running*/
+
+	if (checkchild(cp) != (pid_t)-1) {
+		free(argv);
+		return;	/*already running*/
+	}
+
+	/*
+	 * using vfork() to first run the child
+	 */
+	pid = vfork();
+	if (pid < 0) {
+		perror("fork");
+		cleanup(-1);
+	} else if (pid == 0){
+		execvp(argv[0], argv);
+		perror(argv[0]);
+		_exit(1);
+	}
+
+	window_id = tsearch_child_window(title_arg2);
+
+	if (!cp->cta_flag)	/*will be purged at the end of page*/
+		regchild(pid, cp, window_id, state->page);
+	else
+		regchild(pid, cp, window_id, cp->cta_flag);
+
+	if (0 == window_id) {
+		if (mgp_flag & FL_VERBOSE) {
+			fprintf(stderr, "WARN: %%tsystem can not find child window:");
+			for (i = 0; i < cp->cta_argc; i++) {
+				fprintf(stderr, "%c%s", (i == 0) ? '"' : ' ',
+					cp->cta_argv[i]);
+			}
+			fprintf(stderr, "\"\n");
+		}
+		return;
+	}
+finish:
+	{
+		Window root, par, *child; 
+		int newxloc, newyloc;
+		unsigned int nchild;
+          
+		XGetGeometry(display, window_id, &dumwin, 
+				&xloc, &yloc, &xsiz, &ysiz, &dumint, &dumint);
+		XQueryTree(display, window_id, &root, &par, &child, &nchild);
+		if(child) XFree(child);
+
+		state->linewidth = xsiz;
+		newxloc = set_position(state) + state->xoff 
+			+ (state->tabxprefix ? state->tabxprefix : state->xprefix);
+		newyloc = state->ypos + state->yoff;
+		while((par!=window) || (xloc != newxloc)) {
+			/*
+			 * this hack should correct not moved windows
+			 * if found, that XMoveWindow, XReparentWindow returns success,
+			 * but the window is sometimes not moved etc in ion
+			 */
+			XReparentWindow(display, window_id, window, newxloc, newyloc);
+			XGetGeometry(display, window_id, &dumwin, 
+					&xloc, &yloc, &xsiz, &ysiz, &dumint, &dumint);
+			XQueryTree(display, window_id, &root, &par, &child, &nchild);
+			if(child) XFree(child);
+		}
+	}
+
+	state->ypos += ysiz;
+	free(argv);
+
+#if 0 /* not implemented yet */
+	state->linewidth += xsiz;
+	state->maxascent += ysiz;
+#endif
+}
+
+
 Window 
 search_child_window()
 {
@@ -3745,6 +4007,56 @@
 		return (Window)-1;
 }
 
+/*
+** looks for a window with the specified name
+** return (Window)0 if not found
+*/
+Window 
+tsearch_child_window(const char *name)
+{
+  /* 100 ms between two searches for the specified window */
+#define WAITTIME 100000
+  /* maximal wait time = 1 minute */
+#define WAITCYCLES 60000000 / WAITTIME
+        int maxWait=WAITCYCLES;
+        Window w=0;
+printf("%s\n", name);
+
+        while(maxWait--)
+        {
+          if((w = getNamedWindow(name, DefaultRootWindow(display))))
+            break;
+          usleep(WAITTIME);
+        }
+        return w;
+#undef WAITCYCLES
+#undef WAITTIME
+}
+Window
+getNamedWindow(const char *name, Window top)
+{
+  Window w=0;
+  Window *child;
+  Window dum;
+  unsigned int nchild,i;
+  char *w_name;
+
+  if(XFetchName(display, top, &w_name) && (!strcmp(w_name, name)))
+    return top;
+
+  if(!XQueryTree(display, top, &dum, &dum, &child, &nchild))
+    return (Window)0;
+
+  for(i=0; i<nchild; ++i)
+  {
+    if((w = getNamedWindow(name, child[i])))
+      break;
+  }
+  if(child) XFree((char *)child);
+  
+  return w;
+}
+
 void 
 reparent_child_window(child_window, x, y)
 	Window	child_window;
Index: kit/globals.c
diff -u kit/globals.c:1.50 kit/globals.c:1.51
--- kit/globals.c:1.50	Thu Jul  8 15:09:54 2004
+++ kit/globals.c	Sun May 28 18:59:34 2006
@@ -26,7 +26,7 @@
  * SUCH DAMAGE.
  */
 /*
- * $Id: globals.c,v 1.50 2004/07/08 06:09:54 nishida Exp $
+ * $Id: globals.c,v 1.51 2006/05/28 09:59:34 nishida Exp $
  */
 
 #include "mgp.h"
@@ -141,6 +141,7 @@
 /*CTL*/	{ CTL_QUALITY,		T_INT,	"bquality", 8 },
 /*CTL*/	{ CTL_ICON,		T_SP,	"icon", 4 },
 /*CTL*/	{ CTL_XSYSTEM,		T_SP,	"xsystem", 7 },
+/*CTL*/	{ CTL_TSYSTEM,		T_SP,	"tsystem", 7 },
 /*CTL*/	{ CTL_TFDIR,		T_STR,	"tfdir", 5 },
 /*CTL*/	{ CTL_DEFFONT,		T_STR,	"deffont", 7 },
 /*CTL*/	{ CTL_FONT,		T_STR,	"font", 4 },
Index: kit/grammar.y
diff -u kit/grammar.y:1.45 kit/grammar.y:1.46
--- kit/grammar.y:1.45	Wed Sep  8 01:57:42 2004
+++ kit/grammar.y	Sun May 28 18:59:34 2006
@@ -27,7 +27,7 @@
  * SUCH DAMAGE.
  */
 /*
- * $Id: grammar.y,v 1.45 2004/09/07 16:57:42 nishida Exp $
+ * $Id: grammar.y,v 1.46 2006/05/28 09:59:34 nishida Exp $
  */
 /*
  * partly derived from lbl libpcap source code, which has the following
@@ -770,6 +770,7 @@
 %token KW_PREFIX KW_AGAIN KW_CCOLOR KW_BAR KW_INCLUDE KW_BGRAD KW_TEXT
 %token KW_LINESTART KW_LINEEND KW_MARK KW_SYSTEM KW_FILTER KW_ENDFILTER
 %token KW_QUALITY KW_ICON KW_LEFTFILL KW_XSYSTEM KW_VFCAP KW_TFONT KW_TFDIR
+%token KW_TSYSTEM
 %token KW_DEFFONT KW_FONT KW_TFONT0 KW_EMBED KW_ENDEMBED KW_NEWIMAGE
 %token KW_CHARSET KW_TMFONT KW_PCACHE KW_TMFONT0 KW_ANIM KW_VALIGN KW_AREA 
 %token KW_OPAQUE
@@ -808,6 +809,8 @@
 	| KW_SYSTEM STR		{ $$ = gen_argsfromstr(CTL_SYSTEM, $2, 0); }
 	| KW_XSYSTEM STR NUM	{ $$ = gen_argsfromstr(CTL_XSYSTEM, $2, $3); }
 	| KW_XSYSTEM STR	{ $$ = gen_argsfromstr(CTL_XSYSTEM, $2, 0); }
+	| KW_TSYSTEM STR NUM	{ $$ = gen_argsfromstr(CTL_TSYSTEM, $2, $3); }
+	| KW_TSYSTEM STR	{ $$ = gen_argsfromstr(CTL_TSYSTEM, $2, 0); }
 	| KW_FILTER STR		{ $$ = gen_argsfromstr(CTL_FILTER, $2, 0); }
 	| KW_ENDFILTER		{ $$ = gen_void(CTL_ENDFILTER); }
 	| KW_EMBED STR		{ $$ = gen_str(CTL_EMBED, $2); }
Index: kit/mgp.c
diff -u kit/mgp.c:1.138 kit/mgp.c:1.139
--- kit/mgp.c:1.138	Sat Sep 25 01:42:51 2004
+++ kit/mgp.c	Sun May 28 18:38:09 2006
@@ -26,7 +26,7 @@
  * SUCH DAMAGE.
  */
 /*
- * $Id: mgp.c,v 1.138 2004/09/24 16:42:51 nishida Exp $
+ * $Id: mgp.c,v 1.139 2006/05/28 09:38:09 nishida Exp $
  */
 
 static char *mgp_version = "1.11b (20040925)";
@@ -939,17 +939,21 @@
 				struct render_state tstate;
 				tstate = state;
 
-				if (number == 0)
-					number = 1;
-				if (state.cp && state.cp->ct_op == CTL_PAUSE){
+				if (number == 0 && state.cp && state.cp->ct_op == CTL_PAUSE) {
 					state_next(&tstate);
-				} else if (state.page + number
+				} else {
+				    if (number == 0)
+				        number = 1;
+
+				    if (state.page + number
 						<= maxpage) {
 						state_goto(&tstate, state.page + number, 0);
-				} else {
-					beep();
+				    } else {
+				        beep();
 					break;
+				    }
 				}
+			       
 
 				if (memcmp(&state, &tstate,
 						sizeof(state)) != 0) {
Index: kit/mgp.h
diff -u kit/mgp.h:1.141 kit/mgp.h:1.142
--- kit/mgp.h:1.141	Mon May 16 18:47:03 2005
+++ kit/mgp.h	Sun May 28 15:01:31 2006
@@ -26,7 +26,7 @@
  * SUCH DAMAGE.
  */
 /*
- * $Id: mgp.h,v 1.141 2005/05/16 09:47:03 nishida Exp $
+ * $Id: mgp.h,v 1.142 2006/05/28 06:01:31 nishida Exp $
  */
 
 #include <stdio.h>
@@ -127,7 +127,7 @@
 #define XLFD_HYPHEN	14
 #define FONT_FORMAT	"-*-%s-*-*-%s-*-*-*-*-*-%s"
 #define DEFAULT_X_FONT	"times-medium-r"
-#define CUTIN_DELAY	15000
+#define CUTIN_DELAY	5000
 #define SHRINK_DELAY	00500
 #define EXEC_DELAY  20000
 
Index: kit/parse.c
diff -u kit/parse.c:1.100 kit/parse.c:1.101
--- kit/parse.c:1.100	Fri May 20 12:45:23 2005
+++ kit/parse.c	Sun May 28 18:59:34 2006
@@ -26,7 +26,7 @@
  * SUCH DAMAGE.
  */
 /*
- * $Id: parse.c,v 1.100 2005/05/20 03:45:23 nishida Exp $
+ * $Id: parse.c,v 1.101 2006/05/28 09:59:34 nishida Exp $
  */
 
 #include "mgp.h"
@@ -1577,6 +1577,7 @@
 		break;
 	case CTL_SYSTEM:
 	case CTL_XSYSTEM:
+	case CTL_TSYSTEM:
 	case CTL_FILTER:
 		fprintf(stderr, "argc=%d term=%s flag=%d",
 			p->cta_argc,
@@ -1834,6 +1835,7 @@
 		return (a->cti_value == b->cti_value) ? 0 : 1;
 	case CTL_SYSTEM:
 	case CTL_XSYSTEM:
+	case CTL_TSYSTEM:
 	case CTL_FILTER:
 		return 1;
 	case CTL_IMAGE:
Index: kit/scanner.l
diff -u kit/scanner.l:1.25 kit/scanner.l:1.26
--- kit/scanner.l:1.25	Thu Jul  8 15:09:54 2004
+++ kit/scanner.l	Sun May 28 18:59:34 2006
@@ -27,7 +27,7 @@
  * SUCH DAMAGE.
  */
 /*
- * $Id: scanner.l,v 1.25 2004/07/08 06:09:54 nishida Exp $
+ * $Id: scanner.l,v 1.26 2006/05/28 09:59:34 nishida Exp $
  */
 /*
  * partly derived from lbl libpcap source code, which has the following
@@ -148,6 +148,7 @@
 (MARK|mark)		return KW_MARK;
 (SYSTEM|system)		return KW_SYSTEM;
 (XSYSTEM|xsystem)	return KW_XSYSTEM;
+(TSYSTEM|tsystem)	return KW_TSYSTEM;
 (FILTER|filter)		return KW_FILTER;
 (ENDFILTER|endfilter)	return KW_ENDFILTER;
 (BQUALITY|bquality)	return KW_QUALITY;
Index: kit/image/gif.h
diff -u kit/image/gif.h:1.2 kit/image/gif.h:removed
--- kit/image/gif.h:1.2	Mon Dec 28 17:23:03 1998
+++ kit/image/gif.h	Mon May 29 05:10:02 2006
@@ -1,72 +0,0 @@
-/* gif.h:
- *
- * gifin.h
- * kirk johnson
- * november 1989
- * external interface to gifin.c
- *
- * Copyright 1989 Kirk L. Johnson (see the included file
- * "kljcpyrght.h" for complete copyright information)
- */
-
-/*
- * gifin return codes
- */
-#define GIFIN_SUCCESS       0   /* success */
-#define GIFIN_DONE          1   /* no more images */
-
-#define GIFIN_ERR_BAD_SD   -1   /* bad screen descriptor */
-#define GIFIN_ERR_BAD_SEP  -2   /* bad image separator */
-#define GIFIN_ERR_BAD_SIG  -3   /* bad signature */
-#define GIFIN_ERR_EOD      -4   /* unexpected end of raster data */
-#define GIFIN_ERR_EOF      -5   /* unexpected end of input stream */
-#define GIFIN_ERR_FAO      -6   /* file already open */
-#define GIFIN_ERR_IAO      -7   /* image already open */
-#define GIFIN_ERR_NFO      -8   /* no file open */
-#define GIFIN_ERR_NIO      -9   /* no image open */
-
-/*
- * colormap indices 
- */
-
-#define GIF_RED  0
-#define GIF_GRN  1
-#define GIF_BLU  2
-
-/*
- * typedef BYTE for convenience
- */
-
-typedef unsigned char BYTE;
-
-static int gifin_open_file();
-static int gifin_open_image();
-static int gifin_get_pixel();
-#if 0
-static int gifin_close_image();
-#endif
-static int gifin_close_file();
-static int gifin_load_cmap();
-static int gifin_skip_extension();
-static int gifin_read_data_block();
-static int gifin_push_string();
-static void gifin_add_string();
-static void gifin_fatal();
-
-/* #defines, typedefs, and such
- */
-
-#define GIF_SIG      "GIF87a"
-#define GIF_SIG_89   "GIF89a"
-#define GIF_SIG_LEN  6          /* GIF signature length */
-#define GIF_SD_SIZE  7          /* GIF screen descriptor size */
-#define GIF_ID_SIZE  9          /* GIF image descriptor size */
-
-#define GIF_SEPARATOR   ','     /* GIF image separator */
-#define GIF_EXTENSION   '!'     /* GIF extension block marker */
-#define GIF_TERMINATOR  ';'     /* GIF terminator */
-
-#define STAB_SIZE  4096         /* string table size */
-#define PSTK_SIZE  4096         /* pixel stack size */
-
-#define NULL_CODE  -1           /* string table null code */
Index: kit/sample/cloud.gif
Index: kit/sample/dad.gif
Index: kit/sample/dns-jp.mgp
diff -u kit/sample/dns-jp.mgp:1.5 kit/sample/dns-jp.mgp:removed
--- kit/sample/dns-jp.mgp:1.5	Fri Sep  4 21:33:18 1998
+++ kit/sample/dns-jp.mgp	Mon May 29 05:10:02 2006
@@ -1,130 +0,0 @@
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-%%
-%%	This file is automatically created from the file
-%%	main.pre modified at Fri Jan 23 14:31:24 1998
-%%
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-%%
-%include "default.mgp"
-%% "noop" cancels definitions in default.mgp
-%default 1 left, size 7, fore "light yellow", back "blue4", font "standard", ccolor "white", vgap 35
-%default 2 noop
-%default 3 fore "white", bar "gray70", vgap 10
-%default 4 noop
-%tab 1 noop
-%tab 2 noop
-%tab 3 noop
-%%%
-%page
-%nodefault
-%fore "red", back "blue4", size 9, vgap 15
-%center, fore "yellow", font "thick"
-%ccolor "white"
-
-
-
-Root DNS `M' $B$K$D$$$F(B
-
-%size 6, fore "red", font "thick"
-$B2CF#(B   $BO/(B
-
-%size 5, fore "white", font "standard"
-$BEl5~Bg3XBg7?7W;;5!%;%s%?!<(B
-
-
-%font "typewriter"
-kato@wide.ad.jp
-%font "standard"
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-%page
-
-%back "blue4"
-  $B7P0^(B (1)
-%fore "red", size 6, font "thick"
-   $B!y(B Root DNS
-%fore "white", size 5, font "standard"
-       $B!&(B $B#9Bf$G1?MQ(B
-%fore "white", size 5, font "standard"
-          $B!](B $B#8Bf$,(B US
-          $B!](B Stockholm $B$K#1Bf(B
-%fore "white", size 5, font "standard"
-       $B!&(B $B:GBg$G#1#3Bf(B
-%fore "white", size 5, font "standard"
-          $B!](B $B%Q%1%C%HD9$N@)Ls(B
-%fore "red", size 6, font "thick"
-   $B!y(B Root DNS $B$N1?MQ4p=`(B
-%fore "white", size 5, font "standard"
-       $B!&(B RFC 2010
-       $B!&(B gTLD $B$H$N4X78(B
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-%page
-
-%back "blue4"
-  $B7P0^(B (2)
-%fore "red", size 6, font "thick"
-   $B!y(B IEPG $B$G3HD%$r8!F$(B
-   $B!y(B $B%h!<%m%C%QCO0h(B
-%fore "white", size 5, font "standard"
-       $B!&(B LINX $B$K?7@_(B : 1997 $BG/(B 4 $B7n(B
-%fore "white", size 5, font "standard"
-          $B!](B RIPE/NCC $B$,4IM}(B
-          $B!](B `K'
-%fore "red", size 6, font "thick"
-   $B!y(B $B%"%8%"B@J?MNCO0h(B
-%fore "white", size 5, font "standard"
-       $B!&(B NSPIXP-2 $B!'(B 1997 $BG/(B 8 $B7n(B
-%fore "white", size 5, font "standard"
-          $B!](B WIDE $B$,4IM}(B
-          $B!](B `M'
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-%page
-
-%back "blue4"
-  `M'
-%fore "red", size 6, font "thick"
-   $B!y(B $B9=@.(B
-%fore "white", size 5, font "standard"
-       $B!&(B $B#2Bf$N(B PentiumPro 200MHz
-       $B!&(B Primary/Backup$B!"(B $B<+F0@Z$jBX$((B
-%fore "red", size 6, font "thick"
-   $B!y(B Root-only $B%5!<%P(B
-%fore "white", size 5, font "standard"
-       $B!&(B 
-%cont, font "typewriter"
-202.12.27.33
-%font "standard"
-       $B!&(B 400 $B!A(B 500 query/sec
-%fore "red", size 6, font "thick"
-   $B!y(B $B1?MQ4IM}(B
-%fore "white", size 5, font "standard"
-       $B!&(B WIDE $B$*$h$S(B ISP $BM-;V(B
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-%page
-
-%back "blue4"
-  $B$*4j$$(B
-%fore "red", size 6, font "thick"
-   $B!y(B $B:G?7$N(B root.cache $B$NF~$l49$((B
-%fore "white", size 5, font "standard"
-       $B!&(B 
-%cont, font "typewriter"
-1997082200
-%fore "red", size 6, font "thick"
-   $B!y(B Named $B$N99?7(B
-%fore "white", size 5, font "standard"
-       $B!&(B 4.9.6/8.8.1
-%fore "red", size 6, font "thick"
-   $B!y(B $BM7$P$J$$$G!'(B
-%fore "white", size 5, font "standard"
-       $B!&(B 
-%cont, font "typewriter"
-ping/traceroute
-%font "standard"
-       $B!&(B 
-%cont, font "typewriter"
-telnet/spray/...
-%fore "red", size 6, font "thick"
-   $B!y(B Thanks to
-%fore "white", size 5, font "standard"
-       $B!&(B $BF|K\(B Cisco/$BB?$/$N(B ISP
-       $B!&(B `M' $B4IM}%0%k!<%W(B
Index: kit/sample/mgp-old1.gif
Index: kit/sample/mgp-old2.gif
Index: kit/sample/mgp-old3.gif
Index: kit/sample/mgp1.gif
Index: kit/sample/mgp2.gif
Index: kit/sample/mgp3.gif
Index: kit/sample/v6header.gif
