From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from bio.cse.psu.edu ([130.203.12.17]) by hawkwind.utcs.utoronto.ca with SMTP id <25108>; Tue, 15 Jun 1999 17:58:47 -0400 Received: (qmail 8334 invoked by uid 991); 15 Jun 1999 00:39:48 -0000 Message-ID: <19990615003948.8333.qmail@g.bio.cse.psu.edu> Date: Mon, 14 Jun 1999 20:39:48 -0400 To: "Mark H. Wilkinson" cc: Sam Fans , Bengt Kleberg Subject: Re: 9libs, new sam release, experimental wily release In-reply-to: Your message of "Mon, 14 Jun 1999 20:46:50 BST." <199906142046.20514.9libs.badum@kremvax.demon.co.uk> Date: Mon, 14 Jun 1999 20:39:48 -0400 From: Scott Schwartz "Mark H. Wilkinson" writes: | It looks like your patches hadn't made it into the Bell Labs source, | although I do remember some of them being posted to sam-fans. If you | forward them to Bengt and myself we'll get them integrated. Here they are. (Hopefully I haven't introduced any new problems today; I did tweak some things.) The program I use in my xinitrc to load the font property looks like this: #!/bin/rc F=``(){sed -e 's/$/ \\n\\/'} { echo -n '*p9font: ' echo $F echo -n '*p9fixed: ' echo $F } | xrdb -merge I use it like: load9font <$home/lib/unicode.9.font Wily users might want to do this slightly differently, since that requires a proportional font for one case. cd ./libXg =================================================================== RCS file: rdfontfile.c,v retrieving revision 1.1 diff -c -r1.1 rdfontfile.c *** /tmp/T0s0Qol_ Mon Jun 14 20:25:00 1999 --- rdfontfile.c Mon Jun 14 18:06:11 1999 *************** *** 13,27 **** return s; } ! Font * ! rdfontfile(char *name, int ldepth) { ! Font *fnt; ! Cachesubf *c; ! int fd, i; ! char *buf, *s, *t; struct stat sbuf; ! unsigned long min, max; fd = open(name, O_RDONLY); if (fd < 0) --- 13,25 ---- return s; } ! char * ! file2string(char* name) { ! int fd; struct stat sbuf; ! char *buf; ! int i; fd = open(name, O_RDONLY); if (fd < 0) *************** *** 44,54 **** free(buf); return 0; } ! s = buf; fnt = (Font *)malloc(sizeof(Font)); ! if (fnt == 0) ! goto Err1; memset((void*)fnt, 0, sizeof(Font)); fnt->name = (char *)malloc(strlen(name)+1); if (fnt->name==0) --- 42,73 ---- free(buf); return 0; } + return buf; + } ! Font * ! rdfontfile(char *name, int ldepth) ! { ! return rdfontstring(name, file2string(name), ldepth); ! } ! ! Font* ! rdfontstring(char *name, char *s, int ldepth) ! { ! Font *fnt; ! Cachesubf *c; ! int i; ! char *t; ! struct stat sbuf; ! unsigned long min, max; ! ! if (s == 0) ! return 0; fnt = (Font *)malloc(sizeof(Font)); ! if (fnt == 0) { ! Err1: ! return 0; ! } memset((void*)fnt, 0, sizeof(Font)); fnt->name = (char *)malloc(strlen(name)+1); if (fnt->name==0) *************** *** 97,117 **** c->min = min; c->max = max; t = s; ! while (*s && *s!='\n' && *s!='\t') s++; ! *s++ = 0; c->f = (Subfont *)0; ! c->name = (char *)malloc(strlen(t)+1); if (c->name == 0) { free(c); goto Err3; } ! strcpy(c->name, t); s = skip(s); fnt->nsubf++; } while(*s); - free(buf); return fnt; } --- 116,139 ---- c->min = min; c->max = max; t = s; ! while (*s && *s!='\n' && *s!='\t' && *s!=' ') s++; ! /* *s++ = 0; */ c->f = (Subfont *)0; ! c->name = (char *)malloc(s-t+1); if (c->name == 0) { free(c); goto Err3; } ! { int i; ! for (i = 0; i < s-t; ++i) c->name[i] = t[i]; ! c->name[i] = 0; ! } ! /* strcpy(c->name, t); */ s = skip(s); fnt->nsubf++; } while(*s); return fnt; } *************** *** 127,132 **** --- 149,155 ---- if (c->f) subffree(c->f); free(c->name); + free(c); } free(f->subf); free(f); =================================================================== RCS file: xtbinit.c,v retrieving revision 1.1 diff -c -r1.1 xtbinit.c *** /tmp/T0s0Qol_ Mon Jun 14 20:25:00 1999 --- xtbinit.c Mon Jun 14 17:24:10 1999 *************** *** 185,191 **** font = 0; subfont = 0; if (fontname) { ! font = rdfontfile(fontname, screen.ldepth); if (!font || charwidth(font, (Rune) ' ') == 0) { subfont = getsubfont(fontname); if (!subfont) --- 185,193 ---- font = 0; subfont = 0; if (fontname) { ! font = (fontname[0] == '.' || fontname[0] == '/') ! ? rdfontfile(fontname, screen.ldepth) ! : rdfontstring("p9font", fontname, screen.ldepth); if (!font || charwidth(font, (Rune) ' ') == 0) { subfont = getsubfont(fontname); if (!subfont) cd ./include =================================================================== RCS file: libg.h,v retrieving revision 1.1 diff -c -r1.1 libg.h *** /tmp/T0gdJVh_ Mon Jun 14 20:25:01 1999 --- libg.h Mon Jun 14 02:15:54 1999 *************** *** 201,206 **** --- 201,207 ---- extern int bitbltclip(void*); extern Subfont* getsubfont(char*); extern Font *rdfontfile(char*, int); + extern Font *rdfontstring(char*, char*, int); extern void ffree(Font*); extern Font *mkfont(Subfont*); extern void subffree(Subfont*); cd ./sam-9libs/sam =================================================================== RCS file: sam.c,v retrieving revision 1.1 diff -c -r1.1 sam.c *** /tmp/T002r2br Mon Jun 14 20:25:01 1999 --- sam.c Mon Jun 14 02:27:09 1999 *************** *** 151,157 **** continue; if(io == -1){ sprint(buf, "%s/sam.save", home); ! io = create(buf, 1, 0777); if(io<0) return; } --- 151,157 ---- continue; if(io == -1){ sprint(buf, "%s/sam.save", home); ! io = create(buf, 1, 0700); if(io<0) return; } =================================================================== RCS file: shell.c,v retrieving revision 1.1 diff -c -r1.1 shell.c *** /tmp/T002r2br Mon Jun 14 20:25:01 1999 --- shell.c Mon Jun 14 02:28:37 1999 *************** *** 34,40 **** remove(errfile); if((pid=fork()) == 0){ if(downloaded){ /* also put nasty fd's into errfile */ ! fd = create(errfile, 1, 0666L); if(fd < 0) fd = create("/dev/null", 1, 0666L); dup(fd, 2); --- 34,40 ---- remove(errfile); if((pid=fork()) == 0){ if(downloaded){ /* also put nasty fd's into errfile */ ! fd = create(errfile, 1, 0600L); if(fd < 0) fd = create("/dev/null", 1, 0666L); dup(fd, 2); cd ./sam-9libs/samterm =================================================================== RCS file: samterm.h,v retrieving revision 1.1 diff -c -r1.1 samterm.h *** /tmp/T00P2og_ Mon Jun 14 20:25:01 1999 --- samterm.h Mon Jun 14 17:51:13 1999 *************** *** 2,8 **** #define SAMTERM #define RUNESIZE sizeof(Rune) ! #define MAXFILES 256 #define NL 5 enum{ --- 2,8 ---- #define SAMTERM #define RUNESIZE sizeof(Rune) ! #define MAXFILES (4*1024) #define NL 5 enum{