[Commit] jove ChangeLog, 1.6, 1.7 daemon.c, 1.4, 1.5 insert.c, 1.8, 1.9 io.c, 1.5, 1.6 jove.c, 1.7, 1.8 jovedaemon.c, 1.1.1.1, 1.2 tune.h, 1.5, 1.6

Keith Packard commit at keithp.com
Sun Dec 19 17:13:43 PST 2004


Committed by: keithp

Update of /local/src/CVS/jove
In directory home.keithp.com:/tmp/cvs-serv23865

Modified Files:
	ChangeLog daemon.c insert.c io.c jove.c jovedaemon.c tune.h 
Log Message:
2004-12-19  Keith Packard  <keithp at keithp.com>

	* daemon.c: (InitDaemon), (closeDown), (StopDaemon), (CloseDaemon):
	* jovedaemon.c:
	Fix daemon stuff
	* doc/.joverc:
	i/d is now disabled by default
	* insert.c: (NextComposeSequence):
	Add more compose sequences.
	* io.c: (dfollow):
	use dfollow when auto-pushing tags to get absolute path names
	* jove.c: (terminchar):
	* tune.h:


Index: ChangeLog
===================================================================
RCS file: /local/src/CVS/jove/ChangeLog,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -d -r1.6 -r1.7
--- ChangeLog	28 Oct 2004 15:17:24 -0000	1.6
+++ ChangeLog	20 Dec 2004 01:13:39 -0000	1.7
@@ -1,3 +1,17 @@
+2004-12-19  Keith Packard  <keithp at keithp.com>
+
+	* daemon.c: (InitDaemon), (closeDown), (StopDaemon), (CloseDaemon):
+	* jovedaemon.c:
+	Fix daemon stuff
+	* doc/.joverc:
+	i/d is now disabled by default
+	* insert.c: (NextComposeSequence):
+	Add more compose sequences.
+	* io.c: (dfollow):
+	use dfollow when auto-pushing tags to get absolute path names
+	* jove.c: (terminchar):
+	* tune.h:
+
 2004-10-28  Keith Packard  <keithp at keithp.com>
 
 	* man.c:

Index: daemon.c
===================================================================
RCS file: /local/src/CVS/jove/daemon.c,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- daemon.c	15 May 2003 06:01:20 -0000	1.4
+++ daemon.c	20 Dec 2004 01:13:39 -0000	1.5
@@ -23,11 +23,15 @@
  */
 
 extern fd_set	global_fd;
+extern int	max_fd;
 
-fd_set	WatchMask;
 int	WatchDaemon;
 int	WatchFd;
 int	WatchLock;
+fd_set	WatchMask;
+
+static void
+closeDown (int fd);
 
 struct monitoring {
 	struct monitoring	*next;
@@ -58,9 +62,12 @@
 			mon->next = monitoring;
 			monitoring = mon;
 			mon->fd = new;
+			FD_SET(new, &global_fd);
+			FD_SET(new, &WatchMask);
+			if (new > max_fd)
+				max_fd = new;
 			mon->name[0] = '\0';
 			mon->count = 0;
-			FD_SET(new, &WatchMask);
 		}
 	} else {
 		len = read (fd, fileName, sizeof (fileName));
@@ -122,37 +129,31 @@
 	    sizeof (address.sun_family) + strlen (address.sun_path) + 1) == -1)
 		complain ("bind to %s failed", address.sun_path);
 	listen (WatchFd, 5);
+	FD_SET (WatchFd, &global_fd);
+	FD_SET (WatchFd, &WatchMask);
+	if (WatchFd > max_fd)
+		max_fd = WatchFd;
 	WatchDaemon = 1;
 }
 
