📄 patches
字号:
*** /usr2/polymnia/hyc/News/arc/arcsq.c Wed Jul 6 02:27:24 1988--- arc/arcsq.c Sun Jul 31 18:54:48 1988****************** 1,5 **** /*! * $Header: arcsq.c,v 1.2 88/06/02 16:27:38 hyc Locked $ */ /*--- 1,5 ---- /*! * $Header: arcsq.c,v 1.3 88/07/31 18:53:32 hyc Exp $ */ /******************* 65,71 **** static int cbitsrem; /* # of code string bits left */ static unsigned short ccode; /* current code right justified */ ! int init_sq() { /* prepare for scanning pass */ int i; /* node index */--- 65,73 ---- static int cbitsrem; /* # of code string bits left */ static unsigned short ccode; /* current code right justified */ ! static void scale(), heap(), adjust(), bld_tree(), init_enc(), put_int();! static int cmptrees(), buildenc(), maxchar();! void init_sq() { /* prepare for scanning pass */ int i; /* node index */****************** 86,92 **** valcount[i] = 0; } ! int scan_sq(c) /* add a byte to the tables */ int c; /* byte to add */ {--- 88,94 ---- valcount[i] = 0; } ! void scan_sq(c) /* add a byte to the tables */ int c; /* byte to add */ {****************** 113,123 **** unsigned short ceiling;/* limit for scaling */ long size = 0; /* predicted size */ int numnodes; /* # of nodes in simplified tree */- int scale();- int heap();- int bld_tree();- int buildenc();- int init_enc(); scan_sq(EOF); /* signal end of input */ --- 115,120 ----****************** 188,194 **** * integer. Rescaling is used if necessary to limit the code length. */ ! static int scale(ceil) unsigned short ceil; /* upper limit on total weight */ {--- 185,191 ---- * integer. Rescaling is used if necessary to limit the code length. */ ! static void scale(ceil) unsigned short ceil; /* upper limit on total weight */ {****************** 236,247 **** * rescaling. */ ! static int heap(list, length) int list[], length; { register int i;- int adjust(); for (i = (length - 2) / 2; i >= 0; --i) adjust(list, i, length - 1);--- 233,243 ---- * rescaling. */ ! static void heap(list, length) int list[], length; { register int i; for (i = (length - 2) / 2; i >= 0; --i) adjust(list, i, length - 1);****************** 249,260 **** /* Make a heap from a heap with a new top */ ! static int adjust(list, top, bottom) int list[], top, bottom; { register int k, temp;- int cmptrees(); k = 2 * top + 1; /* left child of top */ temp = list[top]; /* remember root node of top tree */--- 245,255 ---- /* Make a heap from a heap with a new top */ ! static void adjust(list, top, bottom) int list[], top, bottom; { register int k, temp; k = 2 * top + 1; /* left child of top */ temp = list[top]; /* remember root node of top tree */****************** 282,288 **** * comparison rules in previous comments. */ ! static int cmptrees(a, b) int a, b; /* root nodes of trees */ {--- 277,283 ---- * comparison rules in previous comments. */ ! static int cmptrees(a, b) int a, b; /* root nodes of trees */ {****************** 308,314 **** * element and reheaping the shorter list. */ ! static int bld_tree(list, len) int list[]; int len;--- 303,309 ---- * element and reheaping the shorter list. */ ! static void bld_tree(list, len) int list[]; int len;****************** 316,322 **** register int freenode; /* next free node in tree */ register struct nd *frnp; /* free node pointer */ int lch, rch; /* temps for left, right children */- int maxchar(); /* * Initialize index to next available (non-leaf) node. Lower numbered--- 311,316 ----****************** 365,371 **** return a > b ? a : b; } ! static int init_enc() { register int i;--- 359,365 ---- return a > b ? a : b; } ! static void init_enc() { register int i;****************** 421,431 **** return NULL; /* it worked if we reach here */ } ! static int put_int(n, f) /* output an integer */ short n; /* integer to output */ FILE *f; /* file to put it to */ { putc_pak(n & 0xff, f); /* first the low byte */ putc_pak(n >> 8, f); /* then the high byte */ }--- 415,427 ---- return NULL; /* it worked if we reach here */ } ! static void put_int(n, f) /* output an integer */ short n; /* integer to output */ FILE *f; /* file to put it to */ {+ void putc_pak();+ putc_pak(n & 0xff, f); /* first the low byte */ putc_pak(n >> 8, f); /* then the high byte */ }****************** 481,486 ****--- 477,483 ---- { int rbyte; /* Result byte value */ int need; /* number of bits */+ int getc_ncr(); rbyte = 0; need = 8; /* build one byte per call */diff -c /usr2/polymnia/hyc/News/arc/arcsqs.c arc/arcsqs.c*** /usr2/polymnia/hyc/News/arc/arcsqs.c Wed Jul 6 02:27:43 1988--- arc/arcsqs.c Sun Jul 31 18:55:21 1988****************** 1,5 **** /*! * $Header: arcsqs.c,v 1.2 88/06/01 16:31:39 hyc Locked $ */ /* ARC - Archive utility - SQUASH--- 1,5 ---- /*! * $Header: arcsqs.c,v 1.3 88/07/31 18:54:14 hyc Exp $ */ /* ARC - Archive utility - SQUASH****************** 12,18 **** */ /*! * $Header: arcsqs.c,v 1.2 88/06/01 16:31:39 hyc Locked $ */ #include <stdio.h>--- 12,18 ---- */ /*! * $Header: arcsqs.c,v 1.3 88/07/31 18:54:14 hyc Exp $ */ #include <stdio.h>diff -c /usr2/polymnia/hyc/News/arc/arcsvc.c arc/arcsvc.c*** /usr2/polymnia/hyc/News/arc/arcsvc.c Wed Jul 6 02:27:44 1988--- arc/arcsvc.c Sun Jul 31 18:55:55 1988****************** 1,5 **** /*! * $Header: arcsvc.c,v 1.8 88/06/13 00:42:59 hyc Locked $ */ /* ARC - Archive utility - ARCSVC--- 1,5 ---- /*! * $Header: arcsvc.c,v 1.9 88/07/31 18:54:55 hyc Exp $ */ /* ARC - Archive utility - ARCSVC****************** 31,37 **** { FILE *fopen();/* file opener */ ! if (!(arc = fopen(arcname, "rb"))) { if (chg) { if (note) printf("Creating new archive: %s\n", arcname);--- 31,37 ---- { FILE *fopen();/* file opener */ ! if (!(arc = fopen(arcname, OPEN_R))) { if (chg) { if (note) printf("Creating new archive: %s\n", arcname);****************** 45,51 **** int inlen; struct GDDSECT *region; ! region=gdinfo(arc->_fd); inlen=region->GDINLEN; buffer=malloc(inlen); setbuf(arc, buffer);--- 45,51 ---- int inlen; struct GDDSECT *region; ! region=gdinfo(arc->_fd._fdub); inlen=region->GDINLEN; buffer=malloc(inlen); setbuf(arc, buffer);****************** 53,59 **** } #endif if (chg) { /* if opening for changes */! if (!(new = fopen(newname, "wb"))) abort("Cannot create archive copy: %s", newname); changing = chg; /* note if open for changes */--- 53,59 ---- } #endif if (chg) { /* if opening for changes */! if (!(new = fopen(newname, OPEN_W))) abort("Cannot create archive copy: %s", newname); changing = chg; /* note if open for changes */****************** 66,73 **** { if (arc) { /* if we had an initial archive */ fclose(arc);- if (kludge) /* kludge to update timestamp */ #if !MTS setstamp(arcname, olddate, oldtime); #endif }--- 66,73 ---- { if (arc) { /* if we had an initial archive */ fclose(arc); #if !MTS+ if (kludge) /* kludge to update timestamp */ setstamp(arcname, olddate, oldtime); #endif }diff -c /usr2/polymnia/hyc/News/arc/marc.c arc/marc.c*** /usr2/polymnia/hyc/News/arc/marc.c Wed Jul 6 02:27:53 1988--- arc/marc.c Fri Jul 22 14:59:11 1988****************** 25,30 ****--- 25,35 ---- #include <stdio.h> #include "arc.h" + #if UNIX+ #include <sys/types.h>+ #include <sys/stat.h>+ #endif+ FILE *src; /* source archive */ char srcname[STRLEN]; /* source archive name */ ****************** 46,52 ****--- 51,61 ---- void exitpause(); #endif int n; /* index */+ #if UNIX+ struct stat sbuf;+ #endif + if(nargs<3) { printf("MARC - Archive merger, Version 5.21, created on 04/22/87 at 15:05:10\n"); /* printf("(C) COPYRIGHT 1985,86,87 by System Enhancement Associates;");****************** 96,102 **** arctemp[n] = CUTOFF; } #if !MSDOS! strcat(arctemp, mktemp("AXXXXXX")); #else strcat(arctemp, "$ARCTEMP"); #endif--- 105,117 ---- arctemp[n] = CUTOFF; } #if !MSDOS! {! static char tempname[] = "AXXXXXX";! #if UNIX! strcpy(arctemp, "/tmp/");! #endif /*UNIX*/! strcat(arctemp, mktemp(tempname));! } #else strcat(arctemp, "$ARCTEMP"); #endif****************** 109,127 **** arctemp[0] = tmpchr[0]; #endif ! makefnam(arg[1],".arc",arcname); /* fix up archive names */! makefnam(arg[2],".arc",srcname); /* makefnam(".$$$",arcname,newname);*/ sprintf(newname,"%s.arc",arctemp);- - #if !UNIX- upper(arcname); upper(srcname); upper(newname); #endif ! arc = fopen(arcname,"rb"); /* open the archives */! if(!(src=fopen(srcname,"rb"))) abort("Cannot read source archive %s",srcname);! if(!(new=fopen(newname,"wb"))) abort("Cannot create new archive %s",newname); if(!arc)--- 124,149 ---- arctemp[0] = tmpchr[0]; #endif ! #if UNIX! if (!stat(arg[1],&sbuf))! strcpy(arcname,arg[1]);! else! makefnam(arg[1],".arc",arcname);! if (!stat(arg[2],&sbuf))! strcpy(srcname,arg[2]);! else! makefnam(arg[2],".arc",srcname);! #else! makefnam(arg[1],".ARC",arcname); /* fix up archive names */! makefnam(arg[2],".ARC",srcname); /* makefnam(".$$$",arcname,newname);*/ sprintf(newname,"%s.arc",arctemp); #endif ! arc = fopen(arcname,OPEN_R); /* open the archives */! if(!(src=fopen(srcname,OPEN_R))) abort("Cannot read source archive %s",srcname);! if(!(new=fopen(newname,OPEN_W))) abort("Cannot create new archive %s",newname); if(!arc)
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -