FreeBSD用のパッチをもとに、NEWS-OS Release 4.2.1でコンパイルできるように しました。 mallocはGNU mallocを使います。 hiraga@meis.sony.co.jp diff -crP dserver/Makefile dserver2.1-newsos4/Makefile *** dserver/Makefile Thu Jan 1 09:00:00 1970 --- dserver2.1-newsos4/Makefile Tue Aug 20 00:17:59 1996 *************** *** 0 **** --- 1,8 ---- + all: + (cd server2.1; ${MAKE} all) + (cd clients/kenjiro; ${MAKE} all) + (cd clients/diclookup-mule-2.3.0; ${MAKE} all) + install: + (cd server2.1; ${MAKE} install) + (cd clients/kenjiro; ${MAKE} install) + (cd clients/diclookup-mule-2.3.0; ${MAKE} install) diff -crP dserver/clients/kenjiro/Makefile dserver2.1-newsos4/clients/kenjiro/Makefile *** dserver/clients/kenjiro/Makefile Tue Jun 27 01:21:31 1995 --- dserver2.1-newsos4/clients/kenjiro/Makefile Tue Aug 20 11:18:44 1996 *************** *** 1,5 **** --- 1,6 ---- CFLAGS = -O # for termcap #CFLAGS = -O -DTERMIO # for termio + #CFLAGS = -O -DTERMIOS # for termios # if you have no bcopy sigmask sigblock (e.g. on Solaris 2.x) # define NO_BCOPY NO_SIGMASK NO_SIGBLOCK like *************** *** 15,20 **** --- 16,25 ---- all: kenjiro kenjiro.l + install: all + install -s kenjiro /usr/local/bin/ + cp kenjiro.l /usr/local/man/ja_JP.EUC/manl/ + kenjiro: $(OBJS) $(CC) $(CFLAGS) -o kenjiro $(OBJS) $(LIBS) *************** *** 30,35 **** ln -s filter.c.euc filter.c clean: ! rm -f *.o *.out kenjiro.l kenjiro core typescript # DO NOT DELETE --- 35,40 ---- ln -s filter.c.euc filter.c clean: ! rm -f *.o *.out kenjiro.l* kenjiro core typescript # DO NOT DELETE Only in dserver/clients/kenjiro: Makefile.bak diff -crP dserver/clients/kenjiro/config.h dserver2.1-newsos4/clients/kenjiro/config.h *** dserver/clients/kenjiro/config.h Tue Jun 27 01:21:34 1995 --- dserver2.1-newsos4/clients/kenjiro/config.h Tue Aug 20 00:17:58 1996 *************** *** 1,7 **** ! #define PAGER "/usr/local/bin/less" /* pager program */ #define HISTSIZE 20 /* history size */ #define KOUHO 10 /* number of kouho (0 < n <= 10) */ ! #define SERVER "dserver" /* hostname with server */ #define SERVICE "ndtp" /* service name */ #define KANJICODE JIS /* default kanji code (JIS,EUC,SJIS)*/ /*#define PORT 2010*/ /* port of service */ --- 1,7 ---- ! #define PAGER "/usr/local/bin/jless" /* pager program */ #define HISTSIZE 20 /* history size */ #define KOUHO 10 /* number of kouho (0 < n <= 10) */ ! #define SERVER "localhost" /* hostname with server */ #define SERVICE "ndtp" /* service name */ #define KANJICODE JIS /* default kanji code (JIS,EUC,SJIS)*/ /*#define PORT 2010*/ /* port of service */ *************** *** 15,20 **** { "eiwa" , "研究社英和" , ENG , }, { "waei" , "研究社和英" , JPN , }, { "kojien" , "広辞苑" , JPN , }, { "CDkojien" , "CD広辞苑" , JPN , }, ! { "readers" , "リーダーず英和" , ENG , }, }; --- 15,21 ---- { "eiwa" , "研究社英和" , ENG , }, { "waei" , "研究社和英" , JPN , }, { "kojien" , "広辞苑" , JPN , }, + { "kojien-furoku" , "広辞苑付録", JPN , }, { "CDkojien" , "CD広辞苑" , JPN , }, ! { "readers" , "リーダーズ英和" , ENG , }, }; diff -crP dserver/clients/kenjiro/kenjiro.h dserver2.1-newsos4/clients/kenjiro/kenjiro.h *** dserver/clients/kenjiro/kenjiro.h Tue Jun 27 01:21:31 1995 --- dserver2.1-newsos4/clients/kenjiro/kenjiro.h Tue Aug 20 00:17:59 1996 *************** *** 41,47 **** #define F(n) (1 << n) typedef struct { ! char name[10]; unsigned char prompt[25]; int inputmode; int filter; --- 41,47 ---- #define F(n) (1 << n) typedef struct { ! char name[16]; unsigned char prompt[25]; int inputmode; int filter; diff -crP dserver/clients/kenjiro/sub.c dserver2.1-newsos4/clients/kenjiro/sub.c *** dserver/clients/kenjiro/sub.c Tue Jun 27 01:21:31 1995 --- dserver2.1-newsos4/clients/kenjiro/sub.c Tue Aug 20 00:17:58 1996 *************** *** 1,6 **** --- 1,11 ---- #include "kenjiro.h" static int sttylevel = 0; + #ifdef TERMIOS + #include + #include + static struct termios ttyorg, ttynew; + #else /* TERMIOS */ #ifdef TERMIO #include #include *************** *** 10,15 **** --- 15,21 ---- static struct tchars tcorg, tcnew; #endif static struct ltchars ltcorg, ltcnew; + #endif /* TERMIOS */ int numk; int mode; int fd1 = 0; *************** *** 31,36 **** --- 37,62 ---- ttynew.c_cc[VQUIT] = 0; if (ioctl(0, TCSETA, &ttynew) < 0) return; #else + # ifdef TERMIOS + if (tcgetattr(0, &ttyorg) < 0) return; + ttynew = ttyorg; + ttynew.c_lflag &= ~ECHO; + ttynew.c_lflag &= ~ICANON; + ttynew.c_cc[VMIN] = 1; + ttynew.c_cc[VTIME] = 0; + ttynew.c_cc[VQUIT] = 0; + ttynew.c_cc[VLNEXT] = _POSIX_VDISABLE; + #if defined(VDSUSP) + ttynew.c_cc[VDSUSP] = _POSIX_VDISABLE; + #else /* VDSUSP */ + # if defined(VEOL) + ttynew.c_cc[VEOL] = _POSIX_VDISABLE; + # endif /* VEOL */ + #endif /* VDSUSP */ + sttylevel++; + if (tcsetattr(0, TCSANOW, &ttynew) < 0) return; + sttylevel++; + # else /* TERMIOS */ if (ioctl(0, TIOCGETP, &ttyorg) < 0) return; ttynew = ttyorg; ttynew.sg_flags |= CBREAK; *************** *** 41,47 **** --- 67,75 ---- tcnew = tcorg; tcnew.t_quitc = -1; if (ioctl(0, TIOCSETC, &tcnew) < 0) return; + # endif /* TERMIOS */ #endif + #ifndef TERMIOS sttylevel++; if (ioctl(0, TIOCGLTC, <corg) < 0) return; ltcnew = ltcorg; *************** *** 49,54 **** --- 77,83 ---- ltcnew.t_dsuspc = -1; if (ioctl(0, TIOCSLTC, <cnew) < 0) return; sttylevel++; + #endif /* TERMIOS */ } void romakana_fixtty() *************** *** 60,71 **** --- 89,106 ---- case 1: ioctl(0, TCSETA, &ttyorg); #else + # ifdef TERMIOS + case 2: + case 1: + tcsetattr(0, TCSANOW, &ttyorg); + # else /* TERMIOS */ case 3: ioctl(0, TIOCSLTC, <corg); case 2: ioctl(0, TIOCSETC, &tcorg); case 1: ioctl(0, TIOCSETP, &ttyorg); + # endif /* TERMIOS */ #endif } } *************** *** 128,134 **** void getttyval() { ! #ifdef TERMIO struct winsize ws; ioctl(0, TIOCGWINSZ, &ws); --- 163,169 ---- void getttyval() { ! #if defined(TERMIO) || defined(TERMIOS) struct winsize ws; ioctl(0, TIOCGWINSZ, &ws); Only in dserver/clients/xdic: Imakefile.orig Only in dserver/clients/xdic: Xdic.ad.orig Only in dserver/clients/xdic: dscon.c.orig Only in dserver/clients/xdic: patchlevel.h.orig Only in dserver/clients/xdic: xdic.c.orig diff -crP dserver/server2.1/Makefile dserver2.1-newsos4/server2.1/Makefile *** dserver/server2.1/Makefile Thu Oct 19 13:03:31 1995 --- dserver2.1-newsos4/server2.1/Makefile Tue Aug 20 17:24:17 1996 *************** *** 1,34 **** OBJ=main.o daemon.o access.o access_inet.o subnet.o lookup.o util.o CC=cc ! DSERVERTOPDIR=/usr/local/etc/dserverdir ACCESSFILE=${DSERVERTOPDIR}/dserver_access ! BINDIR=/usr/local/lib ! LISPLIB=/usr/local/lib/Nemacs/lisp #usui DEFS=-D'ACCESSFILE="$(ACCESSFILE)"' \ -D'DSERVERTOPDIR="$(DSERVERTOPDIR)"' ! OFLAG= ! #OFLAG=-O #OFLAG=-g #CFLAGS= $(OFLAG) -DSTANDALONE $(DEFS) -DDEBUG -DSYSLOG ! CFLAGS=-Dsparc $(OFLAG) -DSYSLOG -DSTANDALONE $(DEFS) #CFLAGS=-Dsparc $(OFLAG) -DSYSLOG $(DEFS) #CFLAGS= $(OFLAG) $(DEFS) -DSYSLOG #CFLAGS=-Dsparc $(OFLAG) -DSTANDALONE $(DEFS) #CFLAGS=-Dsparc $(OFLAG) $(DEFS) #CFLAGS=-Dsparc $(OFLAG) -DSYSLOG $(DEFS) all: dserver dserver: $(OBJ) ! $(CC) $(CFLAGS) -o dserver $(OBJ) $(OBJ): clean: rm -f *.o core dserver *~ bytecmp.el lint: lint -Dsparc -DSTANDALONE -DSYSLOG $(DEFS) *.c ! install: ! install -m 755 dserver $(BINDIR) --- 1,39 ---- OBJ=main.o daemon.o access.o access_inet.o subnet.o lookup.o util.o CC=cc ! DSERVERTOPDIR=/usr/local/dict/dserver ACCESSFILE=${DSERVERTOPDIR}/dserver_access ! BINDIR=${DSERVERTOPDIR} ! LISPLIB=/usr/local/lib/mule/site-lisp #usui DEFS=-D'ACCESSFILE="$(ACCESSFILE)"' \ -D'DSERVERTOPDIR="$(DSERVERTOPDIR)"' ! #OFLAG= -O2 ! OFLAG=-O #OFLAG=-g #CFLAGS= $(OFLAG) -DSTANDALONE $(DEFS) -DDEBUG -DSYSLOG ! #CFLAGS=-Dsparc $(OFLAG) -DSYSLOG -DSTANDALONE $(DEFS) #CFLAGS=-Dsparc $(OFLAG) -DSYSLOG $(DEFS) #CFLAGS= $(OFLAG) $(DEFS) -DSYSLOG #CFLAGS=-Dsparc $(OFLAG) -DSTANDALONE $(DEFS) #CFLAGS=-Dsparc $(OFLAG) $(DEFS) #CFLAGS=-Dsparc $(OFLAG) -DSYSLOG $(DEFS) + CFLAGS= $(OFLAG) -DSTANDALONE $(DEFS) all: dserver dserver: $(OBJ) ! # $(CC) $(CFLAGS) -o dserver $(OBJ) -lmalloc ! $(CC) $(CFLAGS) -o dserver -L/usr/local/lib $(OBJ) -lmalloc $(OBJ): clean: rm -f *.o core dserver *~ bytecmp.el lint: lint -Dsparc -DSTANDALONE -DSYSLOG $(DEFS) *.c ! install: all ! if [ ! -d /usr/local/dict/dserver/cdrom ] ; then mkdir /usr/local/dict/dserver/cdrom ; fi ! install -s -m 755 dserver $(BINDIR) ! cp README.standalone newfeature.doc ${DSERVERTOPDIR} ! cp table/*.tbl table/dserver_access ${DSERVERTOPDIR} diff -crP dserver/server2.1/access.c dserver2.1-newsos4/server2.1/access.c *** dserver/server2.1/access.c Tue Jun 27 01:20:50 1995 --- dserver2.1-newsos4/server2.1/access.c Tue Aug 20 00:17:57 1996 *************** *** 32,38 **** register FILE *acs_fp; #ifdef DEBUG ! return; #endif sockt = s; --- 32,38 ---- register FILE *acs_fp; #ifdef DEBUG ! return 0; #endif sockt = s; diff -crP dserver/server2.1/daemon.c dserver2.1-newsos4/server2.1/daemon.c *** dserver/server2.1/daemon.c Tue Jun 27 01:20:50 1995 --- dserver2.1-newsos4/server2.1/daemon.c Tue Aug 20 10:28:32 1996 *************** *** 6,16 **** --- 6,19 ---- */ #include + #include #include #include #include #include #include + #include + #include #include "config.h" *************** *** 27,35 **** #include "ndtp.h" #include "misc.h" - #ifdef DEBUG extern int debug; - #endif ENV env[MAXUSER]; --- 30,36 ---- *************** *** 53,59 **** int default_idle_limit=600; Dict *select_dict(); ! client_wants_talk(); iserver_init() { --- 54,60 ---- int default_idle_limit=600; Dict *select_dict(); ! int client_wants_talk(); iserver_init() { *************** *** 86,92 **** exit(1); } ! if( bind(ls, &myaddr_in, sizeof(struct sockaddr_in)) == -1) { #ifdef SYSLOG syslog(LOG_ERR,"Unable to bind address /iserver_init\n"); #endif --- 87,93 ---- exit(1); } ! if( bind(ls, (struct sockaddr *)&myaddr_in, sizeof(struct sockaddr_in)) == -1) { #ifdef SYSLOG syslog(LOG_ERR,"Unable to bind address /iserver_init\n"); #endif *************** *** 117,123 **** addrlen = sizeof(struct sockaddr_in); bzero((char *)&peeraddr_in, addrlen); ! s = accept(ls, &peeraddr_in, &addrlen); if(s==-1) { #ifdef SYSLOG syslog(LOG_ERR,"Unable to accept /iserver_accept\n"); --- 118,124 ---- addrlen = sizeof(struct sockaddr_in); bzero((char *)&peeraddr_in, addrlen); ! s = accept(ls, (struct sockaddr *)&peeraddr_in, &addrlen); if(s==-1) { #ifdef SYSLOG syslog(LOG_ERR,"Unable to accept /iserver_accept\n"); *************** *** 179,184 **** --- 180,187 ---- } } for(client_num=0; client_numdict_num=dict_num; ! env_p->dict=&(dict_set[dict_num].dict); dict_set[dict_num].users++; write(s,"$*\n",3); } --- 384,391 ---- } else { /* chage dict /* decrement old dict_set.users /* increment new dict_set.users */ ! env_p->dict_num = dict_num; ! env_p->dict = &(dict_set[dict_num].dict); dict_set[dict_num].users++; write(s,"$*\n",3); } *************** *** 475,481 **** if (*line!='#') continue; if (!strncmp(line,"#DICT ",6)){ ! i=++last_dict; sscanf(line, "#DICT %s %s %s %d %d" ,name ,filename --- 478,484 ---- if (*line!='#') continue; if (!strncmp(line,"#DICT ",6)){ ! i = ++last_dict; sscanf(line, "#DICT %s %s %s %d %d" ,name ,filename *************** *** 792,801 **** int k,l ; HIC *r ,*q; LOC *t ,*s; ! int j,i,m={0,0,0}; CTBL cctbl; /* current conv table */ for(i=1 ; i<=last_dict ; i++ ){ if ( !dict_set[i].mount ) continue; --- 795,806 ---- int k,l ; HIC *r ,*q; LOC *t ,*s; ! int j,i,m; CTBL cctbl; /* current conv table */ + j = i = m = 0; + for(i=1 ; i<=last_dict ; i++ ){ if ( !dict_set[i].mount ) continue; *************** *** 825,831 **** while (fgets(line, sizeof(line), tbl_fp) != NULL) { if (!strncmp(line,"hi=1byte",8)){ k=cctbl.hmax++; ! (r+k)->highcode='0x23'; (r+k)->lmax=0; (r+k)->lowp =(LOC *)malloc( sizeof(LOC)*256); } else if (!strncmp(line,"hi=",3)){ --- 830,836 ---- while (fgets(line, sizeof(line), tbl_fp) != NULL) { if (!strncmp(line,"hi=1byte",8)){ k=cctbl.hmax++; ! (r+k)->highcode=0x23; (r+k)->lmax=0; (r+k)->lowp =(LOC *)malloc( sizeof(LOC)*256); } else if (!strncmp(line,"hi=",3)){ diff -crP dserver/server2.1/dict.h dserver2.1-newsos4/server2.1/dict.h *** dserver/server2.1/dict.h Tue Jun 27 01:20:50 1995 --- dserver2.1-newsos4/server2.1/dict.h Tue Aug 20 00:17:57 1996 *************** *** 8,14 **** #define HALF 1 #define FULL 0 ! typedef struct { unsigned int type; unsigned int start; struct Index *next; --- 8,14 ---- #define HALF 1 #define FULL 0 ! typedef struct Index { unsigned int type; unsigned int start; struct Index *next; *************** *** 17,22 **** --- 17,28 ---- typedef struct { FILE *stream; Index *index; + int compressed; + char *buf; + int buffered; + unsigned long *comp_tab, comp_seek; + int frm, nfrm; + long ofs; } Dict; typedef struct { diff -crP dserver/server2.1/lookup.c dserver2.1-newsos4/server2.1/lookup.c *** dserver/server2.1/lookup.c Thu Nov 9 22:37:31 1995 --- dserver2.1-newsos4/server2.1/lookup.c Tue Aug 20 00:17:56 1996 *************** *** 194,199 **** --- 194,311 ---- } } + /* extracted from cdio.c in dic023.lzh */ + decode(buf, len, fp) + char *buf; + FILE *fp; + { + int i, n, c, d, bit; + + n = 0; + while ( n < len && (bit = getc(fp)) != EOF ) { + for ( i = 1 ; i < 0x100 && n < len ; i <<= 1 ) { + if ( (bit & i) == 0 ) { + if ( (c = getc(fp)) == EOF || (d = getc(fp)) == EOF ) + break; + d |= (c << 8); + c = ((d & 0x1F) + 3); + d >>= 5; d &= 0x7FF; + while ( c-- > 0 && n < len ) + buf[n++] = buf[d++]; + } else { + if ( (c = getc(fp)) == EOF ) + break; + buf[n++] = c; + } + } + } + + return n; + } + + readframe(dict) + Dict *dict; + { + unsigned long ofs, sect; + sect = dict->frm - 1; + if (dict->comp_seek != (sect & 0xffffff00L)) { + dict->comp_seek = (sect & 0xffffff00L); + fseek(dict->stream, dict->comp_seek*sizeof(long) + 4L, 0); + fread(dict->comp_tab, sizeof(long), 256, dict->stream); + } + fseek(dict->stream, dict->comp_tab[sect & 0xff], 0); + decode(dict->buf, FRAMESIZE, dict->stream); + dict->buffered = 1; + } + + dict_seek(dict,ofs) + Dict *dict; + long ofs; + { + if (dict->compressed) { + dict->ofs += ofs; + if (dict->ofs >= FRAMESIZE) { + dict->buffered = 0; + while (dict->ofs >= FRAMESIZE) { + dict->ofs -= FRAMESIZE; + if (++dict->frm >= dict->nfrm) + return -1; + } + } + return 0; + } + else + return fseek (dict->stream, ofs, 1); + } + + dict_read(dict,ptr,size,count) + Dict *dict; + char *ptr; + { + int s; + if (dict->compressed) { + size *= count; + while (size > 0) { + if (!dict->buffered) + readframe (dict); + s = dict->ofs+size > FRAMESIZE ? FRAMESIZE - dict->ofs : size; + bcopy(dict->buf + dict->ofs, ptr, s); + ptr += s; + size -= s; + dict->ofs += s; + if (dict->ofs == FRAMESIZE) { + dict->ofs = 0; + dict->buffered = 0; + if (++dict->frm >= dict->nfrm) + return 0; + } + } + return count; + } + else + return fread (ptr, size, count, dict->stream); + } + + dict_getc(dict) + Dict *dict; + { + int c; + if (dict->compressed) { + if (!dict->buffered) + readframe(dict); + c = (unsigned char) dict->buf[dict->ofs]; + if (++dict->ofs == FRAMESIZE) { + dict->buffered = 0; + dict->ofs = 0; + if (++dict->frm >= dict->nfrm) + return EOF; + } + return c; + } + else + return getc (dict->stream); + } + init_dic(dict,stream) Dict *dict; FILE *stream; *************** *** 201,215 **** #define BS 16 static unsigned char b[BS]; static unsigned char null[BS]; ! int e; Index *new; dict->stream = stream; bzero(null,BS); ! seekframe(dict->stream,1); ! if(fread(b,BS,1,dict->stream)!=1) return -1; e = TWOBYTEUINT(b); --- 313,340 ---- #define BS 16 static unsigned char b[BS]; static unsigned char null[BS]; ! static char buf[4]; ! int e, i; Index *new; dict->stream = stream; + fseek(stream, (long) 0, 0); + if (fread(buf, 4, 1, stream)!=1) return -1; + if (strncmp(buf, "EDIC", 4) == 0) { + dict->compressed = 1; + fread (&i, 4, 1, stream); + dict->nfrm = i / 4 - 1; + dict->buf = (char*) malloc(FRAMESIZE); + dict->buffered = 0; + dict->comp_tab = (unsigned long *) malloc(sizeof(long)*256); + dict->comp_seek = 0xffffffffL; + } + bzero(null,BS); ! seekframe(dict,1); ! if(dict_read(dict,b,BS,1)!=1) return -1; e = TWOBYTEUINT(b); *************** *** 220,226 **** dict->index = NULL; for(; e>0; e--) { ! if(fread(b,BS,1,dict->stream)!=1) return -1; if(!bcmp(b,null,BS)) break; new = (Index *)calloc(1,sizeof(Index)); --- 345,351 ---- dict->index = NULL; for(; e>0; e--) { ! if(dict_read(dict,b,BS,1)!=1) return -1; if(!bcmp(b,null,BS)) break; new = (Index *)calloc(1,sizeof(Index)); *************** *** 232,241 **** return 0; } ! seekframe(stream,f) ! FILE *stream; { ! return (fseek(stream, (long)(f-1)*FRAMESIZE , 0)); } findentry(ent,type,env_p) --- 357,377 ---- return 0; } ! seekframe(dict,f) ! Dict *dict; { ! if (dict->compressed) { ! if (f >= dict->nfrm) ! return -1; ! if (!dict->buffered || dict->frm != f) { ! dict->frm = f; ! dict->buffered = 0; ! } ! dict->ofs = 0; ! return 0; ! } ! else ! return (fseek(dict->stream, (long)(f-1)*FRAMESIZE , 0)); } findentry(ent,type,env_p) *************** *** 342,349 **** frame[FRAMESIZE] = frame[FRAMESIZE+1] = '\0'; /* sentinel */ do { ! seekframe(dict->stream,frm++); ! fread(frame,FRAMESIZE,1,dict->stream); if((frame[0]&0x10) && frame[1]!=0) { /* koteityou assyuku type */ sprintf(msg,"$^C,frm=%x\n",frm-1); --- 478,485 ---- frame[FRAMESIZE] = frame[FRAMESIZE+1] = '\0'; /* sentinel */ do { ! seekframe(dict,frm++); ! dict_read(dict,frame,FRAMESIZE,1); if((frame[0]&0x10) && frame[1]!=0) { /* koteityou assyuku type */ sprintf(msg,"$^C,frm=%x\n",frm-1); *************** *** 426,433 **** #ifdef DEBUG printf("#Newpage\n"); #endif ! seekframe(dict->stream,frm); ! fread(frame,FRAMESIZE,1,dict->stream); q=frame+4; } else if(*q==0xc0 || *q==0x00) { --- 562,569 ---- #ifdef DEBUG printf("#Newpage\n"); #endif ! seekframe(dict,frm); ! dict_read(dict,frame,FRAMESIZE,1); q=frame+4; } else if(*q==0xc0 || *q==0x00) { *************** *** 510,538 **** #ifdef DEBUG printf("%x,%x\n",frm,ofs); #endif ! if(seekframe(dict->stream,frm)) return ; ! if(fseek(dict->stream,(long)ofs,1)) return ; if (dict_set[env_p->dict_num].code == FULL) { ! hi = getc(dict->stream); ! lo = getc(dict->stream); } else { ! lo = getc(dict->stream); if (lo < 32) { hi = lo; ! lo = getc(dict->stream); } else hi = 0x23; } while(!(hi==0x1f && lo==0x0a)){ if(hi!=0x1f) puteucz2h(cur_s,hi,lo,env_p->dict_num); if (dict_set[env_p->dict_num].code == FULL) { ! hi = getc(dict->stream); ! lo = getc(dict->stream); } else { ! lo = getc(dict->stream); if (lo < 32) { hi = lo; ! lo = getc(dict->stream); } else hi = 0x23; } } --- 646,674 ---- #ifdef DEBUG printf("%x,%x\n",frm,ofs); #endif ! if(seekframe(dict,frm)) return ; ! if(dict_seek(dict,(long)ofs)) return ; if (dict_set[env_p->dict_num].code == FULL) { ! hi = dict_getc(dict); ! lo = dict_getc(dict); } else { ! lo = dict_getc(dict); if (lo < 32) { hi = lo; ! lo = dict_getc(dict); } else hi = 0x23; } while(!(hi==0x1f && lo==0x0a)){ if(hi!=0x1f) puteucz2h(cur_s,hi,lo,env_p->dict_num); if (dict_set[env_p->dict_num].code == FULL) { ! hi = dict_getc(dict); ! lo = dict_getc(dict); } else { ! lo = dict_getc(dict); if (lo < 32) { hi = lo; ! lo = dict_getc(dict); } else hi = 0x23; } } *************** *** 570,583 **** printf("%x,%x\n",frm,ofs); #endif ! if( seekframe(dict->stream,frm) ) return ; if(raw) { ! fread(frame,FRAMESIZE,1,dict->stream); write(cur_s,frame,FRAMESIZE); /*count=FRAMESIZE/2; while( count-- ) { ! hi = getc(dict->stream); ! lo = getc(dict->stream); sprintf(buf,"#x%02x%02x",hi,lo); write(cur_s,buf,strlen(buf)); } --- 706,719 ---- printf("%x,%x\n",frm,ofs); #endif ! if( seekframe(dict,frm) ) return ; if(raw) { ! dict_read(dict,frame,FRAMESIZE,1); write(cur_s,frame,FRAMESIZE); /*count=FRAMESIZE/2; while( count-- ) { ! hi = dict_getc(dict); ! lo = dict_getc(dict); sprintf(buf,"#x%02x%02x",hi,lo); write(cur_s,buf,strlen(buf)); } *************** *** 590,629 **** end_tab=0; } */ ! if( fseek(dict->stream,(long)ofs,1)) return ; ! hi = getc(dict->stream); /* Fetch */ ! lo = getc(dict->stream); while(!(hi==0x1f && lo==0x02) && /* if Doc start */ !(hi==0x1f && lo==0x41) && /* if Key start */ !(hi==0x1f && lo==0x45)) { /* if Fig start */ if(hi==0x1f && lo==0x09){ /* if not /* if TAB skip 2byte */ ! hi = getc(dict->stream); ! lo = getc(dict->stream); } ! hi = getc(dict->stream); ! lo = getc(dict->stream); } /* Doc ,Key or Fig start */ /* if Key start */ if(hi==0x1f && lo==0x41) { ! hi = getc(dict->stream); /* skip 2 bytes */ ! lo = getc(dict->stream); } /* if Fig start */ if(hi==0x1f && lo==0x45) { ! hi = getc(dict->stream); /* skip 2 bytes */ ! lo = getc(dict->stream); fig=TRUE; } if (dict_set[env_p->dict_num].code == FULL) { ! hi = getc(dict->stream); ! lo = getc(dict->stream); } else { ! lo = getc(dict->stream); if (lo < 32) { hi = lo; ! lo = getc(dict->stream); } else hi = 0x23; } --- 726,765 ---- end_tab=0; } */ ! if( dict_seek(dict,(long)ofs)) return ; ! hi = dict_getc(dict); /* Fetch */ ! lo = dict_getc(dict); while(!(hi==0x1f && lo==0x02) && /* if Doc start */ !(hi==0x1f && lo==0x41) && /* if Key start */ !(hi==0x1f && lo==0x45)) { /* if Fig start */ if(hi==0x1f && lo==0x09){ /* if not /* if TAB skip 2byte */ ! hi = dict_getc(dict); ! lo = dict_getc(dict); } ! hi = dict_getc(dict); ! lo = dict_getc(dict); } /* Doc ,Key or Fig start */ /* if Key start */ if(hi==0x1f && lo==0x41) { ! hi = dict_getc(dict); /* skip 2 bytes */ ! lo = dict_getc(dict); } /* if Fig start */ if(hi==0x1f && lo==0x45) { ! hi = dict_getc(dict); /* skip 2 bytes */ ! lo = dict_getc(dict); fig=TRUE; } if (dict_set[env_p->dict_num].code == FULL) { ! hi = dict_getc(dict); ! lo = dict_getc(dict); } else { ! lo = dict_getc(dict); if (lo < 32) { hi = lo; ! lo = dict_getc(dict); } else hi = 0x23; } *************** *** 634,641 **** !(hi==0x1f && lo==0x03) ) { /* end */ if(TAB ) { ! hi = getc(dict->stream); /* skip 2bytes */ ! lo = getc(dict->stream); TAB =FALSE; } if(hi==0x1f) { --- 770,777 ---- !(hi==0x1f && lo==0x03) ) { /* end */ if(TAB ) { ! hi = dict_getc(dict); /* skip 2bytes */ ! lo = dict_getc(dict); TAB =FALSE; } if(hi==0x1f) { *************** *** 664,670 **** break; case 0x14: skipcnt = 2; ! while(skipcnt--) hi = getc(dict->stream); break; case 0x0a: /* cr */ if(!ignore_cr) { --- 800,806 ---- break; case 0x14: skipcnt = 2; ! while(skipcnt--) hi = dict_getc(dict); break; case 0x0a: /* cr */ if(!ignore_cr) { *************** *** 674,691 **** case 0x15: /* ? */ break; case 0x31: /* fig start */ ! hi = getc(dict->stream); ! lo = getc(dict->stream); ! fread(rbuf,4,1,dict->stream); height = TWOBCDUINT(rbuf); width = TWOBCDUINT(rbuf+2); sprintf(buf,"",height,width); write(cur_s,buf,strlen(buf)); do { ! hi = getc(dict->stream); ! lo = getc(dict->stream); } while(!(hi==0x1f && lo==0x51 )); ! fread(rbuf,6,1,dict->stream); frmtmp = FOURBCDUINT(rbuf); ofstmp = TWOBCDUINT(rbuf+4); break; --- 810,827 ---- case 0x15: /* ? */ break; case 0x31: /* fig start */ ! hi = dict_getc(dict); ! lo = dict_getc(dict); ! dict_read(dict,rbuf,4,1); height = TWOBCDUINT(rbuf); width = TWOBCDUINT(rbuf+2); sprintf(buf,"",height,width); write(cur_s,buf,strlen(buf)); do { ! hi = dict_getc(dict); ! lo = dict_getc(dict); } while(!(hi==0x1f && lo==0x51 )); ! dict_read(dict,rbuf,6,1); frmtmp = FOURBCDUINT(rbuf); ofstmp = TWOBCDUINT(rbuf+4); break; *************** *** 694,700 **** case 0x33: /* music start */ if(fig) { skipcnt = 4; ! while(skipcnt--) hi = getc(dict->stream); } break; --- 830,836 ---- case 0x33: /* music start */ if(fig) { skipcnt = 4; ! while(skipcnt--) hi = dict_getc(dict); } break; *************** *** 704,716 **** break; case 0x41: /* key start with 0 0 */ /* skipcnt = 2; while(skipcnt--) */ ! hi = getc(dict->stream); ! lo = getc(dict->stream); break; case 0x44: /* fig start */ ! hi = getc(dict->stream); ! lo = getc(dict->stream); ! fread(rbuf,8,1,dict->stream); height = FOURBCDUINT(rbuf); width = FOURBCDUINT(rbuf+4); sprintf(buf,"",height,width); --- 840,852 ---- break; case 0x41: /* key start with 0 0 */ /* skipcnt = 2; while(skipcnt--) */ ! hi = dict_getc(dict); ! lo = dict_getc(dict); break; case 0x44: /* fig start */ ! hi = dict_getc(dict); ! lo = dict_getc(dict); ! dict_read(dict,rbuf,8,1); height = FOURBCDUINT(rbuf); width = FOURBCDUINT(rbuf+4); sprintf(buf,"",height,width); *************** *** 718,741 **** break; case 0x45: /* fig and music ref start */ /* skipcnt = 2; while(skipcnt--) */ ! hi = getc(dict->stream); ! lo = getc(dict->stream); break; case 0x48: /* music ref start */ ! fread(rbuf,10,1,dict->stream); frmtmp=SIXBCDUINT(rbuf); ofstmp=FOURBCDUINT(rbuf+6); write(cur_s,buf,strlen(buf)); break; case 0x51: /* pointer to fig page:offset(BCD)*/ ! fread(rbuf,6,1,dict->stream); frmtmp=FOURBCDUINT(rbuf); ofstmp=TWOBCDUINT(rbuf+4); sprintf(buf,"<%x:%x>",frmtmp,ofstmp); write(cur_s,buf,strlen(buf)); break; case 0x52: /* picture end with page:offset(BCD)*/ ! fread(rbuf,6,1,dict->stream); frmtmp=FOURBCDUINT(rbuf); ofstmp=TWOBCDUINT(rbuf+4); sprintf(buf,"<%x:%x>",frmtmp,ofstmp); --- 854,877 ---- break; case 0x45: /* fig and music ref start */ /* skipcnt = 2; while(skipcnt--) */ ! hi = dict_getc(dict); ! lo = dict_getc(dict); break; case 0x48: /* music ref start */ ! dict_read(dict,rbuf,10,1); frmtmp=SIXBCDUINT(rbuf); ofstmp=FOURBCDUINT(rbuf+6); write(cur_s,buf,strlen(buf)); break; case 0x51: /* pointer to fig page:offset(BCD)*/ ! dict_read(dict,rbuf,6,1); frmtmp=FOURBCDUINT(rbuf); ofstmp=TWOBCDUINT(rbuf+4); sprintf(buf,"<%x:%x>",frmtmp,ofstmp); write(cur_s,buf,strlen(buf)); break; case 0x52: /* picture end with page:offset(BCD)*/ ! dict_read(dict,rbuf,6,1); frmtmp=FOURBCDUINT(rbuf); ofstmp=TWOBCDUINT(rbuf+4); sprintf(buf,"<%x:%x>",frmtmp,ofstmp); *************** *** 744,760 **** case 0x53: /* end with page:offset(BCD)*/ ref = FALSE; if(fig==FALSE){ ! fread(rbuf,8,1,dict->stream); frmtmp=FOURBCDUINT(rbuf); ofstmp=FOURBCDUINT(rbuf+4); sprintf(buf,"<%x:%x>",frmtmp,ofstmp); write(cur_s,buf,strlen(buf)); } else { ! if( seekframe(dict->stream,frmtmp) ) return ; ! if( fseek(dict->stream,(long)ofstmp,1)) return ; for( i=0; istream); } } fig=FALSE; --- 880,896 ---- case 0x53: /* end with page:offset(BCD)*/ ref = FALSE; if(fig==FALSE){ ! dict_read(dict,rbuf,8,1); frmtmp=FOURBCDUINT(rbuf); ofstmp=FOURBCDUINT(rbuf+4); sprintf(buf,"<%x:%x>",frmtmp,ofstmp); write(cur_s,buf,strlen(buf)); } else { ! if( seekframe(dict,frmtmp) ) return ; ! if( dict_seek(dict,(long)ofstmp)) return ; for( i=0; istream); frmtmp=FOURBCDUINT(rbuf); ofstmp=TWOBCDUINT(rbuf+4); sprintf(buf,"<%x:%x>",frmtmp,ofstmp); --- 900,906 ---- case 0x62: /* refrence end with page:offset(BCD) */ case 0x63: /* menu end with page:offset(BCD) */ ref = FALSE; ! dict_read(dict,rbuf,6,1); frmtmp=FOURBCDUINT(rbuf); ofstmp=TWOBCDUINT(rbuf+4); sprintf(buf,"<%x:%x>",frmtmp,ofstmp); *************** *** 772,778 **** break; case 0x64: /* fig ref end with page:offset(BCD) */ honmon = TRUE; ! fread(rbuf,6,1,dict->stream); frmtmp=FOURBCDUINT(rbuf); ofstmp=TWOBCDUINT(rbuf+4); sprintf(buf,"<%x:%x>",frmtmp,ofstmp); --- 908,914 ---- break; case 0x64: /* fig ref end with page:offset(BCD) */ honmon = TRUE; ! dict_read(dict,rbuf,6,1); frmtmp=FOURBCDUINT(rbuf); ofstmp=TWOBCDUINT(rbuf+4); sprintf(buf,"<%x:%x>",frmtmp,ofstmp); *************** *** 782,792 **** break; case 0x65: /* ref end */ if (fig==TRUE) { ! if( seekframe(dict->stream,frmtmp) ) return ; ! if( fseek(dict->stream,(long)ofstmp,1)) return ; for( i=0; istream); } } fig=FALSE; --- 918,928 ---- break; case 0x65: /* ref end */ if (fig==TRUE) { ! if( seekframe(dict,frmtmp) ) return ; ! if( dict_seek(dict,(long)ofstmp)) return ; for( i=0; idict_num].code == FULL) { ! hi = getc(dict->stream); ! lo = getc(dict->stream); } else { ! lo = getc(dict->stream); if (lo < 32) { hi = lo; ! lo = getc(dict->stream); } else hi = 0x23; } } --- 942,954 ---- } if (dict_set[env_p->dict_num].code == FULL) { ! hi = dict_getc(dict); ! lo = dict_getc(dict); } else { ! lo = dict_getc(dict); if (lo < 32) { hi = lo; ! lo = dict_getc(dict); } else hi = 0x23; } } diff -crP dserver/server2.1/misc.h dserver2.1-newsos4/server2.1/misc.h *** dserver/server2.1/misc.h Tue Jun 27 01:20:52 1995 --- dserver2.1-newsos4/server2.1/misc.h Tue Aug 20 10:19:25 1996 *************** *** 1,5 **** --- 1,7 ---- /* external variable controle */ + #include + #ifdef DSERVER_MAIN #define Extern #else *************** *** 33,49 **** (bcduint(*((b)+1)))) #define FOURBCDUINT(b) \ ! ((bcduint(*((b)+0))*1000000) + \ ! (bcduint(*((b)+1))*10000) + \ ! (bcduint(*((b)+2))*100) + \ (bcduint(*((b)+3)) )) #define SIXBCDUINT(b) \ ! ((bcduint(*((b)+0))*10000000000) + \ ! (bcduint(*((b)+1))*100000000) + \ ! (bcduint(*((b)+2))*1000000) + \ ! (bcduint(*((b)+3))*10000) + \ ! (bcduint(*((b)+4))*100) + \ (bcduint(*((b)+5)) )) --- 35,51 ---- (bcduint(*((b)+1)))) #define FOURBCDUINT(b) \ ! ((bcduint(*((b)+0))*1000000UL) + \ ! (bcduint(*((b)+1))*10000UL) + \ ! (bcduint(*((b)+2))*100UL) + \ (bcduint(*((b)+3)) )) #define SIXBCDUINT(b) \ ! ((bcduint(*((b)+0))*10000000000UL) + \ ! (bcduint(*((b)+1))*100000000UL) + \ ! (bcduint(*((b)+2))*1000000UL) + \ ! (bcduint(*((b)+3))*10000UL) + \ ! (bcduint(*((b)+4))*100UL) + \ (bcduint(*((b)+5)) )) Only in dserver/server2.1/table: #dserver_access# diff -crP dserver/server2.1/table/dserver_access dserver2.1-newsos4/server2.1/table/dserver_access *** dserver/server2.1/table/dserver_access Thu Oct 19 23:29:38 1995 --- dserver2.1-newsos4/server2.1/table/dserver_access Tue Aug 20 00:18:00 1996 *************** *** 1,10 **** ! #DICT kojien /usr/local/etc/CDdict/yrrs096/koujien/start. "広辞苑第4版" 1 600 ! #DICT eiwa /usr/local/etc/CDdict/yrrs118/chujiten/start. "研究社中英和" 25 600 ! #DICT waei /usr/local/etc/CDdict/yrrs118/chujiten/start. "研究社中和英" 25 600 ! #DICT CDkojien /usr/local/etc/CDdict/cdkouji/koujien/data/honmon. "広辞苑CD版" 1 600 ! #DICT readers /usr/local/etc/CDdict/yrrs172/readers/start. "リーダーズ英和" 1 600 ! ##DICTROOT /usr/local/etc/CDdict 2 500 ## access control # ! topics # --- 1,11 ---- ! #DICT kojien /usr/local/dict/dserver/cdrom/koujien/koujien/start "広辞苑第4版" 1 600 ! #DICT kojien-furoku /usr/local/dict/dserver/cdrom/koujien/furoku/start "広辞苑付録" 1 600 ! #DICT eiwa /usr/local/dict/dserver/cdrom/chujiten/chujiten/start "研究社中英和" 25 600 ! #DICT waei /usr/local/dict/dserver/cdrom/chujiten/chujiten/start "研究社中和英" 25 600 ! #DICT CDkojien /usr/local/dict/dserver/cdrom/koujien/data/honmon "広辞苑CD版" 1 600 ! #DICT readers /usr/local/dict/dserver/cdrom/readers/start "リーダーズ英和" 1 600 ! ##DICTROOT /usr/local/dserver/cdrom 2 500 ## access control # ! localhost # Only in dserver/server2.1/table: readers.tbl~ Only in dserver/server2.1/table: yrrs096.tbl~