-closeDown (fd)
+static void
+closeDown (int fd)
 {
-	struct monitoring	*m, *p, *n;
+	struct monitoring	**p, *m;
 
-	if (fd == 0) {
-		for (m = monitoring; m; m = n) {
-			n = m->next;
-			FD_CLR (m->fd, &WatchMask);
+	for (p = &monitoring; m = *p;) {
+		if (fd == 0 || fd == m->fd) {
+			*p = m->next;
 			FD_CLR (m->fd, &global_fd);
-			Watch
-			WatchMask &= ~(1 << m->fd);
+			FD_CLR (m->fd, &WatchMask);
 			close (m->fd);
+			if (m->fd == max_fd)
+				while (--max_fd)
+					if (FD_ISSET (max_fd, &global_fd))
+						break;
 			free (m);
-		}
-		monitoring = 0;
-	} else {
-		p = 0;
-		for (m = monitoring; m; m = n) {
-			n = m->next;
-			if (m->fd == fd) {
-				WatchMask &= ~(1 << m->fd);
-				close (m->fd);
-				if (p)
-					p->next = n;
-				else
-					monitoring = n;
-			}
-		}
+		} else
+			p = &m->next;
 	}
 }
 
@@ -160,17 +161,21 @@
 {
 	if (WatchFd) {
 		closeDown (0);
+		FD_CLR (WatchFd, &global_fd);
+		FD_CLR (WatchFd, &WatchMask);
 		close (WatchFd);
+		if (WatchFd == max_fd)
+			while (--max_fd)
+				if (FD_ISSET (max_fd, &global_fd))
+					break;
 		close (WatchLock);
 	}
-	WatchMask = 0;
 	WatchDaemon = 0;
 	WatchFd = 0;
 }
 
 CloseDaemon ()
 {
-	char	*ask();
 	char	*name;
 	struct monitoring	*mon;
 	char	**names;

Index: insert.c
===================================================================
RCS file: /local/src/CVS/jove/insert.c,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -d -r1.8 -r1.9
--- insert.c	27 Oct 2004 17:58:21 -0000	1.8
+++ insert.c	20 Dec 2004 01:13:39 -0000	1.9
@@ -465,7 +465,7 @@
 char	ComposeSequences[V_STRING_LEN] = 
 /* Latin 1 Supplement */
 "!:¡|c:¢#:£$:¤y:¥| :¦ss:§\" :¨cr:©_a:ª<<:«~ :¬- :­rc:®__:¯"
-". :°+-:±1 :¹2 :²3 :³' :´,u:µpp:¶ .:·, :¸m:º>>:»14:¼12:½34:¾?:¿"
+". :°+-:±^1:¹^2:²^3:³' :´,u:µpp:¶ .:·, :¸m:º>>:»14:¼12:½34:¾?:¿"
 "`A:À'A:Á^A:Â~A:Ã\"A:Ä.A:ÅAE:Æ,C:Ç`E:È'E:É^E:Ê\"E:Ë`I:Ì'I:Í^I:Î\"I:Ï"
 "-D:Ð~N:Ñ`O:Ò'O:Ó^O:Ô~O:Õ\"O:Ö* :×/O:Ø`U:Ù'U:Ú^U:Û\"U:Ü'Y:ÝTR:ÞSS:ß"
 "`a:à'a:á^a:â~a:ã\"a:ä.a:åae:æ,c:ç`e:è'e:é^e:ê\"e:ë`i:ì'i:í^i:î\"i:ï"
@@ -475,18 +475,25 @@
 /* Greek */
 "AL:ΑBE:ΒGA:ΓDE:ΔEP:ΕZE:ΖET:ΗTH:ΘIO:ΙKA:ΚLA:ΛMU:ΜNU:ΝXI:ΞON:ΟPI:ΠRH:ΡSI:ΣTA:ΤUP:ΥPH:ΦCH:ΧPS:ΨOM:Ω"
 "al:αbe:βga:γde:δep:εze:ζet:ηth:θio:ιka:κla:λmu:μnu:νxi:ξon:οpi:πrh:ρsi:σta:τup:υph:φch:χps:ψom:ω"
-/* Currency Symbols */
-"/C:₡CR:₢=F:₣=L:₤/m:₥=N:₦=P:₧=R:₨=W:₩=S:₪=d:₫=C:€=K:₭=T:₮=D:₯=f:₰"
 /* General punctuation, preceded by a space in some cases */
 "||:‖__:‗ `:‘ ':’ ,:‚``:“'':”,,:„+ :†++:‡o :•..:…%:‰ <:‹ >:›"
+/* Superscripts and Subscripts */
+"^0:⁰^i:ⁱ^4:⁴^5:⁵^6:⁶^7:⁷^8:⁸^9:⁹^+:⁺^-:⁻^=:⁼^(:⁽^):⁾^n:ⁿ"
+"_0:₀_1:₁_2:₂_3:₃_4:₄_5:₅_6:₆_7:₇_8:₈_9:₉_+:₊_-:₋_=:₌_(:₍_):₎"
+/* Currency Symbols */
+"/C:₡CR:₢=F:₣=L:₤/m:₥=N:₦=P:₧=R:₨=W:₩=S:₪=d:₫=C:€=K:₭=T:₮=D:₯=f:₰"
 /* Letterlike Sybols */
 "tm:â„¢"
+/* Number forms */
+"13:⅓23:⅔15:⅕25:⅖35:⅗45:⅘16:⅙56:⅚18:⅛38:⅜58:⅝78:⅞"
 /* Arrows */
 "->:→<-:←|^:↑|v:↓<=:⇐=>:⇒=^:⇑=v:⇓<~:⇜~>:⇝"
 /* Mathematical operators */
 "V-:∀di:∂ E:∃/E:∄ /:∕sq:√oo:∞in:∫~~:≈/=:≠<=:≤>=:≥ -:− ~:∼ |:∣/|:∤||:∥=~:≂~=:≃"
 /* Geometric Shapes */
 "<>:â—Š"
+/* Miscellaneous Symbols */
+":(:☹:):☺"
 /* Alphabetic Presentation Forms */
 "fi:fifl:fl"
 ;
@@ -495,10 +502,11 @@
 NextComposeSequence (char *compose)
 {
 	ucs4	c;
+	int	first = 1;
 	if (!compose)
 		return 0;
-	while ((c = next_ucs4 (&compose)) && c != ':')
-	    ;
+	while ((c = next_ucs4 (&compose)) && (first || c != ':'))
+	    first = 0;
 	if (!c)
 	    return 0;
 	return buf_next (compose);

Index: io.c
===================================================================
RCS file: /local/src/CVS/jove/io.c,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -d -r1.5 -r1.6
--- io.c	20 Oct 2004 05:26:40 -0000	1.5
+++ io.c	20 Dec 2004 01:13:39 -0000	1.6
@@ -26,6 +26,9 @@
 private int	tellall;	/* display file io info? */
 private int	readonly;	/* last file opened readonly */
 
+private
+dfollow(char *file, char *into);
+
 #ifdef VMUNIX
 char	genbuf[LBSIZE],
 	linebuf[LBSIZE];
@@ -263,7 +266,7 @@
 RealCD (newdir, miniadd)
 char	*newdir;
 {
-	char	tag_file;
+	char	tag_file[FILESIZE];
 
 	if (!strcmp (newdir, PWD))
 		return;
@@ -277,7 +280,10 @@
 	UpdModLine++;
 	setCWD (newdir);
 	if (AutoPushTag)
-		AddTagFile ("tags", FALSE);
+	{
+		dfollow ("tags", tag_file);
+		AddTagFile (tag_file, FALSE);
+	}
 }
 
 #ifndef IPROCS
@@ -415,9 +421,7 @@
 }
 
 private
-dfollow(file, into)
-char	*file,
-	*into;
+dfollow(char *file, char *into)
 {
 	char	*dp,
 		*sp,

Index: jove.c
===================================================================
RCS file: /local/src/CVS/jove/jove.c,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -d -r1.7 -r1.8
--- jove.c	18 Oct 2004 04:31:16 -0000	1.7
+++ jove.c	20 Dec 2004 01:13:39 -0000	1.8
@@ -192,16 +192,16 @@
 	extern fd_set	global_fd;
 	extern int	NumProcs,
 			max_fd,
-#ifdef JDAEMON
-			WatchDaemon,
-			WatchMask,
-			WatchFd,
-#endif
 			errno;
 	register int	tmp,
 			nfds;
 	fd_set		reads;
 	int		fd;
+#ifdef JDAEMON
+	extern int    	WatchDaemon;
+	extern int    	WatchFd;
+	extern fd_set	WatchMask;
+#endif
 
 	if (nchars <= 0) {
 		/* Get a character from the keyboard, first checking for
@@ -216,11 +216,7 @@
  		{
 			do {
 				do {
-#ifdef JDAEMON
-					reads = global_fd | WatchMask;
-#else
 					reads = global_fd;
-#endif
 					nfds = select(max_fd+1, &reads, (fd_set *) 0, (fd_set *) 0, (struct timeval *) 0);
 				} while (nfds < 0 && errno == EINTR);
 
@@ -228,6 +224,9 @@
 				case -1:
 					printf("\rerror %d in select", errno);
 					FD_ZERO (&global_fd);
+#ifdef JDAEMON
+					global_fd = WatchMask;
+#endif
 					FD_SET (0, &global_fd);
 					break;
 				default:
@@ -242,12 +241,11 @@
 					{
 						if (FD_ISSET (fd, &reads)) {
 #ifdef JDAEMON
-							if (WatchMask & bit)
-								jdaemon (tmp);
+							if (FD_ISSET (fd, &WatchMask))
+								jdaemon (fd);
 							else
-#endif							
+#endif
 							read_proc(fd);
-							FD_CLR (fd, &reads);
 							nfds--;
 						}
 					}

Index: jovedaemon.c
===================================================================
RCS file: /local/src/CVS/jove/jovedaemon.c,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -d -r1.1.1.1 -r1.2
--- jovedaemon.c	10 Mar 2001 12:23:12 -0000	1.1.1.1
+++ jovedaemon.c	20 Dec 2004 01:13:39 -0000	1.2
@@ -5,7 +5,7 @@
  */
 
 #include "tune.h"
-#ifndef SYSV
+#ifdef JDAEMON
 # include	<sys/types.h>
 # include	<sys/socket.h>
 # include	<sys/un.h>
@@ -14,11 +14,10 @@
 main (argc, argv)
 char	**argv;
 {
-#ifndef SYSV
+#ifdef JDAEMON
 	char	*home, *getenv();
 	struct sockaddr_un	address;
 	int	s;
-	int	reads;
 	char	pathname[1024];
 	char	wd[1024];
 	int	gotwd = 0;
@@ -28,8 +27,8 @@
 	sprintf (address.sun_path, "%s/.joved", home);
 	address.sun_family = AF_UNIX;
 	s = socket (AF_UNIX, SOCK_STREAM, 0);
-	connect (s, &address, sizeof (address.sun_family) +
-			strlen (address.sun_path) + 1);
+	connect (s, (struct sockaddr *) &address, 
+		 sizeof (address.sun_family) + strlen (address.sun_path) + 1);
 	while (*++argv) {
 		if (**argv == '-') {
 			switch (*++*argv) {
@@ -41,7 +40,7 @@
 			write (s, *argv, strlen (*argv) + 1);
 		else {
 			if (!gotwd) {
-				(void) getwd (wd);
+				(void) getcwd (wd, sizeof (wd));
 				strcat (wd, "/");
 				gotwd = 1;
 			}
@@ -51,8 +50,10 @@
 		}
 	}
 	if (!leave) {
-		reads = 1 << s;
-		select (reads+1, &reads, (int *) 0, (int *) 0, (struct timeval *) 0);
+		fd_set	reads;
+		FD_ZERO(&reads);
+		FD_SET(s, &reads);
+		select (s+1, &reads, (fd_set *) 0, (fd_set *) 0, (struct timeval *) 0);
 	}
 #endif
 	exit (0);

Index: tune.h
===================================================================
RCS file: /local/src/CVS/jove/tune.h,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -d -r1.5 -r1.6
--- tune.h	20 Oct 2004 05:26:40 -0000	1.5
+++ tune.h	20 Dec 2004 01:13:39 -0000	1.6
@@ -116,7 +116,7 @@
 #       define WIRED_TERMS	/* include code for wired terminals */
 #       define ANSICODES	/* extra commands that process ANSI codes */
 #	ifdef BSD4_2
-/* #		define JDAEMON	/* support unix domain socket for daemon */
+#		define JDAEMON	/* support unix domain socket for daemon */
 #	endif
 #   endif
 #   define LISP			/* include the code for Lisp Mode */




More information about the Commit mailing list