@@ -8,7 +8,7 @@ DPADD= ${LIBCURSES} ${LIBTERMCAP} | ||
LDADD= -lcurses -ltermcap | ||
HIDEGAME=hidegam | ||
-beforeinstall: | ||
+beforeinstall: | ||
install -c -o ${BINOWN} -g ${BINGRP} -m 444 ${.CURDIR}/gnuch | ||
${DESTDIR}/usr/s | ||
@@ -1,5 +1,5 @@ | ||
-# RCS Info: $Revision: 1.1.1.1 $ on $Date: 1993/06/12 14:41:05 $ | ||
-# $Source: /a/cvs/386BSD/sr | ||
+# RCS Info: $Revision: 1.2 $ on $Date: 1994/01/07 11:10:39 $ | ||
+# $Source: /home/ncvs/src/g | ||
# Copyright (c) 1985 Wayne A. Christopher, U. C. Berkeley CAD Group | ||
# | ||
# Makefile for xchess. | ||
@@ -95,7 +95,7 @@ reopt: all | ||
install: all | ||
-source: $(SOURCE) | ||
+source: $(SOURCE) | ||
tags: $(ALLFILES) | ||
ctags -w -t *.c *.h > /dev/null 2>&1 | ||
@@ -123,7 +123,7 @@ depend: $(SOURCE) | ||
echo '$$r makedep' >>eddep | ||
echo 'w' >>eddep | ||
ed - Makefile < eddep | ||
- rm eddep makedep | ||
+ rm eddep makedep | ||
echo '# DEPENDENCIES MUST END AT END OF FILE' >> Makefile | ||
echo '# IF YOU PUT STUFF HERE IT WILL GO AWAY' >> Makefile | ||
echo '# see make depend above' >> Makefile |
@@ -20,8 +20,8 @@ file named COPYING. Among other things, the copyright notice | ||
and this notice must be preserved on all copies. */ | ||
-/* RCS Info: $Revision: 1.2 $ on $Date: 86/11/23 17:17:04 $ | ||
- * $Source: /users/faustus/x | ||
+/* RCS Info: $Revision: 1.1.1.1 $ on $Date: 1993/06/12 14:41:12 $ | ||
+ * $Source: /home/ncvs/src/g | ||
* Copyright (c) 1986 Wayne A. Christopher, U. C. Berkeley CAD Group | ||
* Permission is granted to do anything with this code except sell it | ||
* or remove this message. | ||
@@ -143,7 +143,7 @@ XCircle(win, x, y, rad, start, end, width, height, pixel, func, planes) | ||
verts[0].flags |= VertexStartClose | ||
verts[j].x = verts[0].x; | ||
verts[j].y = verts[0].y; | ||
- verts[j].flags = (verts[0].flags & ~VertexStartClos | ||
+ verts[j].flags = (verts[0].flags & ~VertexStartClos | ||
VertexEndClosed; | ||
for (i = 0; i < 15; i++) { | ||
if (dp) |
@@ -20,8 +20,8 @@ file named COPYING. Among other things, the copyright notice | ||
and this notice must be preserved on all copies. */ | ||
-/* RCS Info: $Revision: 1.4 $ on $Date: 86/11/23 17:17:15 $ | ||
- * $Source: /users/faustus/x | ||
+/* RCS Info: $Revision: 1.1.1.1 $ on $Date: 1993/06/12 14:41:08 $ | ||
+ * $Source: /home/ncvs/src/g | ||
* Copyright (c) 1986 Wayne A. Christopher, U. C. Berkeley CAD Group | ||
* Permission is granted to do anything with this code except sell it | ||
* or remove this message. | ||
@@ -164,12 +164,12 @@ board_move(b, m) | ||
if (m->piece.color == WHITE) { | ||
if (m->fromx == 0) | ||
b->white_cant_ca | ||
- else if (m->fromx == 7) | ||
+ else if (m->fromx == 7) | ||
b->white_cant_ca | ||
} else { | ||
if (m->fromx == 0) | ||
b->black_cant_ca | ||
- else if (m->fromx == 7) | ||
+ else if (m->fromx == 7) | ||
b->black_cant_ca | ||
} | ||
} |
@@ -20,8 +20,8 @@ file named COPYING. Among other things, the copyright notice | ||
and this notice must be preserved on all copies. */ | ||
-/* RCS Info: $Revision: 1.4 $ on $Date: 86/11/26 12:09:41 $ | ||
- * $Source: /users/faustus/x | ||
+/* RCS Info: $Revision: 1.1.1.1 $ on $Date: 1993/06/12 14:41:15 $ | ||
+ * $Source: /home/ncvs/src/g | ||
* Copyright (c) 1986 Wayne A. Christopher, U. C. Berkeley CAD Group | ||
* Permission is granted to do anything with this code except sell it | ||
* or remove this message. | ||
@@ -52,7 +52,7 @@ static struct but { | ||
{ "Reset", 0, 80, 108, 29, RESTART } , | ||
{ "Save", 109, 80, 108, 29, SAVE } , | ||
#define EASY_OFFSET 8 | ||
- { "Switch", 219, 80, 108, 29, SWITCH } | ||
+ { "Switch", 219, 80, 108, 29, SWITCH } | ||
/* { "NoEasy", 219, 80, 108, 29, EASY }*/ | ||
} ; | ||
static int easy = 1; | ||
@@ -69,7 +69,7 @@ button_draw(win) | ||
XSetLineAttribut | ||
BORDER_WIDTH, LineSolid, CapButt, | ||
JoinMiter); | ||
- | ||
+ | ||
XDrawLine(win->d | ||
DefaultGC(win->d | ||
0, 29, BUTTON_WIDTH, 29); | ||
@@ -85,9 +85,9 @@ button_draw(win) | ||
XSetFont(win->di | ||
XSetForeground(w | ||
- win->textcolor.p | ||
+ win->textcolor.p | ||
XSetBackground(w | ||
- win->textback.pi | ||
+ win->textback.pi | ||
for (i = 0; i < numbuts; i++) { | ||
x = (buts[i].width - | ||
@@ -219,7 +219,7 @@ button_service(w | ||
case SAVE: | ||
if (saveflag) { | ||
- message_add(win, | ||
+ message_add(win, | ||
"Game is already being logged in file '", true); | ||
message_add(win, | ||
message_add(win, | ||
@@ -248,12 +248,12 @@ button_service(w | ||
return; | ||
} | ||
} | ||
- message_add(win1 | ||
+ message_add(win1 | ||
"Clock stopped.\nHit 'Pause' again to restart.\n", | ||
false); | ||
if (!oneboard) | ||
- message_add(win2 | ||
- "Clock stopped.\nHit 'Pause' again to restart.\n", | ||
+ message_add(win2 | ||
+ "Clock stopped.\nHit 'Pause' again to restart.\n", | ||
false); | ||
clock_started = false; | ||
} else { | ||
@@ -320,7 +320,7 @@ button_service(w | ||
win->textcolor.p | ||
XSetBackground(w | ||
DefaultGC(win->d | ||
- win->textback.pi | ||
+ win->textback.pi | ||
XDrawImageString | ||
win->buttonwin, |
@@ -20,8 +20,8 @@ file named COPYING. Among other things, the copyright notice | ||
and this notice must be preserved on all copies. */ | ||
-/* RCS Info: $Revision: 1.4 $ on $Date: 86/11/26 12:09:47 $ | ||
- * $Source: /users/faustus/x | ||
+/* RCS Info: $Revision: 1.1.1.1 $ on $Date: 1993/06/12 14:41:08 $ | ||
+ * $Source: /home/ncvs/src/g | ||
* Copyright (c) 1986 Wayne A. Christopher, U. C. Berkeley CAD Group | ||
* Permission is granted to do anything with this code except sell it | ||
* or remove this message. | ||
@@ -59,7 +59,7 @@ clock_draw(win, col) | ||
Window w = ((col == WHITE) ? win->wclockwin : win->bclockwin); | ||
/* Draw a clock face and the hands. */ | ||
- XCircle(w, x, y, rad, 0.0, 0.0, 1, 1, win->textcolor.p | ||
+ XCircle(w, x, y, rad, 0.0, 0.0, 1, 1, win->textcolor.p | ||
AllPlanes); | ||
rad -= 8; | ||
@@ -112,7 +112,7 @@ clock_update() | ||
lastwhite = lastblack = now; | ||
return; | ||
} | ||
- | ||
+ | ||
if (white_running) { | ||
whiteseconds += now - lastwhite; | ||
lastwhite = now; | ||
@@ -198,7 +198,7 @@ dohands(win, col) | ||
{ | ||
int cx = CLOCK_WIDTH / 2, cy = CLOCK_WIDTH / 2; | ||
double *h = (col == WHITE) ? win->whitehands : win->blackhands; | ||
- Window w = (col == WHITE) ? win->wclockwin : win->bclockwin; | ||
+ Window w = (col == WHITE) ? win->wclockwin : win->bclockwin; | ||
long secs = (col == WHITE) ? whiteseconds : blackseconds; | ||
int rad, x, y, i; | ||
@@ -272,11 +272,11 @@ hilight(win, col, on) | ||
BORDER_WIDTH, LineSolid, CapButt, JoinMiter); | ||
XSetFont(win->di | ||
win->large->fid) | ||
- | ||
+ | ||
XDrawLine(win->d | ||
0, CLOCK_HEIGHT - 26, | ||
CLOCK_WIDTH, CLOCK_HEIGHT - 26); | ||
- | ||
+ | ||
XDrawImageString | ||
(CLOCK_WIDTH - x) / 2, CLOCK_HEIGHT, | ||
s, strlen(s)); |
@@ -19,8 +19,8 @@ file named COPYING. Among other things, the copyright notice | ||
and this notice must be preserved on all copies. */ | ||
-/* RCS Info: $Revision: 1.4 $ on $Date: 86/11/23 17:17:32 $ | ||
- * $Source: /users/faustus/x | ||
+/* RCS Info: $Revision: 1.1.1.1 $ on $Date: 1993/06/12 14:41:11 $ | ||
+ * $Source: /home/ncvs/src/g | ||
* Copyright (c) 1986 Wayne A. Christopher, U. C. Berkeley CAD Group | ||
* Permission is granted to do anything with this code except sell it | ||
* or remove this message. | ||
@@ -154,7 +154,7 @@ button_released( | ||
thismove->type = QCASTLE; | ||
else | ||
thismove->type = MOVE; | ||
- | ||
+ | ||
/* Now check the en-passant case... */ | ||
if ((thismove->type | ||
|| (thismove->tox == thismove->fromx - 1)) && | ||
@@ -278,7 +278,7 @@ screen_move(m) | ||
win_drawpiece(&m | ||
} | ||
break; | ||
- | ||
+ | ||
case KCASTLE: | ||
if (m->piece.color == WHITE) { | ||
win_erasepiece(7 |
@@ -20,8 +20,8 @@ file named COPYING. Among other things, the copyright notice | ||
and this notice must be preserved on all copies. */ | ||
-/* RCS Info: $Revision: 1.3 $ on $Date: 86/11/26 12:09:54 $ | ||
- * $Source: /users/faustus/x | ||
+/* RCS Info: $Revision: 1.1.1.1 $ on $Date: 1993/06/12 14:41:12 $ | ||
+ * $Source: /home/ncvs/src/g | ||
* Copyright (c) 1986 Wayne A. Christopher, U. C. Berkeley CAD Group | ||
* Permission is granted to do anything with this code except sell it | ||
* or remove this message. | ||
@@ -82,7 +82,7 @@ jail_draw(win) | ||
win->textcolor.p | ||
XSetBackground(w | ||
win->textback.pi | ||
- | ||
+ | ||
XDrawImageString | ||
DefaultGC(win->d | ||
(JAIL_WIDTH - i) / 2, 20, JAIL_HEADER, | ||
@@ -96,7 +96,7 @@ jail_draw(win) | ||
FillSolid); | ||
XSetFunction(win | ||
GXcopy); | ||
- | ||
+ | ||
for (i = 0; i < 16; i++) | ||
if (pos[i]) { | ||
p.color = WHITE; | ||
@@ -105,7 +105,7 @@ jail_draw(win) | ||
tmpPM = XCreateBitmapFro | ||
win->jailwin, bits, | ||
32, 32); | ||
- | ||
+ | ||
XCopyPlane(win-> | ||
DefaultGC(win->d | ||
0, 0, 32, 32, | ||
@@ -127,7 +127,7 @@ jail_draw(win) | ||
tmpPM = XCreateBitmapFro | ||
win->jailwin, bits, | ||
32, 32); | ||
- | ||
+ | ||
XCopyPlane(win-> | ||
DefaultGC(win->d | ||
0, 0, 32, 32, | ||
@@ -151,7 +151,7 @@ jail_add(p) | ||
int i = piecepos(p, false); | ||
char *bits; | ||
Pixmap tmpPM; | ||
- | ||
+ | ||
pos[i] = true; | ||
bits = bitsget(p); | ||
@@ -165,14 +165,14 @@ jail_add(p) | ||
tmpPM = XCreateBitmapFro | ||
win1->jailwin, bits, | ||
32, 32); | ||
- | ||
+ | ||
XCopyPlane(win1- | ||
DefaultGC(win1-> | ||
0, 0, 32, 32, | ||
5 + (i % 8) * 32, ((i >= 16) ? 30 : 25) + (i / 8) * 32, | ||
1); | ||
XFreePixmap(win1 | ||
- | ||
+ | ||
if (!oneboard) { | ||
XSetState(win2-> | ||
win2->blackpiece | ||
@@ -184,7 +184,7 @@ jail_add(p) | ||
tmpPM = XCreateBitmapFro | ||
win2->jailwin, bits, | ||
32, 32); | ||
- | ||
+ | ||
XCopyPlane(win2- | ||
DefaultGC(win2-> | ||
0, 0, 32, 32, |
@@ -20,8 +20,8 @@ file named COPYING. Among other things, the copyright notice | ||
and this notice must be preserved on all copies. */ | ||
-/* RCS Info: $Revision: 1.4 $ on $Date: 86/11/26 12:10:22 $ | ||
- * $Source: /users/faustus/x | ||
+/* RCS Info: $Revision: 1.1.1.1 $ on $Date: 1993/06/12 14:41:14 $ | ||
+ * $Source: /home/ncvs/src/g | ||
* Copyright (c) 1986 Wayne A. Christopher, U. C. Berkeley CAD Group | ||
* Permission is granted to do anything with this code except sell it | ||
* or remove this message. | ||
@@ -38,7 +38,7 @@ void | ||
message_init(win | ||
windata *win; | ||
{ | ||
- TxtGrab(win->dis | ||
+ TxtGrab(win->dis | ||
win->textback.pi | ||
win->cursorcolor | ||
TxtAddFont(win-> |
@@ -19,8 +19,8 @@ file named COPYING. Among other things, the copyright notice | ||
and this notice must be preserved on all copies. */ | ||
-/* RCS Info: $Revision: 1.2 $ on $Date: 86/11/23 17:17:59 $ | ||
- * $Source: /users/faustus/x | ||
+/* RCS Info: $Revision: 1.1.1.1 $ on $Date: 1993/06/12 14:41:06 $ | ||
+ * $Source: /home/ncvs/src/g | ||
* Copyright (c) 1986 Wayne A. Christopher, U. C. Berkeley CAD Group | ||
* Permission is granted to do anything with this code except sell it | ||
* or remove this message. | ||
@@ -71,7 +71,7 @@ load_game(file) | ||
message_add(win1 | ||
if (!oneboard) | ||
message_add(win2 | ||
- | ||
+ | ||
fgets(buf, BSIZE, fp); | ||
if (eq(buf, "\tenglish\n")) | ||
eflag = true; | ||
@@ -106,7 +106,7 @@ load_game(file) | ||
while (fgets(buf, BSIZE, fp)) | ||
message_add(win1 | ||
- | ||
+ | ||
fclose(fp); | ||
return; | ||
@@ -179,7 +179,7 @@ parse_file(fp, b, english) | ||
* name followed by a row number. If the column name is kr, kn, kb, k, q, | ||
* qb, qn, or qr, then the row number is according to the english system, | ||
* or if it is a-h then it is according to the international system. | ||
- * | ||
+ * | ||
*** As of now the spec must include the position. | ||
*/ | ||
@@ -380,7 +380,7 @@ if (debug) fprintf(stderr, "(alg) parsing %s\n", buf); | ||
else if ((m->piece.type == KING) && (m->fromy == m->toy) && | ||
(m->fromx == 4) && (m->tox == 2)) | ||
m->type = QCASTLE; | ||
- | ||
+ | ||
return (m); | ||
} | ||
@@ -20,9 +20,9 @@ file named COPYING. Among other things, the copyright notice | ||
and this notice must be preserved on all copies. */ | ||
-/* RCS Info: $Revision: 1.2 $ on $Date: 86/11/26 12:10:38 $ | ||
- * $Source: /users/faustus/x | ||
- * Copyright (c) 1986 Wayne A. Christopher, U. C. Berkeley CAD Group | ||
+/* RCS Info: $Revision: 1.1.1.1 $ on $Date: 1993/06/12 14:41:13 $ | ||
+ * $Source: /home/ncvs/src/g | ||
+ * Copyright (c) 1986 Wayne A. Christopher, U. C. Berkeley CAD Group | ||
* faustus@cad.berk | ||
* Permission is granted to modify and re-distribute this code in any manner | ||
* as long as this notice is preserved. All standard disclaimers apply. | ||
@@ -75,7 +75,7 @@ pop_question(win | ||
XMapRaised(win-> | ||
XSetFont(win->di | ||
win->medium->fid | ||
- | ||
+ | ||
for (i = 0, s = text; i < nlines - 4; i++) { | ||
for (t = s, j = 0; *t && (*t != '\n'); t++, j++) | ||
; |
@@ -20,7 +20,7 @@ file named COPYING. Among other things, the copyright notice | ||
and this notice must be preserved on all copies. */ | ||
-/* RCS Info: $Revision: 1.2 $ on $Date: 1994/01/07 11:10:40 $ | ||
+/* RCS Info: $Revision: 1.3 $ on $Date: 1994/11/04 02:11:30 $ | ||
* $Source: /home/ncvs/src/g | ||
* Copyright (c) 1986 Wayne A. Christopher, U. C. Berkeley CAD Group | ||
* Permission is granted to do anything with this code except sell it | ||
@@ -62,7 +62,7 @@ program_init(nam | ||
sprintf (moves, "%d", movesperunit); | ||
if (proghost) | ||
execl("/usr/ucb/ | ||
- moves, time, | ||
+ moves, time, | ||
(char *) NULL); | ||
else | ||
execl(name, name, moves, time, (char *) NULL); |
@@ -20,8 +20,8 @@ file named COPYING. Among other things, the copyright notice | ||
and this notice must be preserved on all copies. */ | ||
-/* RCS Info: $Revision: 1.4 $ on $Date: 86/11/23 17:18:20 $ | ||
- * $Source: /users/faustus/x | ||
+/* RCS Info: $Revision: 1.1.1.1 $ on $Date: 1993/06/12 14:41:09 $ | ||
+ * $Source: /home/ncvs/src/g | ||
* Copyright (c) 1986 Wayne A. Christopher, U. C. Berkeley CAD Group | ||
* Permission is granted to do anything with this code except sell it | ||
* or remove this message. | ||
@@ -56,7 +56,7 @@ record_init(win) | ||
i = XTextWidth(win-> | ||
sizeof(RECORD_HE | ||
i = (40 * win->small->max_ | ||
- win->medium->max | ||
+ win->medium->max | ||
win->medium->max | ||
TxtGrab(win->dis | ||
win->textcolor.p | ||
@@ -64,7 +64,7 @@ record_init(win) | ||
for (; i > 0; i++) | ||
TxtWriteStr(win- | ||
TxtWriteStr(win- | ||
- | ||
+ | ||
if (saveflag) { | ||
if (!(backup = fopen(record_fil | ||
perror(record_fi | ||
@@ -72,7 +72,7 @@ record_init(win) | ||
} else { | ||
fprintf(backup, "X Chess -- %s\n", datestring()); | ||
if (dispname2) | ||
- fprintf(backup, "\tWhite on %s, black on %s\n", | ||
+ fprintf(backup, "\tWhite on %s, black on %s\n", | ||
dispname1, dispname2); | ||
else | ||
fprintf(backup, "\tGame played on %s\n", | ||
@@ -136,7 +136,7 @@ record_save() | ||
} | ||
fprintf(fp, "X Chess -- %s\n", datestring()); | ||
if (dispname2) | ||
- fprintf(fp, "\tWhite on %s, black on %s\n", | ||
+ fprintf(fp, "\tWhite on %s, black on %s\n", | ||
dispname1, dispname2); | ||
else | ||
fprintf(fp, "\tGame played on %s\n", dispname1); | ||
@@ -201,7 +201,7 @@ record_back() | ||
s = buf; | ||
for (i = 0; *s != '\0'; i++) | ||
*s++ = ''; /* control H, backspace */ | ||
- | ||
+ | ||
TxtWriteStr(win1 | ||
if (!oneboard) { | ||
TxtWriteStr(win2 | ||
@@ -279,9 +279,9 @@ movestring(m) | ||
sprintf(buf, "something strange"); | ||
break; | ||
} | ||
- if ((m->piece.type == PAWN) && (((m->piece.colo | ||
+ if ((m->piece.type == PAWN) && (((m->piece.colo | ||
(m->toy == 7)) || ((m->piece.color | ||
- (m->toy == 0)))) | ||
+ (m->toy == 0)))) | ||
strcat(buf, "(Q)"); | ||
#ifdef smartass |
@@ -1,7 +1,7 @@ | ||
/* | ||
* A Scrollable Text Output Window | ||
* | ||
- * David Harrison | ||
+ * David Harrison | ||
* University of California, Berkeley | ||
* 1986 | ||
* | ||
@@ -204,7 +204,7 @@ int bg, fg, cur; /* Background, foreground, and cursor colors */ | ||
XWindowAttribute | ||
int index; | ||
XGCValues gc_val; | ||
- | ||
+ | ||
if (textWindows == (XAssocTable *) 0) { | ||
textWindows = XCreateAssocTabl | ||
if (textWindows == (XAssocTable *) 0) return(0); | ||
@@ -259,7 +259,7 @@ int bg, fg, cur; /* Background, foreground, and cursor colors */ | ||
winInfo.width - BARSIZE, | ||
0, BARSIZE - (2*BARBORDER), | ||
winInfo.height - (2*BARBORDER), | ||
- BARBORDER, | ||
+ BARBORDER, | ||
fg, bg); | ||
XSelectInput(dis | ||
XMapRaised(displ | ||
@@ -302,7 +302,7 @@ int bg, fg, cur; /* Background, foreground, and cursor colors */ | ||
newWin->fontGC[i | ||
} | ||
- | ||
+ | ||
/* Initialize size of first line */ | ||
newWin->txtBuffe | ||
newWin->theFonts | ||
@@ -391,7 +391,7 @@ struct txtWin *textInfo; /* Text window information */ | ||
(startPos > 0) && (textInfo->mainB | ||
startPos--) | ||
/* null loop body */; | ||
- | ||
+ | ||
/* Clear out the old line start array */ | ||
for (index = 0; index < textInfo->numLin | ||
InitLine(textInf | ||
@@ -411,7 +411,7 @@ struct txtWin *textInfo; /* Text window information */ | ||
curfont = 0; | ||
for (index = 0; index < textInfo->bufSpo | ||
theChar = bufptr[index] & CHARMASK; | ||
- | ||
+ | ||
if ((bufptr[index] & FONTMASK) != curfont) { | ||
int newFontNum, heightDiff; | ||
@@ -503,7 +503,7 @@ int newColor; /* Color of font */ | ||
struct txtWin *textInfo; | ||
int redrawFlag; | ||
XGCValues gc_val; | ||
- | ||
+ | ||
if ((fontNumber < 0) || (fontNumber >= MAXFONTS)) return 0; | ||
if ((textInfo = (struct txtWin *) | ||
XLookUpAssoc(dis | ||
@@ -518,7 +518,7 @@ int newColor; /* Color of font */ | ||
gc_val.plane_mas | ||
gc_val.graphics_ | ||
gc_val.function = GXcopy; | ||
- | ||
+ | ||
if (textInfo->fontG | ||
{ | ||
XChangeGC(displa | ||
@@ -532,7 +532,7 @@ int newColor; /* Color of font */ | ||
GCFunction | | ||
GCPlaneMask | | ||
GCGraphicsExposu | ||
- &gc_val); | ||
+ &gc_val); | ||
redrawFlag = (textInfo->theFo | ||
@@ -622,7 +622,7 @@ struct txtWin *textInfo; /* Text window information */ | ||
if (bottom == textInfo->h-(2*B | ||
XFillRectangle(d | ||
- textInfo->bgGC, | ||
+ textInfo->bgGC, | ||
0, 0, BARSIZE, top-1); | ||
#ifdef __FreeBSD__ | ||
XFillRectangle(d | ||
@@ -648,7 +648,7 @@ Display *display; | ||
Window w; | ||
/* | ||
* This routine clears a scrollable text window. It resets the current | ||
- * writing position to the upper left hand corner of the screen. | ||
+ * writing position to the upper left hand corner of the screen. | ||
* NOTE: THIS ALSO CLEARS THE CONTENTS OF THE TEXT WINDOW BUFFER AND | ||
* RESETS THE SCROLL BAR. Returns 0 if the window is not a text window. | ||
* This should be used *instead* of XClear. | ||
@@ -674,7 +674,7 @@ Window w; | ||
textInfo->endLin | ||
textInfo->curLin | ||
textInfo->curX = 0; | ||
- textInfo->curY = YPADDING + textInfo->theFon | ||
+ textInfo->curY = YPADDING + textInfo->theFon | ||
+ textInfo->theFon | ||
textInfo->bottom | ||
@@ -1119,7 +1119,7 @@ int ypos; /* Y position for line */ | ||
curX += CharSize(textInf | ||
glyph++; | ||
} | ||
- | ||
+ | ||
/* Flush out the glyphs */ | ||
XFillRectangle(d | ||
textInfo->bgGC, | ||
@@ -1191,7 +1191,7 @@ int flagWord; /* DODISP or nothing */ | ||
if ((textInfo->curY | ||
INTERLINE) > textInfo->h) | ||
{ | ||
- /* | ||
+ /* | ||
* General approach: "unscroll" the last line up | ||
* and then call ScrollDown to do the right thing. | ||
*/ | ||
@@ -1210,7 +1210,7 @@ int flagWord; /* DODISP or nothing */ | ||
(textInfo->botto | ||
thisLine->lineHe | ||
} | ||
- else | ||
+ else | ||
{ | ||
/* Just update bottom space */ | ||
textInfo->bottom | ||
@@ -1251,7 +1251,7 @@ register char *str; /* 0 terminated string */ | ||
* - A new font can be chosen using the sequence '^F<digit>' where | ||
* <digit> is 0-7. The directive will be ignored if | ||
* there is no font in the specified slot. | ||
- * Returns 0 if something went wrong. | ||
+ * Returns 0 if something went wrong. | ||
*/ | ||
{ | ||
register int fontIndex; | ||
@@ -1260,7 +1260,7 @@ register char *str; /* 0 terminated string */ | ||
if ((textInfo = (struct txtWin *) XLookUpAssoc(dis | ||
return 0; | ||
- | ||
+ | ||
/* See if screen needs to be updated */ | ||
if (textInfo->flagW | ||
TxtRepaint(displ | ||
@@ -1292,7 +1292,7 @@ register char *str; /* 0 terminated string */ | ||
continue; | ||
} | ||
} | ||
- | ||
+ | ||
/* Inline code for handling normal character case */ | ||
if ((*str >= LOWCHAR) && (*str <= HIGHCHAR)) { | ||
register XFontStruct *thisFont; | ||
@@ -1324,21 +1324,21 @@ register char *str; /* 0 terminated string */ | ||
HandleNewLine(di | ||
thisLine = textInfo->txtBuf | ||
} | ||
- | ||
+ | ||
/* Ready to draw character */ | ||
XDrawString(disp | ||
- DEFAULT_GC, | ||
+ DEFAULT_GC, | ||
textInfo->curX += charWidth, | ||
- textInfo->curY + thisLine->lineHe | ||
+ textInfo->curY + thisLine->lineHe | ||
str, 1); | ||
- | ||
+ | ||
/* Append character onto main buffer */ | ||
if (textInfo->bufSp | ||
/* Make room for more characters */ | ||
ExpandBuffer(tex | ||
textInfo->mainBu | ||
(textInfo->curFo | ||
- | ||
+ | ||
/* Update the line start array */ | ||
thisLine->lineLe | ||
thisLine->lineWi | ||
@@ -1384,7 +1384,7 @@ register char *str; /* NULL terminated string */ | ||
if ((textInfo = (struct txtWin *) XLookUpAssoc(dis | ||
) == 0) | ||
return 0; | ||
- | ||
+ | ||
for ( /* str is ok */ ; (*str != 0) ; str++) { | ||
/* Check to see if we are waiting on a font */ | ||
if (textInfo->flagW | ||
@@ -1402,7 +1402,7 @@ register char *str; /* NULL terminated string */ | ||
register XFontStruct *thisFont; | ||
register struct txtLine *thisLine; | ||
register int charWidth; | ||
- | ||
+ | ||
/* Determine size of character */ | ||
thisFont = &(textInfo->theF | ||
@@ -1429,7 +1429,7 @@ register char *str; /* NULL terminated string */ | ||
ExpandBuffer(tex | ||
textInfo->mainBu | ||
(textInfo->curFo | ||
- | ||
+ | ||
/* Update the line start array */ | ||
thisLine->lineLe | ||
thisLine->lineWi | ||
@@ -1455,7 +1455,7 @@ Display *display; | ||
Window w; | ||
/* | ||
* Repaints the given scrollable text window. The routine repaints | ||
- * the entire window. For handling exposure events, the TxtFilter | ||
+ * the entire window. For handling exposure events, the TxtFilter | ||
* routine should be used. | ||
*/ | ||
{ | ||
@@ -1589,7 +1589,7 @@ struct txtWin *textInfo; /* Text window information */ | ||
0, textInfo->h - textInfo->bottom | ||
textInfo->w, textInfo->bottom | ||
#endif | ||
- | ||
+ | ||
UpdateExposures( | ||
UpdateScroll(dis | ||
@@ -1774,7 +1774,7 @@ XEvent *evt; | ||
return 0; | ||
if ((textInfo = (struct txtWin *) | ||
- XLookUpAssoc(dis | ||
+ XLookUpAssoc(dis | ||
return 0; | ||
/* Determine whether it's main window or not */ |
@@ -1,7 +1,7 @@ | ||
/* | ||
* A Scrollable Text Output Window | ||
* | ||
- * David Harrison | ||
+ * David Harrison | ||
* University of California, Berkeley | ||
* 1986 | ||
* | ||
@@ -204,7 +204,7 @@ int bg, fg, cur; /* Background, foreground, and cursor colors */ | ||
XWindowAttribute | ||
int index; | ||
XGCValues gc_val; | ||
- | ||
+ | ||
if (textWindows == (XAssocTable *) 0) { | ||
textWindows = XCreateAssocTabl | ||
if (textWindows == (XAssocTable *) 0) return(0); | ||
@@ -259,7 +259,7 @@ int bg, fg, cur; /* Background, foreground, and cursor colors */ | ||
winInfo.width - BARSIZE, | ||
0, BARSIZE - (2*BARBORDER), | ||
winInfo.height - (2*BARBORDER), | ||
- BARBORDER, | ||
+ BARBORDER, | ||
fg, bg); | ||
XSelectInput(dis | ||
XMapRaised(displ | ||
@@ -302,7 +302,7 @@ int bg, fg, cur; /* Background, foreground, and cursor colors */ | ||
newWin->fontGC[i | ||
} | ||
- | ||
+ | ||
/* Initialize size of first line */ | ||
newWin->txtBuffe | ||
newWin->theFonts | ||
@@ -391,7 +391,7 @@ struct txtWin *textInfo; /* Text window information */ | ||
(startPos > 0) && (textInfo->mainB | ||
startPos--) | ||
/* null loop body */; | ||
- | ||
+ | ||
/* Clear out the old line start array */ | ||
for (index = 0; index < textInfo->numLin | ||
InitLine(textInf | ||
@@ -411,7 +411,7 @@ struct txtWin *textInfo; /* Text window information */ | ||
curfont = 0; | ||
for (index = 0; index < textInfo->bufSpo | ||
theChar = bufptr[index] & CHARMASK; | ||
- | ||
+ | ||
if ((bufptr[index] & FONTMASK) != curfont) { | ||
int newFontNum, heightDiff; | ||
@@ -503,7 +503,7 @@ int newColor; /* Color of font */ | ||
struct txtWin *textInfo; | ||
int redrawFlag; | ||
XGCValues gc_val; | ||
- | ||
+ | ||
if ((fontNumber < 0) || (fontNumber >= MAXFONTS)) return 0; | ||
if ((textInfo = (struct txtWin *) | ||
XLookUpAssoc(dis | ||
@@ -518,7 +518,7 @@ int newColor; /* Color of font */ | ||
gc_val.plane_mas | ||
gc_val.graphics_ | ||
gc_val.function = GXcopy; | ||
- | ||
+ | ||
if (textInfo->fontG | ||
{ | ||
XChangeGC(displa | ||
@@ -532,7 +532,7 @@ int newColor; /* Color of font */ | ||
GCFunction | | ||
GCPlaneMask | | ||
GCGraphicsExposu | ||
- &gc_val); | ||
+ &gc_val); | ||
redrawFlag = (textInfo->theFo | ||
@@ -622,7 +622,7 @@ struct txtWin *textInfo; /* Text window information */ | ||
if (bottom == textInfo->h-(2*B | ||
XFillRectangle(d | ||
- textInfo->bgGC, | ||
+ textInfo->bgGC, | ||
0, 0, BARSIZE, top-1); | ||
XFillRectangle(d | ||
DEFAULT_GC, top, BARSIZE - (2*BARBORDER) - 2, | ||
@@ -642,7 +642,7 @@ Display *display; | ||
Window w; | ||
/* | ||
* This routine clears a scrollable text window. It resets the current | ||
- * writing position to the upper left hand corner of the screen. | ||
+ * writing position to the upper left hand corner of the screen. | ||
* NOTE: THIS ALSO CLEARS THE CONTENTS OF THE TEXT WINDOW BUFFER AND | ||
* RESETS THE SCROLL BAR. Returns 0 if the window is not a text window. | ||
* This should be used *instead* of XClear. | ||
@@ -668,7 +668,7 @@ Window w; | ||
textInfo->endLin | ||
textInfo->curLin | ||
textInfo->curX = 0; | ||
- textInfo->curY = YPADDING + textInfo->theFon | ||
+ textInfo->curY = YPADDING + textInfo->theFon | ||
+ textInfo->theFon | ||
textInfo->bottom | ||
@@ -1106,7 +1106,7 @@ int ypos; /* Y position for line */ | ||
curX += CharSize(textInf | ||
glyph++; | ||
} | ||
- | ||
+ | ||
/* Flush out the glyphs */ | ||
XFillRectangle(d | ||
textInfo->bgGC, | ||
@@ -1178,7 +1178,7 @@ int flagWord; /* DODISP or nothing */ | ||
if ((textInfo->curY | ||
INTERLINE) > textInfo->h) | ||
{ | ||
- /* | ||
+ /* | ||
* General approach: "unscroll" the last line up | ||
* and then call ScrollDown to do the right thing. | ||
*/ | ||
@@ -1197,7 +1197,7 @@ int flagWord; /* DODISP or nothing */ | ||
(textInfo->botto | ||
thisLine->lineHe | ||
} | ||
- else | ||
+ else | ||
{ | ||
/* Just update bottom space */ | ||
textInfo->bottom | ||
@@ -1238,7 +1238,7 @@ register char *str; /* 0 terminated string */ | ||
* - A new font can be chosen using the sequence '^F<digit>' where | ||
* <digit> is 0-7. The directive will be ignored if | ||
* there is no font in the specified slot. | ||
- * Returns 0 if something went wrong. | ||
+ * Returns 0 if something went wrong. | ||
*/ | ||
{ | ||
register int fontIndex; | ||
@@ -1247,7 +1247,7 @@ register char *str; /* 0 terminated string */ | ||
if ((textInfo = (struct txtWin *) XLookUpAssoc(dis | ||
return 0; | ||
- | ||
+ | ||
/* See if screen needs to be updated */ | ||
if (textInfo->flagW | ||
TxtRepaint(displ | ||
@@ -1279,7 +1279,7 @@ register char *str; /* 0 terminated string */ | ||
continue; | ||
} | ||
} | ||
- | ||
+ | ||
/* Inline code for handling normal character case */ | ||
if ((*str >= LOWCHAR) && (*str <= HIGHCHAR)) { | ||
register XFontStruct *thisFont; | ||
@@ -1311,21 +1311,21 @@ register char *str; /* 0 terminated string */ | ||
HandleNewLine(di | ||
thisLine = textInfo->txtBuf | ||
} | ||
- | ||
+ | ||
/* Ready to draw character */ | ||
XDrawString(disp | ||
- DEFAULT_GC, | ||
+ DEFAULT_GC, | ||
textInfo->curX += charWidth, | ||
- textInfo->curY + thisLine->lineHe | ||
+ textInfo->curY + thisLine->lineHe | ||
str, 1); | ||
- | ||
+ | ||
/* Append character onto main buffer */ | ||
if (textInfo->bufSp | ||
/* Make room for more characters */ | ||
ExpandBuffer(tex | ||
textInfo->mainBu | ||
(textInfo->curFo | ||
- | ||
+ | ||
/* Update the line start array */ | ||
thisLine->lineLe | ||
thisLine->lineWi | ||
@@ -1371,7 +1371,7 @@ register char *str; /* NULL terminated string */ | ||
if ((textInfo = (struct txtWin *) XLookUpAssoc(dis | ||
) == 0) | ||
return 0; | ||
- | ||
+ | ||
for ( /* str is ok */ ; (*str != 0) ; str++) { | ||
/* Check to see if we are waiting on a font */ | ||
if (textInfo->flagW | ||
@@ -1389,7 +1389,7 @@ register char *str; /* NULL terminated string */ | ||
register XFontStruct *thisFont; | ||
register struct txtLine *thisLine; | ||
register int charWidth; | ||
- | ||
+ | ||
/* Determine size of character */ | ||
thisFont = &(textInfo->theF | ||
@@ -1416,7 +1416,7 @@ register char *str; /* NULL terminated string */ | ||
ExpandBuffer(tex | ||
textInfo->mainBu | ||
(textInfo->curFo | ||
- | ||
+ | ||
/* Update the line start array */ | ||
thisLine->lineLe | ||
thisLine->lineWi | ||
@@ -1442,7 +1442,7 @@ Display *display; | ||
Window w; | ||
/* | ||
* Repaints the given scrollable text window. The routine repaints | ||
- * the entire window. For handling exposure events, the TxtFilter | ||
+ * the entire window. For handling exposure events, the TxtFilter | ||
* routine should be used. | ||
*/ | ||
{ | ||
@@ -1570,7 +1570,7 @@ struct txtWin *textInfo; /* Text window information */ | ||
XClearArea(displ | ||
0, textInfo->h - textInfo->bottom | ||
textInfo->w, textInfo->bottom | ||
- | ||
+ | ||
UpdateExposures( | ||
UpdateScroll(dis | ||
@@ -1755,7 +1755,7 @@ XEvent *evt; | ||
return 0; | ||
if ((textInfo = (struct txtWin *) | ||
- XLookUpAssoc(dis | ||
+ XLookUpAssoc(dis | ||
return 0; | ||
/* Determine whether it's main window or not */ |
@@ -20,7 +20,7 @@ file named COPYING. Among other things, the copyright notice | ||
and this notice must be preserved on all copies. */ | ||
-/* RCS Info: $Revision: 1.2 $ on $Date: 1994/01/07 11:10:42 $ | ||
+/* RCS Info: $Revision: 1.3 $ on $Date: 1994/11/04 02:11:33 $ | ||
* $Source: /home/ncvs/src/g | ||
* Copyright (c) 1985 Wayne A. Christopher, U. C. Berkeley CAD Group | ||
* | ||
@@ -62,7 +62,7 @@ copy(str) | ||
char *str; | ||
{ | ||
char *p, *tmalloc(); | ||
- | ||
+ | ||
p = tmalloc(strlen(s | ||
strcpy(p, str); | ||
return(p); | ||
@@ -90,7 +90,7 @@ substring(sub, str) | ||
} | ||
/* Malloc num bytes and initialize to zero. Fatal error if the space can't | ||
- * be malloc'd. | ||
+ * be malloc'd. | ||
*/ | ||
char * | ||
@@ -375,7 +375,7 @@ setenv(name, value) | ||
environ = xx; | ||
} else | ||
xx = environ; | ||
- | ||
+ | ||
xx[i] = tmalloc(strlen(n | ||
sprintf(xx[i], "%s=%s", name, value); | ||
return; |
@@ -20,8 +20,8 @@ file named COPYING. Among other things, the copyright notice | ||
and this notice must be preserved on all copies. */ | ||
-/* RCS Info: $Revision: 1.3 $ on $Date: 86/11/23 17:18:35 $ | ||
- * $Source: /users/faustus/x | ||
+/* RCS Info: $Revision: 1.1.1.1 $ on $Date: 1993/06/12 14:41:08 $ | ||
+ * $Source: /home/ncvs/src/g | ||
* Copyright (c) 1986 Wayne A. Christopher, U. C. Berkeley CAD Group | ||
* Permission is granted to do anything with this code except sell it | ||
* or remove this message. | ||
@@ -49,10 +49,10 @@ valid_move(m, b) | ||
board_move(&tb, m); | ||
if (ischeck(&tb, m->piece.color)) | ||
return (false); | ||
- | ||
+ | ||
if (ischeck(&tb, ((m->piece.color | ||
m->check = true; | ||
- | ||
+ | ||
return (true); | ||
} | ||
@@ -66,7 +66,7 @@ couldmove(m, b) | ||
switch (m->type) { | ||
case KCASTLE: | ||
if ((m->piece.color | ||
- (m->piece.color == BLACK) && | ||
+ (m->piece.color == BLACK) && | ||
(b->black_cant_c | ||
return (false); | ||
if ((b->square[m->f | ||
@@ -78,7 +78,7 @@ couldmove(m, b) | ||
case QCASTLE: | ||
if ((m->piece.color | ||
- (m->piece.color == BLACK) && | ||
+ (m->piece.color == BLACK) && | ||
(b->black_cant_c | ||
return (false); | ||
if ((b->square[m->f | ||
@@ -129,7 +129,7 @@ couldmove(m, b) | ||
*/ | ||
if (m->enpassant) { | ||
if (b->square[(m->p | ||
- ? 3 : 4][m->tox].color | ||
+ ? 3 : 4][m->tox].color | ||
((m->piece.color | ||
BLACK : WHITE)) | ||
break; |
@@ -19,8 +19,8 @@ file named COPYING. Among other things, the copyright notice | ||
and this notice must be preserved on all copies. */ | ||
-/* RCS Info: $Revision: 1.5 $ on $Date: 86/11/26 12:11:15 $ | ||
- * $Source: /users/faustus/x | ||
+/* RCS Info: $Revision: 1.1.1.1 $ on $Date: 1993/06/12 14:41:08 $ | ||
+ * $Source: /home/ncvs/src/g | ||
* Copyright (c) 1986 Wayne A. Christopher, U. C. Berkeley CAD Group | ||
* Permission is granted to do anything with this code except sell it | ||
* or remove this message. | ||
@@ -89,7 +89,7 @@ win_setup(disp1, | ||
win2->flipped = true; | ||
win_drawboard(wi | ||
} | ||
- | ||
+ | ||
return(true); | ||
} | ||
@@ -199,7 +199,7 @@ win_drawpiece(p, | ||
XSetState(win->d | ||
BlackPixel(win-> | ||
WhitePixel(win-> | ||
- | ||
+ | ||
tmpPM = XCreateBitmapFro | ||
shade_bits, SQUARE_WIDTH, SQUARE_HEIGHT); | ||
@@ -209,7 +209,7 @@ win_drawpiece(p, | ||
y * (SQUARE_HEIGHT + BORDER_WIDTH), 1); | ||
XFreePixmap(win- | ||
- | ||
+ | ||
XSetFunction(win | ||
GXandInverted); | ||
maskPM = XCreateBitmapFro | ||
@@ -268,16 +268,16 @@ win_drawpiece(p, | ||
gc.background = win->blacksquare | ||
gc.font = win->small->fid; | ||
- | ||
+ | ||
XChangeGC(win->d | ||
GCForeground | GCBackground | GCFont, &gc); | ||
- | ||
+ | ||
if (!x) { | ||
sprintf(buf, " %d", SIZE - y); | ||
XDrawImageString | ||
DefaultGC(win->d | ||
- 1, (y + 1) * (SQUARE_HEIGHT + | ||
- BORDER_WIDTH) - BORDER_WIDTH + | ||
+ 1, (y + 1) * (SQUARE_HEIGHT + | ||
+ BORDER_WIDTH) - BORDER_WIDTH + | ||
win->small->max_ | ||
} | ||
if (y == SIZE - 1) { | ||
@@ -285,7 +285,7 @@ win_drawpiece(p, | ||
XDrawImageString | ||
DefaultGC(win->d | ||
x * (SQUARE_WIDTH + BORDER_WIDTH) + 1, | ||
- SIZE * (SQUARE_HEIGHT + BORDER_WIDTH) - BORDER_WIDTH + | ||
+ SIZE * (SQUARE_HEIGHT + BORDER_WIDTH) - BORDER_WIDTH + | ||
win->small->max_ | ||
} | ||
} | ||
@@ -301,12 +301,12 @@ win_erasepiece(y | ||
char buf[BSIZE]; | ||
XGCValues gc; | ||
Pixmap tmpPM; | ||
- | ||
+ | ||
if (oneboard || (wnum == win1->color)) | ||
win = win1; | ||
else | ||
win = win2; | ||
- | ||
+ | ||
if (win->flipped) { | ||
y = SIZE - y - 1; | ||
x = SIZE - x - 1; | ||
@@ -354,16 +354,16 @@ win_erasepiece(y | ||
gc.background = win->blacksquare | ||
gc.font = win->small->fid; | ||
- | ||
+ | ||
XChangeGC(win->d | ||
GCForeground | GCBackground | GCFont, &gc); | ||
- | ||
+ | ||
if (!x) { | ||
sprintf(buf, " %d", SIZE - y); | ||
XDrawImageString | ||
DefaultGC(win->d | ||
- 1, (y + 1) * (SQUARE_HEIGHT + | ||
- BORDER_WIDTH) - BORDER_WIDTH + | ||
+ 1, (y + 1) * (SQUARE_HEIGHT + | ||
+ BORDER_WIDTH) - BORDER_WIDTH + | ||
win->small->max_ | ||
} | ||
if (y == SIZE - 1) { | ||
@@ -371,11 +371,11 @@ win_erasepiece(y | ||
XDrawImageString | ||
DefaultGC(win->d | ||
x * (SQUARE_WIDTH + BORDER_WIDTH) + 1, | ||
- SIZE * (SQUARE_HEIGHT + BORDER_WIDTH) - BORDER_WIDTH + | ||
+ SIZE * (SQUARE_HEIGHT + BORDER_WIDTH) - BORDER_WIDTH + | ||
win->small->max_ | ||
} | ||
} | ||
- | ||
+ | ||
return; | ||
} | ||
@@ -392,7 +392,7 @@ win_flash(m, wnum) | ||
win = win1; | ||
else | ||
win = win2; | ||
- | ||
+ | ||
if (win->flipped) { | ||
sx = SIZE - m->fromx - 1; | ||
sy = SIZE - m->fromy - 1; | ||
@@ -417,7 +417,7 @@ win_flash(m, wnum) | ||
DefaultGC(win->d | ||
sx, sy, ex, ey); | ||
} | ||
- | ||
+ | ||
XSetFunction(win | ||
return; | ||
} | ||
@@ -598,7 +598,7 @@ win_redraw(win, event) | ||
x2 = SIZE - x1 - 1; | ||
} | ||
- for (i = x1; i <= x2; i++) | ||
+ for (i = x1; i <= x2; i++) | ||
for (j = y1; j <= y2; j++) { | ||
if (chessboard->squ | ||
win_erasepiece(j | ||
@@ -613,7 +613,7 @@ win_redraw(win, event) | ||
j, i, BLACK); | ||
} | ||
} | ||
- | ||
+ | ||
return; | ||
} | ||
@@ -627,11 +627,11 @@ setup(dispname, win) | ||
Cursor cur; | ||
extern char *program, *recfile; | ||
XSizeHints xsizes; | ||
- | ||
+ | ||
if (!(win->display = XOpenDisplay(dis | ||
return (false); | ||
- | ||
+ | ||
/* Now get boolean defaults... */ | ||
if ((s = XGetDefault(win- | ||
@@ -646,13 +646,13 @@ setup(dispname, win) | ||
quickflag = true; | ||
if ((s = XGetDefault(win- | ||
win_flashmove = true; | ||
- | ||
+ | ||
/* ... numeric variables ... */ | ||
if (s = XGetDefault(win- | ||
num_flashes = atoi(s); | ||
if (s = XGetDefault(win- | ||
flash_size = atoi(s); | ||
- | ||
+ | ||
/* ... and strings. */ | ||
if (s = XGetDefault(win- | ||
progname = s; | ||
@@ -683,7 +683,7 @@ setup(dispname, win) | ||
if ((DisplayPlanes( | ||
win->bnw = true; | ||
- | ||
+ | ||
/* Allocate colors... */ | ||
if (win->bnw) { | ||
win->blackpiece. | ||
@@ -699,64 +699,64 @@ setup(dispname, win) | ||
} else { | ||
if (!XParseColor(wi | ||
DefaultColormap( | ||
- black_piece_colo | ||
+ black_piece_colo | ||
!XParseColor(win | ||
DefaultColormap( | ||
- white_piece_colo | ||
+ white_piece_colo | ||
!XParseColor(win | ||
DefaultColormap( | ||
- black_square_col | ||
+ black_square_col | ||
!XParseColor(win | ||
DefaultColormap( | ||
- white_square_col | ||
+ white_square_col | ||
!XParseColor(win | ||
DefaultColormap( | ||
- border_color, &win->border) || | ||
+ border_color, &win->border) || | ||
!XParseColor(win | ||
DefaultColormap( | ||
- text_color, &win->textcolor) | ||
+ text_color, &win->textcolor) | ||
!XParseColor(win | ||
DefaultColormap( | ||
- text_back, &win->textback) || | ||
+ text_back, &win->textback) || | ||
!XParseColor(win | ||
DefaultColormap( | ||
- error_text, &win->errortext) | ||
+ error_text, &win->errortext) | ||
!XParseColor(win | ||
DefaultColormap( | ||
- player_text, &win->playertext | ||
+ player_text, &win->playertext | ||
!XParseColor(win | ||
DefaultColormap( | ||
cursor_color, &win->cursorcolo | ||
!XAllocColor(win | ||
DefaultColormap( | ||
- &win->blackpiece | ||
+ &win->blackpiece | ||
!XAllocColor(win | ||
DefaultColormap( | ||
- &win->whitepiece | ||
+ &win->whitepiece | ||
!XAllocColor(win | ||
DefaultColormap( | ||
- &win->blacksquar | ||
+ &win->blacksquar | ||
!XAllocColor(win | ||
DefaultColormap( | ||
- &win->whitesquar | ||
+ &win->whitesquar | ||
!XAllocColor(win | ||
DefaultColormap( | ||
- &win->border) || | ||
+ &win->border) || | ||
!XAllocColor(win | ||
DefaultColormap( | ||
- &win->textcolor) | ||
+ &win->textcolor) | ||
!XAllocColor(win | ||
DefaultColormap( | ||
- &win->textback) || | ||
+ &win->textback) || | ||
!XAllocColor(win | ||
DefaultColormap( | ||
- &win->errortext) | ||
+ &win->errortext) | ||
!XAllocColor(win | ||
DefaultColormap( | ||
- &win->playertext | ||
+ &win->playertext | ||
!XAllocColor(win | ||
DefaultColormap( | ||
- &win->cursorcolo | ||
+ &win->cursorcolo | ||
fprintf(stderr, "Can't get colors...\n"); | ||
} | ||
@@ -773,17 +773,17 @@ setup(dispname, win) | ||
NULL) | ||
fprintf(stderr, "Can't get large font...\n"); | ||
- | ||
+ | ||
/* Create the windows... */ | ||
win->basewin = | ||
XCreateSimpleWin | ||
- BASE_XPOS, BASE_YPOS, | ||
+ BASE_XPOS, BASE_YPOS, | ||
BASE_WIDTH, BASE_HEIGHT, 0, | ||
BlackPixel(win-> | ||
- WhitePixel(win-> | ||
+ WhitePixel(win-> | ||
win->boardwin = XCreateSimpleWin | ||
- BOARD_XPOS, BOARD_YPOS, | ||
+ BOARD_XPOS, BOARD_YPOS, | ||
BOARD_WIDTH, BOARD_HEIGHT, | ||
BORDER_WIDTH, | ||
win->border.pixe | ||
@@ -819,7 +819,7 @@ setup(dispname, win) | ||
BUTTON_WIDTH, BUTTON_HEIGHT, | ||
BORDER_WIDTH, win->border.pixe | ||
win->textback.pi | ||
- | ||
+ | ||
/* Let's define an icon... */ | ||
win->iconpixmap = XCreatePixmapFro | ||
win->basewin, icon_bits, | ||
@@ -835,7 +835,7 @@ setup(dispname, win) | ||
XSetStandardProp | ||
program, program, win->iconpixmap, | ||
0, NULL, &xsizes); | ||
- | ||
+ | ||
bm = XCreateBitmapFro | ||
win->basewin, xchess_bits, | ||
xchess_width, xchess_height); | ||
@@ -848,7 +848,7 @@ setup(dispname, win) | ||
xchess_x_hot, xchess_y_hot); | ||
XFreePixmap(win- | ||
XFreePixmap(win- | ||
- | ||
+ | ||
XDefineCursor(wi | ||
XMapSubwindows(w | ||
@@ -866,7 +866,7 @@ setup(dispname, win) | ||
ButtonReleaseMas | ||
XSelectInput(win | ||
ButtonPressMask | ExposureMask); | ||
- | ||
+ | ||
message_init(win | ||
record_init(win) | ||
button_draw(win) | ||
@@ -900,12 +900,12 @@ drawgrid(win) | ||
gc.foreground = win->border.pixe | ||
gc.line_width = 0; | ||
gc.line_style = LineSolid; | ||
- | ||
+ | ||
XChangeGC(win->d | ||
DefaultGC(win->d | ||
GCFunction | GCPlaneMask | GCForeground | | ||
GCLineWidth | GCLineStyle, &gc); | ||
- | ||
+ | ||
/* Draw the lines... horizontal, */ | ||
for (i = 1; i < SIZE; i++) | ||
XDrawLine(win->d | ||
@@ -923,7 +923,7 @@ drawgrid(win) | ||
i * (SQUARE_WIDTH + BORDER_WIDTH) - | ||
BORDER_WIDTH / 2, 0, | ||
i * (SQUARE_WIDTH + BORDER_WIDTH) - | ||
- BORDER_WIDTH / 2, | ||
+ BORDER_WIDTH / 2, | ||
SIZE * (SQUARE_WIDTH + BORDER_WIDTH)); | ||
return; | ||
} |
@@ -20,8 +20,8 @@ file named COPYING. Among other things, the copyright notice | ||
and this notice must be preserved on all copies. */ | ||
-/* RCS Info: $Revision: 1.2 $ on $Date: 89/04/28 08:44:02 $ | ||
- * $Source: /usr/local/src/s | ||
+/* RCS Info: $Revision: 1.1.1.1 $ on $Date: 1993/06/12 14:41:09 $ | ||
+ * $Source: /home/ncvs/src/g | ||
* Copyright (c) 1986 Wayne A. Christopher, U. C. Berkeley CAD Group | ||
* Permission is granted to do anything with this code except sell it | ||
* or remove this message. | ||
@@ -82,7 +82,7 @@ main(ac, av) | ||
char *s; | ||
program = av[0]; | ||
- | ||
+ | ||
#ifdef notdef | ||
signal(SIGCHLD, die); | ||
#endif | ||
@@ -157,7 +157,7 @@ main(ac, av) | ||
if (!dispname2) | ||
oneboard = true; | ||
- | ||
+ | ||
srandom(getpid() | ||
if (!oneboard && randflag && (random() % 2)) { | ||
@@ -165,10 +165,10 @@ main(ac, av) | ||
dispname1 = dispname2; | ||
dispname2 = s; | ||
} | ||
- | ||
+ | ||
if (!dispname1) | ||
dispname1 = getenv("DISPLAY" | ||
- | ||
+ | ||
/* Set up the board. */ | ||
board_setup(); | ||
@@ -1,5 +1,5 @@ | ||
/* | ||
- C source for CHESS | ||
+ C source for CHESS | ||
Revision: 4-25-88 | ||
@@ -44,7 +44,7 @@ | ||
#define neutral 2 | ||
#define white 0 | ||
-#define black 1 | ||
+#define black 1 | ||
#define no_piece 0 | ||
#define pawn 1 | ||
#define knight 2 | ||
@@ -164,7 +164,7 @@ short unmap[120]= | ||
40,41,42,43,44,4 | ||
48,49,50,51,52,5 | ||
56,57,58,59,60,6 | ||
-short Dcode[120]= | ||
+short Dcode[120]= | ||
{0,1,1,1,1,1,1,1 | ||
0x10,0x11,0x12,0 | ||
0x10,0x21,0x11,0 | ||
@@ -287,7 +287,7 @@ short PawnAdvance[64]= | ||
12,16,24,32,32,2 | ||
12,16,24,32,32,2 | ||
0, 0, 0, 0, 0, 0, 0, 0}; | ||
- | ||
+ | ||
main(argc,argv) | ||
int argc; char *argv[]; | ||
@@ -331,8 +331,8 @@ short iop; | ||
unsigned short *mv; | ||
/* | ||
- Compare the string 's' to the list of legal moves available for the | ||
- opponent. If a match is found, make the move on the board. | ||
+ Compare the string 's' to the list of legal moves available for the | ||
+ opponent. If a match is found, make the move on the board. | ||
*/ | ||
{ | ||
@@ -373,7 +373,7 @@ struct leaf *node; | ||
if (xnode.flags & epmask) UpdateDisplay(0, | ||
else UpdateDisplay(xn | ||
if (xnode.flags & cstlmask) Game50 = GameCnt; | ||
- else if (board[xnode.t] == pawn || (xnode.flags & capture)) | ||
+ else if (board[xnode.t] == pawn || (xnode.flags & capture)) | ||
Game50 = GameCnt; | ||
GameList[GameCnt | ||
GameList[GameCnt | ||
@@ -384,7 +384,7 @@ struct leaf *node; | ||
*mv = (xnode.f << 8) + xnode.t; | ||
algbr(xnode.f,xn | ||
return(true); | ||
- } | ||
+ } | ||
} | ||
if (cnt > 1) ShowMessage("Amb | ||
return(false); | ||
@@ -464,12 +464,12 @@ SelectMove(side, | ||
short side,iop; | ||
/* | ||
- Select a move by calling function search() at progressively deeper | ||
- ply until time is up or a mate or draw is reached. An alpha-beta | ||
- window of -90 to +90 points is set around the score returned from the | ||
- previous iteration. If Sdepth != 0 then the program has correctly | ||
- predicted the opponents move and the search will start at a depth of | ||
- Sdepth+1 rather than a depth of 1. | ||
+ Select a move by calling function search() at progressively deeper | ||
+ ply until time is up or a mate or draw is reached. An alpha-beta | ||
+ window of -90 to +90 points is set around the score returned from the | ||
+ previous iteration. If Sdepth != 0 then the program has correctly | ||
+ predicted the opponents move and the search will start at a depth of | ||
+ Sdepth+1 rather than a depth of 1. | ||
*/ | ||
{ | ||
@@ -495,7 +495,7 @@ static short i,alpha,beta,sco | ||
ExaminePosition( | ||
ScorePosition(si | ||
ShowSidetomove() | ||
- | ||
+ | ||
if (Sdepth == 0) | ||
{ | ||
ZeroTTable(); | ||
@@ -516,7 +516,7 @@ static short i,alpha,beta,sco | ||
NodeCnt = ETnodes = EvalNodes = HashCnt = 0; | ||
Zscore = 0; zwndw = 20; | ||
} | ||
- | ||
+ | ||
while (!timeout && Sdepth < MaxSearchDepth) | ||
{ | ||
Sdepth++; | ||
@@ -576,7 +576,7 @@ static short i,alpha,beta,sco | ||
if (score == -9999 || score == 9998) mate = true; | ||
if (mate) hint = 0; | ||
if (root->flags & cstlmask) Game50 = GameCnt; | ||
- else if (board[root->t] == pawn || (root->flags & capture)) | ||
+ else if (board[root->t] == pawn || (root->flags & capture)) | ||
Game50 = GameCnt; | ||
GameList[GameCnt | ||
GameList[GameCnt | ||
@@ -599,13 +599,13 @@ static short i,alpha,beta,sco | ||
OpeningBook() | ||
/* | ||
- Go thru each of the opening lines of play and check for a match with | ||
- the current game listing. If a match occurs, generate a random number. | ||
- If this number is the largest generated so far then the next move in | ||
- this line becomes the current "candidate". After all lines are | ||
- checked, the candidate move is put at the top of the Tree[] array and | ||
- will be played by the program. Note that the program does not handle | ||
- book transpositions. | ||
+ Go thru each of the opening lines of play and check for a match with | ||
+ the current game listing. If a match occurs, generate a random number. | ||
+ If this number is the largest generated so far then the next move in | ||
+ this line becomes the current "candidate". After all lines are | ||
+ checked, the candidate move is put at the top of the Tree[] array and | ||
+ will be played by the program. Note that the program does not handle | ||
+ book transpositions. | ||
*/ | ||
{ | ||
@@ -630,7 +630,7 @@ struct BookEntry *p; | ||
} | ||
p = p->next; | ||
} | ||
- | ||
+ | ||
for (pnt = TrPnt[1]; pnt < TrPnt[2]; pnt++) | ||
if ((Tree[pnt].f<<8 | ||
pick(TrPnt[1],Tr | ||
@@ -658,12 +658,12 @@ short side,ply,depth,a | ||
unsigned short bstline[]; | ||
/* | ||
- Perform an alpha-beta search to determine the score for the current | ||
- board position. If depth <= 0 only capturing moves, pawn promotions | ||
- and responses to check are generated and searched, otherwise all | ||
- moves are processed. The search depth is modified for check evasions, | ||
- certain re-captures and threats. Extensions may continue for up to 11 | ||
- ply beyond the nominal search depth. | ||
+ Perform an alpha-beta search to determine the score for the current | ||
+ board position. If depth <= 0 only capturing moves, pawn promotions | ||
+ and responses to check are generated and searched, otherwise all | ||
+ moves are processed. The search depth is modified for check evasions, | ||
+ certain re-captures and threats. Extensions may continue for up to 11 | ||
+ ply beyond the nominal search depth. | ||
*/ | ||
#define prune (cf && score+node->scor | ||
@@ -683,7 +683,7 @@ struct leaf *node,tmp; | ||
NodeCnt++; | ||
xside = otherside[side]; | ||
if (depth < 0) depth = 0; | ||
- | ||
+ | ||
if (ply <= Sdepth+3) repetition(rpt); | ||
if (*rpt >= 2) return(0); | ||
@@ -693,7 +693,7 @@ struct leaf *node,tmp; | ||
bstline[ply] = 0; | ||
return(score); | ||
} | ||
- | ||
+ | ||
if (depth > 0) | ||
{ | ||
if (InChk || PawnThreat[ply-1 | ||
@@ -704,7 +704,7 @@ struct leaf *node,tmp; | ||
(InChk || PawnThreat[ply-1 | ||
else if (score <= beta && MateThreat) ++depth; | ||
} | ||
- | ||
+ | ||
if (depth > 0 && hashflag && ply > 1) | ||
{ | ||
ProbeTTable(side | ||
@@ -713,21 +713,21 @@ struct leaf *node,tmp; | ||
if (beta == -20000) return(score); | ||
if (alpha > beta) return(alpha); | ||
} | ||
- | ||
+ | ||
if (Sdepth == 1) d = 7; else d = 11; | ||
if (ply > Sdepth+d || (depth < 1 && score > beta)) return(score); | ||
if (ply > 1) | ||
if (depth > 0) MoveList(side,pl | ||
else CaptureList(side | ||
- | ||
+ | ||
if (TrPnt[ply] == TrPnt[ply+1]) return(score); | ||
- | ||
+ | ||
cf = (depth < 1 && ply > Sdepth+1 && !ChkFlag[ply-2] && !slk); | ||
if (depth > 0) best = -12000; else best = score; | ||
if (best > alpha) alpha = best; | ||
- | ||
+ | ||
for (pnt = pbst = TrPnt[ply]; | ||
pnt < TrPnt[ply+1] && best <= beta; | ||
pnt++) | ||
@@ -736,7 +736,7 @@ struct leaf *node,tmp; | ||
node = &Tree[pnt]; | ||
mv = (node->f << 8) + node->t; | ||
nxtline[ply+1] = 0; | ||
- | ||
+ | ||
if (prune) break; | ||
if (ply == 1) UpdateSearchStat | ||
@@ -789,7 +789,7 @@ struct leaf *node,tmp; | ||
if (NodeCnt > ETnodes) ElapsedTime(0); | ||
if (timeout) return(-Tscore[p | ||
} | ||
- | ||
+ | ||
node = &Tree[pbst]; | ||
mv = (node->f<<8) + node->t; | ||
if (hashflag && ply <= Sdepth && *rpt == 0 && best == alpha) | ||
@@ -815,13 +815,13 @@ evaluate(side,xs | ||
short side,xside,ply,a | ||
/* | ||
- Compute an estimate of the score by adding the positional score from | ||
- the previous ply to the material difference. If this score falls | ||
- inside a window which is 180 points wider than the alpha-beta window | ||
- (or within a 50 point window during quiescence search) call | ||
- ScorePosition() to determine a score, otherwise return the estimated | ||
- score. If one side has only a king and the other either has no pawns | ||
- or no pieces then the function ScoreLoneKing() is called. | ||
+ Compute an estimate of the score by adding the positional score from | ||
+ the previous ply to the material difference. If this score falls | ||
+ inside a window which is 180 points wider than the alpha-beta window | ||
+ (or within a 50 point window during quiescence search) call | ||
+ ScorePosition() to determine a score, otherwise return the estimated | ||
+ score. If one side has only a king and the other either has no pawns | ||
+ or no pieces then the function ScoreLoneKing() is called. | ||
*/ | ||
{ | ||
@@ -832,14 +832,14 @@ short s,evflag; | ||
(mtl[black] == valueK && (pmtl[white] == 0 || emtl[white] == 0))); | ||
s = -Pscore[ply-1] + mtl[side] - mtl[xside]; | ||
s -= INCscore; | ||
- | ||
+ | ||
if (slk) evflag = false; | ||
- else evflag = | ||
+ else evflag = | ||
(ply == 1 || ply < Sdepth || | ||
((ply == Sdepth+1 || ply == Sdepth+2) && | ||
(s > alpha-xwndw && s < beta+xwndw)) || | ||
(ply > Sdepth+2 && s >= alpha-25 && s <= beta+25)); | ||
- | ||
+ | ||
if (evflag) | ||
{ | ||
EvalNodes++; | ||
@@ -855,7 +855,7 @@ short s,evflag; | ||
InChk = SqAtakd(PieceLis | ||
if (slk) ScoreLoneKing(si | ||
} | ||
- | ||
+ | ||
Pscore[ply] = s - mtl[side] + mtl[xside]; | ||
if (InChk) ChkFlag[ply-1] = Pindex[TOsquare] | ||
else ChkFlag[ply-1] = 0; | ||
@@ -867,7 +867,7 @@ short s,evflag; | ||
ProbeTTable(side | ||
short side,depth,*alph | ||
-/* | ||
+/* | ||
Look for the current board position in the transposition table. | ||
*/ | ||
@@ -916,7 +916,7 @@ short hindx; | ||
ptbl = (ttable + hindx); | ||
ptbl->hashbd = hashbd; | ||
ptbl->depth = depth; | ||
- ptbl->score = score; | ||
+ ptbl->score = score; | ||
ptbl->mv = mv; | ||
ptbl->flags = 0; | ||
if (score < alpha) ptbl->flags |= upperbound; | ||
@@ -941,10 +941,10 @@ MoveList(side,pl | ||
short side,ply; | ||
/* | ||
- Fill the array Tree[] with all available moves for side to play. Array | ||
- TrPnt[ply] contains the index into Tree[] of the first move at a ply. | ||
+ Fill the array Tree[] with all available moves for side to play. Array | ||
+ TrPnt[ply] contains the index into Tree[] of the first move at a ply. | ||
*/ | ||
- | ||
+ | ||
{ | ||
register short i; | ||
short xside,f; | ||
@@ -979,16 +979,16 @@ GenMoves(ply,sq, | ||
short ply,sq,side,xsid | ||
/* | ||
- Generate moves for a piece. The from square is mapped onto a special | ||
- board and offsets (taken from array Dir[]) are added to the mapped | ||
- location. The newly generated square is tested to see if it falls off | ||
- the board by ANDing the square with 88 HEX. Legal moves are linked | ||
- into the tree. | ||
+ Generate moves for a piece. The from square is mapped onto a special | ||
+ board and offsets (taken from array Dir[]) are added to the mapped | ||
+ location. The newly generated square is tested to see if it falls off | ||
+ the board by ANDing the square with 88 HEX. Legal moves are linked | ||
+ into the tree. | ||
*/ | ||
- | ||
+ | ||
{ | ||
register short m,u,d; | ||
-short i,m0,piece; | ||
+short i,m0,piece; | ||
piece = board[sq]; m0 = map[sq]; | ||
if (sweep[piece]) | ||
@@ -1057,7 +1057,7 @@ short ply,f,t,xside; | ||
2. Capture of last moved piece | ||
3. Other captures (major pieces first) | ||
4. Killer moves | ||
- 5. "history" killers | ||
+ 5. "history" killers | ||
*/ | ||
{ | ||
@@ -1140,7 +1140,7 @@ struct leaf *node; | ||
} | ||
PL = PieceList[side]; | ||
for (i = 0; i <= PieceCnt[side]; i++) | ||
- { | ||
+ { | ||
sq = PL[i]; | ||
m0 = map[sq]; piece = board[sq]; | ||
j1 = Dstart[piece]; j2 = Dstop[piece]; | ||
@@ -1176,7 +1176,7 @@ struct leaf *node; | ||
} | ||
} | ||
#endif | ||
- | ||
+ | ||
int castle(side,kf,k | ||
short side,kf,kt,iop; | ||
@@ -1244,7 +1244,7 @@ short l; | ||
{ | ||
board[l] = no_piece; color[l] = neutral; | ||
} | ||
- else | ||
+ else | ||
{ | ||
board[l] = pawn; color[l] = xside; | ||
} | ||
@@ -1257,11 +1257,11 @@ short side,*tempc,*tem | ||
struct leaf *node; | ||
/* | ||
- Update Arrays board[], color[], and Pindex[] to reflect the new board | ||
- position obtained after making the move pointed to by node. Also | ||
- update miscellaneous stuff that changes when a move is made. | ||
+ Update Arrays board[], color[], and Pindex[] to reflect the new board | ||
+ position obtained after making the move pointed to by node. Also | ||
+ update miscellaneous stuff that changes when a move is made. | ||
*/ | ||
- | ||
+ | ||
{ | ||
register short f,t; | ||
short xside,ct,cf; | ||
@@ -1323,7 +1323,7 @@ short xside,ct,cf; | ||
UpdateHashbd(sid | ||
} | ||
INCscore -= *tempsf; | ||
- } | ||
+ } | ||
if (board[t] == king) ++kingmoved[side | ||
if (node->flags & epmask) EnPassant(xside, | ||
else if (hashflag) UpdateHashbd(sid | ||
@@ -1363,7 +1363,7 @@ short xside; | ||
UpdateHashbd(sid | ||
UpdateHashbd(sid | ||
} | ||
- } | ||
+ } | ||
if (*tempc != neutral) | ||
{ | ||
UpdatePieceList( | ||
@@ -1388,10 +1388,10 @@ UpdateHashbd(sid | ||
short side,piece,f,t; | ||
/* | ||
- hashbd contains a 32 bit "signature" of the board position. hashkey | ||
- contains a 16 bit code used to address the hash table. When a move is | ||
- made, XOR'ing the hashcode of moved piece on the from and to squares | ||
- with the hashbd and hashkey values keeps things current. | ||
+ hashbd contains a 32 bit "signature" of the board position. hashkey | ||
+ contains a 16 bit code used to address the hash table. When a move is | ||
+ made, XOR'ing the hashcode of moved piece on the from and to squares | ||
+ with the hashbd and hashkey values keeps things current. | ||
*/ | ||
{ | ||
@@ -1412,8 +1412,8 @@ UpdatePieceList( | ||
short side,sq,iop; | ||
/* | ||
- Update the PieceList and Pindex arrays when a piece is captured or | ||
- when a capture is unmade. | ||
+ Update the PieceList and Pindex arrays when a piece is captured or | ||
+ when a capture is unmade. | ||
*/ | ||
{ | ||
@@ -1439,13 +1439,13 @@ register short i; | ||
InitializeStats( | ||
/* | ||
- Scan thru the board seeing what's on each square. If a piece is found, | ||
- update the variables PieceCnt, PawnCnt, Pindex and PieceList. Also | ||
- determine the material for each side and set the hashkey and hashbd | ||
- variables to represent the current board position. Array | ||
- PieceList[side][ | ||
- either side. Array Pindex[sq] contains the indx into PieceList for a | ||
- given square. | ||
+ Scan thru the board seeing what's on each square. If a piece is found, | ||
+ update the variables PieceCnt, PawnCnt, Pindex and PieceList. Also | ||
+ determine the material for each side and set the hashkey and hashbd | ||
+ variables to represent the current board position. Array | ||
+ PieceList[side][ | ||
+ either side. Array Pindex[sq] contains the indx into PieceList for a | ||
+ given square. | ||
*/ | ||
{ | ||
@@ -1477,9 +1477,9 @@ register short i,sq; | ||
pick(p1,p2) | ||
short p1,p2; | ||
-/* | ||
- Find the best move in the tree between indexes p1 and p2. Swap the | ||
- best move into the p1 element. | ||
+/* | ||
+ Find the best move in the tree between indexes p1 and p2. Swap the | ||
+ best move into the p1 element. | ||
*/ | ||
{ | ||
@@ -1535,7 +1535,7 @@ short sq,side; | ||
/* | ||
See if any piece with color 'side' ataks sq. First check for pawns | ||
or king, then try other pieces. Array Dcode is used to check for | ||
- knight attacks or R,B,Q co-linearity. | ||
+ knight attacks or R,B,Q co-linearity. | ||
*/ | ||
{ | ||
@@ -1550,7 +1550,7 @@ short i,m0,m1,loc,piec | ||
if (!(m & 0x88)) | ||
if (board[unmap[m]] | ||
if (distance(sq,Pie | ||
- | ||
+ | ||
PL = PieceList[side]; | ||
for (i = 1; i <= PieceCnt[side]; i++) | ||
{ | ||
@@ -1584,7 +1584,7 @@ short side,*a; | ||
{ | ||
register short u,m; | ||
short d,c,j,j1,j2,piec | ||
- | ||
+ | ||
/* | ||
memset((char *)a,0,64*sizeof( | ||
*/ | ||
@@ -1626,9 +1626,9 @@ ScorePosition(si | ||
short side,*score; | ||
/* | ||
- Perform normal static evaluation of board position. A score is | ||
- generated for each piece and these are summed to get a score for each | ||
- side. | ||
+ Perform normal static evaluation of board position. A score is | ||
+ generated for each piece and these are summed to get a score for each | ||
+ side. | ||
*/ | ||
{ | ||
@@ -1656,17 +1656,17 @@ short i,xside,pscore[3 | ||
} | ||
if (hung[side] > 1) pscore[side] += HUNGX; | ||
if (hung[xside] > 1) pscore[xside] += HUNGX; | ||
- | ||
+ | ||
*score = mtl[side] - mtl[xside] + pscore[side] - pscore[xside] + 10; | ||
if (dither) *score += rand() % dither; | ||
- | ||
+ | ||
if (*score > 0 && pmtl[side] == 0) | ||
if (emtl[side] < valueR) *score = 0; | ||
else if (*score < valueR) *score /= 2; | ||
if (*score < 0 && pmtl[xside] == 0) | ||
if (emtl[xside] < valueR) *score = 0; | ||
else if (-*score < valueR) *score /= 2; | ||
- | ||
+ | ||
if (mtl[xside] == valueK && emtl[side] > valueB) *score += 200; | ||
if (mtl[side] == valueK && emtl[xside] > valueB) *score -= 200; | ||
} | ||
@@ -1675,7 +1675,7 @@ short i,xside,pscore[3 | ||
ScoreLoneKing(si | ||
short side,*score; | ||
-/* | ||
+/* | ||
Static evaluation when loser has only a king and winner has no pawns | ||
or no pieces. | ||
*/ | ||
@@ -1687,19 +1687,19 @@ short winner,loser,kin | ||
if (mtl[white] > mtl[black]) winner = white; else winner = black; | ||
loser = otherside[winner | ||
king1 = PieceList[winner | ||
- | ||
+ | ||
s = 0; | ||
- | ||
+ | ||
if (pmtl[winner] > 0) | ||
for (i = 1; i <= PieceCnt[winner] | ||
s += ScoreKPK(side,wi | ||
- | ||
+ | ||
else if (emtl[winner] == valueB+valueN) | ||
s = ScoreKBNK(winner | ||
- | ||
+ | ||
else if (emtl[winner] > valueB) | ||
s = 500 + emtl[winner] - DyingKing[king2] | ||
- | ||
+ | ||
if (side == winner) *score = s; else *score = -s; | ||
} | ||
@@ -1713,7 +1713,7 @@ short side,winner,lose | ||
{ | ||
short s,r; | ||
- | ||
+ | ||
if (PieceCnt[winner | ||
if (winner == white) | ||
{ | ||
@@ -1883,8 +1883,8 @@ short s,piece,a1,a2,in | ||
if (PC2[7] == 0) s += KHOPNX; | ||
} | ||
} | ||
- | ||
- if (a2 > 0) | ||
+ | ||
+ if (a2 > 0) | ||
{ | ||
c = (control[piece] & 0x4FFF); | ||
if (a1 == 0 || a2 > c+1) | ||
@@ -1977,8 +1977,8 @@ BRscan(sq,s,mob) | ||
short sq,*s,*mob; | ||
/* | ||
- Find Bishop and Rook mobility, XRAY attacks, and pins. Increment the | ||
- hung[] array if a pin is found. | ||
+ Find Bishop and Rook mobility, XRAY attacks, and pins. Increment the | ||
+ hung[] array if a pin is found. | ||
*/ | ||
{ | ||
@@ -2077,9 +2077,9 @@ short i,m0; | ||
ExaminePosition( | ||
/* | ||
- This is done one time before the search is started. Set up arrays | ||
- Mwpawn, Mbpawn, Mknight, Mbishop, Mking which are used in the | ||
- SqValue() function to determine the positional value of each piece. | ||
+ This is done one time before the search is started. Set up arrays | ||
+ Mwpawn, Mbpawn, Mknight, Mbishop, Mking which are used in the | ||
+ SqValue() function to determine the positional value of each piece. | ||
*/ | ||
{ | ||
@@ -2114,14 +2114,14 @@ short wpadv,bpadv,wstr | ||
if (!PawnStorm && stage < 5) | ||
PawnStorm = ((column[wking] < 3 && column[bking] > 4) || | ||
(column[wking] > 4 && column[bking] < 3)); | ||
- | ||
+ | ||
CopyBoard(pknigh | ||
CopyBoard(pknigh | ||
CopyBoard(pbisho | ||
CopyBoard(pbisho | ||
BlendBoard(KingO | ||
BlendBoard(KingO | ||
- | ||
+ | ||
for (sq = 0; sq < 64; sq++) | ||
{ | ||
fyle = column[sq]; rank = row[sq]; | ||
@@ -2159,7 +2159,7 @@ short wpadv,bpadv,wstr | ||
if ((column[bking] < 4 && fyle > 4) || | ||
(column[bking] > 3 && fyle < 3)) Mbpawn[sq] -= 3*rank; | ||
} | ||
- | ||
+ | ||
Mknight[white][s | ||
Mknight[white][s | ||
Mknight[black][s | ||
@@ -2176,19 +2176,19 @@ short wpadv,bpadv,wstr | ||
if (bstrong) Mknight[black][s | ||
if (wstrong) Mbishop[white][s | ||
if (bstrong) Mbishop[black][s | ||
- | ||
+ | ||
if (HasBishop[white | ||
if (HasBishop[black | ||
if (HasKnight[white | ||
if (HasKnight[black | ||
- | ||
+ | ||
if (board[sq] == bishop) | ||
if (rank % 2 == fyle % 2) KBNKsq = 0; else KBNKsq = 7; | ||
- | ||
+ | ||
Kfield[white][sq | ||
if (distance(sq,wki | ||
if (distance(sq,bki | ||
- | ||
+ | ||
Pd = 0; | ||
for (i = 0; i < 64; i++) | ||
if (board[i] == pawn) | ||
@@ -2221,9 +2221,9 @@ short wpadv,bpadv,wstr | ||
UpdateWeights() | ||
-/* | ||
- If material balance has changed, determine the values for the | ||
- positional evaluation terms. | ||
+/* | ||
+ If material balance has changed, determine the values for the | ||
+ positional evaluation terms. | ||
*/ | ||
{ | ||
@@ -2241,7 +2241,7 @@ short tmtl; | ||
if (tmtl > 3600) stage2 = 0; | ||
else if (tmtl < 1400) stage2 = 10; | ||
else stage2 = (3600-tmtl) / 220; | ||
- | ||
+ | ||
PEDRNK2B = -15; /* centre pawn on 2nd rank & blocked */ | ||
PBLOK = -4; /* blocked backward pawn */ | ||
PDOUBLED = -14; /* doubled pawn */ | ||
@@ -2250,27 +2250,27 @@ short tmtl; | ||
PADVNCM = 10; /* advanced pawn multiplier */ | ||
PADVNCI = 7; /* muliplier for isolated pawn */ | ||
PawnBonus = stage; | ||
- | ||
+ | ||
KNIGHTPOST = (stage+2)/3; /* knight near enemy pieces */ | ||
KNIGHTSTRONG = (stage+6)/2; /* occupies pawn hole */ | ||
- | ||
+ | ||
BISHOPSTRONG = (stage+6)/2; /* occupies pawn hole */ | ||
BishopBonus = 2*stage; | ||
- | ||
+ | ||
RHOPN = 10; /* rook on half open file */ | ||
RHOPNX = 4; | ||
RookBonus = 6*stage; | ||
- | ||
+ | ||
XRAY = 8; /* Xray attack on piece */ | ||
PINVAL = 10; /* Pin */ | ||
- | ||
+ | ||
KHOPN = (3*stage-30) / 2; /* king on half open file */ | ||
KHOPNX = KHOPN / 2; | ||
KCASTLD = 10 - stage; | ||
KMOVD = -40 / (stage+1); /* king moved before castling */ | ||
KATAK = (10-stage) / 2; /* B,R attacks near enemy king */ | ||
if (stage < 8) KSFTY = 16-2*stage; else KSFTY = 0; | ||
- | ||
+ | ||
ATAKD = -6; /* defender > attacker */ | ||
HUNGP = -8; /* each hung piece */ | ||
HUNGX = -12; /* extra for >1 hung piece */ |
@@ -21,11 +21,11 @@ | ||
*/ | ||
-/* Header file for GNU CHESS */ | ||
+/* Header file for GNU CHESS */ | ||
#define neutral 2 | ||
#define white 0 | ||
-#define black 1 | ||
+#define black 1 | ||
#define no_piece 0 | ||
#define pawn 1 | ||
#define knight 2 |
@@ -161,7 +161,7 @@ short sq,side; | ||
u = p[u].nextpos; | ||
} | ||
else { | ||
- if (color[u] == side && | ||
+ if (color[u] == side && | ||
(board[u] == queen || board[u] == bishop)) | ||
return(true); | ||
u = p[u].nextdir; | ||
@@ -175,7 +175,7 @@ short sq,side; | ||
u = p[u].nextpos; | ||
} | ||
else { | ||
- if (color[u] == side && | ||
+ if (color[u] == side && | ||
(board[u] == queen || board[u] == rook)) | ||
return(true); | ||
u = p[u].nextdir; | ||
@@ -201,8 +201,8 @@ short sq,side; | ||
BRscan(sq,s,mob) | ||
short sq,*s,*mob; | ||
/* | ||
- Find Bishop and Rook mobility, XRAY attacks, and pins. Increment the | ||
- hung[] array if a pin is found. | ||
+ Find Bishop and Rook mobility, XRAY attacks, and pins. Increment the | ||
+ hung[] array if a pin is found. | ||
*/ | ||
{ | ||
register short u,piece,pin; | ||
@@ -260,7 +260,7 @@ short side,xside,ply; | ||
register struct sqdata *p; | ||
short i,piece,*PL; | ||
struct leaf *node; | ||
- | ||
+ | ||
TrPnt[ply+1] = TrPnt[ply]; | ||
node = &Tree[TrPnt[ply] | ||
PL = PieceList[side]; | ||
@@ -312,17 +312,17 @@ short side,xside,ply; | ||
#if (NEWMOVE > 5) | ||
GenMoves(ply,sq, | ||
short ply,sq,side,xsid | ||
- | ||
+ | ||
/* | ||
Generate moves for a piece. The moves are taken from the | ||
precalulated array posdata. If the board is free, next move | ||
is choosen from nextpos else from nextdir. | ||
*/ | ||
- | ||
+ | ||
{ | ||
register short u,piece; | ||
register struct sqdata *p; | ||
- | ||
+ | ||
piece = board[sq]; | ||
p = posdata[side][pi | ||
if (piece == pawn) { | ||
@@ -339,7 +339,7 @@ GenMoves(ply,sq, | ||
} | ||
u = p[u].nextpos; | ||
} | ||
- } | ||
+ } | ||
else { | ||
u = p[sq].nextpos; | ||
while (u != sq) { | ||
@@ -352,6 +352,6 @@ GenMoves(ply,sq, | ||
u = p[u].nextdir; | ||
} | ||
} | ||
- } | ||
-} | ||
+ } | ||
+} | ||
#endif |
@@ -11,7 +11,7 @@ extern short taxidata[64][64] | ||
extern void Initialize_dist( | ||
#endif | ||
- | ||
+ | ||
#if (NEWMOVE >= 2) | ||
struct sqdata { | ||
short nextpos; |
@@ -1,8 +1,8 @@ | ||
/* | ||
UNIX & MSDOS NON-DISPLAY, AND CHESSTOOL interface for Chess | ||
- | ||
+ | ||
Revision: 4-25-88 | ||
- | ||
+ | ||
Copyright (C) 1986, 1987, 1988 Free Software Foundation, Inc. | ||
Copyright (c) 1988 John Stanback | ||
@@ -90,12 +90,12 @@ TerminateSearch( | ||
InputCommand() | ||
/* | ||
- Process the users command. If easy mode is OFF (the computer is | ||
- thinking on opponents time) and the program is out of book, then make | ||
- the 'hint' move on the board and call SelectMove() to find a response. | ||
- The user terminates the search by entering ^C (quit siqnal) before | ||
- entering a command. If the opponent does not make the hint move, then | ||
- set Sdepth to zero. | ||
+ Process the users command. If easy mode is OFF (the computer is | ||
+ thinking on opponents time) and the program is out of book, then make | ||
+ the 'hint' move on the board and call SelectMove() to find a response. | ||
+ The user terminates the search by entering ^C (quit siqnal) before | ||
+ entering a command. If the opponent does not make the hint move, then | ||
+ set Sdepth to zero. | ||
*/ | ||
{ | ||
@@ -124,7 +124,7 @@ char s[80]; | ||
ft = time((long *)0) - time0; | ||
epsquare = tmp; | ||
} | ||
- | ||
+ | ||
#ifndef MSDOS | ||
#endif | ||
while (!(ok || quit)) | ||
@@ -139,7 +139,7 @@ char s[80]; | ||
Sdepth = 0; | ||
ft = 0; | ||
} | ||
- | ||
+ | ||
if (strcmp(s,"bd") == 0) | ||
{ | ||
ClrScreen(); | ||
@@ -183,7 +183,7 @@ char s[80]; | ||
Sdepth = 0; | ||
ok = true; | ||
} | ||
- if (strcmp(s,"white | ||
+ if (strcmp(s,"white | ||
{ | ||
computer = white; opponent = black; | ||
ok = true; force = false; | ||
@@ -196,7 +196,7 @@ char s[80]; | ||
Sdepth = 0; | ||
} | ||
if (strcmp(s,"undo" | ||
- if (strcmp(s,"remov | ||
+ if (strcmp(s,"remov | ||
{ | ||
Undo(); Undo(); | ||
} | ||
@@ -221,7 +221,7 @@ char s[80]; | ||
printz("cnt= %ld rate= %ld\n",cnt,rate) | ||
} | ||
} | ||
- | ||
+ | ||
ElapsedTime(1); | ||
if (force) | ||
{ | ||
@@ -272,7 +272,7 @@ help() | ||
printz("Easy mode: "); | ||
if (easy) printz("ON\n"); else printz("OFF\n"); | ||
printz("Depth: %d\n",MaxSearchD | ||
- printz("Random: "); | ||
+ printz("Random: "); | ||
if (dither) printz("ON\n"); else printz("OFF\n"); | ||
printz("Transpos | ||
if (hashflag) printz("ON\n"); else printz("OFF\n"); | ||
@@ -282,10 +282,10 @@ help() | ||
EditBoard() | ||
-/* | ||
- Set up a board position. Pieces are entered by typing the piece | ||
- followed by the location. For example, Nf3 will place a knight on | ||
- square f3. | ||
+/* | ||
+ Set up a board position. Pieces are entered by typing the piece | ||
+ followed by the location. For example, Nf3 will place a knight on | ||
+ square f3. | ||
*/ | ||
{ | ||
@@ -297,7 +297,7 @@ char s[80]; | ||
printz(". exit to main\n"); | ||
printz("# clear board\n"); | ||
printz("enter piece & location: \n"); | ||
- | ||
+ | ||
a = white; | ||
do | ||
{ | ||
@@ -399,12 +399,12 @@ OutputMove() | ||
NodeCnt,EvalNode | ||
printz("CPU= %.2ld:%.2ld.%.2l | ||
cputimer/6000,(c | ||
- | ||
+ | ||
if (root->flags & epmask) UpdateDisplay(0, | ||
else UpdateDisplay(ro | ||
printz("My move is: %s\n\n",mvstr1); | ||
if (beep) printz("%c",7); | ||
- | ||
+ | ||
if (root->flags & draw) printz("Draw game!\n"); | ||
else if (root->score == -9999) printz("opponent | ||
else if (root->score == 9998) printz("computer | ||
@@ -417,10 +417,10 @@ OutputMove() | ||
ElapsedTime(iop) | ||
short iop; | ||
-/* | ||
- Determine the time that has passed since the search was started. If | ||
- the elapsed time exceeds the target (ResponseTime+Ex | ||
- timeout to true which will terminate the search. | ||
+/* | ||
+ Determine the time that has passed since the search was started. If | ||
+ the elapsed time exceeds the target (ResponseTime+Ex | ||
+ timeout to true which will terminate the search. | ||
*/ | ||
{ | ||
@@ -508,12 +508,12 @@ short r,c,l; | ||
GetOpenings() | ||
/* | ||
- Read in the Opening Book file and parse the algebraic notation for a | ||
- move into an unsigned integer format indicating the from and to | ||
- square. Create a linked list of opening lines of play, with | ||
- entry->next pointing to the next line and entry->move pointing to a | ||
- chunk of memory containing the moves. More Opening lines of up to 256 | ||
- half moves may be added to gnuchess.book. | ||
+ Read in the Opening Book file and parse the algebraic notation for a | ||
+ move into an unsigned integer format indicating the from and to | ||
+ square. Create a linked list of opening lines of play, with | ||
+ entry->next pointing to the next line and entry->move pointing to a | ||
+ chunk of memory containing the moves. More Opening lines of up to 256 | ||
+ half moves may be added to gnuchess.book. | ||
*/ | ||
{ | ||
@@ -542,7 +542,7 @@ unsigned short mv,*mp,tmp[100]; | ||
mp = (unsigned short *)malloc((i+1)*s | ||
entry->mv = mp; | ||
entry->next = Book; | ||
- Book = entry; | ||
+ Book = entry; | ||
for (j = 1; j <= i; j++) *(mp++) = tmp[j]; | ||
*mp = 0; | ||
i = 0; side = white; | ||
@@ -640,7 +640,7 @@ short sq,i,c; | ||
printz("Enter file name: "); | ||
scanz("%s",fname | ||
- | ||
+ | ||
if (fname[0] == '\0' || access(fname,W_O | ||
fd = fopen(fname,"w") | ||
fprintf(fd,"%d %d %d\n",computer+1 | ||
@@ -687,7 +687,7 @@ short i,f,t; | ||
} | ||
fprintf(fd,"\n\n | ||
fclose(fd); | ||
-} | ||
+} | ||
Undo() |
@@ -1,8 +1,8 @@ | ||
/* | ||
ALPHA interface for CHESS | ||
- | ||
+ | ||
Revision: 4-25-88 | ||
- | ||
+ | ||
Copyright (C) 1986, 1987, 1988 Free Software Foundation, Inc. | ||
Copyright (c) 1988 John Stanback | ||
@@ -88,12 +88,12 @@ TerminateSearch( | ||
InputCommand() | ||
/* | ||
- Process the users command. If easy mode is OFF (the computer is | ||
- thinking on opponents time) and the program is out of book, then make | ||
- the 'hint' move on the board and call SelectMove() to find a response. | ||
- The user terminates the search by entering ^C (quit siqnal) before | ||
- entering a command. If the opponent does not make the hint move, then | ||
- set Sdepth to zero. | ||
+ Process the users command. If easy mode is OFF (the computer is | ||
+ thinking on opponents time) and the program is out of book, then make | ||
+ the 'hint' move on the board and call SelectMove() to find a response. | ||
+ The user terminates the search by entering ^C (quit siqnal) before | ||
+ entering a command. If the opponent does not make the hint move, then | ||
+ set Sdepth to zero. | ||
*/ | ||
{ | ||
@@ -123,7 +123,7 @@ char s[80]; | ||
ft = time((time_t *)0) - time0; | ||
epsquare = tmp; | ||
} | ||
- | ||
+ | ||
signal(SIGINT,Di | ||
while (!(ok || quit)) | ||
{ | ||
@@ -136,7 +136,7 @@ char s[80]; | ||
Sdepth = 0; | ||
ft = 0; | ||
} | ||
- | ||
+ | ||
if (strcmp(s,"bd") == 0) | ||
{ | ||
ClrScreen(); | ||
@@ -179,7 +179,7 @@ char s[80]; | ||
Sdepth = 0; | ||
ok = true; | ||
} | ||
- if (strcmp(s,"white | ||
+ if (strcmp(s,"white | ||
{ | ||
computer = white; opponent = black; | ||
ok = true; force = false; | ||
@@ -191,7 +191,7 @@ char s[80]; | ||
ok = true; force = false; | ||
Sdepth = 0; | ||
} | ||
- if (strcmp(s,"remov | ||
+ if (strcmp(s,"remov | ||
{ | ||
Undo(); Undo(); | ||
} | ||
@@ -220,7 +220,7 @@ char s[80]; | ||
if (strcmp(s,"p") == 0) ShowPostnValues( | ||
if (strcmp(s,"debug | ||
} | ||
- | ||
+ | ||
ClearMessage(); | ||
ElapsedTime(1); | ||
if (force) | ||
@@ -234,10 +234,10 @@ char s[80]; | ||
EditBoard() | ||
-/* | ||
- Set up a board position. Pieces are entered by typing the piece | ||
- followed by the location. For example, Nf3 will place a knight on | ||
- square f3. | ||
+/* | ||
+ Set up a board position. Pieces are entered by typing the piece | ||
+ followed by the location. For example, Nf3 will place a knight on | ||
+ square f3. | ||
*/ | ||
{ | ||
@@ -322,7 +322,7 @@ help() | ||
gotoXY(10,24); printz("Easy mode: "); | ||
if (easy) printz("ON"); else printz("OFF"); | ||
gotoXY(40,21); printz("Depth: %d",MaxSearchDep | ||
- gotoXY(40,22); printz("Random: "); | ||
+ gotoXY(40,22); printz("Random: "); | ||
if (dither) printz("ON"); else printz("OFF"); | ||
gotoXY(40,23); printz("Transpos | ||
if (hashflag) printz("ON"); else printz("OFF"); | ||
@@ -390,7 +390,7 @@ OutputMove() | ||
gotoXY(50,17); printz("My move is: %s",mvstr1); | ||
if (beep) putchar(7); | ||
ClrEoln(); | ||
- | ||
+ | ||
gotoXY(50,24); | ||
if (root->flags & draw) printz("Draw game!"); | ||
else if (root->score == -9999) printz("opponent | ||
@@ -398,7 +398,7 @@ OutputMove() | ||
else if (root->score < -9000) printz("opponent | ||
else if (root->score > 9000) printz("computer | ||
ClrEoln(); | ||
- | ||
+ | ||
if (post) | ||
{ | ||
gotoXY(50,22); printz("Nodes= %6ld",NodeCnt); ClrEoln(); | ||
@@ -409,10 +409,10 @@ OutputMove() | ||
ElapsedTime(iop) | ||
-/* | ||
- Determine the time that has passed since the search was started. If | ||
- the elapsed time exceeds the target (ResponseTime+Ex | ||
- timeout to true which will terminate the search. | ||
+/* | ||
+ Determine the time that has passed since the search was started. If | ||
+ the elapsed time exceeds the target (ResponseTime+Ex | ||
+ timeout to true which will terminate the search. | ||
*/ | ||
short iop; | ||
@@ -515,7 +515,7 @@ short r,c; char x; | ||
UpdateDisplay(f, | ||
short f,t,flag,iscastl | ||
{ | ||
-short i,l,z; | ||
+short i,l,z; | ||
if (flag) | ||
{ | ||
gotoXY(56,2); printz("CHESS"); | ||
@@ -557,12 +557,12 @@ short i,l,z; | ||
GetOpenings() | ||
/* | ||
- Read in the Opening Book file and parse the algebraic notation for a | ||
- move into an unsigned integer format indicating the from and to | ||
- square. Create a linked list of opening lines of play, with | ||
- entry->next pointing to the next line and entry->move pointing to a | ||
- chunk of memory containing the moves. More Opening lines of up to 256 | ||
- half moves may be added to gnuchess.book. | ||
+ Read in the Opening Book file and parse the algebraic notation for a | ||
+ move into an unsigned integer format indicating the from and to | ||
+ square. Create a linked list of opening lines of play, with | ||
+ entry->next pointing to the next line and entry->move pointing to a | ||
+ chunk of memory containing the moves. More Opening lines of up to 256 | ||
+ half moves may be added to gnuchess.book. | ||
*/ | ||
{ | ||
@@ -587,7 +587,7 @@ unsigned short mv,*mp,tmp[100]; | ||
mp = (unsigned short *)malloc((i+1)*s | ||
entry->mv = mp; | ||
entry->next = Book; | ||
- Book = entry; | ||
+ Book = entry; | ||
for (j = 1; j <= i; j++) *(mp++) = tmp[j]; | ||
*mp = 0; | ||
i = 0; side = white; | ||
@@ -690,7 +690,7 @@ short sq,i,c; | ||
ShowMessage("Fil | ||
scanz("%s",fname | ||
- | ||
+ | ||
if (fname[0] == '\0' || access(fname,W_O | ||
fd = fopen(fname,"w") | ||
fprintf(fd,"%d %d %d\n",computer+1 | ||
@@ -737,7 +737,7 @@ short i,f,t; | ||
} | ||
fprintf(fd,"\n\n | ||
fclose(fd); | ||
-} | ||
+} | ||
Undo() | ||
@@ -851,7 +851,7 @@ SelectLevel() | ||
gotoXY(20,11); printz(" 8. 1 move in 15 minutes"); | ||
gotoXY(20,12); printz(" 9. 1 move in 60 minutes"); | ||
gotoXY(20,13); printz("10. 1 move in 600 minutes"); | ||
- | ||
+ | ||
OperatorTime = 0; TCmoves = 60; TCminutes = 5; | ||
gotoXY(20,17); printz("Enter Level: "); |
@@ -2,7 +2,7 @@ | ||
#warning "this file includes <values.h> which is obsoleted, use <limits.h> or <float.h> instead" | ||
#endif | ||
-/* | ||
+/* | ||
Copyright (C) 1988 Free Software Foundation | ||
written by Doug Lea (dl@rocky.oswego | ||
@@ -72,7 +72,7 @@ Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. | ||
#define DMAXEXP ((1 << _DEXPLEN - 1) - 1 + _IEEE) | ||
#define FMAXEXP ((1 << _FEXPLEN - 1) - 1 + _IEEE) | ||
-#elif defined(sony) | ||
+#elif defined(sony) | ||
#define MAXDOUBLE 1.79769313486231 | ||
#define MAXFLOAT ((float)3.402823 | ||
#define MINDOUBLE 2.22507385850720 | ||
@@ -150,7 +150,7 @@ extern float _maxfloat, _minfloat; | ||
/* #elif defined(vax) */ | ||
/* use vax versions by default -- they seem to be the most conservative */ | ||
-#else | ||
+#else | ||
#define MAXDOUBLE 1.70141183460469 | ||
#define MINDOUBLE (2.9387358770557 |
@@ -79,7 +79,7 @@ int dialog_checklist | ||
/* center dialog box on screen */ | ||
x = (COLS - width)/2; | ||
y = (LINES - height)/2; | ||
- | ||
+ | ||
#ifdef HAVE_NCURSES | ||
if (use_shadow) | ||
draw_shadow(stds | ||
@@ -156,7 +156,7 @@ int dialog_checklist | ||
if (key < 0x100 && toupper(key) == toupper(items[(s | ||
break; | ||
- if (i < max_choice || (key >= '1' && key <= MIN('9', '0'+max_choice)) | ||
+ if (i < max_choice || (key >= '1' && key <= MIN('9', '0'+max_choice)) | ||
key == KEY_UP || key == KEY_DOWN || key == ' ' || | ||
key == '+' || key == '-' ) { | ||
if (key >= '1' && key <= MIN('9', '0'+max_choice)) |
@@ -44,7 +44,7 @@ | ||
#endif | ||
-/* | ||
+/* | ||
* Attribute names | ||
*/ | ||
#define screen_attr attributes[0] | ||
@@ -115,5 +115,5 @@ void use_helpfile(cha | ||
void use_helpline(cha | ||
char *get_helpline(vo | ||
void restore_helpline | ||
-void dialog_gauge(cha | ||
+void dialog_gauge(cha | ||
int height, int width, int perc); |
@@ -49,7 +49,7 @@ | ||
#ifndef ctrl | ||
#define ctrl(a) ((a) - 'a' + 1) | ||
-#endif | ||
+#endif | ||
#ifndef HAVE_NCURSES | ||
#ifndef ACS_ULCORNER | ||
@@ -101,7 +101,7 @@ bool use_shadow = USE_SHADOW; | ||
#endif | ||
-/* | ||
+/* | ||
* Attribute values, default is for mono display | ||
*/ | ||
chtype attributes[] = { |
@@ -3,7 +3,7 @@ | ||
* | ||
* Program: dir.c | ||
* Author: Marc van Kempen | ||
- * desc: Directory routines, sorting and reading | ||
+ * desc: Directory routines, sorting and reading | ||
* | ||
* Copyright (c) 1995, Marc van Kempen | ||
* | ||
@@ -16,7 +16,7 @@ | ||
* responsible for the proper functioning of this software, nor does | ||
* the author assume any responsibility for damages incurred with | ||
* its use. | ||
- * | ||
+ * | ||
**************** | ||
#include <sys/types.h> | ||
@@ -71,7 +71,7 @@ static int _showdotfiles = TRUE; | ||
* | ||
**************** | ||
-int | ||
+int | ||
dir_select_nd( | ||
#if defined __linux__ | ||
const struct dirent *d | ||
@@ -79,8 +79,8 @@ dir_select_nd( | ||
struct dirent *d | ||
#endif | ||
) | ||
-/* | ||
- * desc: allways include a directory entry <d>, except | ||
+/* | ||
+ * desc: allways include a directory entry <d>, except | ||
* for the current directory and other dot-files | ||
* keep '..' however. | ||
* pre: <d> points to a dirent | ||
@@ -90,13 +90,13 @@ dir_select_nd( | ||
if (strcmp(d->d_nam | ||
(d->d_name[0] == '.' && strlen(d->d_name | ||
return(FALSE); | ||
- } else { | ||
+ } else { | ||
return(TRUE); | ||
} | ||
}/* dir_select_nd() */ | ||
-int | ||
+int | ||
dir_select( | ||
#ifdef __linux__ | ||
const struct dirent *d | ||
@@ -104,8 +104,8 @@ dir_select( | ||
struct dirent *d | ||
#endif | ||
) | ||
-/* | ||
- * desc: allways include a directory entry <d>, except | ||
+/* | ||
+ * desc: allways include a directory entry <d>, except | ||
* for the current directory | ||
* pre: <d> points to a dirent | ||
* post: returns TRUE if d->d_name != "." else FALSE | ||
@@ -118,16 +118,16 @@ dir_select( | ||
} | ||
} /* dir_select() */ | ||
-int | ||
+int | ||
dir_select_root_ | ||
-#ifdef __linux__ | ||
+#ifdef __linux__ | ||
const struct dirent *d | ||
#else | ||
struct dirent *d | ||
#endif | ||
) | ||
-/* | ||
- * desc: allways include a directory entry <d>, except | ||
+/* | ||
+ * desc: allways include a directory entry <d>, except | ||
* for the current directory and the parent directory. | ||
* Also skip any other dot-files. | ||
* pre: <d> points to a dirent | ||
@@ -142,22 +142,22 @@ dir_select_root_ | ||
} /* dir_select_root_ | ||
-int | ||
+int | ||
dir_select_root( | ||
-#ifdef __linux__ | ||
+#ifdef __linux__ | ||
const struct dirent *d | ||
#else | ||
struct dirent *d | ||
#endif | ||
) | ||
-/* | ||
- * desc: allways include a directory entry <d>, except | ||
+/* | ||
+ * desc: allways include a directory entry <d>, except | ||
* for the current directory and the parent directory | ||
* pre: <d> points to a dirent | ||
* post: returns TRUE if d->d_name[0] != "." else FALSE | ||
*/ | ||
{ | ||
- if (strcmp(d->d_nam | ||
+ if (strcmp(d->d_nam | ||
return(FALSE); | ||
} else { | ||
return(TRUE); | ||
@@ -185,7 +185,7 @@ dir_alphasort(co | ||
* | ||
*/ | ||
{ | ||
- DirList *f1 = ((DirList *) d1), | ||
+ DirList *f1 = ((DirList *) d1), | ||
*f2 = ((DirList *) d2); | ||
struct stat *s1 = &(f1->filestatus | ||
struct stat *s2 = &(f2->filestatus | ||
@@ -197,7 +197,7 @@ dir_alphasort(co | ||
if (strcmp(((DirLis | ||
return(1); | ||
} | ||
- | ||
+ | ||
/* put directories first */ | ||
if ((s1->st_mode & S_IFDIR) && (s2->st_mode & S_IFDIR)) { | ||
return(strcmp(f1 | ||
@@ -212,7 +212,7 @@ dir_alphasort(co | ||
} /* dir_alphasort() */ | ||
- | ||
+ | ||
int | ||
dir_sizesort(con | ||
/* | ||
@@ -220,7 +220,7 @@ dir_sizesort(con | ||
* | ||
*/ | ||
{ | ||
- DirList *f1 = ((DirList *) d1), | ||
+ DirList *f1 = ((DirList *) d1), | ||
*f2 = ((DirList *) d2); | ||
struct stat *s1 = &(f1->filestatus | ||
struct stat *s2 = &(f2->filestatus | ||
@@ -232,12 +232,12 @@ dir_sizesort(con | ||
if (strcmp(((DirLis | ||
return(1); | ||
} | ||
- | ||
+ | ||
/* put directories first */ | ||
if ((s1->st_mode & S_IFDIR) && (s2->st_mode & S_IFDIR)) { | ||
- return(s1->st_si | ||
- -1 | ||
- : | ||
+ return(s1->st_si | ||
+ -1 | ||
+ : | ||
s1->st_size >= s2->st_size); | ||
}; | ||
if (s1->st_mode & S_IFDIR) { | ||
@@ -246,11 +246,11 @@ dir_sizesort(con | ||
if (s2->st_mode & S_IFDIR) { | ||
return(1); | ||
} | ||
- return(s1->st_si | ||
- -1 | ||
- : | ||
+ return(s1->st_si | ||
+ -1 | ||
+ : | ||
s1->st_size >= s2->st_size); | ||
- | ||
+ | ||
} /* dir_sizesort() */ | ||
int | ||
@@ -259,11 +259,11 @@ dir_datesort(con | ||
* desc: compare d1 and d2 on date, but put directories always first | ||
*/ | ||
{ | ||
- DirList *f1 = ((DirList *) d1), | ||
+ DirList *f1 = ((DirList *) d1), | ||
*f2 = ((DirList *) d2); | ||
struct stat *s1 = &(f1->filestatus | ||
struct stat *s2 = &(f2->filestatus | ||
- | ||
+ | ||
/* check for '..' */ | ||
if (strcmp(((DirLis | ||
@@ -272,12 +272,12 @@ dir_datesort(con | ||
if (strcmp(((DirLis | ||
return(1); | ||
} | ||
- | ||
+ | ||
/* put directories first */ | ||
if ((s1->st_mode & S_IFDIR) && (s2->st_mode & S_IFDIR)) { | ||
- return(s1->st_mt | ||
- -1 | ||
- : | ||
+ return(s1->st_mt | ||
+ -1 | ||
+ : | ||
s1->st_mtime >= s2->st_mtime); | ||
}; | ||
if (s1->st_mode & S_IFDIR) { | ||
@@ -286,13 +286,13 @@ dir_datesort(con | ||
if (s2->st_mode & S_IFDIR) { | ||
return(1); | ||
} | ||
- return(s1->st_mt | ||
- -1 | ||
- : | ||
+ return(s1->st_mt | ||
+ -1 | ||
+ : | ||
s1->st_mtime >= s2->st_mtime); | ||
} /* dir_datesort() */ | ||
- | ||
+ | ||
int | ||
null_strcmp(char | ||
@@ -303,15 +303,15 @@ null_strcmp(char | ||
if ((s1 == NULL) && (s2 == NULL)) { | ||
return(0); | ||
} | ||
- if (s1 == NULL) { | ||
- return(-1); | ||
+ if (s1 == NULL) { | ||
+ return(-1); | ||
} | ||
if (s2 == NULL) { | ||
return(1); | ||
} | ||
return(strcmp(s1 | ||
} /* null_strcmp() */ | ||
- | ||
+ | ||
int | ||
dir_extsort(cons | ||
@@ -322,7 +322,7 @@ dir_extsort(cons | ||
* post: see code | ||
*/ | ||
{ | ||
- DirList *f1 = ((DirList *) d1), | ||
+ DirList *f1 = ((DirList *) d1), | ||
*f2 = ((DirList *) d2); | ||
struct stat *s1 = &(f1->filestatus | ||
struct stat *s2 = &(f2->filestatus | ||
@@ -337,10 +337,10 @@ dir_extsort(cons | ||
if (strcmp(((DirLis | ||
return(1); | ||
} | ||
- | ||
+ | ||
/* find the first extension */ | ||
- | ||
+ | ||
ext1 = f1->filename + strlen(f1->filen | ||
extf = FALSE; | ||
while (!extf && (ext1 > f1->filename)) { | ||
@@ -353,21 +353,21 @@ dir_extsort(cons | ||
} | ||
/* ext1 == NULL if there's no "extension" else ext1 points */ | ||
/* to the first character of the extension string */ | ||
- | ||
+ | ||
/* find the second extension */ | ||
- | ||
+ | ||
ext2 = f2->filename + strlen(f2->filen | ||
extf = FALSE; | ||
while (!extf && (ext2 > f2->filename)) { | ||
extf = (*--ext2 == '.'); | ||
- } | ||
+ } | ||
if (!extf) { | ||
ext2 = NULL; | ||
} else { | ||
ext2++; | ||
} | ||
/* idem as for ext1 */ | ||
- | ||
+ | ||
if ((s1->st_mode & S_IFDIR) && (s2->st_mode & S_IFDIR)) { | ||
ret = null_strcmp(ext1 | ||
if (ret == 0) { | ||
@@ -431,7 +431,7 @@ get_dir(char *dirname, char *fmask, DirList **dir, int *n) | ||
/* Solution: */ | ||
/* manually insert the parent directory as the only */ | ||
/* directory entry, and return. */ | ||
- | ||
+ | ||
if (*n == -1) { | ||
*n = 1; | ||
*dir = (DirList *) malloc(sizeof(Di | ||
@@ -440,7 +440,7 @@ get_dir(char *dirname, char *fmask, DirList **dir, int *n) | ||
(*dir)[0].filest | ||
(*dir)[0].link = FALSE; | ||
return; | ||
- } | ||
+ } | ||
*dir = (DirList *) malloc( *n * sizeof(DirList) ); | ||
d = 0; | ||
@@ -450,7 +450,7 @@ get_dir(char *dirname, char *fmask, DirList **dir, int *n) | ||
lstat(dire[j]->d | ||
/* check if this file is to be included */ | ||
/* always include directories, the rest is subject to fmask */ | ||
- if (S_ISDIR(status. | ||
+ if (S_ISDIR(status. | ||
|| fnmatch(fmask, dire[j]->d_name, | ||
strcpy((*dir)[i] | ||
(*dir)[i].filest | ||
@@ -478,7 +478,7 @@ get_dir(char *dirname, char *fmask, DirList **dir, int *n) | ||
j++; | ||
} | ||
*n = i; | ||
- | ||
+ | ||
/* sort the directory with the directory names on top */ | ||
qsort((*dir), *n, sizeof(DirList), | ||
@@ -490,13 +490,13 @@ get_dir(char *dirname, char *fmask, DirList **dir, int *n) | ||
return; | ||
}/* get_dir() */ | ||
- | ||
+ | ||
void | ||
FreeDir(DirList *d, int n) | ||
/* | ||
* desc: free the dirlist d | ||
- * pre: d != NULL | ||
+ * pre: d != NULL | ||
* post: memory allocated to d has been released | ||
*/ | ||
{ |
@@ -1,5 +1,5 @@ | ||
-/* | ||
- * include file for dir.c | ||
+/* | ||
+ * include file for dir.c | ||
* | ||
* Copyright (c) 1995, Marc van Kempen | ||
* | ||
@@ -12,7 +12,7 @@ | ||
* responsible for the proper functioning of this software, nor does | ||
* the author assume any responsibility for damages incurred with | ||
* its use. | ||
- * | ||
+ * | ||
*/ | ||
#include <sys/types.h> | ||
@@ -25,7 +25,7 @@ typedef struct DirList { /* structure to hold the directory entries | ||
int link; /* is it a link ? */ | ||
char *linkname; /* the name of the file the link points to */ | ||
} DirList; | ||
- | ||
+ | ||
#ifndef TRUE | ||
#define TRUE (1) | ||
#endif |
@@ -1,7 +1,7 @@ | ||
/* | ||
* program: fselect.c | ||
* author: Marc van Kempen (wmbfmk@urc.tue. | ||
- * Desc: File selection routine | ||
+ * Desc: File selection routine | ||
* | ||
* Copyright (c) 1995, Marc van Kempen | ||
* | ||
@@ -14,7 +14,7 @@ | ||
* responsible for the proper functioning of this software, nor does | ||
* the author assume any responsibility for damages incurred with | ||
* its use. | ||
- * | ||
+ * | ||
*/ | ||
#include <stdlib.h> | ||
@@ -31,7 +31,7 @@ | ||
char *dialog_dfselect | ||
-/* | ||
+/* | ||
* Functions | ||
*/ | ||
@@ -60,7 +60,7 @@ get_directories( | ||
void | ||
get_filenames(Di | ||
/* | ||
- * Desc: return the filenames in <dir> as an arry in | ||
+ * Desc: return the filenames in <dir> as an arry in | ||
* <names>, the # of entries in <nf>, memory allocated | ||
* to *names should be freed when done. | ||
*/ | ||
@@ -78,7 +78,7 @@ get_filenames(Di | ||
(*names)[i] = (char *) malloc( strlen(d[i+nd].f | ||
strcpy((*names)[ | ||
} | ||
- | ||
+ | ||
return; | ||
} /* get_filenames() */ | ||
@@ -102,8 +102,8 @@ FreeNames(char **names, int n) | ||
int | ||
dialog_dselect_o | ||
/* | ||
- * Desc: starting from the current directory, | ||
- * choose a new current directory | ||
+ * Desc: starting from the current directory, | ||
+ * choose a new current directory | ||
*/ | ||
{ | ||
DirList *d = NULL; | ||
@@ -114,12 +114,12 @@ dialog_dselect_o | ||
StringObj *dir_obj; | ||
char o_dir[MAXPATHLEN | ||
struct ComposeObj *obj = NULL; | ||
- int n, nd, okbutton, cancelbutton, | ||
+ int n, nd, okbutton, cancelbutton, | ||
quit, cancel, ret; | ||
ds_win = newwin(LINES-8, COLS-30, 4, 15); | ||
if (ds_win == NULL) { | ||
- fprintf(stderr, "\nnewwin(%d,%d, | ||
+ fprintf(stderr, "\nnewwin(%d,%d, | ||
LINES-8, COLS-30, 4, 15); | ||
exit(1); | ||
} | ||
@@ -137,7 +137,7 @@ dialog_dselect_o | ||
/* the list of directories */ | ||
get_dir(".", "*", &d, &n); | ||
get_directories( | ||
- dirs_obj = NewListObj(ds_wi | ||
+ dirs_obj = NewListObj(ds_wi | ||
LINES-15, COLS-48, nd); | ||
AddObj(&obj, LISTOBJ, (void *) dirs_obj); | ||
@@ -145,7 +145,7 @@ dialog_dselect_o | ||
okbutton = FALSE; | ||
okbut = NewButtonObj(ds_ | ||
AddObj(&obj, BUTTONOBJ, (void *) okbut); | ||
- | ||
+ | ||
/* the Cancel-button */ | ||
cancelbutton = FALSE; | ||
cancelbut = NewButtonObj(ds_ | ||
@@ -176,7 +176,7 @@ dialog_dselect_o | ||
strcpy(old_dir, o_dir); | ||
RefreshStringObj | ||
} | ||
- } | ||
+ } | ||
get_dir(".", "*", &d, &n); | ||
FreeNames(names, | ||
get_directories( | ||
@@ -194,7 +194,7 @@ dialog_dselect_o | ||
break; | ||
} | ||
} | ||
- | ||
+ | ||
FreeNames(names, | ||
DelObj(obj); | ||
delwin(ds_win); | ||
@@ -229,7 +229,7 @@ char * | ||
dialog_dfselect( | ||
/* | ||
* Desc: choose a file from the directory <dir>, which | ||
- * initially display files with the mask <filemask> | ||
+ * initially display files with the mask <filemask> | ||
* pre: <dir> is the initial directory | ||
* only files corresponding to the mask <fmask> are displayed | ||
* post: returns NULL if no file was selected | ||
@@ -262,7 +262,7 @@ dialog_dfselect( | ||
fs_win = newwin(LINES-2, COLS-20, 1, 10); | ||
if (fs_win == NULL) { | ||
endwin(); | ||
- fprintf(stderr, "\nnewwin(%d,%d, | ||
+ fprintf(stderr, "\nnewwin(%d,%d, | ||
LINES-2, COLS-20, 2, 10); | ||
exit(1); | ||
} | ||
@@ -289,7 +289,7 @@ dialog_dfselect( | ||
get_dir(".", fmask, &d, &n); /* read the entire directory */ | ||
get_directories( | ||
if (is_fselect) { | ||
- dirs_obj = NewListObj(fs_wi | ||
+ dirs_obj = NewListObj(fs_wi | ||
LINES-16, (COLS-20)/2-2, nd); | ||
} else { | ||
dirs_obj = NewListObj(fs_wi | ||
@@ -340,7 +340,7 @@ dialog_dfselect( | ||
switch(ret) { | ||
case SEL_CR: | ||
if (strcmp(old_fmas | ||
- /* reread directory and update the listobjects */ | ||
+ /* reread directory and update the listobjects */ | ||
if (strcmp(old_dir, | ||
if (chdir(o_dir)) { | ||
dialog_notify("C |
@@ -20,7 +20,7 @@ | ||
#include "dialog.h" | ||
void | ||
-dialog_gauge(ch | ||
+dialog_gauge(ch | ||
int height, int width, int perc) | ||
/* | ||
* Desc: display a progress bar, progress indicated by <perc> | ||
@@ -36,7 +36,7 @@ dialog_gauge(cha | ||
height, width, y, x); | ||
exit(-1); | ||
} | ||
- | ||
+ | ||
draw_box(gw, 0, 0, height, width, dialog_attr, border_attr); | ||
draw_shadow(stds | ||
@@ -69,4 +69,4 @@ dialog_gauge(cha | ||
return; | ||
} /* dialog_gauge() */ | ||
- | ||
+ |
@@ -1,5 +1,5 @@ | ||
/*************** | ||
- * | ||
+ * | ||
* Program: help.c | ||
* Author: Marc van Kempen | ||
* Desc: get help | ||
@@ -16,7 +16,7 @@ | ||
* responsible for the proper functioning of this software, nor does | ||
* the author assume any responsibility for damages incurred with | ||
* its use. | ||
- * | ||
+ * | ||
**************** | ||
#include <stdlib.h> | ||
@@ -111,7 +111,7 @@ display_helpfile | ||
return; | ||
} /* display_helpfile | ||
- | ||
+ | ||
/*************** | ||
* | ||
@@ -121,7 +121,7 @@ display_helpfile | ||
void | ||
use_helpline(cha | ||
-/* | ||
+/* | ||
* desc: set the helpline to printed in dialogs | ||
*/ | ||
{ | ||
@@ -177,7 +177,7 @@ get_helpline(voi | ||
} else { | ||
hlp = NULL; | ||
} | ||
- | ||
+ | ||
return(hlp); | ||
} /* get_helpline() */ | ||
@@ -25,7 +25,7 @@ | ||
* 19/12/93 - menu will now scroll if there are more items than can fit | ||
* on the screen. | ||
* - added 'checklist', a dialog box with a list of options that | ||
- * can be turned on or off. A list of options that are on is | ||
+ * can be turned on or off. A list of options that are on is | ||
* returned on exit. | ||
* | ||
* 20/12/93 - Version 0.15 released. | ||
@@ -67,7 +67,7 @@ | ||
* 13/01/94 - some changes for easier porting to other Unix systems (tested | ||
* on Ultrix, SunOS and HPUX) | ||
* - Version 0.3 released. | ||
- * | ||
+ * | ||
* 08/06/94 - Patches by Stuart Herbert - S.Herbert@shef.a | ||
* Fixed attr_clear and the textbox stuff to work with ncurses 1.8.5 | ||
* Fixed the wordwrap routine - it'll actually wrap properly now |
@@ -71,7 +71,7 @@ int dialog_menu(unsi | ||
/* center dialog box on screen */ | ||
x = (COLS - width)/2; | ||
y = (LINES - height)/2; | ||
- | ||
+ | ||
#ifdef HAVE_NCURSES | ||
if (use_shadow) | ||
draw_shadow(stds | ||
@@ -149,7 +149,7 @@ int dialog_menu(unsi | ||
if (key < 0x100 && toupper(key) == toupper(items[(s | ||
break; | ||
- if (i < max_choice || (key >= '1' && key <= MIN('9', '0'+max_choice)) | ||
+ if (i < max_choice || (key >= '1' && key <= MIN('9', '0'+max_choice)) | ||
key == KEY_UP || key == KEY_DOWN || key == '-' || key == '+') { | ||
if (key >= '1' && key <= MIN('9', '0'+max_choice)) | ||
i = key - '1'; | ||
@@ -245,7 +245,7 @@ int dialog_menu(unsi | ||
*ch = choice; | ||
if (sc) | ||
*sc = scroll; | ||
- | ||
+ | ||
switch (key) { | ||
case KEY_PPAGE: | ||
if (scroll > height-4) { /* can we go up? */ | ||
@@ -316,7 +316,7 @@ int dialog_menu(unsi | ||
} | ||
if (redraw_menu) { | ||
for (i = 0; i < max_choice; i++) { | ||
- print_item(menu, | ||
+ print_item(menu, | ||
items[(scroll+i) | ||
} | ||
wnoutrefresh(men |
@@ -226,7 +226,7 @@ dialog_mesgbox(u | ||
display_helpfile | ||
break; | ||
} | ||
- print_page(dialo | ||
+ print_page(dialo | ||
print_perc(dialo | ||
wmove(dialog, height-2, width/2-2); | ||
wrefresh(dialog) | ||
@@ -284,7 +284,7 @@ getline(unsigned | ||
if (n<0) { | ||
return(NULL); | ||
} | ||
- | ||
+ | ||
i=0; | ||
while (*buf && i<n) { | ||
if (*buf == '\n' || *buf == '\r') { | ||
@@ -315,7 +315,7 @@ print_page(WINDO | ||
wmove(win, 1+i, 1); | ||
for (j=0; j<width-2; j++) waddnstr(win, " ", 1); | ||
wmove(win, 1+i, 1); | ||
- j = 0; | ||
+ j = 0; | ||
/* scroll to the right */ | ||
while (*b && (*b != '\n') && (*b != '\r') && (j<hscroll)) { | ||
b++; | ||
@@ -336,7 +336,7 @@ print_page(WINDO | ||
if (*b) b++; /* skip over '\n', if it exists */ | ||
} | ||
} /* print_page() */ | ||
- | ||
- | ||
- | ||
- | ||
+ | ||
+ | ||
+ | ||
+ |
@@ -14,7 +14,7 @@ | ||
* responsible for the proper functioning of this software, nor does | ||
* the author assume any responsibility for damages incurred with | ||
* its use. | ||
- * | ||
+ * | ||
*/ | ||
@@ -23,7 +23,7 @@ | ||
void | ||
dialog_notify(ch | ||
-/* | ||
+/* | ||
* Desc: display an error message | ||
*/ | ||
{ |
@@ -87,7 +87,7 @@ int dialog_radiolist | ||
/* center dialog box on screen */ | ||
x = (COLS - width)/2; | ||
y = (LINES - height)/2; | ||
- | ||
+ | ||
#ifdef HAVE_NCURSES | ||
if (use_shadow) | ||
draw_shadow(stds | ||
@@ -164,7 +164,7 @@ int dialog_radiolist | ||
if (toupper(key) == toupper(items[(s | ||
break; | ||
- if (i < max_choice || (key >= '1' && key <= MIN('9', '0'+max_choice)) | ||
+ if (i < max_choice || (key >= '1' && key <= MIN('9', '0'+max_choice)) | ||
key == KEY_UP || key == KEY_DOWN || key == ' ' || | ||
key == '+' || key == '-' ) { | ||
if (key >= '1' && key <= MIN('9', '0'+max_choice)) |
@@ -53,8 +53,8 @@ static struct pid { | ||
struct pid *next; | ||
FILE *fp; | ||
pid_t pid; | ||
-} *pidlist; | ||
- | ||
+} *pidlist; | ||
+ | ||
FILE * | ||
raw_popen(const char *program, char * const *argv, const char *type) | ||
{ | ||
@@ -155,6 +155,6 @@ raw_pclose(FILE *iop) | ||
else | ||
last->next = cur->next; | ||
free(cur); | ||
- | ||
+ | ||
return (pid == -1 ? -1 : pstat.w_status); | ||
} |
@@ -3,7 +3,7 @@ | ||
* Author: Marc van Kempen | ||
* Desc: Implementation of UI-objects: | ||
* - String input fields | ||
- * - List selection | ||
+ * - List selection | ||
* - Buttons | ||
* | ||
* Copyright (c) 1995, Marc van Kempen | ||
@@ -17,7 +17,7 @@ | ||
* responsible for the proper functioning of this software, nor does | ||
* the author assume any responsibility for damages incurred with | ||
* its use. | ||
- * | ||
+ * | ||
*/ | ||
#include <stdlib.h> | ||
@@ -79,14 +79,14 @@ FreeObj(ComposeO | ||
*/ | ||
{ | ||
ComposeObj *o = Obj; | ||
- | ||
+ | ||
o = Obj; | ||
while (o) { | ||
o = Obj->next; | ||
free(Obj); | ||
Obj = o; | ||
} | ||
- | ||
+ | ||
return; | ||
} /* FreeObj() */ | ||
@@ -94,7 +94,7 @@ FreeObj(ComposeO | ||
int | ||
ReadObj(ComposeO | ||
/* | ||
- * Desc: navigate through the different objects calling their | ||
+ * Desc: navigate through the different objects calling their | ||
* respective navigation routines as necessary | ||
* Pre: Obj != NULL | ||
*/ | ||
@@ -145,7 +145,7 @@ ReadObj(ComposeO | ||
} | ||
return(ret); | ||
- | ||
+ | ||
} /* ReadObj() */ | ||
@@ -225,7 +225,7 @@ DelObj(ComposeOb | ||
FreeObj(o); | ||
} /* DelObj() */ | ||
- | ||
+ | ||
/*************** | ||
* | ||
* StringObj routines | ||
@@ -265,7 +265,7 @@ NewStringObj(WIN | ||
*/ | ||
{ | ||
StringObj *so; | ||
- | ||
+ | ||
/* Initialize a new object */ | ||
so = (StringObj *) malloc( sizeof(StringObj | ||
if (!so) { | ||
@@ -302,7 +302,7 @@ SelectStringObj( | ||
char tmp[so->len+1]; | ||
strcpy(tmp, so->s); | ||
- key = line_edit(so->wi | ||
+ key = line_edit(so->wi | ||
so->len, so->w-2, inputbox_attr, TRUE, tmp); | ||
if ((key == '\n') || (key == '\r') || (key == '\t') || key == (KEY_BTAB) ) { | ||
strcpy(so->s, tmp); | ||
@@ -335,7 +335,7 @@ DelStringObj(Str | ||
return; | ||
} | ||
- | ||
+ | ||
/*************** | ||
* | ||
* ListObj routines | ||
@@ -377,7 +377,7 @@ DrawNames(ListOb | ||
i++; | ||
} | ||
- return; | ||
+ return; | ||
} /* DrawNames() */ | ||
void | ||
@@ -401,12 +401,12 @@ RefreshListObj(L | ||
sprintf(perc, "(%3d%%)", MIN(100, (int) (100 * (lo->sel+lo->h-2 | ||
wmove(lo->win, lo->y + lo->h, lo->x + lo->w - 8); | ||
wattrset(lo->win | ||
- waddstr(lo->win, | ||
- | ||
- | ||
+ waddstr(lo->win, | ||
+ | ||
+ | ||
return; | ||
} /* RefreshListObj() | ||
- | ||
+ | ||
ListObj * | ||
NewListObj(WINDO | ||
int h, int w, int n) | ||
@@ -485,7 +485,7 @@ UpdateListObj(Li | ||
} | ||
} else { | ||
lo->seld = NULL; | ||
- } | ||
+ } | ||
lo->n = n; | ||
lo->scroll = 0; | ||
lo->sel = 0; | ||
@@ -521,7 +521,7 @@ SelectListObj(Li | ||
key = wgetch(lo->win); | ||
quit = FALSE; | ||
- while ((key != '\t') && (key != '\n') && (key != '\r') | ||
+ while ((key != '\t') && (key != '\n') && (key != '\r') | ||
&& (key != ESC) && (key != KEY_F(1)) && (key != '?') && !quit) { | ||
/* first draw current item in normal video */ | ||
wmove(lo->win, sel_y, sel_x); | ||
@@ -620,11 +620,11 @@ SelectListObj(Li | ||
break; | ||
} | ||
/* Draw % indication */ | ||
- sprintf(perc, "(%3d%%)", MIN(100, (int) | ||
+ sprintf(perc, "(%3d%%)", MIN(100, (int) | ||
(100 * (lo->sel+lo->h - 2) / MAX(1, lo->n)))); | ||
wmove(lo->win, lo->y + lo->h, lo->x + lo->w - 8); | ||
wattrset(lo->win | ||
- waddstr(lo->win, | ||
+ waddstr(lo->win, | ||
/* draw current item in inverse */ | ||
wmove(lo->win, sel_y, sel_x); | ||
@@ -632,8 +632,8 @@ SelectListObj(Li | ||
if (strlen(lo->name | ||
/* when printing in inverse video show the last characters in the */ | ||
/* name that will fit in the window */ | ||
- strncpy(tmp, | ||
- lo->name[lo->sel | ||
+ strncpy(tmp, | ||
+ lo->name[lo->sel | ||
lo->w - 2); | ||
tmp[lo->w - 2] = 0; | ||
waddstr(lo->win, | ||
@@ -642,7 +642,7 @@ SelectListObj(Li | ||
} | ||
if (!quit) key = wgetch(lo->win); | ||
} | ||
- | ||
+ | ||
if (key == ESC) { | ||
return(SEL_ESC); | ||
} | ||
@@ -674,8 +674,8 @@ DelListObj(ListO | ||
void | ||
MarkCurrentListO | ||
-/* | ||
- * Desc: mark the current item for the selection list | ||
+/* | ||
+ * Desc: mark the current item for the selection list | ||
*/ | ||
{ | ||
lo->seld[lo->sel | ||
@@ -707,7 +707,7 @@ UnMarkAllListObj | ||
*/ | ||
{ | ||
int i; | ||
- | ||
+ | ||
for (i=0; i<lo->n; i++) { | ||
lo->seld[i] = FALSE; | ||
} | ||
@@ -745,7 +745,7 @@ NewButtonObj(WIN | ||
ButtonObj *bo; | ||
bo = (ButtonObj *) malloc( sizeof(ButtonObj | ||
- | ||
+ | ||
bo->win = win; | ||
bo->title = (char *) malloc( strlen(title) + 1); | ||
strcpy(bo->title | ||
@@ -771,7 +771,7 @@ SelectButtonObj( | ||
print_button(bo- | ||
wmove(bo->win, bo->y+1, bo->x+(bo->w/2)- | ||
key = wgetch(bo->win); | ||
- print_button(bo- | ||
+ print_button(bo- | ||
switch(key) { | ||
case '\t': | ||
return(SEL_TAB); |
@@ -13,7 +13,7 @@ | ||
* responsible for the proper functioning of this software, nor does | ||
* the author assume any responsibility for damages incurred with | ||
* its use. | ||
- * | ||
+ * | ||
*/ | ||
#include "dialog.h" | ||
@@ -85,13 +85,13 @@ typedef struct ComposeObj { | ||
**************** | ||
void RefreshStringObj | ||
-StringObj *NewStringObj(WI | ||
+StringObj *NewStringObj(WI | ||
int y, int x, int w, int len); | ||
int SelectStringObj( | ||
void DelStringObj(Str | ||
void RefreshListObj(L | ||
-ListObj *NewListObj(WIND | ||
+ListObj *NewListObj(WIND | ||
char *listelt, int y, int x, int h, int w, int n); | ||
void UpdateListObj(Li | ||
int SelectListObj(Li | ||
@@ -101,7 +101,7 @@ void MarkAllListObj(L | ||
void UnMarkAllListObj | ||
void RefreshButtonObj | ||
-ButtonObj *NewButtonObj(WI | ||
+ButtonObj *NewButtonObj(WI | ||
int y, int x); | ||
int SelectButtonObj( | ||
void DelButtonObj(But |
@@ -52,7 +52,7 @@ int dialog_yesno(uns | ||
/* center dialog box on screen */ | ||
x = (COLS - width)/2; | ||
y = (LINES - height)/2; | ||
- | ||
+ | ||
#ifdef HAVE_NCURSES | ||
if (use_shadow) | ||
draw_shadow(stds |
@@ -1,5 +1,5 @@ | ||
// This may look like C code, but it is really -*- C++ -*- | ||
-/* | ||
+/* | ||
Copyright (C) 1988 Free Software Foundation | ||
written by Dirk Grunwald (grunwald@cs.uiu | ||
@@ -16,7 +16,7 @@ License along with this library; if not, write to the Free Software | ||
Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. | ||
*/ | ||
#ifndef _ACG_h | ||
-#define _ACG_h 1 | ||
+#define _ACG_h 1 | ||
#include <RNG.h> | ||
#include <math.h> |
@@ -1,5 +1,5 @@ | ||
// This may look like C code, but it is really -*- C++ -*- | ||
-/* | ||
+/* | ||
Copyright (C) 1989 Free Software Foundation | ||
written by Doug Lea (dl@rocky.oswego | ||
@@ -25,7 +25,7 @@ Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. | ||
/* | ||
- An AllocRing holds the last n malloc'ed strings, reallocating/reu | ||
+ An AllocRing holds the last n malloc'ed strings, reallocating/reu | ||
one only when the queue wraps around. It thus guarantees that the | ||
last n allocations are intact. It is useful for things like I/O | ||
formatting where reasonable restrictions may be made about the |
@@ -1,5 +1,5 @@ | ||
// This may look like C code, but it is really -*- C++ -*- | ||
-/* | ||
+/* | ||
Copyright (C) 1988 Free Software Foundation | ||
written by Dirk Grunwald (grunwald@cs.uiu | ||
@@ -1,5 +1,5 @@ | ||
// This may look like C code, but it is really -*- C++ -*- | ||
-/* | ||
+/* | ||
Copyright (C) 1988 Free Software Foundation | ||
written by Doug Lea (dl@rocky.oswego | ||
@@ -36,11 +36,11 @@ struct BitSetRep | ||
unsigned short s[1]; // bits start here | ||
}; | ||
-extern BitSetRep* BitSetalloc(BitS | ||
+extern BitSetRep* BitSetalloc(BitS | ||
int, int, int); | ||
extern BitSetRep* BitSetcopy(BitSe | ||
extern BitSetRep* BitSetresize(Bit | ||
-extern BitSetRep* BitSetop(const BitSetRep*, const BitSetRep*, | ||
+extern BitSetRep* BitSetop(const BitSetRep*, const BitSetRep*, | ||
BitSetRep*, char); | ||
extern BitSetRep* BitSetcmpl(const | ||
@@ -69,7 +69,7 @@ class BitSet | ||
protected: | ||
BitSetRep* rep; | ||
- | ||
+ | ||
public: | ||
// constructors | ||
@@ -116,7 +116,7 @@ public: | ||
int test(int from, int to) const; | ||
BitSetBit operator [] (int i); | ||
- | ||
+ | ||
// iterators | ||
int first(int b = 1) const; | ||
@@ -132,13 +132,13 @@ public: | ||
int empty() const; | ||
int virtual_bit() const; | ||
int count(int b = 1) const; | ||
- | ||
+ | ||
// convertors & IO | ||
- friend BitSet atoBitSet(const char* s, | ||
+ friend BitSet atoBitSet(const char* s, | ||
char f='0', char t='1', char star='*'); | ||
// BitSettoa is deprecated; do not use in new programs. | ||
- friend const char* BitSettoa(const BitSet& x, | ||
+ friend const char* BitSettoa(const BitSet& x, | ||
char f='0', char t='1', char star='*'); | ||
friend BitSet shorttoBitSet(un | ||
@@ -193,7 +193,7 @@ inline BitSet::BitSet(c | ||
inline BitSet::~BitSet( | ||
inline BitSet& BitSet::operator | ||
-{ | ||
+{ | ||
rep = BitSetcopy(rep, y.rep); | ||
return *this; | ||
} | ||
@@ -258,27 +258,27 @@ inline BitSet operator ~ (const BitSet& x) return r | ||
#else /* NO_NRV */ | ||
-inline BitSet operator & (const BitSet& x, const BitSet& y) | ||
+inline BitSet operator & (const BitSet& x, const BitSet& y) | ||
{ | ||
BitSet r; and(x, y, r); return r; | ||
} | ||
-inline BitSet operator | (const BitSet& x, const BitSet& y) | ||
+inline BitSet operator | (const BitSet& x, const BitSet& y) | ||
{ | ||
BitSet r; or(x, y, r); return r; | ||
} | ||
-inline BitSet operator ^ (const BitSet& x, const BitSet& y) | ||
+inline BitSet operator ^ (const BitSet& x, const BitSet& y) | ||
{ | ||
BitSet r; xor(x, y, r); return r; | ||
} | ||
-inline BitSet operator - (const BitSet& x, const BitSet& y) | ||
+inline BitSet operator - (const BitSet& x, const BitSet& y) | ||
{ | ||
BitSet r; diff(x, y, r); return r; | ||
} | ||
-inline BitSet operator ~ (const BitSet& x) | ||
+inline BitSet operator ~ (const BitSet& x) | ||
{ | ||
BitSet r; ::complement(x, r); return r; | ||
} | ||
@@ -329,7 +329,7 @@ inline int BitSet::test(int | ||
{ | ||
if (p < 0) error("Illegal bit index"); | ||
int index = BitSet_index(p); | ||
- return (index >= rep->len)? rep->virt : | ||
+ return (index >= rep->len)? rep->virt : | ||
((rep->s[index] & (1 << BitSet_pos(p))) != 0); | ||
} | ||
@@ -1,5 +1,5 @@ | ||
// This may look like C code, but it is really -*- C++ -*- | ||
-/* | ||
+/* | ||
Copyright (C) 1988 Free Software Foundation | ||
written by Doug Lea (dl@rocky.oswego | ||
@@ -138,7 +138,7 @@ public: | ||
friend void complement(const | ||
- friend int lcompare(const BitString&, const BitString&); | ||
+ friend int lcompare(const BitString&, const BitString&); | ||
// assignment-based | ||
// (constuctive versions decalred inline below | ||
@@ -162,7 +162,7 @@ public: | ||
void clear(int pos); | ||
void clear(int from, int to); | ||
- void clear(); | ||
+ void clear(); | ||
void invert(int pos); | ||
void invert(int from, int to); | ||
@@ -188,7 +188,7 @@ public: | ||
// searching & matching | ||
- int index(unsigned int bit, int startpos = 0) const ; | ||
+ int index(unsigned int bit, int startpos = 0) const ; | ||
int index(const BitString&, int startpos = 0) const; | ||
int index(const BitSubString&, int startpos = 0) const; | ||
int index(const BitPattern&, int startpos = 0) const; | ||
@@ -208,9 +208,9 @@ public: | ||
// BitSubString extraction | ||
BitSubString at(int pos, int len); | ||
- BitSubString at(const BitString&, int startpos = 0); | ||
- BitSubString at(const BitSubString&, int startpos = 0); | ||
- BitSubString at(const BitPattern&, int startpos = 0); | ||
+ BitSubString at(const BitString&, int startpos = 0); | ||
+ BitSubString at(const BitSubString&, int startpos = 0); | ||
+ BitSubString at(const BitPattern&, int startpos = 0); | ||
BitSubString before(int pos); | ||
BitSubString before(const BitString&, int startpos = 0); | ||
@@ -224,9 +224,9 @@ public: | ||
// other friends & utilities | ||
- friend BitString common_prefix(co | ||
+ friend BitString common_prefix(co | ||
int pos = 0); | ||
- friend BitString common_suffix(co | ||
+ friend BitString common_suffix(co | ||
int pos = -1); | ||
friend BitString reverse(const BitString&); | ||
@@ -259,7 +259,7 @@ public: | ||
friend BitPattern atoBitPattern(co | ||
char f='0',char t='1',char x='X'); | ||
- friend const char* BitPatterntoa(co | ||
+ friend const char* BitPatterntoa(co | ||
char f='0',char t='1',char x='X'); | ||
int OK() const; | ||
}; | ||
@@ -277,7 +277,7 @@ public: | ||
~BitPattern(); | ||
- friend const char* BitPatterntoa(co | ||
+ friend const char* BitPatterntoa(co | ||
char f/*='0'*/,char t/*='1'*/,char x/*='X'*/); | ||
void printon(ostream& | ||
friend BitPattern atoBitPattern(co | ||
@@ -320,16 +320,16 @@ inline BitString::BitSt | ||
inline BitString::BitSt | ||
-inline BitString::BitSt | ||
+inline BitString::BitSt | ||
:rep (BStr_alloc(0, y.S.rep->s, y.pos, y.pos+y.len, y.len)) {} | ||
inline BitString::~BitS | ||
-{ | ||
+{ | ||
if (rep != &_nilBitStrRep) delete rep; | ||
} | ||
-inline BitString shorttoBitString | ||
-{ | ||
+inline BitString shorttoBitString | ||
+{ | ||
BitString r; | ||
_BS_word ww = w; | ||
#if _BS_BIGENDIAN | ||
@@ -339,8 +339,8 @@ inline BitString shorttoBitString | ||
return r; | ||
} | ||
-inline BitString longtoBitString( | ||
-{ | ||
+inline BitString longtoBitString( | ||
+{ | ||
BitString r; | ||
#if 1 | ||
_BS_word u = w; | ||
@@ -355,13 +355,13 @@ inline BitString longtoBitString( | ||
} | ||
inline BitString& BitString::opera | ||
-{ | ||
+{ | ||
rep = BStr_copy(rep, y.rep); | ||
return *this; | ||
} | ||
inline BitString& BitString::opera | ||
-{ | ||
+{ | ||
_BS_word bit = b; | ||
rep = BStr_alloc(rep, &bit, 0, 1, 1); | ||
return *this; | ||
@@ -373,7 +373,7 @@ inline BitString& BitString::opera | ||
return *this; | ||
} | ||
-inline BitSubString::Bi | ||
+inline BitSubString::Bi | ||
:S(x.S), pos(x.pos), len(x.len) {} | ||
inline BitSubString::Bi | ||
@@ -544,47 +544,47 @@ inline BitString operator ~ (const BitString& x) return r | ||
#else /* NO_NRV */ | ||
-inline BitString operator & (const BitString& x, const BitString& y) | ||
+inline BitString operator & (const BitString& x, const BitString& y) | ||
{ | ||
BitString r; and(x, y, r); return r; | ||
} | ||
-inline BitString operator | (const BitString& x, const BitString& y) | ||
+inline BitString operator | (const BitString& x, const BitString& y) | ||
{ | ||
BitString r; or(x, y, r); return r; | ||
} | ||
-inline BitString operator ^ (const BitString& x, const BitString& y) | ||
+inline BitString operator ^ (const BitString& x, const BitString& y) | ||
{ | ||
BitString r; xor(x, y, r); return r; | ||
} | ||
-inline BitString operator << (const BitString& x, int y) | ||
+inline BitString operator << (const BitString& x, int y) | ||
{ | ||
BitString r; lshift(x, y, r); return r; | ||
} | ||
-inline BitString operator >> (const BitString& x, int y) | ||
+inline BitString operator >> (const BitString& x, int y) | ||
{ | ||
BitString r; rshift(x, y, r); return r; | ||
} | ||
-inline BitString operator - (const BitString& x, const BitString& y) | ||
+inline BitString operator - (const BitString& x, const BitString& y) | ||
{ | ||
BitString r; diff(x, y, r); return r; | ||
} | ||
-inline BitString operator + (const BitString& x, const BitString& y) | ||
+inline BitString operator + (const BitString& x, const BitString& y) | ||
{ | ||
BitString r; cat(x, y, r); return r; | ||
} | ||
-inline BitString operator + (const BitString& x, unsigned int y) | ||
+inline BitString operator + (const BitString& x, unsigned int y) | ||
{ | ||
BitString r; cat(x, y, r); return r; | ||
} | ||
-inline BitString operator ~ (const BitString& x) | ||
+inline BitString operator ~ (const BitString& x) | ||
{ | ||
BitString r; complement(x, r); return r; | ||
} | ||
@@ -594,32 +594,32 @@ inline BitString operator ~ (const BitString& x) | ||
// status, matching | ||
inline int BitString::lengt | ||
-{ | ||
+{ | ||
return rep->len; | ||
} | ||
inline int BitString::empty | ||
-{ | ||
+{ | ||
return rep->len == 0; | ||
} | ||
inline int BitString::index | ||
-{ | ||
+{ | ||
return search(startpos, | ||
} | ||
inline int BitString::index | ||
-{ | ||
+{ | ||
return search(startpos, | ||
} | ||
inline int BitString::conta | ||
-{ | ||
+{ | ||
return search(0, rep->len, y.rep->s, 0, y.rep->len) >= 0; | ||
} | ||
inline int BitString::conta | ||
-{ | ||
+{ | ||
return search(0, rep->len, y.S.rep->s, y.pos, y.pos+y.len) >= 0; | ||
} | ||
@@ -664,12 +664,12 @@ inline int BitString::index | ||
} | ||
inline int BitSubString::le | ||
-{ | ||
+{ | ||
return len; | ||
} | ||
inline int BitSubString::em | ||
-{ | ||
+{ | ||
return len == 0; | ||
} | ||
@@ -706,7 +706,7 @@ inline int BitString::index | ||
return prev(rep->len + startpos + 1, bit); | ||
} | ||
-inline void BitString::right | ||
+inline void BitString::right | ||
{ | ||
int nb = (b == 0)? 1 : 0; | ||
rep = BStr_resize(rep, | ||
@@ -721,7 +721,7 @@ inline void BitString::left_ | ||
inline int BitString::test( | ||
{ | ||
- return ((unsigned)(i) >= rep->len)? 0 : | ||
+ return ((unsigned)(i) >= rep->len)? 0 : | ||
((rep->s[BitStr_ | ||
} | ||
@@ -754,7 +754,7 @@ inline BitSubString BitString::_subs | ||
{ | ||
if (first < 0 || l <= 0 || (unsigned)(first | ||
return BitSubString(_ni | ||
- else | ||
+ else | ||
return BitSubString(*th | ||
} | ||
@@ -1,5 +1,5 @@ | ||
// This may look like C code, but it is really -*- C++ -*- | ||
-/* | ||
+/* | ||
Copyright (C) 1988 Free Software Foundation | ||
written by Doug Lea (dl@rocky.oswego | ||
@@ -57,8 +57,8 @@ public: | ||
Complex& operator *= (const Complex& y); | ||
Complex& operator *= (double y); | ||
- Complex& operator /= (const Complex& y); | ||
- Complex& operator /= (double y); | ||
+ Complex& operator /= (const Complex& y); | ||
+ Complex& operator /= (double y); | ||
void error(const char* msg) const; | ||
}; | ||
@@ -83,7 +83,7 @@ Complex pow(const Complex& x, int p); | ||
Complex pow(const Complex& x, const Complex& p); | ||
Complex pow(const Complex& x, double y); | ||
Complex sqrt(const Complex& x); | ||
- | ||
+ | ||
istream& operator >> (istream& s, Complex& x); | ||
ostream& operator << (ostream& s, const Complex& x); | ||
@@ -99,42 +99,42 @@ inline Complex::Complex | ||
inline Complex::~Comple | ||
-inline Complex& Complex::operato | ||
-{ | ||
- re = y.real(); im = y.imag(); return *this; | ||
-} | ||
+inline Complex& Complex::operato | ||
+{ | ||
+ re = y.real(); im = y.imag(); return *this; | ||
+} | ||
inline Complex& Complex::operato | ||
-{ | ||
- re += y.real(); im += y.imag(); return *this; | ||
+{ | ||
+ re += y.real(); im += y.imag(); return *this; | ||
} | ||
inline Complex& Complex::operato | ||
-{ | ||
- re += y; return *this; | ||
+{ | ||
+ re += y; return *this; | ||
} | ||
inline Complex& Complex::operato | ||
-{ | ||
- re -= y.real(); im -= y.imag(); return *this; | ||
+{ | ||
+ re -= y.real(); im -= y.imag(); return *this; | ||
} | ||
inline Complex& Complex::operato | ||
-{ | ||
- re -= y; return *this; | ||
+{ | ||
+ re -= y; return *this; | ||
} | ||
inline Complex& Complex::operato | ||
-{ | ||
+{ | ||
double r = re * y.real() - im * y.imag(); | ||
- im = re * y.imag() + im * y.real(); | ||
- re = r; | ||
- return *this; | ||
+ im = re * y.imag() + im * y.real(); | ||
+ re = r; | ||
+ return *this; | ||
} | ||
inline Complex& Complex::operato | ||
-{ | ||
- re *= y; im *= y; return *this; | ||
+{ | ||
+ re *= y; im *= y; return *this; | ||
} | ||
@@ -202,7 +202,7 @@ inline Complex operator - (double x, const Complex& y) | ||
inline Complex operator * (const Complex& x, const Complex& y) | ||
{ | ||
- return Complex(x.real() | ||
+ return Complex(x.real() | ||
x.real() * y.imag() + x.imag() * y.real()); | ||
} | ||
@@ -1,6 +1,6 @@ | ||
// This may look like C code, but it is really -*- C++ -*- | ||
-/* | ||
+/* | ||
Copyright (C) 1989 Free Software Foundation | ||
written by Eric Newton (newton@rocky.os | ||
@@ -237,7 +237,7 @@ inline int (mvinsch)(int y, int x, char c) | ||
* | ||
*/ | ||
-class CursesWindow | ||
+class CursesWindow | ||
{ | ||
protected: | ||
static int count; // count of all active windows: | ||
@@ -385,102 +385,102 @@ inline int CursesWindow::wi | ||
return maxx() - begx() + 1; | ||
} | ||
-inline int CursesWindow::bo | ||
+inline int CursesWindow::bo | ||
{ | ||
- return ::box(w, vert, hor); | ||
+ return ::box(w, vert, hor); | ||
} | ||
-inline int CursesWindow::ov | ||
+inline int CursesWindow::ov | ||
{ | ||
- return ::overlay(w, win.w); | ||
+ return ::overlay(w, win.w); | ||
} | ||
-inline int CursesWindow::ov | ||
+inline int CursesWindow::ov | ||
{ | ||
- return ::overwrite(w, win.w); | ||
+ return ::overwrite(w, win.w); | ||
} | ||
-inline int CursesWindow::sc | ||
+inline int CursesWindow::sc | ||
{ | ||
- return ::scroll(w); | ||
+ return ::scroll(w); | ||
} | ||
-inline int CursesWindow::to | ||
+inline int CursesWindow::to | ||
{ | ||
- return ::touchwin(w); | ||
+ return ::touchwin(w); | ||
} | ||
-inline int CursesWindow::ad | ||
+inline int CursesWindow::ad | ||
{ | ||
- return ::waddch(w, ch); | ||
+ return ::waddch(w, ch); | ||
} | ||
-inline int CursesWindow::ad | ||
+inline int CursesWindow::ad | ||
{ | ||
// The (char*) cast is to hack around prototypes in curses.h that | ||
// have const missing in the parameter lists. [E.g. SVR4] | ||
- return ::waddstr(w, (char*)str); | ||
+ return ::waddstr(w, (char*)str); | ||
} | ||
-inline int CursesWindow::cl | ||
+inline int CursesWindow::cl | ||
{ | ||
- return ::wclear(w); | ||
+ return ::wclear(w); | ||
} | ||
-inline int CursesWindow::cl | ||
+inline int CursesWindow::cl | ||
{ | ||
- return ::wclrtobot(w); | ||
+ return ::wclrtobot(w); | ||
} | ||
-inline int CursesWindow::cl | ||
+inline int CursesWindow::cl | ||
{ | ||
- return ::wclrtoeol(w); | ||
+ return ::wclrtoeol(w); | ||
} | ||
-inline int CursesWindow::de | ||
+inline int CursesWindow::de | ||
{ | ||
- return ::wdelch(w); | ||
+ return ::wdelch(w); | ||
} | ||
-inline int CursesWindow::de | ||
+inline int CursesWindow::de | ||
{ | ||
- return ::wdeleteln(w); | ||
+ return ::wdeleteln(w); | ||
} | ||
-inline int CursesWindow::er | ||
+inline int CursesWindow::er | ||
{ | ||
- return ::werase(w); | ||
+ return ::werase(w); | ||
} | ||
-inline int CursesWindow::ge | ||
+inline int CursesWindow::ge | ||
{ | ||
- return ::wgetch(w); | ||
+ return ::wgetch(w); | ||
} | ||
-inline int CursesWindow::ge | ||
+inline int CursesWindow::ge | ||
{ | ||
- return ::wgetstr(w, str); | ||
+ return ::wgetstr(w, str); | ||
} | ||
-inline int CursesWindow::in | ||
+inline int CursesWindow::in | ||
{ | ||
- return winch(w); | ||
+ return winch(w); | ||
} | ||
-inline int CursesWindow::in | ||
+inline int CursesWindow::in | ||
{ | ||
- return ::winsch(w, c); | ||
+ return ::winsch(w, c); | ||
} | ||
-inline int CursesWindow::in | ||
+inline int CursesWindow::in | ||
{ | ||
- return ::winsertln(w); | ||
+ return ::winsertln(w); | ||
} | ||
-inline int CursesWindow::mo | ||
+inline int CursesWindow::mo | ||
{ | ||
- return ::wmove(w, y, x); | ||
+ return ::wmove(w, y, x); | ||
} | ||
@@ -524,56 +524,56 @@ inline int CursesWindow::mv | ||
return (::wmove(w, y, x)==ERR) ? ERR : ::winsch(w, ch); | ||
} | ||
-inline int CursesWindow::re | ||
+inline int CursesWindow::re | ||
{ | ||
- return ::wrefresh(w); | ||
+ return ::wrefresh(w); | ||
} | ||
-inline int CursesWindow::cl | ||
+inline int CursesWindow::cl | ||
{ | ||
- return ::clearok(w,bf); | ||
+ return ::clearok(w,bf); | ||
} | ||
-inline int CursesWindow::le | ||
+inline int CursesWindow::le | ||
{ | ||
- return ::leaveok(w,bf); | ||
+ return ::leaveok(w,bf); | ||
} | ||
-inline int CursesWindow::sc | ||
+inline int CursesWindow::sc | ||
{ | ||
- return ::scrollok(w,bf) | ||
+ return ::scrollok(w,bf) | ||
} | ||
#ifndef _no_flushok | ||
-inline int CursesWindow::fl | ||
+inline int CursesWindow::fl | ||
{ | ||
- return ::flushok(w, bf); | ||
+ return ::flushok(w, bf); | ||
} | ||
#endif | ||
-inline void CursesWindow::ge | ||
+inline void CursesWindow::ge | ||
{ | ||
- ::getyx(w, y, x); | ||
+ ::getyx(w, y, x); | ||
} | ||
-inline int CursesWindow::st | ||
+inline int CursesWindow::st | ||
{ | ||
- return ::wstandout(w); | ||
+ return ::wstandout(w); | ||
} | ||
-inline int CursesWindow::st | ||
+inline int CursesWindow::st | ||
{ | ||
- return ::wstandend(w); | ||
+ return ::wstandend(w); | ||
} | ||
-inline int CursesWindow::li | ||
+inline int CursesWindow::li | ||
{ | ||
- return LINES; | ||
+ return LINES; | ||
} | ||
-inline int CursesWindow::co | ||
+inline int CursesWindow::co | ||
{ | ||
- return COLS; | ||
+ return COLS; | ||
} | ||
inline CursesWindow* CursesWindow::ch |
@@ -1,5 +1,5 @@ | ||
// This may look like C code, but it is really -*- C++ -*- | ||
-/* | ||
+/* | ||
Copyright (C) 1988 Free Software Foundation | ||
written by Doug Lea (dl@rocky.oswego | ||
@@ -1,5 +1,5 @@ | ||
// This may look like C code, but it is really -*- C++ -*- | ||
-/* | ||
+/* | ||
Copyright (C) 1988 Free Software Foundation | ||
written by Dirk Grunwald (grunwald@cs.uiu | ||
@@ -25,7 +25,7 @@ Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. | ||
// | ||
// The interval [lo..hi) | ||
-// | ||
+// | ||
class DiscreteUniform: | ||
long pLow; |
@@ -1,5 +1,5 @@ | ||
// This may look like C code, but it is really -*- C++ -*- | ||
-/* | ||
+/* | ||
Copyright (C) 1988 Free Software Foundation | ||
written by Dirk Grunwald (grunwald@cs.uiu | ||
@@ -19,7 +19,7 @@ Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. | ||
#ifdef __GNUG__ | ||
#pragma interface | ||
#endif | ||
-#define _Erlang_h 1 | ||
+#define _Erlang_h 1 | ||
#include <Random.h> | ||
@@ -1,5 +1,5 @@ | ||
// -*- C++ -*- | ||
-// Fix.h : variable length fixed point data type | ||
+// Fix.h : variable length fixed point data type | ||
// | ||
#ifndef _Fix_h | ||
@@ -124,7 +124,7 @@ public: | ||
friend char* Ftoa(const Fix&, int width = default_print_wi | ||
void printon(ostream& | ||
friend Fix atoF(const char*, int len = default_length); | ||
- | ||
+ | ||
friend istream& operator >> (istream&, Fix&); | ||
friend ostream& operator << (ostream&, const Fix&); | ||
@@ -184,7 +184,7 @@ Fix::mask (Fix::Rep* x) | ||
{ | ||
int n = x->len & 0x0f; | ||
if ( n ) | ||
- x->s[x->siz - 1] &= 0xffff0000 >> n; | ||
+ x->s[x->siz - 1] &= 0xffff0000 >> n; | ||
} | ||
inline Fix::Rep* | ||
@@ -269,7 +269,7 @@ Fix::operator = (const Fix& y) | ||
if ( rep->len == y.rep->len ) { | ||
++y.rep->ref; | ||
if ( --rep->ref <= 0 ) delete rep; | ||
- rep = y.rep; | ||
+ rep = y.rep; | ||
} | ||
else { | ||
unique(); | ||
@@ -290,37 +290,37 @@ Fix::operator = (double d) | ||
inline int | ||
operator == (const Fix& x, const Fix& y) | ||
{ | ||
- return Fix::compare(x.r | ||
+ return Fix::compare(x.r | ||
} | ||
inline int | ||
operator != (const Fix& x, const Fix& y) | ||
{ | ||
- return Fix::compare(x.r | ||
+ return Fix::compare(x.r | ||
} | ||
inline int | ||
operator < (const Fix& x, const Fix& y) | ||
{ | ||
- return Fix::compare(x.r | ||
+ return Fix::compare(x.r | ||
} | ||
inline int | ||
operator <= (const Fix& x, const Fix& y) | ||
{ | ||
- return Fix::compare(x.r | ||
+ return Fix::compare(x.r | ||
} | ||
inline int | ||
operator > (const Fix& x, const Fix& y) | ||
{ | ||
- return Fix::compare(x.r | ||
+ return Fix::compare(x.r | ||
} | ||
inline int | ||
operator >= (const Fix& x, const Fix& y) | ||
{ | ||
- return Fix::compare(x.r | ||
+ return Fix::compare(x.r | ||
} | ||
inline Fix& | ||
@@ -415,7 +415,7 @@ operator << (const Fix& x, int y) | ||
inline Fix | ||
operator >> (const Fix& x, int y) | ||
-{ | ||
+{ | ||
Fix::Rep* rep = Fix::shift(x.rep | ||
} | ||
@@ -1,5 +1,5 @@ | ||
// This may look like C code, but it is really -*- C++ -*- | ||
-/* | ||
+/* | ||
Copyright (C) 1988 Free Software Foundation | ||
written by Kurt Baudendistel (gt-eedsp!baud@g | ||
adapted for libg++ by Doug Lea (dl@rocky.oswego | ||
@@ -58,8 +58,8 @@ Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. | ||
// consists of a 16-bit mantissa (sign bit & 15 data bits). | ||
// | ||
-class Fix16 | ||
-{ | ||
+class Fix16 | ||
+{ | ||
friend class Fix32; | ||
short m; | ||
@@ -102,7 +102,7 @@ public: | ||
Fix16& operator -= (const Fix16& f); | ||
Fix16& operator *= (const Fix16& ); | ||
Fix16& operator /= (const Fix16& f); | ||
- | ||
+ | ||
Fix16& operator <<=(int b); | ||
Fix16& operator >>=(int b); | ||
@@ -124,15 +124,15 @@ public: | ||
Fix16& operator *= (int g); | ||
}; | ||
- | ||
+ | ||
// | ||
// Fix32 class: 32-bit Fixed point data type | ||
// | ||
// consists of a 32-bit mantissa (sign bit & 31 data bits). | ||
// | ||
-class Fix32 | ||
-{ | ||
+class Fix32 | ||
+{ | ||
friend class Fix16; | ||
_G_int32_t m; | ||
@@ -241,141 +241,141 @@ extern void | ||
inline Fix16::~Fix16() {} | ||
inline short Fix16::round(dou | ||
-{ | ||
- return short( (d >= 0)? d + 0.5 : d - 0.5); | ||
+{ | ||
+ return short( (d >= 0)? d + 0.5 : d - 0.5); | ||
} | ||
-inline Fix16::Fix16(sho | ||
-{ | ||
- m = i; | ||
+inline Fix16::Fix16(sho | ||
+{ | ||
+ m = i; | ||
} | ||
-inline Fix16::Fix16(int | ||
-{ | ||
- m = i; | ||
+inline Fix16::Fix16(int | ||
+{ | ||
+ m = i; | ||
} | ||
-inline Fix16::operator double() const | ||
-{ | ||
- return Fix16_div * m; | ||
+inline Fix16::operator double() const | ||
+{ | ||
+ return Fix16_div * m; | ||
} | ||
-inline Fix16::Fix16() | ||
-{ | ||
- m = 0; | ||
+inline Fix16::Fix16() | ||
+{ | ||
+ m = 0; | ||
} | ||
-inline Fix16::Fix16(con | ||
-{ | ||
- m = f.m; | ||
+inline Fix16::Fix16(con | ||
+{ | ||
+ m = f.m; | ||
} | ||
-inline Fix16::Fix16(dou | ||
+inline Fix16::Fix16(dou | ||
{ | ||
m = assign(d); | ||
} | ||
-inline Fix16& Fix16::operator= | ||
-{ | ||
- m = f.m; | ||
- return *this; | ||
+inline Fix16& Fix16::operator= | ||
+{ | ||
+ m = f.m; | ||
+ return *this; | ||
} | ||
-inline Fix16& Fix16::operator= | ||
-{ | ||
- m = assign(d); | ||
- return *this; | ||
+inline Fix16& Fix16::operator= | ||
+{ | ||
+ m = assign(d); | ||
+ return *this; | ||
} | ||
-inline Fix32::Fix32() | ||
-{ | ||
+inline Fix32::Fix32() | ||
+{ | ||
m = 0; | ||
} | ||
-inline Fix32::Fix32(_G_ | ||
-{ | ||
+inline Fix32::Fix32(_G_ | ||
+{ | ||
m = i; | ||
} | ||
-inline Fix32:: operator double() const | ||
-{ | ||
+inline Fix32:: operator double() const | ||
+{ | ||
return Fix32_div * m; | ||
} | ||
-inline Fix32::Fix32(con | ||
-{ | ||
+inline Fix32::Fix32(con | ||
+{ | ||
m = f.m; | ||
} | ||
-inline Fix32::Fix32(con | ||
-{ | ||
+inline Fix32::Fix32(con | ||
+{ | ||
m = _G_int32_t(f.m) << 16; | ||
} | ||
-inline Fix32::Fix32(dou | ||
-{ | ||
+inline Fix32::Fix32(dou | ||
+{ | ||
m = assign(d); | ||
} | ||
-inline Fix16::Fix16(con | ||
-{ | ||
- m = f.m >> 16; | ||
+inline Fix16::Fix16(con | ||
+{ | ||
+ m = f.m >> 16; | ||
} | ||
inline Fix16& Fix16::operator= | ||
-{ | ||
- m = f.m >> 16; | ||
- return *this; | ||
+{ | ||
+ m = f.m >> 16; | ||
+ return *this; | ||
} | ||
-inline Fix32& Fix32::operator= | ||
-{ | ||
+inline Fix32& Fix32::operator= | ||
+{ | ||
m = f.m; | ||
- return *this; | ||
+ return *this; | ||
} | ||
-inline Fix32& Fix32::operator= | ||
-{ | ||
+inline Fix32& Fix32::operator= | ||
+{ | ||
m = _G_int32_t(f.m) << 16; | ||
return *this; | ||
} | ||
-inline Fix32& Fix32::operator= | ||
-{ | ||
+inline Fix32& Fix32::operator= | ||
+{ | ||
m = assign(d); | ||
- return *this; | ||
+ return *this; | ||
} | ||
-inline short& mantissa(Fix16& f) | ||
-{ | ||
- return f.m; | ||
+inline short& mantissa(Fix16& f) | ||
+{ | ||
+ return f.m; | ||
} | ||
-inline const short& mantissa(const Fix16& f) | ||
-{ | ||
- return f.m; | ||
+inline const short& mantissa(const Fix16& f) | ||
+{ | ||
+ return f.m; | ||
} | ||
-inline double value(const Fix16& f) | ||
-{ | ||
- return double(f); | ||
+inline double value(const Fix16& f) | ||
+{ | ||
+ return double(f); | ||
} | ||
-inline Fix16 Fix16::operator+ | ||
-{ | ||
- return m; | ||
+inline Fix16 Fix16::operator+ | ||
+{ | ||
+ return m; | ||
} | ||
-inline Fix16 Fix16::operator- | ||
-{ | ||
- return -m; | ||
+inline Fix16 Fix16::operator- | ||
+{ | ||
+ return -m; | ||
} | ||
-inline Fix16 operator+(const Fix16& f, const Fix16& g) | ||
+inline Fix16 operator+(const Fix16& f, const Fix16& g) | ||
{ | ||
short sum = f.m + g.m; | ||
if ( (f.m ^ sum) & (g.m ^ sum) & Fix16_msb ) | ||
@@ -383,7 +383,7 @@ inline Fix16 operator+(const Fix16& f, const Fix16& g) | ||
return sum; | ||
} | ||
-inline Fix16 operator-(const Fix16& f, const Fix16& g) | ||
+inline Fix16 operator-(const Fix16& f, const Fix16& g) | ||
{ | ||
short sum = f.m - g.m; | ||
if ( (f.m ^ sum) & (-g.m ^ sum) & Fix16_msb ) | ||
@@ -392,90 +392,90 @@ inline Fix16 operator-(const Fix16& f, const Fix16& g) | ||
} | ||
inline Fix32 operator*(const Fix16& f, const Fix16& g) | ||
-{ | ||
- return Fix32( _G_int32_t( _G_int32_t(f.m) * _G_int32_t(g.m) << 1)); | ||
+{ | ||
+ return Fix32( _G_int32_t( _G_int32_t(f.m) * _G_int32_t(g.m) << 1)); | ||
} | ||
-inline Fix16 operator<<(const | ||
-{ | ||
- return a.m << b; | ||
+inline Fix16 operator<<(const | ||
+{ | ||
+ return a.m << b; | ||
} | ||
-inline Fix16 operator>>(const | ||
-{ | ||
- return a.m >> b; | ||
+inline Fix16 operator>>(const | ||
+{ | ||
+ return a.m >> b; | ||
} | ||
inline Fix16& Fix16:: operator+=(const | ||
-{ | ||
- return *this = *this + f; | ||
+{ | ||
+ return *this = *this + f; | ||
} | ||
-inline Fix16& Fix16:: operator-=(const | ||
-{ | ||
- return *this = *this - f; | ||
+inline Fix16& Fix16:: operator-=(const | ||
+{ | ||
+ return *this = *this - f; | ||
} | ||
-inline Fix16& Fix16::operator* | ||
-{ | ||
- return *this = *this * f; | ||
+inline Fix16& Fix16::operator* | ||
+{ | ||
+ return *this = *this * f; | ||
} | ||
-inline Fix16& Fix16:: operator/=(const | ||
-{ | ||
- return *this = *this / f; | ||
+inline Fix16& Fix16:: operator/=(const | ||
+{ | ||
+ return *this = *this / f; | ||
} | ||
-inline Fix16& Fix16:: operator<<=(int b) | ||
-{ | ||
+inline Fix16& Fix16:: operator<<=(int b) | ||
+{ | ||
return *this = *this << b; | ||
} | ||
-inline Fix16& Fix16:: operator>>=(int b) | ||
-{ | ||
+inline Fix16& Fix16:: operator>>=(int b) | ||
+{ | ||
return *this = *this >> b; | ||
} | ||
-inline int operator==(const | ||
-{ | ||
+inline int operator==(const | ||
+{ | ||
return f.m == g.m; | ||
} | ||
-inline int operator!=(const | ||
-{ | ||
+inline int operator!=(const | ||
+{ | ||
return f.m != g.m; | ||
} | ||
-inline int operator>=(const | ||
-{ | ||
+inline int operator>=(const | ||
+{ | ||
return f.m >= g.m; | ||
} | ||
-inline int operator<=(const | ||
-{ | ||
+inline int operator<=(const | ||
+{ | ||
return f.m <= g.m; | ||
} | ||
-inline int operator>(const Fix16& f, const Fix16& g) | ||
-{ | ||
+inline int operator>(const Fix16& f, const Fix16& g) | ||
+{ | ||
return f.m > g.m; | ||
} | ||
-inline int operator<(const Fix16& f, const Fix16& g) | ||
-{ | ||
+inline int operator<(const Fix16& f, const Fix16& g) | ||
+{ | ||
return f.m < g.m; | ||
} | ||
inline istream& operator>>(istre | ||
-{ | ||
+{ | ||
double d; | ||
- s >> d; | ||
- f = d; | ||
- return s; | ||
+ s >> d; | ||
+ f = d; | ||
+ return s; | ||
} | ||
inline ostream& operator<<(ostre | ||
-{ | ||
+{ | ||
return s << double(f); | ||
} | ||
@@ -499,36 +499,36 @@ inline Fix16& Fix16::operator* | ||
inline Fix32::~Fix32() {} | ||
inline _G_int32_t Fix32::round(dou | ||
-{ | ||
+{ | ||
return _G_int32_t( (d >= 0)? d + 0.5 : d - 0.5); | ||
} | ||
-inline _G_int32_t& mantissa(Fix32& f) | ||
-{ | ||
+inline _G_int32_t& mantissa(Fix32& f) | ||
+{ | ||
return f.m; | ||
} | ||
-inline const _G_int32_t& mantissa(const Fix32& f) | ||
-{ | ||
+inline const _G_int32_t& mantissa(const Fix32& f) | ||
+{ | ||
return f.m; | ||
} | ||
-inline double value(const Fix32& f) | ||
-{ | ||
+inline double value(const Fix32& f) | ||
+{ | ||
return double(f); | ||
} | ||
inline Fix32 Fix32::operator+ | ||
-{ | ||
+{ | ||
return m; | ||
} | ||
-inline Fix32 Fix32::operator- | ||
-{ | ||
+inline Fix32 Fix32::operator- | ||
+{ | ||
return -m; | ||
} | ||
-inline Fix32 operator+(const Fix32& f, const Fix32& g) | ||
+inline Fix32 operator+(const Fix32& f, const Fix32& g) | ||
{ | ||
_G_int32_t sum = f.m + g.m; | ||
if ( (f.m ^ sum) & (g.m ^ sum) & Fix32_msb ) | ||
@@ -536,7 +536,7 @@ inline Fix32 operator+(const Fix32& f, const Fix32& g) | ||
return sum; | ||
} | ||
-inline Fix32 operator-(const Fix32& f, const Fix32& g) | ||
+inline Fix32 operator-(const Fix32& f, const Fix32& g) | ||
{ | ||
_G_int32_t sum = f.m - g.m; | ||
if ( (f.m ^ sum) & (-g.m ^ sum) & Fix32_msb ) | ||
@@ -544,87 +544,87 @@ inline Fix32 operator-(const Fix32& f, const Fix32& g) | ||
return sum; | ||
} | ||
-inline Fix32 operator<<(const | ||
-{ | ||
+inline Fix32 operator<<(const | ||
+{ | ||
return a.m << b; | ||
} | ||
-inline Fix32 operator>>(const | ||
-{ | ||
+inline Fix32 operator>>(const | ||
+{ | ||
return a.m >> b; | ||
} | ||
-inline Fix32& Fix32::operator+ | ||
-{ | ||
+inline Fix32& Fix32::operator+ | ||
+{ | ||
return *this = *this + f; | ||
} | ||
-inline Fix32& Fix32::operator- | ||
-{ | ||
+inline Fix32& Fix32::operator- | ||
+{ | ||
return *this = *this - f; | ||
} | ||
-inline Fix32& Fix32::operator* | ||
-{ | ||
+inline Fix32& Fix32::operator* | ||
+{ | ||
return *this = *this * f; | ||
} | ||
-inline Fix32& Fix32::operator/ | ||
-{ | ||
+inline Fix32& Fix32::operator/ | ||
+{ | ||
return *this = *this / f; | ||
} | ||
-inline Fix32& Fix32::operator< | ||
-{ | ||
+inline Fix32& Fix32::operator< | ||
+{ | ||
return *this = *this << b; | ||
} | ||
-inline Fix32& Fix32::operator> | ||
-{ | ||
+inline Fix32& Fix32::operator> | ||
+{ | ||
return *this = *this >> b; | ||
} | ||
-inline int operator==(const | ||
-{ | ||
+inline int operator==(const | ||
+{ | ||
return f.m == g.m; | ||
} | ||
-inline int operator!=(const | ||
-{ | ||
+inline int operator!=(const | ||
+{ | ||
return f.m != g.m; | ||
} | ||
-inline int operator>=(const | ||
-{ | ||
+inline int operator>=(const | ||
+{ | ||
return f.m >= g.m; | ||
} | ||
-inline int operator<=(const | ||
-{ | ||
+inline int operator<=(const | ||
+{ | ||
return f.m <= g.m; | ||
} | ||
-inline int operator>(const Fix32& f, const Fix32& g) | ||
-{ | ||
+inline int operator>(const Fix32& f, const Fix32& g) | ||
+{ | ||
return f.m > g.m; | ||
} | ||
-inline int operator<(const Fix32& f, const Fix32& g) | ||
-{ | ||
+inline int operator<(const Fix32& f, const Fix32& g) | ||
+{ | ||
return f.m < g.m; | ||
} | ||
inline istream& operator>>(istre | ||
-{ | ||
+{ | ||
double d; | ||
- s >> d; | ||
- f = d; | ||
- return s; | ||
+ s >> d; | ||
+ f = d; | ||
+ return s; | ||
} | ||
inline ostream& operator<<(ostre | ||
-{ | ||
+{ | ||
return s << double(f); | ||
} | ||
@@ -1,5 +1,5 @@ | ||
// This may look like C code, but it is really -*- C++ -*- | ||
-/* | ||
+/* | ||
Copyright (C) 1988 Free Software Foundation | ||
written by Kurt Baudendistel (gt-eedsp!baud@g | ||
adapted for libg++ by Doug Lea (dl@rocky.oswego | ||
@@ -26,7 +26,7 @@ Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. | ||
#include <stream.h> | ||
#include <std.h> | ||
-// extra type definitions | ||
+// extra type definitions | ||
typedef struct { | ||
_G_int32_t u; | ||
@@ -37,14 +37,14 @@ typedef struct { | ||
static const int | ||
Fix24_shift = 31; | ||
- | ||
+ | ||
static const double | ||
Fix24_fs = 2147483648., // 2^Fix24_shift | ||
Fix24_mult = Fix24_fs, | ||
Fix24_div = 1./Fix24_fs, | ||
Fix24_max = 1. - .5/Fix24_fs, | ||
Fix24_min = -1.; | ||
- | ||
+ | ||
static const _G_uint32_t | ||
Fix24_msb = 0x80000000L, | ||
Fix24_lsb = 0x00000100L, | ||
@@ -57,21 +57,21 @@ static const double | ||
Fix48_min = -1., | ||
Fix48_div_u = 1./Fix24_fs, | ||
Fix48_div_l = 1./Fix48_fs; | ||
- | ||
+ | ||
static const twolongs | ||
Fix48_msb = { 0x80000000L, 0L }, | ||
Fix48_lsb = { 0L, 0x00000100L }, | ||
Fix48_m_max = { 0x7fffff00L, 0xffffff00L }, | ||
Fix48_m_min = { 0x80000000L, 0L }; | ||
- | ||
+ | ||
// | ||
// Fix24 class: 24-bit Fixed point data type | ||
// | ||
// consists of a 24-bit mantissa (sign bit & 23 data bits). | ||
// | ||
-class Fix24 | ||
-{ | ||
+class Fix24 | ||
+{ | ||
friend class Fix48; | ||
_G_int32_t m; | ||
@@ -133,15 +133,15 @@ public: | ||
void range_error(_G_i | ||
}; | ||
- | ||
+ | ||
// | ||
// Fix48 class: 48-bit Fixed point data type | ||
// | ||
// consists of a 48-bit mantissa (sign bit & 47 data bits). | ||
// | ||
-class Fix48 | ||
-{ | ||
+class Fix48 | ||
+{ | ||
friend class Fix24; | ||
twolongs m; | ||
@@ -242,85 +242,85 @@ extern void | ||
inline Fix24::~Fix24() {} | ||
-inline Fix24::Fix24(lon | ||
-{ | ||
- m = i; | ||
+inline Fix24::Fix24(lon | ||
+{ | ||
+ m = i; | ||
} | ||
-inline Fix24::Fix24(int | ||
-{ | ||
- m = i; | ||
+inline Fix24::Fix24(int | ||
+{ | ||
+ m = i; | ||
} | ||
inline Fix24::operator double() const | ||
-{ | ||
- return Fix24_div * m; | ||
+{ | ||
+ return Fix24_div * m; | ||
} | ||
-inline Fix24::Fix24() | ||
-{ | ||
- m = 0; | ||
+inline Fix24::Fix24() | ||
+{ | ||
+ m = 0; | ||
} | ||
-inline Fix24::Fix24(con | ||
-{ | ||
- m = f.m; | ||
+inline Fix24::Fix24(con | ||
+{ | ||
+ m = f.m; | ||
} | ||
-inline Fix24::Fix24(dou | ||
+inline Fix24::Fix24(dou | ||
{ | ||
m = assign(d); | ||
} | ||
-inline Fix24::Fix24(con | ||
-{ | ||
+inline Fix24::Fix24(con | ||
+{ | ||
m = f.m.u; | ||
} | ||
-inline Fix24& Fix24::operator= | ||
-{ | ||
- m = f.m; | ||
- return *this; | ||
+inline Fix24& Fix24::operator= | ||
+{ | ||
+ m = f.m; | ||
+ return *this; | ||
} | ||
-inline Fix24& Fix24::operator= | ||
-{ | ||
- m = assign(d); | ||
- return *this; | ||
+inline Fix24& Fix24::operator= | ||
+{ | ||
+ m = assign(d); | ||
+ return *this; | ||
} | ||
inline Fix24& Fix24::operator= | ||
-{ | ||
+{ | ||
m = f.m.u; | ||
- return *this; | ||
+ return *this; | ||
} | ||
inline _G_int32_t& mantissa(Fix24& f) | ||
-{ | ||
- return f.m; | ||
+{ | ||
+ return f.m; | ||
} | ||
inline const _G_int32_t& mantissa(const Fix24& f) | ||
-{ | ||
- return f.m; | ||
+{ | ||
+ return f.m; | ||
} | ||
inline double value(const Fix24& f) | ||
-{ | ||
- return double(f); | ||
+{ | ||
+ return double(f); | ||
} | ||
-inline Fix24 Fix24::operator+ | ||
-{ | ||
- return m; | ||
+inline Fix24 Fix24::operator+ | ||
+{ | ||
+ return m; | ||
} | ||
inline Fix24 Fix24::operator- | ||
-{ | ||
- return -m; | ||
+{ | ||
+ return -m; | ||
} | ||
-inline Fix24 operator+(const Fix24& f, const Fix24& g) | ||
+inline Fix24 operator+(const Fix24& f, const Fix24& g) | ||
{ | ||
_G_int32_t sum = f.m + g.m; | ||
if ( (f.m ^ sum) & (g.m ^ sum) & Fix24_msb ) | ||
@@ -328,7 +328,7 @@ inline Fix24 operator+(const Fix24& f, const Fix24& g) | ||
return sum; | ||
} | ||
-inline Fix24 operator-(const Fix24& f, const Fix24& g) | ||
+inline Fix24 operator-(const Fix24& f, const Fix24& g) | ||
{ | ||
_G_int32_t sum = f.m - g.m; | ||
if ( (f.m ^ sum) & (-g.m ^ sum) & Fix24_msb ) | ||
@@ -336,23 +336,23 @@ inline Fix24 operator-(const Fix24& f, const Fix24& g) | ||
return sum; | ||
} | ||
-inline Fix24 operator*(const Fix24& a, int b) | ||
-{ | ||
- return a.m * b; | ||
+inline Fix24 operator*(const Fix24& a, int b) | ||
+{ | ||
+ return a.m * b; | ||
} | ||
-inline Fix24 operator*(int b, const Fix24& a) | ||
-{ | ||
- return a * b; | ||
+inline Fix24 operator*(int b, const Fix24& a) | ||
+{ | ||
+ return a * b; | ||
} | ||
-inline Fix24 operator<<(const | ||
-{ | ||
- return a.m << b; | ||
+inline Fix24 operator<<(const | ||
+{ | ||
+ return a.m << b; | ||
} | ||
-inline Fix24 operator>>(const | ||
-{ | ||
+inline Fix24 operator>>(const | ||
+{ | ||
return (a.m >> b) & ~0xff; | ||
} | ||
@@ -361,236 +361,236 @@ inline Fix24& Fix24:: operator+=(const | ||
return *this = *this + f; | ||
} | ||
-inline Fix24& Fix24:: operator-=(const | ||
-{ | ||
- return *this = *this - f; | ||
+inline Fix24& Fix24:: operator-=(const | ||
+{ | ||
+ return *this = *this - f; | ||
} | ||
-inline Fix24& Fix24::operator* | ||
-{ | ||
- return *this = *this * f; | ||
+inline Fix24& Fix24::operator* | ||
+{ | ||
+ return *this = *this * f; | ||
} | ||
-inline Fix24& Fix24:: operator/=(const | ||
-{ | ||
- return *this = *this / f; | ||
+inline Fix24& Fix24:: operator/=(const | ||
+{ | ||
+ return *this = *this / f; | ||
} | ||
-inline Fix24& Fix24:: operator<<=(int b) | ||
-{ | ||
+inline Fix24& Fix24:: operator<<=(int b) | ||
+{ | ||
return *this = *this << b; | ||
} | ||
-inline Fix24& Fix24:: operator>>=(int b) | ||
-{ | ||
+inline Fix24& Fix24:: operator>>=(int b) | ||
+{ | ||
return *this = *this >> b; | ||
} | ||
inline Fix24& Fix24::operator* | ||
-{ | ||
- return *this = *this * b; | ||
+{ | ||
+ return *this = *this * b; | ||
} | ||
-inline int operator==(const | ||
-{ | ||
+inline int operator==(const | ||
+{ | ||
return f.m == g.m; | ||
} | ||
-inline int operator!=(const | ||
-{ | ||
+inline int operator!=(const | ||
+{ | ||
return f.m != g.m; | ||
} | ||
-inline int operator>=(const | ||
-{ | ||
+inline int operator>=(const | ||
+{ | ||
return f.m >= g.m; | ||
} | ||
-inline int operator<=(const | ||
-{ | ||
+inline int operator<=(const | ||
+{ | ||
return f.m <= g.m; | ||
} | ||
-inline int operator>(const Fix24& f, const Fix24& g) | ||
-{ | ||
+inline int operator>(const Fix24& f, const Fix24& g) | ||
+{ | ||
return f.m > g.m; | ||
} | ||
-inline int operator<(const Fix24& f, const Fix24& g) | ||
-{ | ||
+inline int operator<(const Fix24& f, const Fix24& g) | ||
+{ | ||
return f.m < g.m; | ||
} | ||
inline istream& operator>>(istre | ||
-{ | ||
+{ | ||
double d; | ||
- s >> d; | ||
- f = d; | ||
- return s; | ||
+ s >> d; | ||
+ f = d; | ||
+ return s; | ||
} | ||
inline ostream& operator<<(ostre | ||
-{ | ||
+{ | ||
return s << double(f); | ||
} | ||
inline Fix48::~Fix48() {} | ||
-inline Fix48::Fix48(two | ||
-{ | ||
+inline Fix48::Fix48(two | ||
+{ | ||
m = i; | ||
} | ||
inline Fix48:: operator double() const | ||
-{ | ||
+{ | ||
/* | ||
* Note: can't simply do Fix48_div_u * m.u + Fix48_div_l * m.l, because | ||
* m.u is signed and m.l is unsigned. | ||
*/ | ||
return (m.u >= 0)? Fix48_div_u * m.u + Fix48_div_l * m.l : | ||
- (Fix48_div_u * ((_G_uint32_t)(m | ||
+ (Fix48_div_u * ((_G_uint32_t)(m | ||
+ Fix48_div_l * m.l) - 2; | ||
} | ||
-inline Fix48::Fix48() | ||
-{ | ||
+inline Fix48::Fix48() | ||
+{ | ||
m.u = 0; | ||
m.l = 0; | ||
} | ||
-inline Fix48::Fix48(con | ||
-{ | ||
+inline Fix48::Fix48(con | ||
+{ | ||
m = f.m; | ||
} | ||
-inline Fix48::Fix48(con | ||
-{ | ||
+inline Fix48::Fix48(con | ||
+{ | ||
m.u = f.m; | ||
m.l = 0; | ||
} | ||
-inline Fix48::Fix48(dou | ||
-{ | ||
+inline Fix48::Fix48(dou | ||
+{ | ||
m = assign(d); | ||
} | ||
-inline Fix48& Fix48::operator= | ||
-{ | ||
+inline Fix48& Fix48::operator= | ||
+{ | ||
m = f.m; | ||
- return *this; | ||
+ return *this; | ||
} | ||
-inline Fix48& Fix48::operator= | ||
-{ | ||
+inline Fix48& Fix48::operator= | ||
+{ | ||
m.u = f.m; | ||
m.l = 0; | ||
return *this; | ||
} | ||
-inline Fix48& Fix48::operator= | ||
-{ | ||
+inline Fix48& Fix48::operator= | ||
+{ | ||
m = assign(d); | ||
- return *this; | ||
+ return *this; | ||
} | ||
-inline twolongs& mantissa(Fix48& f) | ||
-{ | ||
+inline twolongs& mantissa(Fix48& f) | ||
+{ | ||
return f.m; | ||
} | ||
-inline const twolongs& mantissa(const Fix48& f) | ||
-{ | ||
+inline const twolongs& mantissa(const Fix48& f) | ||
+{ | ||
return f.m; | ||
} | ||
inline double value(const Fix48& f) | ||
-{ | ||
+{ | ||
return double(f); | ||
} | ||
-inline Fix48 Fix48::operator+ | ||
-{ | ||
+inline Fix48 Fix48::operator+ | ||
+{ | ||
return m; | ||
} | ||
inline Fix48 Fix48::operator- | ||
-{ | ||
+{ | ||
twolongs n; | ||
n.l = -m.l; | ||
n.u = ~m.u + ((n.l ^ m.l) & Fix24_msb ? 0 : Fix24_lsb); | ||
return Fix48(n); | ||
} | ||
-inline Fix48 operator*(int b, const Fix48& a) | ||
-{ | ||
- return a * b; | ||
+inline Fix48 operator*(int b, const Fix48& a) | ||
+{ | ||
+ return a * b; | ||
} | ||
-inline Fix48& Fix48::operator+ | ||
-{ | ||
+inline Fix48& Fix48::operator+ | ||
+{ | ||
return *this = *this + f; | ||
} | ||
-inline Fix48& Fix48::operator- | ||
-{ | ||
+inline Fix48& Fix48::operator- | ||
+{ | ||
return *this = *this - f; | ||
} | ||
-inline Fix48& Fix48::operator* | ||
-{ | ||
+inline Fix48& Fix48::operator* | ||
+{ | ||
return *this = *this * b; | ||
} | ||
-inline Fix48& Fix48::operator< | ||
-{ | ||
+inline Fix48& Fix48::operator< | ||
+{ | ||
return *this = *this << b; | ||
} | ||
-inline Fix48& Fix48::operator> | ||
-{ | ||
+inline Fix48& Fix48::operator> | ||
+{ | ||
return *this = *this >> b; | ||
} | ||
-inline int operator==(const | ||
-{ | ||
+inline int operator==(const | ||
+{ | ||
return f.m.u == g.m.u && f.m.l == g.m.l; | ||
} | ||
-inline int operator!=(const | ||
-{ | ||
+inline int operator!=(const | ||
+{ | ||
return f.m.u != g.m.u || f.m.l != g.m.l; | ||
} | ||
-inline int operator>=(const | ||
-{ | ||
+inline int operator>=(const | ||
+{ | ||
return f.m.u >= g.m.u || (f.m.u == g.m.u && f.m.l >= g.m.l); | ||
} | ||
-inline int operator<=(const | ||
-{ | ||
+inline int operator<=(const | ||
+{ | ||
return f.m.u <= g.m.u || (f.m.u == g.m.u && f.m.l <= g.m.l); | ||
} | ||
-inline int operator>(const Fix48& f, const Fix48& g) | ||
-{ | ||
+inline int operator>(const Fix48& f, const Fix48& g) | ||
+{ | ||
return f.m.u > g.m.u || (f.m.u == g.m.u && f.m.l > g.m.l); | ||
} | ||
-inline int operator<(const Fix48& f, const Fix48& g) | ||
-{ | ||
+inline int operator<(const Fix48& f, const Fix48& g) | ||
+{ | ||
return f.m.u < g.m.u || (f.m.u == g.m.u && f.m.l < g.m.l); | ||
} | ||
inline istream& operator>>(istre | ||
-{ | ||
+{ | ||
double d; | ||
- s >> d; | ||
- f = d; | ||
- return s; | ||
+ s >> d; | ||
+ f = d; | ||
+ return s; | ||
} | ||
inline ostream& operator<<(ostre | ||
-{ | ||
+{ | ||
return s << double(f); | ||
} | ||
@@ -1,5 +1,5 @@ | ||
// This may look like C code, but it is really -*- C++ -*- | ||
-/* | ||
+/* | ||
Copyright (C) 1988 Free Software Foundation | ||
written by Dirk Grunwald (grunwald@cs.uiu | ||
@@ -19,7 +19,7 @@ Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. | ||
#ifdef __GNUG__ | ||
#pragma interface | ||
#endif | ||
-#define _Geometric_h | ||
+#define _Geometric_h | ||
#include <Random.h> | ||
@@ -1,4 +1,4 @@ | ||
-/* Getopt for GNU. | ||
+/* Getopt for GNU. | ||
Copyright (C) 1987, 1989, 1992 Free Software Foundation, Inc. | ||
(Modified by Douglas C. Schmidt for use with GNU G++.) | ||
@@ -45,51 +45,51 @@ private: | ||
/* The next char to be scanned in the option-element | ||
in which the last option character we returned was found. | ||
This allows us to pick up the scan where we left off. | ||
- | ||
+ | ||
If this is zero, or a null string, it means resume the scan | ||
by advancing to the next ARGV-element. */ | ||
- | ||
+ | ||
static char *nextchar; | ||
- | ||
- | ||
+ | ||
+ | ||
/* Describe how to deal with options that follow non-option ARGV-elements. | ||
- | ||
+ | ||
UNSPECIFIED means the caller did not specify anything; | ||
the default is then REQUIRE_ORDER if the environment variable | ||
_OPTIONS_FIRST is defined, PERMUTE otherwise. | ||
- | ||
+ | ||
REQUIRE_ORDER means don't recognize them as options. | ||
Stop option processing when the first non-option is seen. | ||
This is what Unix does. | ||
- | ||
+ | ||
PERMUTE is the default. We permute the contents of `argv' as we scan, | ||
so that eventually all the options are at the end. This allows options | ||
to be given in any order, even with programs that were not written to | ||
expect this. | ||
- | ||
+ | ||
RETURN_IN_ORDER is an option available to programs that were written | ||
to expect options and other ARGV-elements in any order and that care about | ||
the ordering of the two. We describe each non-option ARGV-element | ||
as if it were the argument of an option with character code zero. | ||
Using `-' as the first character of the list of option characters | ||
requests this mode of operation. | ||
- | ||
+ | ||
The special argument `--' forces an end of option-scanning regardless | ||
of the value of `ordering'. In the case of RETURN_IN_ORDER, | ||
`--' can cause `getopt' to return EOF with `optind' != ARGC. */ | ||
- | ||
+ | ||
enum OrderingEnum { REQUIRE_ORDER, PERMUTE, RETURN_IN_ORDER }; | ||
OrderingEnum ordering; | ||
/* Handle permutation of arguments. */ | ||
- | ||
+ | ||
/* Describe the part of ARGV that contains non-options that have | ||
been skipped. `first_nonopt' is the index in ARGV of the first of them; | ||
`last_nonopt' is the index after the last of them. */ | ||
- | ||
+ | ||
static int first_nonopt; | ||
static int last_nonopt; | ||
- | ||
+ | ||
void exchange (char **argv); | ||
public: | ||
/* For communication from `getopt' to the caller. | ||
@@ -97,31 +97,31 @@ public: | ||
the argument value is returned here. | ||
Also, when `ordering' is RETURN_IN_ORDER, | ||
each non-option ARGV-element is returned here. */ | ||
- | ||
+ | ||
char *optarg; | ||
- | ||
+ | ||
/* Index in ARGV of the next element to be scanned. | ||
This is used for communication to and from the caller | ||
and for communication between successive calls to `getopt'. | ||
On entry to `getopt', zero means this is the first call; initialize. | ||
- | ||
+ | ||
When `getopt' returns EOF, this is the index of the first of the | ||
non-option elements that the caller should itself scan. | ||
- | ||
+ | ||
Otherwise, `optind' communicates from one call to the next | ||
how much of ARGV has been scanned so far. */ | ||
- | ||
+ | ||
int optind; | ||
/* Callers store zero here to inhibit the error message | ||
for unrecognized options. */ | ||
- | ||
+ | ||
int opterr; | ||
- | ||
+ | ||
int nargc; | ||
char **nargv; | ||
const char *noptstring; | ||
- | ||
+ | ||
GetOpt (int argc, char **argv, const char *optstring); | ||
int operator () (void); | ||
}; |
@@ -1,5 +1,5 @@ | ||
// This may look like C code, but it is really -*- C++ -*- | ||
-/* | ||
+/* | ||
Copyright (C) 1988 Free Software Foundation | ||
written by Dirk Grunwald (grunwald@cs.uiu | ||
@@ -19,7 +19,7 @@ Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. | ||
#ifdef __GNUG__ | ||
#pragma interface | ||
#endif | ||
-#define _HyperGeometric_ | ||
+#define _HyperGeometric_ | ||
#include <Random.h> | ||
@@ -1,6 +1,6 @@ | ||
// This may look like C code, but it is really -*- C++ -*- | ||
-/* | ||
+/* | ||
Copyright (C) 1988 Free Software Foundation | ||
written by Doug Lea (dl@rocky.oswego | ||
@@ -29,7 +29,7 @@ struct IntRep // internal Integer representations | ||
{ | ||
unsigned short len; // current length | ||
unsigned short sz; // allocated space (0 means static). | ||
- short sgn; // 1 means >= 0; 0 means < 0 | ||
+ short sgn; // 1 means >= 0; 0 means < 0 | ||
unsigned short s[1]; // represented as ushort array starting here | ||
}; | ||
@@ -67,7 +67,7 @@ extern int ucompare(const IntRep*, const IntRep*); | ||
extern int ucompare(const IntRep*, long); | ||
extern char* Itoa(const IntRep* x, int base = 10, int width = 0); | ||
extern char* cvtItoa(const IntRep* x, char* fmt, int& fmtlen, int base, | ||
- int showbase, int width, int align_right, | ||
+ int showbase, int width, int align_right, | ||
char fillchar, char Xcase, int showpos); | ||
extern IntRep* atoIntRep(const char* s, int base = 10); | ||
extern long Itolong(const IntRep*); | ||
@@ -152,14 +152,14 @@ public: | ||
friend void negate(const Integer& x, Integer& dest); | ||
friend void complement(const | ||
- friend int compare(const Integer&, const Integer&); | ||
- friend int ucompare(const Integer&, const Integer&); | ||
+ friend int compare(const Integer&, const Integer&); | ||
+ friend int ucompare(const Integer&, const Integer&); | ||
friend void add(const Integer& x, const Integer& y, Integer& dest); | ||
friend void sub(const Integer& x, const Integer& y, Integer& dest); | ||
friend void mul(const Integer& x, const Integer& y, Integer& dest); | ||
friend void div(const Integer& x, const Integer& y, Integer& dest); | ||
friend void mod(const Integer& x, const Integer& y, Integer& dest); | ||
- friend void divide(const Integer& x, const Integer& y, | ||
+ friend void divide(const Integer& x, const Integer& y, | ||
Integer& q, Integer& r); | ||
friend void and(const Integer& x, const Integer& y, Integer& dest); | ||
friend void or(const Integer& x, const Integer& y, Integer& dest); | ||
@@ -168,8 +168,8 @@ public: | ||
friend void rshift(const Integer& x, const Integer& y, Integer& dest); | ||
friend void pow(const Integer& x, const Integer& y, Integer& dest); | ||
- friend int compare(const Integer&, long); | ||
- friend int ucompare(const Integer&, long); | ||
+ friend int compare(const Integer&, long); | ||
+ friend int ucompare(const Integer&, long); | ||
friend void add(const Integer& x, long y, Integer& dest); | ||
friend void sub(const Integer& x, long y, Integer& dest); | ||
friend void mul(const Integer& x, long y, Integer& dest); | ||
@@ -183,8 +183,8 @@ public: | ||
friend void rshift(const Integer& x, long y, Integer& dest); | ||
friend void pow(const Integer& x, long y, Integer& dest); | ||
- friend int compare(long, const Integer&); | ||
- friend int ucompare(long, const Integer&); | ||
+ friend int compare(long, const Integer&); | ||
+ friend int ucompare(long, const Integer&); | ||
friend void add(long x, const Integer& y, Integer& dest); | ||
friend void sub(long x, const Integer& y, Integer& dest); | ||
friend void mul(long x, const Integer& y, Integer& dest); | ||
@@ -203,7 +203,7 @@ public: | ||
friend char* Itoa(const Integer& x, int base = 10, int width = 0); | ||
friend Integer atoI(const char* s, int base = 10); | ||
void printon(ostream& | ||
- | ||
+ | ||
friend istream& operator >> (istream& s, Integer& y); | ||
friend ostream& operator << (ostream& s, const Integer& y); | ||
@@ -211,7 +211,7 @@ public: | ||
int initialized() const; | ||
void error(const char* msg) const; | ||
- int OK() const; | ||
+ int OK() const; | ||
}; | ||
@@ -263,7 +263,7 @@ public: | ||
Integer pow(const Integer& x, const Integer& y); | ||
Integer pow(const Integer& x, long y); | ||
- Integer Ipow(long x, long y); // x to the y as Integer | ||
+ Integer Ipow(long x, long y); // x to the y as Integer | ||
extern char* dec(const Integer& x, int width = 0); | ||
@@ -498,62 +498,62 @@ inline void xor(long x, const Integer& y, Integer& dest) | ||
inline int operator == (const Integer& x, const Integer& y) | ||
{ | ||
- return compare(x, y) == 0; | ||
+ return compare(x, y) == 0; | ||
} | ||
inline int operator == (const Integer& x, long y) | ||
{ | ||
- return compare(x, y) == 0; | ||
+ return compare(x, y) == 0; | ||
} | ||
inline int operator != (const Integer& x, const Integer& y) | ||
{ | ||
- return compare(x, y) != 0; | ||
+ return compare(x, y) != 0; | ||
} | ||
inline int operator != (const Integer& x, long y) | ||
{ | ||
- return compare(x, y) != 0; | ||
+ return compare(x, y) != 0; | ||
} | ||
inline int operator < (const Integer& x, const Integer& y) | ||
{ | ||
- return compare(x, y) < 0; | ||
+ return compare(x, y) < 0; | ||
} | ||
inline int operator < (const Integer& x, long y) | ||
{ | ||
- return compare(x, y) < 0; | ||
+ return compare(x, y) < 0; | ||
} | ||
inline int operator <= (const Integer& x, const Integer& y) | ||
{ | ||
- return compare(x, y) <= 0; | ||
+ return compare(x, y) <= 0; | ||
} | ||
inline int operator <= (const Integer& x, long y) | ||
{ | ||
- return compare(x, y) <= 0; | ||
+ return compare(x, y) <= 0; | ||
} | ||
inline int operator > (const Integer& x, const Integer& y) | ||
{ | ||
- return compare(x, y) > 0; | ||
+ return compare(x, y) > 0; | ||
} | ||
inline int operator > (const Integer& x, long y) | ||
{ | ||
- return compare(x, y) > 0; | ||
+ return compare(x, y) > 0; | ||
} | ||
inline int operator >= (const Integer& x, const Integer& y) | ||
{ | ||
- return compare(x, y) >= 0; | ||
+ return compare(x, y) >= 0; | ||
} | ||
inline int operator >= (const Integer& x, long y) | ||
{ | ||
- return compare(x, y) >= 0; | ||
+ return compare(x, y) >= 0; | ||
} | ||
@@ -738,12 +738,12 @@ inline char* Itoa(const Integer& y, int base, int width) | ||
-inline long lg(const Integer& x) | ||
+inline long lg(const Integer& x) | ||
{ | ||
return lg(x.rep); | ||
} | ||
-// constructive operations | ||
+// constructive operations | ||
#if defined(__GNUG__ | ||
@@ -926,179 +926,179 @@ inline Integer gcd(const Integer& x, const Integer& y) return r | ||
#else /* NO_NRV */ | ||
-inline Integer operator + (const Integer& x, const Integer& y) | ||
+inline Integer operator + (const Integer& x, const Integer& y) | ||
{ | ||
Integer r; add(x, y, r); return r; | ||
} | ||
-inline Integer operator + (const Integer& x, long y) | ||
+inline Integer operator + (const Integer& x, long y) | ||
{ | ||
Integer r; add(x, y, r); return r; | ||
} | ||
-inline Integer operator + (long x, const Integer& y) | ||
+inline Integer operator + (long x, const Integer& y) | ||
{ | ||
Integer r; add(x, y, r); return r; | ||
} | ||
-inline Integer operator - (const Integer& x, const Integer& y) | ||
+inline Integer operator - (const Integer& x, const Integer& y) | ||
{ | ||
Integer r; sub(x, y, r); return r; | ||
} | ||
-inline Integer operator - (const Integer& x, long y) | ||
+inline Integer operator - (const Integer& x, long y) | ||
{ | ||
Integer r; sub(x, y, r); return r; | ||
} | ||
-inline Integer operator - (long x, const Integer& y) | ||
+inline Integer operator - (long x, const Integer& y) | ||
{ | ||
Integer r; sub(x, y, r); return r; | ||
} | ||
-inline Integer operator * (const Integer& x, const Integer& y) | ||
+inline Integer operator * (const Integer& x, const Integer& y) | ||
{ | ||
Integer r; mul(x, y, r); return r; | ||
} | ||
-inline Integer operator * (const Integer& x, long y) | ||
+inline Integer operator * (const Integer& x, long y) | ||
{ | ||
Integer r; mul(x, y, r); return r; | ||
} | ||
-inline Integer operator * (long x, const Integer& y) | ||
+inline Integer operator * (long x, const Integer& y) | ||
{ | ||
Integer r; mul(x, y, r); return r; | ||
} | ||
-inline Integer sqr(const Integer& x) | ||
+inline Integer sqr(const Integer& x) | ||
{ | ||
Integer r; mul(x, x, r); return r; | ||
} | ||
-inline Integer operator & (const Integer& x, const Integer& y) | ||
+inline Integer operator & (const Integer& x, const Integer& y) | ||
{ | ||
Integer r; and(x, y, r); return r; | ||
} | ||
-inline Integer operator & (const Integer& x, long y) | ||
+inline Integer operator & (const Integer& x, long y) | ||
{ | ||
Integer r; and(x, y, r); return r; | ||
} | ||
-inline Integer operator & (long x, const Integer& y) | ||
+inline Integer operator & (long x, const Integer& y) | ||
{ | ||
Integer r; and(x, y, r); return r; | ||
} | ||
-inline Integer operator | (const Integer& x, const Integer& y) | ||
+inline Integer operator | (const Integer& x, const Integer& y) | ||
{ | ||
Integer r; or(x, y, r); return r; | ||
} | ||
-inline Integer operator | (const Integer& x, long y) | ||
+inline Integer operator | (const Integer& x, long y) | ||
{ | ||
Integer r; or(x, y, r); return r; | ||
} | ||
-inline Integer operator | (long x, const Integer& y) | ||
+inline Integer operator | (long x, const Integer& y) | ||
{ | ||
Integer r; or(x, y, r); return r; | ||
} | ||
-inline Integer operator ^ (const Integer& x, const Integer& y) | ||
+inline Integer operator ^ (const Integer& x, const Integer& y) | ||
{ | ||
Integer r; xor(x, y, r); return r; | ||
} | ||
-inline Integer operator ^ (const Integer& x, long y) | ||
+inline Integer operator ^ (const Integer& x, long y) | ||
{ | ||
Integer r; xor(x, y, r); return r; | ||
} | ||
-inline Integer operator ^ (long x, const Integer& y) | ||
+inline Integer operator ^ (long x, const Integer& y) | ||
{ | ||
Integer r; xor(x, y, r); return r; | ||
} | ||
-inline Integer operator / (const Integer& x, const Integer& y) | ||
+inline Integer operator / (const Integer& x, const Integer& y) | ||
{ | ||
Integer r; div(x, y, r); return r; | ||
} | ||
-inline Integer operator / (const Integer& x, long y) | ||
+inline Integer operator / (const Integer& x, long y) | ||
{ | ||
Integer r; div(x, y, r); return r; | ||
} | ||
-inline Integer operator % (const Integer& x, const Integer& y) | ||
+inline Integer operator % (const Integer& x, const Integer& y) | ||
{ | ||
Integer r; mod(x, y, r); return r; | ||
} | ||
-inline Integer operator % (const Integer& x, long y) | ||
+inline Integer operator % (const Integer& x, long y) | ||
{ | ||
Integer r; mod(x, y, r); return r; | ||
} | ||
-inline Integer operator << (const Integer& x, const Integer& y) | ||
+inline Integer operator << (const Integer& x, const Integer& y) | ||
{ | ||
Integer r; lshift(x, y, r); return r; | ||
} | ||
-inline Integer operator << (const Integer& x, long y) | ||
+inline Integer operator << (const Integer& x, long y) | ||
{ | ||
Integer r; lshift(x, y, r); return r; | ||
} | ||
-inline Integer operator >> (const Integer& x, const Integer& y) | ||
+inline Integer operator >> (const Integer& x, const Integer& y) | ||
{ | ||
Integer r; rshift(x, y, r); return r; | ||
} | ||
-inline Integer operator >> (const Integer& x, long y) | ||
+inline Integer operator >> (const Integer& x, long y) | ||
{ | ||
Integer r; rshift(x, y, r); return r; | ||
} | ||
-inline Integer pow(const Integer& x, long y) | ||
+inline Integer pow(const Integer& x, long y) | ||
{ | ||
Integer r; pow(x, y, r); return r; | ||
} | ||
-inline Integer Ipow(long x, long y) | ||
+inline Integer Ipow(long x, long y) | ||
{ | ||
Integer r(x); pow(r, y, r); return r; | ||
} | ||
-inline Integer pow(const Integer& x, const Integer& y) | ||
+inline Integer pow(const Integer& x, const Integer& y) | ||
{ | ||
Integer r; pow(x, y, r); return r; | ||
} | ||
-inline Integer abs(const Integer& x) | ||
+inline Integer abs(const Integer& x) | ||
{ | ||
Integer r; abs(x, r); return r; | ||
} | ||
-inline Integer operator - (const Integer& x) | ||
+inline Integer operator - (const Integer& x) | ||
{ | ||
Integer r; negate(x, r); return r; | ||
} | ||
-inline Integer operator ~ (const Integer& x) | ||
+inline Integer operator ~ (const Integer& x) | ||
{ | ||
Integer r; complement(x, r); return r; | ||
} | ||
-inline Integer atoI(const char* s, int base) | ||
+inline Integer atoI(const char* s, int base) | ||
{ | ||
Integer r; r.rep = atoIntRep(s, base); return r; | ||
} | ||
-inline Integer gcd(const Integer& x, const Integer& y) | ||
+inline Integer gcd(const Integer& x, const Integer& y) | ||
{ | ||
Integer r; r.rep = gcd(x.rep, y.rep); return r; | ||
} |
@@ -1,5 +1,5 @@ | ||
// This may look like C code, but it is really -*- C++ -*- | ||
-/* | ||
+/* | ||
Copyright (C) 1988 Free Software Foundation | ||
written by Dirk Grunwald (grunwald@cs.uiu | ||
@@ -19,7 +19,7 @@ Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. | ||
#ifdef __GNUG__ | ||
#pragma interface | ||
#endif | ||
-#define _LogNormal_h | ||
+#define _LogNormal_h | ||
#include <Normal.h> | ||
@@ -44,7 +44,7 @@ inline void LogNormal::setSt | ||
pMean = log(m2 / sqrt(logVariance | ||
// from ch@heike.informa | ||
// (was pVariance = log((sqrt(logVar | ||
- pStdDev = sqrt(log((logVar | ||
+ pStdDev = sqrt(log((logVar | ||
} | ||
inline LogNormal::LogNo |
@@ -1,5 +1,5 @@ | ||
// This may look like C code, but it is really -*- C++ -*- | ||
-/* | ||
+/* | ||
Copyright (C) 1988 Free Software Foundation | ||
written by Dirk Grunwald (grunwald@cs.uiu | ||
@@ -16,7 +16,7 @@ License along with this library; if not, write to the Free Software | ||
Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. | ||
*/ | ||
#ifndef _MLCG_h | ||
-#define _MLCG_h 1 | ||
+#define _MLCG_h 1 | ||
#ifdef __GNUG__ | ||
#pragma interface | ||
#endif |
@@ -1,5 +1,5 @@ | ||
// This may look like C code, but it is really -*- C++ -*- | ||
-/* | ||
+/* | ||
Copyright (C) 1988 Free Software Foundation | ||
written by Dirk Grunwald (grunwald@cs.uiu | ||
@@ -25,7 +25,7 @@ Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. | ||
// | ||
// Negative Exponential Random Numbers | ||
// | ||
-// | ||
+// | ||
#include <Random.h> | ||
@@ -1,5 +1,5 @@ | ||
// This may look like C code, but it is really -*- C++ -*- | ||
-/* | ||
+/* | ||
Copyright (C) 1988 Free Software Foundation | ||
written by Dirk Grunwald (grunwald@cs.uiu | ||
@@ -19,7 +19,7 @@ Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. | ||
#ifdef __GNUG__ | ||
#pragma interface | ||
#endif | ||
-#define _Normal_h | ||
+#define _Normal_h | ||
#include <Random.h> | ||
@@ -31,7 +31,7 @@ protected: | ||
double pMean; | ||
double pVariance; | ||
double pStdDev; | ||
- | ||
+ | ||
public: | ||
Normal(double xmean, double xvariance, RNG *gen); | ||
double mean(); |
@@ -1,5 +1,5 @@ | ||
// This may look like C code, but it is really -*- C++ -*- | ||
-/* | ||
+/* | ||
Copyright (C) 1988 Free Software Foundation | ||
written by Doug Lea (dl@rocky.oswego | ||
@@ -84,127 +84,127 @@ public: | ||
inline Obstack::~Obstac | ||
{ | ||
- _free(0); | ||
+ _free(0); | ||
} | ||
inline void* Obstack::base() | ||
{ | ||
- return objectbase; | ||
+ return objectbase; | ||
} | ||
inline void* Obstack::next_fr | ||
{ | ||
- return nextfree; | ||
+ return nextfree; | ||
} | ||
inline int Obstack::alignme | ||
{ | ||
- return alignmentmask; | ||
+ return alignmentmask; | ||
} | ||
inline int Obstack::chunk_s | ||
{ | ||
- return chunksize; | ||
+ return chunksize; | ||
} | ||
inline int Obstack::size() | ||
{ | ||
- return nextfree - objectbase; | ||
+ return nextfree - objectbase; | ||
} | ||
inline int Obstack::room() | ||
{ | ||
- return chunklimit - nextfree; | ||
+ return chunklimit - nextfree; | ||
} | ||
inline void Obstack:: grow(const void* data, int size) | ||
{ | ||
- if (nextfree+size > chunklimit) | ||
+ if (nextfree+size > chunklimit) | ||
newchunk(size); | ||
memcpy(nextfree, | ||
- nextfree += size; | ||
+ nextfree += size; | ||
} | ||
inline void Obstack:: grow(const void* data, int size, char terminator) | ||
{ | ||
- if (nextfree+size+1 | ||
+ if (nextfree+size+1 | ||
newchunk(size+1) | ||
memcpy(nextfree, | ||
- nextfree += size; | ||
- *(nextfree)++ = terminator; | ||
+ nextfree += size; | ||
+ *(nextfree)++ = terminator; | ||
} | ||
inline void Obstack:: grow(const char* s) | ||
{ | ||
- grow((const void*)s, strlen(s), 0); | ||
+ grow((const void*)s, strlen(s), 0); | ||
} | ||
inline void Obstack:: grow(char c) | ||
{ | ||
- if (nextfree+1 > chunklimit) | ||
- newchunk(1); | ||
- *(nextfree)++ = c; | ||
+ if (nextfree+1 > chunklimit) | ||
+ newchunk(1); | ||
+ *(nextfree)++ = c; | ||
} | ||
inline void Obstack:: blank(int size) | ||
{ | ||
- if (nextfree+size > chunklimit) | ||
+ if (nextfree+size > chunklimit) | ||
newchunk(size); | ||
- nextfree += size; | ||
+ nextfree += size; | ||
} | ||
inline void* Obstack::finish( | ||
{ | ||
- grow(terminator) | ||
- return finish(); | ||
+ grow(terminator) | ||
+ return finish(); | ||
} | ||
inline void* Obstack::copy(co | ||
{ | ||
grow (data, size); | ||
- return finish(); | ||
+ return finish(); | ||
} | ||
inline void* Obstack::copy(co | ||
{ | ||
- grow(data, size, terminator); | ||
- return finish(); | ||
+ grow(data, size, terminator); | ||
+ return finish(); | ||
} | ||
inline void* Obstack::copy(co | ||
{ | ||
- grow((const void*)s, strlen(s), 0); | ||
- return finish(); | ||
+ grow((const void*)s, strlen(s), 0); | ||
+ return finish(); | ||
} | ||
inline void* Obstack::copy(ch | ||
{ | ||
grow(c); | ||
- return finish(); | ||
+ return finish(); | ||
} | ||
inline void* Obstack::alloc(i | ||
{ | ||
blank(size); | ||
- return finish(); | ||
+ return finish(); | ||
} | ||
-inline void Obstack:: free(void* obj) | ||
+inline void Obstack:: free(void* obj) | ||
{ | ||
if (obj >= (void*)chunk && obj<(void*)chunk | ||
nextfree = objectbase = (char *) obj; | ||
- else | ||
- _free(obj); | ||
+ else | ||
+ _free(obj); | ||
} | ||
inline void Obstack:: grow_fast(char c) | ||
{ | ||
- *(nextfree)++ = c; | ||
+ *(nextfree)++ = c; | ||
} | ||
inline void Obstack:: blank_fast(int size) | ||
{ | ||
- nextfree += size; | ||
+ nextfree += size; | ||
} | ||
inline void Obstack:: shrink(int size) // from ken@cs.rochester |
@@ -22,10 +22,10 @@ the resulting executable to be covered by the GNU General Public License. | ||
This exception does not however invalidate any other reasons why | ||
the executable file might be covered by the GNU General Public License. */ | ||
-/* | ||
+/* | ||
a very simple implementation of a class to output unix "plot" | ||
format plotter files. See corresponding unix man pages for | ||
- more details. | ||
+ more details. | ||
written by Doug Lea (dl@rocky.oswego | ||
converted to use iostream library by Per Bothner (bothner@cygnus. | ||
@@ -39,7 +39,7 @@ the executable file might be covered by the GNU General Public License. */ | ||
#include <fstream.h> | ||
-/* | ||
+/* | ||
Some plot libraries have the `box' command to draw boxes. Some don't. | ||
`box' is included here via moves & lines to allow both possiblilties. | ||
*/ | ||
@@ -51,21 +51,21 @@ protected: | ||
PlotFile& cmd(char c); | ||
PlotFile& operator << (const int x); | ||
PlotFile& operator << (const char *s); | ||
- | ||
+ | ||
public: | ||
- | ||
+ | ||
PlotFile() : ofstream() { } | ||
PlotFile(int fd) : ofstream(fd) { } | ||
PlotFile(const char *name, int mode=ios::out, int prot=0664) | ||
: ofstream(name, mode, prot) { } | ||
- | ||
+ | ||
// PlotFile& remove() { ofstream::remove | ||
- | ||
+ | ||
// int filedesc() { return ofstream::filede | ||
// const char* name() { return File::name(); } | ||
// void setname(const char* newname) { File::setname(ne | ||
// int iocount() { return File::iocount(); | ||
- | ||
+ | ||
PlotFile& arc(const int xi, const int yi, | ||
const int x0, const int y0, | ||
const int x1, const int y1); | ||
@@ -75,7 +75,7 @@ public: | ||
PlotFile& cont(const int xi, const int yi); | ||
PlotFile& dot(const int xi, const int yi, const int dx, | ||
int n, const int* pat); | ||
- PlotFile& erase(); | ||
+ PlotFile& erase(); | ||
PlotFile& label(const char* s); | ||
PlotFile& line(const int x0, const int y0, | ||
const int x1, const int y1); |
@@ -1,5 +1,5 @@ | ||
// This may look like C code, but it is really -*- C++ -*- | ||
-/* | ||
+/* | ||
Copyright (C) 1988 Free Software Foundation | ||
written by Dirk Grunwald (grunwald@cs.uiu | ||
@@ -19,7 +19,7 @@ Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. | ||
#ifdef __GNUG__ | ||
#pragma interface | ||
#endif | ||
-#define _Poisson_h | ||
+#define _Poisson_h | ||
#include <Random.h> | ||
@@ -1,5 +1,5 @@ | ||
// This may look like C code, but it is really -*- C++ -*- | ||
-/* | ||
+/* | ||
Copyright (C) 1988 Free Software Foundation | ||
written by Dirk Grunwald (grunwald@cs.uiu | ||
@@ -1,5 +1,5 @@ | ||
// This may look like C code, but it is really -*- C++ -*- | ||
-/* | ||
+/* | ||
Copyright (C) 1988 Free Software Foundation | ||
written by Dirk Grunwald (grunwald@cs.uiu | ||
@@ -1,6 +1,6 @@ | ||
// This may look like C code, but it is really -*- C++ -*- | ||
-/* | ||
+/* | ||
Copyright (C) 1988 Free Software Foundation | ||
written by Doug Lea (dl@rocky.oswego | ||
@@ -171,22 +171,22 @@ inline int operator != (const Rational& x, const Rational& y) | ||
inline int operator < (const Rational& x, const Rational& y) | ||
{ | ||
- return compare(x, y) < 0; | ||
+ return compare(x, y) < 0; | ||
} | ||
inline int operator <= (const Rational& x, const Rational& y) | ||
{ | ||
- return compare(x, y) <= 0; | ||
+ return compare(x, y) <= 0; | ||
} | ||
inline int operator > (const Rational& x, const Rational& y) | ||
{ | ||
- return compare(x, y) > 0; | ||
+ return compare(x, y) > 0; | ||
} | ||
inline int operator >= (const Rational& x, const Rational& y) | ||
{ | ||
- return compare(x, y) >= 0; | ||
+ return compare(x, y) >= 0; | ||
} | ||
inline int sign(const Rational& x) | ||
@@ -200,25 +200,25 @@ inline void Rational::negate | ||
} | ||
-inline Rational& Rational::operat | ||
+inline Rational& Rational::operat | ||
{ | ||
add(*this, y, *this); | ||
return *this; | ||
} | ||
-inline Rational& Rational::operat | ||
+inline Rational& Rational::operat | ||
{ | ||
sub(*this, y, *this); | ||
return *this; | ||
} | ||
-inline Rational& Rational::operat | ||
+inline Rational& Rational::operat | ||
{ | ||
mul(*this, y, *this); | ||
return *this; | ||
} | ||
-inline Rational& Rational::operat | ||
+inline Rational& Rational::operat | ||
{ | ||
div(*this, y, *this); | ||
return *this; | ||
@@ -264,7 +264,7 @@ inline Rational operator / (const Rational& x, const Rational& y) return r | ||
#else /* NO_NRV */ | ||
-inline Rational operator + (const Rational& x, const Rational& y) | ||
+inline Rational operator + (const Rational& x, const Rational& y) | ||
{ | ||
Rational r; add(x, y, r); return r; | ||
} |
@@ -1,5 +1,5 @@ | ||
// This may look like C code, but it is really -*- C++ -*- | ||
-/* | ||
+/* | ||
Copyright (C) 1988 Free Software Foundation | ||
written by Doug Lea (dl@rocky.oswego | ||
@@ -44,15 +44,15 @@ protected: | ||
re_registers* reg; | ||
public: | ||
- Regex(const char* t, | ||
- int fast = 0, | ||
- int bufsize = 40, | ||
+ Regex(const char* t, | ||
+ int fast = 0, | ||
+ int bufsize = 40, | ||
const char* transtable = 0); | ||
~Regex(); | ||
int match(const char* s, int len, int pos = 0) const; | ||
- int search(const char* s, int len, | ||
+ int search(const char* s, int len, | ||
int& matchlen, int startpos = 0) const; | ||
int match_info(int& start, int& length, int nth = 0) const; | ||
@@ -1,5 +1,5 @@ | ||
// This may look like C code, but it is really -*- C++ -*- | ||
-/* | ||
+/* | ||
Copyright (C) 1990 Free Software Foundation | ||
adapted from a submission from John Reidl <riedl@cs.purdue | ||
@@ -40,13 +40,13 @@ Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. | ||
// in a specified range. By default the range is 0..1. Since in my | ||
// experience random numbers are often needed for a wide variety of | ||
// ranges in the same program, this generator accepts a new low or high value | ||
-// as an argument to the asLong and operator() methods to temporarily | ||
+// as an argument to the asLong and operator() methods to temporarily | ||
// override stored values | ||
#include <math.h> | ||
#include <RNG.h> | ||
-class RandomInteger | ||
+class RandomInteger | ||
{ | ||
protected: | ||
RNG *pGenerator; | ||
@@ -90,20 +90,20 @@ class RandomInteger | ||
}; | ||
-inline RandomInteger::R | ||
+inline RandomInteger::R | ||
: pLow((low < high) ? low : high), | ||
pHigh((low < high) ? high : low), | ||
pGenerator(gen) | ||
{} | ||
-inline RandomInteger::R | ||
+inline RandomInteger::R | ||
: pLow((0 < high) ? 0 : high), | ||
pHigh((0 < high) ? high : 0), | ||
pGenerator(gen) | ||
{} | ||
- | ||
-inline RandomInteger::R | ||
+ | ||
+inline RandomInteger::R | ||
: pLow(0), | ||
pHigh(1), | ||
pGenerator(gen) | ||
@@ -113,28 +113,28 @@ inline RNG* RandomInteger::g | ||
inline long RandomInteger::l | ||
inline long RandomInteger::h | ||
-inline RNG* RandomInteger::g | ||
+inline RNG* RandomInteger::g | ||
{ | ||
RNG *tmp = pGenerator; pGenerator = gen; return tmp; | ||
} | ||
-inline long RandomInteger::l | ||
+inline long RandomInteger::l | ||
{ | ||
long tmp = pLow; pLow = x; return tmp; | ||
} | ||
-inline long RandomInteger:: high(long x) | ||
+inline long RandomInteger:: high(long x) | ||
{ | ||
long tmp = pHigh; pHigh = x; return tmp; | ||
} | ||
inline long RandomInteger:: _asLong(long low, long high) | ||
-{ | ||
+{ | ||
return (pGenerator->asL | ||
} | ||
-inline long RandomInteger:: asLong() | ||
+inline long RandomInteger:: asLong() | ||
{ | ||
return _asLong(pLow, pHigh); | ||
} | ||
@@ -149,7 +149,7 @@ inline long RandomInteger:: asLong(long low, long high) | ||
return _asLong(low, high); | ||
} | ||
-inline long RandomInteger:: operator () () | ||
+inline long RandomInteger:: operator () () | ||
{ | ||
return _asLong(pLow, pHigh); | ||
} | ||
@@ -167,7 +167,7 @@ inline long RandomInteger:: operator () (long low, long high) | ||
-inline int RandomInteger:: asInt() | ||
+inline int RandomInteger:: asInt() | ||
{ | ||
return int(asLong()); | ||
} |
@@ -41,10 +41,10 @@ public: | ||
SFile(int fd, int size); | ||
SFile(const char *name, int size, int mode, int prot=0664); | ||
void open(const char *name, int size, int mode, int prot=0664); | ||
- | ||
+ | ||
int size() { return sz; } | ||
int setsize(int s) { int old = sz; sz = s; return old; } | ||
- | ||
+ | ||
SFile& get(void* x); | ||
SFile& put(void* x); | ||
SFile& operator[](long i); |
@@ -1,5 +1,5 @@ | ||
// This may look like C code, but it is really -*- C++ -*- | ||
-/* | ||
+/* | ||
Copyright (C) 1988, 1992 Free Software Foundation | ||
written by Doug Lea (dl@rocky.oswego | ||
@@ -104,7 +104,7 @@ public: | ||
Pix ins_after(Pix p, const T& item) | ||
{ return BaseSLList::ins_ | ||
void join(SLList<T>& a) { BaseSLList::join | ||
- | ||
+ | ||
T& front() { | ||
if (last == 0) error("front: empty list"); | ||
return ((SLNode<T>*)las |
@@ -1,5 +1,5 @@ | ||
// This may look like C code, but it is really -*- C++ -*- | ||
-/* | ||
+/* | ||
Copyright (C) 1988 Free Software Foundation | ||
written by Dirk Grunwald (grunwald@cs.uiu | ||
@@ -28,7 +28,7 @@ Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. | ||
extern const int SampleHistogramM | ||
extern const int SampleHistogramM | ||
-class SampleHistogram : public SampleStatistic | ||
+class SampleHistogram : public SampleStatistic | ||
{ | ||
protected: | ||
short howManyBuckets; | ||
@@ -36,7 +36,7 @@ protected: | ||
double *bucketLimit; | ||
public: | ||
- | ||
+ | ||
SampleHistogram( | ||
~SampleHistogram |
@@ -1,5 +1,5 @@ | ||
// This may look like C code, but it is really -*- C++ -*- | ||
-/* | ||
+/* | ||
Copyright (C) 1988 Free Software Foundation | ||
written by Dirk Grunwald (grunwald@cs.uiu | ||
@@ -34,7 +34,7 @@ protected: | ||
SampleStatistic( | ||
virtual ~SampleStatistic | ||
- virtual void reset(); | ||
+ virtual void reset(); | ||
virtual void operator+=(doubl | ||
int samples(); | ||
@@ -54,7 +54,7 @@ protected: | ||
extern void default_SampleSt | ||
extern one_arg_error_ha | ||
-extern one_arg_error_ha | ||
+extern one_arg_error_ha | ||
set_SampleStatis | ||
inline SampleStatistic: |
@@ -1,5 +1,5 @@ | ||
// This may look like C code, but it is really -*- C++ -*- | ||
-/* | ||
+/* | ||
Copyright (C) 1988 Free Software Foundation | ||
written by Doug Lea (dl@rocky.oswego | ||
@@ -28,9 +28,9 @@ Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. | ||
struct StrRep // internal String representations | ||
{ | ||
- unsigned short len; // string length | ||
+ unsigned short len; // string length | ||
unsigned short sz; // allocated space | ||
- char s[1]; // the string starts here | ||
+ char s[1]; // the string starts here | ||
// (at least 1 char for trailing null) | ||
// allocated & expanded via non-public fcts | ||
}; | ||
@@ -89,7 +89,7 @@ public: | ||
int matches(const Regex& r) const; | ||
-// IO | ||
+// IO | ||
friend ostream& operator<<(ostre | ||
@@ -99,7 +99,7 @@ public: | ||
int empty() const; | ||
const char* chars() const; | ||
- int OK() const; | ||
+ int OK() const; | ||
}; | ||
@@ -140,12 +140,12 @@ public: | ||
// concatenation | ||
- String& operator += (const String& y); | ||
+ String& operator += (const String& y); | ||
String& operator += (const SubString& y); | ||
String& operator += (const char* t); | ||
String& operator += (char c); | ||
- void prepend(const String& y); | ||
+ void prepend(const String& y); | ||
void prepend(const SubString& y); | ||
void prepend(const char* t); | ||
void prepend(char c); | ||
@@ -169,7 +169,7 @@ public: | ||
friend inline void cat(const char*, const char*, String&); | ||
friend inline void cat(const char*, char, String&); | ||
-// double concatenation, by request. (yes, there are too many versions, | ||
+// double concatenation, by request. (yes, there are too many versions, | ||
// but if one is supported, then the others should be too...) | ||
// Concatenate first 3 args, store in last arg | ||
@@ -204,11 +204,11 @@ public: | ||
// return position of target in string or -1 for failure | ||
- int index(char c, int startpos = 0) const; | ||
- int index(const String& y, int startpos = 0) const; | ||
- int index(const SubString& y, int startpos = 0) const; | ||
- int index(const char* t, int startpos = 0) const; | ||
- int index(const Regex& r, int startpos = 0) const; | ||
+ int index(char c, int startpos = 0) const; | ||
+ int index(const String& y, int startpos = 0) const; | ||
+ int index(const SubString& y, int startpos = 0) const; | ||
+ int index(const char* t, int startpos = 0) const; | ||
+ int index(const Regex& r, int startpos = 0) const; | ||
// return 1 if target appears anyhere in String; else 0 | ||
@@ -218,7 +218,7 @@ public: | ||
int contains(const char* t) const; | ||
int contains(const Regex& r) const; | ||
-// return 1 if target appears anywhere after position pos | ||
+// return 1 if target appears anywhere after position pos | ||
// (or before, if pos is negative) in String; else 0 | ||
int contains(char c, int pos) const; | ||
@@ -237,7 +237,7 @@ public: | ||
// return number of occurences of target in String | ||
- int freq(char c) const; | ||
+ int freq(char c) const; | ||
int freq(const String& y) const; | ||
int freq(const SubString& y) const; | ||
int freq(const char* t) const; | ||
@@ -251,11 +251,11 @@ public: | ||
SubString at(int pos, int len); | ||
SubString operator () (int pos, int len); // synonym for at | ||
- SubString at(const String& x, int startpos = 0); | ||
- SubString at(const SubString& x, int startpos = 0); | ||
+ SubString at(const String& x, int startpos = 0); | ||
+ SubString at(const SubString& x, int startpos = 0); | ||
SubString at(const char* t, int startpos = 0); | ||
SubString at(char c, int startpos = 0); | ||
- SubString at(const Regex& r, int startpos = 0); | ||
+ SubString at(const Regex& r, int startpos = 0); | ||
SubString before(int pos); | ||
SubString before(const String& x, int startpos = 0); | ||
@@ -311,14 +311,14 @@ public: | ||
// split string into array res at separators; return number of elements | ||
- friend int split(const String& x, String res[], int maxn, | ||
+ friend int split(const String& x, String res[], int maxn, | ||
const String& sep); | ||
- friend int split(const String& x, String res[], int maxn, | ||
+ friend int split(const String& x, String res[], int maxn, | ||
const Regex& sep); | ||
- friend String common_prefix(co | ||
+ friend String common_prefix(co | ||
int startpos = 0); | ||
- friend String common_suffix(co | ||
+ friend String common_suffix(co | ||
int startpos = -1); | ||
friend String replicate(char c, int n); | ||
friend String replicate(const String& y, int n); | ||
@@ -358,7 +358,7 @@ public: | ||
friend ostream& operator<<(ostre | ||
friend istream& operator>>(istre | ||
- friend int readline(istream | ||
+ friend int readline(istream | ||
char terminator = '\n', | ||
int discard_terminat | ||
@@ -409,17 +409,17 @@ inline const char* SubString::chars | ||
// constructors | ||
-inline String::String() | ||
+inline String::String() | ||
: rep(&_nilStrRep) | ||
-inline String::String(c | ||
+inline String::String(c | ||
: rep(Scopy(0, x.rep)) {} | ||
-inline String::String(c | ||
+inline String::String(c | ||
: rep(Salloc(0, t, -1, -1)) {} | ||
inline String::String(c | ||
: rep(Salloc(0, t, tlen, tlen)) {} | ||
inline String::String(c | ||
: rep(Salloc(0, y.chars(), y.length(), y.length())) {} | ||
-inline String::String(c | ||
+inline String::String(c | ||
: rep(Salloc(0, &c, 1, 1)) {} | ||
inline String::~String( | ||
@@ -434,7 +434,7 @@ inline SubString::~SubS | ||
// assignment | ||
inline String& String::operator | ||
-{ | ||
+{ | ||
rep = Scopy(rep, y.rep); | ||
return *this; | ||
} | ||
@@ -773,67 +773,67 @@ inline String operator + (const String& x, const String& y) | ||
String r; cat(x, y, r); return r; | ||
} | ||
-inline String operator + (const String& x, const SubString& y) | ||
+inline String operator + (const String& x, const SubString& y) | ||
{ | ||
String r; cat(x, y, r); return r; | ||
} | ||
-inline String operator + (const String& x, const char* y) | ||
+inline String operator + (const String& x, const char* y) | ||
{ | ||
String r; cat(x, y, r); return r; | ||
} | ||
-inline String operator + (const String& x, char y) | ||
+inline String operator + (const String& x, char y) | ||
{ | ||
String r; cat(x, y, r); return r; | ||
} | ||
-inline String operator + (const SubString& x, const String& y) | ||
+inline String operator + (const SubString& x, const String& y) | ||
{ | ||
String r; cat(x, y, r); return r; | ||
} | ||
-inline String operator + (const SubString& x, const SubString& y) | ||
+inline String operator + (const SubString& x, const SubString& y) | ||
{ | ||
String r; cat(x, y, r); return r; | ||
} | ||
-inline String operator + (const SubString& x, const char* y) | ||
+inline String operator + (const SubString& x, const char* y) | ||
{ | ||
String r; cat(x, y, r); return r; | ||
} | ||
-inline String operator + (const SubString& x, char y) | ||
+inline String operator + (const SubString& x, char y) | ||
{ | ||
String r; cat(x, y, r); return r; | ||
} | ||
-inline String operator + (const char* x, const String& y) | ||
+inline String operator + (const char* x, const String& y) | ||
{ | ||
String r; cat(x, y, r); return r; | ||
} | ||
-inline String operator + (const char* x, const SubString& y) | ||
+inline String operator + (const char* x, const SubString& y) | ||
{ | ||
String r; cat(x, y, r); return r; | ||
} | ||
-inline String reverse(const String& x) | ||
+inline String reverse(const String& x) | ||
{ | ||
String r; r.rep = Sreverse(x.rep, r.rep); return r; | ||
} | ||
-inline String upcase(const String& x) | ||
+inline String upcase(const String& x) | ||
{ | ||
String r; r.rep = Supcase(x.rep, r.rep); return r; | ||
} | ||
-inline String downcase(const String& x) | ||
+inline String downcase(const String& x) | ||
{ | ||
String r; r.rep = Sdowncase(x.rep, | ||
} | ||
-inline String capitalize(const | ||
+inline String capitalize(const | ||
{ | ||
String r; r.rep = Scapitalize(x.re | ||
} | ||
@@ -849,12 +849,12 @@ inline void String::prepend( | ||
inline void String::prepend( | ||
{ | ||
- rep = Sprepend(rep, y, -1); | ||
+ rep = Sprepend(rep, y, -1); | ||
} | ||
inline void String::prepend( | ||
{ | ||
- rep = Sprepend(rep, &y, 1); | ||
+ rep = Sprepend(rep, &y, 1); | ||
} | ||
inline void String::prepend( | ||
@@ -890,31 +890,31 @@ inline void String::capitali | ||
// element extraction | ||
-inline char& String::operator | ||
-{ | ||
+inline char& String::operator | ||
+{ | ||
if (((unsigned)i) >= length()) error("invalid index"); | ||
return rep->s[i]; | ||
} | ||
inline const char& String::operator | ||
-{ | ||
+{ | ||
if (((unsigned)i) >= length()) error("invalid index"); | ||
return rep->s[i]; | ||
} | ||
inline char String::elem (int i) const | ||
-{ | ||
+{ | ||
if (((unsigned)i) >= length()) error("invalid index"); | ||
return rep->s[i]; | ||
} | ||
inline char String::firstcha | ||
-{ | ||
+{ | ||
return elem(0); | ||
} | ||
inline char String::lastchar | ||
-{ | ||
+{ | ||
return elem(length() - 1); | ||
} | ||
@@ -926,17 +926,17 @@ inline int String::index(ch | ||
} | ||
inline int String::index(co | ||
-{ | ||
+{ | ||
return search(startpos, | ||
} | ||
inline int String::index(co | ||
-{ | ||
+{ | ||
return search(startpos, | ||
} | ||
inline int String::index(co | ||
-{ | ||
+{ | ||
return search(startpos, | ||
} | ||
@@ -951,17 +951,17 @@ inline int String::contains | ||
} | ||
inline int String::contains | ||
-{ | ||
+{ | ||
return search(0, length(), t) >= 0; | ||
} | ||
inline int String::contains | ||
-{ | ||
+{ | ||
return search(0, length(), y.chars(), y.length()) >= 0; | ||
} | ||
inline int String::contains | ||
-{ | ||
+{ | ||
return search(0, length(), y.chars(), y.length()) >= 0; | ||
} | ||
@@ -1024,17 +1024,17 @@ inline int String::matches( | ||
inline int SubString::conta | ||
-{ | ||
+{ | ||
return S.search(pos, pos+len, t) >= 0; | ||
} | ||
inline int SubString::conta | ||
-{ | ||
+{ | ||
return S.search(pos, pos+len, y.chars(), y.length()) >= 0; | ||
} | ||
inline int SubString::conta | ||
-{ | ||
+{ | ||
return S.search(pos, pos+len, y.chars(), y.length()) >= 0; | ||
} | ||
@@ -1088,99 +1088,99 @@ inline ostream& operator<<(ostre | ||
// a zillion comparison operators | ||
-inline int operator==(const | ||
+inline int operator==(const | ||
{ | ||
- return compare(x, y) == 0; | ||
+ return compare(x, y) == 0; | ||
} | ||
inline int operator!=(const | ||
{ | ||
- return compare(x, y) != 0; | ||
+ return compare(x, y) != 0; | ||
} | ||
inline int operator>(const String& x, const String& y) | ||
{ | ||
- return compare(x, y) > 0; | ||
+ return compare(x, y) > 0; | ||
} | ||
inline int operator>=(const | ||
{ | ||
- return compare(x, y) >= 0; | ||
+ return compare(x, y) >= 0; | ||
} | ||
inline int operator<(const String& x, const String& y) | ||
{ | ||
- return compare(x, y) < 0; | ||
+ return compare(x, y) < 0; | ||
} | ||
inline int operator<=(const | ||
{ | ||
- return compare(x, y) <= 0; | ||
+ return compare(x, y) <= 0; | ||
} | ||
-inline int operator==(const | ||
+inline int operator==(const | ||
{ | ||
- return compare(x, y) == 0; | ||
+ return compare(x, y) == 0; | ||
} | ||
inline int operator!=(const | ||
{ | ||
- return compare(x, y) != 0; | ||
+ return compare(x, y) != 0; | ||
} | ||
-inline int operator>(const String& x, const SubString& y) | ||
+inline int operator>(const String& x, const SubString& y) | ||
{ | ||
- return compare(x, y) > 0; | ||
+ return compare(x, y) > 0; | ||
} | ||
inline int operator>=(const | ||
{ | ||
- return compare(x, y) >= 0; | ||
+ return compare(x, y) >= 0; | ||
} | ||
-inline int operator<(const String& x, const SubString& y) | ||
+inline int operator<(const String& x, const SubString& y) | ||
{ | ||
- return compare(x, y) < 0; | ||
+ return compare(x, y) < 0; | ||
} | ||
inline int operator<=(const | ||
{ | ||
- return compare(x, y) <= 0; | ||
+ return compare(x, y) <= 0; | ||
} | ||
-inline int operator==(const | ||
+inline int operator==(const | ||
{ | ||
- return compare(x, t) == 0; | ||
+ return compare(x, t) == 0; | ||
} | ||
-inline int operator!=(const | ||
+inline int operator!=(const | ||
{ | ||
- return compare(x, t) != 0; | ||
+ return compare(x, t) != 0; | ||
} | ||
-inline int operator>(const String& x, const char* t) | ||
+inline int operator>(const String& x, const char* t) | ||
{ | ||
- return compare(x, t) > 0; | ||
+ return compare(x, t) > 0; | ||
} | ||
-inline int operator>=(const | ||
+inline int operator>=(const | ||
{ | ||
- return compare(x, t) >= 0; | ||
+ return compare(x, t) >= 0; | ||
} | ||
-inline int operator<(const String& x, const char* t) | ||
+inline int operator<(const String& x, const char* t) | ||
{ | ||
- return compare(x, t) < 0; | ||
+ return compare(x, t) < 0; | ||
} | ||
-inline int operator<=(const | ||
+inline int operator<=(const | ||
{ | ||
- return compare(x, t) <= 0; | ||
+ return compare(x, t) <= 0; | ||
} | ||
-inline int operator==(const | ||
+inline int operator==(const | ||
{ | ||
- return compare(y, x) == 0; | ||
+ return compare(y, x) == 0; | ||
} | ||
inline int operator!=(const | ||
@@ -1188,29 +1188,29 @@ inline int operator!=(const | ||
return compare(y, x) != 0; | ||
} | ||
-inline int operator>(const SubString& x, const String& y) | ||
+inline int operator>(const SubString& x, const String& y) | ||
{ | ||
return compare(y, x) < 0; | ||
} | ||
-inline int operator>=(const | ||
+inline int operator>=(const | ||
{ | ||
return compare(y, x) <= 0; | ||
} | ||
-inline int operator<(const SubString& x, const String& y) | ||
+inline int operator<(const SubString& x, const String& y) | ||
{ | ||
return compare(y, x) > 0; | ||
} | ||
-inline int operator<=(const | ||
+inline int operator<=(const | ||
{ | ||
return compare(y, x) >= 0; | ||
} | ||
-inline int operator==(const | ||
+inline int operator==(const | ||
{ | ||
- return compare(x, y) == 0; | ||
+ return compare(x, y) == 0; | ||
} | ||
inline int operator!=(const | ||
@@ -1218,7 +1218,7 @@ inline int operator!=(const | ||
return compare(x, y) != 0; | ||
} | ||
-inline int operator>(const SubString& x, const SubString& y) | ||
+inline int operator>(const SubString& x, const SubString& y) | ||
{ | ||
return compare(x, y) > 0; | ||
} | ||
@@ -1228,7 +1228,7 @@ inline int operator>=(const | ||
return compare(x, y) >= 0; | ||
} | ||
-inline int operator<(const SubString& x, const SubString& y) | ||
+inline int operator<(const SubString& x, const SubString& y) | ||
{ | ||
return compare(x, y) < 0; | ||
} | ||
@@ -1238,34 +1238,34 @@ inline int operator<=(const | ||
return compare(x, y) <= 0; | ||
} | ||
-inline int operator==(const | ||
+inline int operator==(const | ||
{ | ||
- return compare(x, t) == 0; | ||
+ return compare(x, t) == 0; | ||
} | ||
-inline int operator!=(const | ||
+inline int operator!=(const | ||
{ | ||
return compare(x, t) != 0; | ||
} | ||
-inline int operator>(const SubString& x, const char* t) | ||
+inline int operator>(const SubString& x, const char* t) | ||
{ | ||
- return compare(x, t) > 0; | ||
+ return compare(x, t) > 0; | ||
} | ||
-inline int operator>=(const | ||
+inline int operator>=(const | ||
{ | ||
- return compare(x, t) >= 0; | ||
+ return compare(x, t) >= 0; | ||
} | ||
-inline int operator<(const SubString& x, const char* t) | ||
+inline int operator<(const SubString& x, const char* t) | ||
{ | ||
- return compare(x, t) < 0; | ||
+ return compare(x, t) < 0; | ||
} | ||
-inline int operator<=(const | ||
+inline int operator<=(const | ||
{ | ||
- return compare(x, t) <= 0; | ||
+ return compare(x, t) <= 0; | ||
} | ||
@@ -1275,7 +1275,7 @@ inline SubString String::_substr( | ||
{ | ||
if (first < 0 || (unsigned)(first | ||
return SubString(_nilSt | ||
- else | ||
+ else | ||
return SubString(*this, | ||
} | ||
@@ -1,5 +1,5 @@ | ||
// This may look like C code, but it is really -*- C++ -*- | ||
-/* | ||
+/* | ||
Copyright (C) 1988 Free Software Foundation | ||
written by Dirk Grunwald (grunwald@cs.uiu | ||
@@ -25,7 +25,7 @@ Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. | ||
// | ||
// The interval [lo..hi] | ||
-// | ||
+// | ||
class Uniform: public Random { | ||
double pLow; |
@@ -1,5 +1,5 @@ | ||
// This may look like C code, but it is really -*- C++ -*- | ||
-/* | ||
+/* | ||
Copyright (C) 1988 Free Software Foundation | ||
written by Dirk Grunwald (grunwald@cs.uiu | ||
@@ -19,7 +19,7 @@ Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. | ||
#ifdef __GNUG__ | ||
#pragma interface | ||
#endif | ||
-#define _Weibull_h | ||
+#define _Weibull_h | ||
#include <Random.h> | ||
@@ -30,7 +30,7 @@ protected: | ||
double pBeta; | ||
void setState(); | ||
- | ||
+ | ||
public: | ||
Weibull(double alpha, double beta, RNG *gen); | ||
@@ -47,7 +47,7 @@ public: | ||
inline void Weibull::setStat | ||
pInvAlpha = 1.0 / pAlpha; | ||
} | ||
- | ||
+ | ||
inline Weibull::Weibull | ||
{ | ||
pAlpha = alpha; |
@@ -1,4 +1,4 @@ | ||
-/* AUTOMATICALLY GENERATED; DO NOT EDIT! */ | ||
+/* AUTOMATICALLY GENERATED; DO NOT EDIT! */ | ||
#include <sys/types.h> | ||
#ifndef _G_config_h | ||
#define _G_config_h |
@@ -1,6 +1,6 @@ | ||
// This may look like C code, but it is really -*- C++ -*- | ||
-/* | ||
+/* | ||
Copyright (C) 1988, 1992 Free Software Foundation | ||
written by Doug Lea (dl@rocky.oswego | ||
@@ -42,7 +42,7 @@ typedef void (*one_arg_error_ | ||
typedef void (*two_arg_error_ | ||
long gcd(long, long); | ||
-long lg(unsigned long); | ||
+long lg(unsigned long); | ||
double pow(double, long); | ||
long pow(long, long); | ||
@@ -60,30 +60,30 @@ extern _VOLATILE_VOID default_two_arg_ | ||
extern two_arg_error_ha | ||
-extern two_arg_error_ha | ||
+extern two_arg_error_ha | ||
set_lib_error_ha | ||
#if !defined(IV) | ||
#if ! _G_MATH_H_INLINE | ||
-inline double abs(double arg) | ||
+inline double abs(double arg) | ||
{ | ||
return (arg < 0.0)? -arg : arg; | ||
} | ||
#endif | ||
-inline float abs(float arg) | ||
+inline float abs(float arg) | ||
{ | ||
return (arg < 0.0)? -arg : arg; | ||
} | ||
-inline short abs(short arg) | ||
+inline short abs(short arg) | ||
{ | ||
return (arg < 0)? -arg : arg; | ||
} | ||
-inline long abs(long arg) | ||
+inline long abs(long arg) | ||
{ | ||
return (arg < 0)? -arg : arg; | ||
} |
@@ -1,4 +1,4 @@ | ||
-/* | ||
+/* | ||
Copyright (C) 1993 Free Software Foundation | ||
This file is part of the GNU IO Library. This library is free |
@@ -1,6 +1,6 @@ | ||
// This may look like C code, but it is really -*- C++ -*- | ||
-/* | ||
+/* | ||
Copyright (C) 1988 Free Software Foundation | ||
written by Doug Lea (dl@rocky.oswego | ||
@@ -1,5 +1,5 @@ | ||
// This may look like C code, but it is really -*- C++ -*- | ||
-/* | ||
+/* | ||
Copyright (C) 1994 Free Software Foundation | ||
written by Jason Merrill (jason@cygnus.co | ||
@@ -39,9 +39,9 @@ typedef /*unsigned*/ char buf_char; | ||
// Logical pos from start of buffer (does not count gap). | ||
typedef long buf_index; | ||
- | ||
+ | ||
// Pos from start of buffer, possibly including gap_size. | ||
-typedef long buf_offset; | ||
+typedef long buf_offset; | ||
#if 0 | ||
struct buf_cookie { |
@@ -1,4 +1,4 @@ | ||
-/* | ||
+/* | ||
Copyright (C) 1993 Free Software Foundation | ||
This file is part of the GNU IO Library. This library is free |
@@ -42,10 +42,10 @@ template<class TP> class smanip; // TP = Type Param | ||
template<class TP> class sapp { | ||
ios& (*_f)(ios&, TP); | ||
-public: | ||
+public: | ||
sapp(ios& (*f)(ios&, TP)) : _f(f) {} | ||
// | ||
- smanip<TP> operator()(TP a) | ||
+ smanip<TP> operator()(TP a) | ||
{ return smanip<TP>(_f, a); } | ||
}; | ||
@@ -55,7 +55,7 @@ template <class TP> class smanip { | ||
public: | ||
smanip(ios& (*f)(ios&, TP), TP a) : _f(f), _a(a) {} | ||
// | ||
- friend | ||
+ friend | ||
istream& operator>>(istre | ||
friend | ||
ostream& operator<<(ostre | ||
@@ -85,11 +85,11 @@ extern template ostream& operator<<(ostre | ||
// Input-Stream Manipulators | ||
//-------------- | ||
// | ||
-template<class TP> class imanip; | ||
+template<class TP> class imanip; | ||
template<class TP> class iapp { | ||
istream& (*_f)(istream&, TP); | ||
-public: | ||
+public: | ||
iapp(istream& (*f)(istream&,TP | ||
// | ||
imanip<TP> operator()(TP a) | ||
@@ -102,7 +102,7 @@ template <class TP> class imanip { | ||
public: | ||
imanip(istream& (*f)(istream&, TP), TP a) : _f(f), _a(a) {} | ||
// | ||
- friend | ||
+ friend | ||
istream& operator>>(istre | ||
{ return (*m._f)( i, m._a); } | ||
}; | ||
@@ -112,11 +112,11 @@ public: | ||
// Output-Stream Manipulators | ||
//-------------- | ||
// | ||
-template<class TP> class omanip; | ||
+template<class TP> class omanip; | ||
template<class TP> class oapp { | ||
ostream& (*_f)(ostream&, TP); | ||
-public: | ||
+public: | ||
oapp(ostream& (*f)(ostream&,TP | ||
// | ||
omanip<TP> operator()(TP a) | ||
@@ -141,7 +141,7 @@ public: | ||
// | ||
// Macro to define an iomanip function, with one argument | ||
-// The underlying function is `__iomanip_<name | ||
+// The underlying function is `__iomanip_<name | ||
// | ||
#define __DEFINE_IOMANIP | ||
extern ios& __iomanip_##func |
@@ -1,4 +1,4 @@ | ||
-/* This is part of libio/iostream, providing -*- C++ -*- input/output. | ||
+/* This is part of libio/iostream, providing -*- C++ -*- input/output. | ||
Copyright (C) 1993 Free Software Foundation | ||
This file is part of the GNU IO Library. This library is free |
@@ -1,4 +1,4 @@ | ||
-/* | ||
+/* | ||
Copyright (C) 1993 Free Software Foundation | ||
This file is part of the GNU IO Library. This library is free |
@@ -1,4 +1,4 @@ | ||
-/* | ||
+/* | ||
Copyright (C) 1993 Free Software Foundation | ||
This file is part of the GNU IO Library. This library is free | ||
@@ -185,21 +185,21 @@ struct _IO_FILE { | ||
char *_IO_save_end; /* Pointer to end of non-current get area. */ | ||
struct _IO_marker *_markers; | ||
- | ||
+ | ||
struct _IO_FILE *_chain; | ||
- | ||
+ | ||
struct _IO_jump_t *_jumps; /* Jump table */ | ||
- | ||
+ | ||
int _fileno; | ||
int _blksize; | ||
_IO_off_t _offset; | ||
- | ||
+ | ||
#define __HAVE_COLUMN /* temporary */ | ||
/* 1+column number of pbase(); 0 is unknown. */ | ||
unsigned short _cur_column; | ||
char _unused; | ||
char _shortbuf[1]; | ||
- | ||
+ | ||
/* char* _save_gptr; char* _save_egptr; */ | ||
}; | ||
@@ -1,4 +1,4 @@ | ||
-/* | ||
+/* | ||
Copyright (C) 1993 Free Software Foundation | ||
This file is part of the GNU IO Library. This library is free |
@@ -67,7 +67,7 @@ class parsebuf : public streambuf { | ||
// Length of current line, not counting either '\n'. | ||
int line_length() { return _line_length; } | ||
- // Current line - not a copy, so file ops may trash it. | ||
+ // Current line - not a copy, so file ops may trash it. | ||
virtual char* current_line(); | ||
virtual streampos seekoff(streamof | ||
virtual streambuf* setbuf(char* p, int len); |
@@ -67,7 +67,7 @@ typedef int (*rx_sp_comparer | ||
typedef int (*rx_sp_comparer | ||
#endif | ||
-struct rx_sp_node | ||
+struct rx_sp_node | ||
{ | ||
void * key; | ||
void * data; | ||
@@ -135,7 +135,7 @@ struct rx_hash_rules | ||
/* Matchers decide what to do by examining a series of these. | ||
* Instruction types are described below. | ||
*/ | ||
-struct rx_inx | ||
+struct rx_inx | ||
{ | ||
void * inx; | ||
void * data; | ||
@@ -179,7 +179,7 @@ struct rx | ||
/* --------- The remaining fields are for internal use only. --------- */ | ||
/* --------- But! they should be initialized to 0. --------- */ | ||
/* NODEC is the number of nodes in the NFA with non-epsilon | ||
- * orx transitions. | ||
+ * orx transitions. | ||
*/ | ||
int nodec; | ||
@@ -196,7 +196,7 @@ struct rx | ||
/* A memo for sets of states in the possible_future lists of an nfa: */ | ||
struct rx_hash set_list_memo; | ||
- /* The instruction table is indexed by the enum of instructions defined in | ||
+ /* The instruction table is indexed by the enum of instructions defined in | ||
* rxrun.h. The values in the table are used to fill in the `inx' | ||
* slot of instruction frames (see rxrun.h). | ||
*/ | ||
@@ -213,7 +213,7 @@ struct rx | ||
/* An RX NFA may contain epsilon edges labeled with side effects. | ||
* These side effects represent match actions that can not normally be | ||
* defined in a `pure' NFA; for example, recording the location at | ||
- * which a paren is crossed in a register structure. | ||
+ * which a paren is crossed in a register structure. | ||
* | ||
* A matcher is supposed to find a particular path | ||
* through the NFA (such as leftmost-longest | ||
@@ -222,7 +222,7 @@ struct rx | ||
* backtracking. | ||
* | ||
* As the NFA is manipulated during matching sets of side effects. | ||
- * Simple lists are used to hold side effect lists. | ||
+ * Simple lists are used to hold side effect lists. | ||
*/ | ||
typedef void * rx_side_effect; | ||
@@ -287,7 +287,7 @@ struct rexp_node | ||
struct rx_nfa_state | ||
{ | ||
- int id; | ||
+ int id; | ||
struct rx_nfa_edge *edges; | ||
struct rx_possible_futu | ||
unsigned int is_final:1; | ||
@@ -333,17 +333,17 @@ struct rx_possible_futu | ||
enum rx_opcode | ||
{ | ||
- /* | ||
+ /* | ||
* BACKTRACK_POINT is invoked when a transition results in more | ||
* than one possible future. | ||
* | ||
* There is one occurence of this instruction per transition_class | ||
- * structure; that occurence is only ever executed if the | ||
+ * structure; that occurence is only ever executed if the | ||
* transition_class | ||
*/ | ||
rx_backtrack_poi | ||
- /* | ||
+ /* | ||
* RX_DO_SIDE_EFFEC | ||
* There is one occurence of this instruction per rx_distinct_futu | ||
* This instruction is skipped if a rx_distinct_futu | ||
@@ -351,7 +351,7 @@ enum rx_opcode | ||
rx_do_side_effec | ||
/* data is (struct rx_distinct_futu | ||
- /* | ||
+ /* | ||
* RX_CACHE_MISS instructions are stored in rx_distinct_futu | ||
* destination superstate has been reclaimed (or was never built). | ||
* It recomputes the destination superstate. | ||
@@ -361,9 +361,9 @@ enum rx_opcode | ||
rx_cache_miss = rx_do_side_effec | ||
/* data is (struct rx_distinct_futu | ||
- /* | ||
+ /* | ||
* RX_NEXT_CHAR is called to consume the next character and take the | ||
- * corresponding transition. This is the only instruction that uses | ||
+ * corresponding transition. This is the only instruction that uses | ||
* the DATA field of the instruction frame instead of DATA_2. | ||
* (see EXPLORE_FUTURE in regex.c). | ||
*/ | ||
@@ -373,7 +373,7 @@ enum rx_opcode | ||
*/ | ||
rx_backtrack = rx_next_char + 1, /* no data */ | ||
- /* | ||
+ /* | ||
* RX_ERROR_INX is stored only in places that should never be executed. | ||
*/ | ||
rx_error_inx = rx_backtrack + 1, /* Not supposed to occur. */ | ||
@@ -390,7 +390,7 @@ extern void * rx_id_instructio | ||
/* If the instruction is `rx_next_char' then data is valid. Otherwise it's 0 | ||
* and data_2 is valid. | ||
*/ | ||
-struct rx_inx | ||
+struct rx_inx | ||
{ | ||
void * inx; | ||
void * data; | ||
@@ -431,7 +431,7 @@ struct rx_superset | ||
/* Every character occurs in at most one super edge per super-state. | ||
* But, that edge might have more than one option, indicating a point | ||
- * of non-determinism. | ||
+ * of non-determinism. | ||
*/ | ||
struct rx_super_edge | ||
{ | ||
@@ -447,7 +447,7 @@ struct rx_super_edge | ||
* without warning. To protect a superstate, use LOCK_SUPERSTATE. | ||
* | ||
* Joe Keane thought of calling these superstates and several people | ||
- * have commented on what a good name it is for what they do. | ||
+ * have commented on what a good name it is for what they do. | ||
*/ | ||
struct rx_superstate | ||
{ | ||
@@ -501,7 +501,7 @@ typedef void (*rx_morecore_fn | ||
typedef void (*rx_morecore_fn | ||
#endif | ||
-/* You use this to control the allocation of superstate data | ||
+/* You use this to control the allocation of superstate data | ||
* during matching. Most of it should be initialized to 0. | ||
* | ||
* A MORECORE function is necessary. It should allocate | ||
@@ -512,10 +512,10 @@ typedef void (*rx_morecore_fn | ||
* the system will try to allocate. The default is 128. Batch style | ||
* applications that are very regexp intensive should use as high a number | ||
* as possible without thrashing. | ||
- * | ||
+ * | ||
* The LOCAL_CSET_SIZE is the number of characters in a character set. | ||
* It is therefore the number of entries in a superstate transition table. | ||
- * Generally, it should be 256. If your character set has 16 bits, | ||
+ * Generally, it should be 256. If your character set has 16 bits, | ||
* it is better to translate your regexps into equivalent 8 bit patterns. | ||
*/ | ||
@@ -523,7 +523,7 @@ struct rx_cache | ||
{ | ||
struct rx_hash_rules superset_hash_ru | ||
- /* Objects are allocated by incrementing a pointer that | ||
+ /* Objects are allocated by incrementing a pointer that | ||
* scans across rx_blocklists. | ||
*/ | ||
struct rx_blocklist * memory; | ||
@@ -614,7 +614,7 @@ typedef enum rx_get_burst_ret | ||
(*rx_get_burst_f | ||
void * app_closure, | ||
int stop); | ||
- | ||
+ | ||
#else | ||
typedef enum rx_get_burst_ret | ||
#endif | ||
@@ -628,7 +628,7 @@ enum rx_back_check_re | ||
rx_back_check_fa | ||
}; | ||
-/* Back_check should advance the position it is passed | ||
+/* Back_check should advance the position it is passed | ||
* over rparen - lparen characters and return pass iff | ||
* the characters starting at POS match those indexed | ||
* by [LPAREN..RPAREN] | ||
@@ -645,7 +645,7 @@ typedef enum rx_back_check_re | ||
unsigned char * translate, | ||
void * app_closure, | ||
int stop); | ||
- | ||
+ | ||
#else | ||
typedef enum rx_back_check_re | ||
#endif | ||
@@ -683,7 +683,7 @@ enum rx_search_return | ||
/* regex.h | ||
- * | ||
+ * | ||
* The remaining declarations replace regex.h. | ||
*/ | ||
@@ -707,7 +707,7 @@ typedef enum | ||
REG_EESCAPE, /* Trailing backslash. */ | ||
REG_ESUBREG, /* Invalid back reference. */ | ||
REG_EBRACK, /* Unmatched left bracket. */ | ||
- REG_EPAREN, /* Parenthesis imbalance. */ | ||
+ REG_EPAREN, /* Parenthesis imbalance. */ | ||
REG_EBRACE, /* Unmatched \{. */ | ||
REG_BADBR, /* Invalid contents of \{\}. */ | ||
REG_ERANGE, /* Invalid range end. */ | ||
@@ -741,8 +741,8 @@ enum re_side_effects | ||
}; | ||
/* These hold paramaters for the kinds of side effects that are possible | ||
- * in the supported pattern languages. These include things like the | ||
- * numeric bounds of {} operators and the index of paren registers for | ||
+ * in the supported pattern languages. These include things like the | ||
+ * numeric bounds of {} operators and the index of paren registers for | ||
* subexpression measurement or backreferencing. | ||
*/ | ||
struct re_se_params | ||
@@ -761,10 +761,10 @@ struct re_pattern_buffe | ||
unsigned int no_sub:1; /* If set, don't return register offsets. */ | ||
unsigned int not_bol:1; /* If set, the anchors ('^' and '$') don't */ | ||
- unsigned int not_eol:1; /* match at the ends of the string. */ | ||
+ unsigned int not_eol:1; /* match at the ends of the string. */ | ||
unsigned int newline_anchor:1 | ||
unsigned int least_subs:1; /* If set, and returning registers, return | ||
- * as few values as possible. Only | ||
+ * as few values as possible. Only | ||
* backreferenced groups and group 0 (the whole | ||
* match) will be returned. | ||
*/ | ||
@@ -780,18 +780,18 @@ struct re_pattern_buffe | ||
unsigned int is_anchored:1; /* Anchorded by ^? */ | ||
unsigned int begbuf_only:1; /* Anchored to char position 0? */ | ||
- | ||
+ | ||
/* If REGS_UNALLOCATED | ||
* for `max (RE_NREGS, re_nsub + 1)' groups. | ||
* If REGS_REALLOCATE, | ||
- * If REGS_FIXED, use what's there. | ||
+ * If REGS_FIXED, use what's there. | ||
*/ | ||
#define REGS_UNALLOCATED | ||
#define REGS_REALLOCATE 1 | ||
#define REGS_FIXED 2 | ||
unsigned int regs_allocated:2 | ||
- | ||
+ | ||
/* Either a translate table to apply to all characters before | ||
* comparing them, or zero for no translation. The translation | ||
* is applied to a pattern when it is compiled and to a string | ||
@@ -799,11 +799,11 @@ struct re_pattern_buffe | ||
*/ | ||
unsigned char * translate; | ||
- /* If this is a valid pointer, it tells rx not to store the extents of | ||
+ /* If this is a valid pointer, it tells rx not to store the extents of | ||
* certain subexpressions (those corresponding to non-zero entries). | ||
* Passing 0x1 is the same as passing an array of all ones. Passing 0x0 | ||
* is the same as passing an array of all zeros. | ||
- * The array should contain as many entries as their are subexps in the | ||
+ * The array should contain as many entries as their are subexps in the | ||
* regexp. | ||
*/ | ||
char * syntax_parens; | ||
@@ -820,7 +820,7 @@ struct re_pattern_buffe | ||
char *fastmap; | ||
unsigned int fastmap_accurate | ||
- unsigned int can_match_empty: | ||
+ unsigned int can_match_empty: | ||
struct rx_nfa_state * start; /* The nfa starting state. */ | ||
/* This is the list of iterator bounds for {lo,hi} constructs. | ||
@@ -871,7 +871,7 @@ typedef struct | ||
#define RE_BACKSLASH_ESC | ||
/* If this bit is not set, then + and ? are operators, and \+ and \? are | ||
- literals. | ||
+ literals. | ||
If set, then \+ and \? are operators and + and ? are literals. */ | ||
#define RE_BK_PLUS_QM (RE_BACKSLASH_ES | ||
@@ -887,7 +887,7 @@ typedef struct | ||
^ is an anchor if it is at the beginning of a regular | ||
expression or after an open-group or an alternation operator; | ||
$ is an anchor if it is at the end of a regular expression, or | ||
- before a close-group or an alternation operator. | ||
+ before a close-group or an alternation operator. | ||
This bit could be (re)combined with RE_CONTEXT_INDEP | ||
POSIX draft 11.2 says that * etc. in leading positions is undefined. | ||
@@ -898,7 +898,7 @@ typedef struct | ||
/* If this bit is set, then special characters are always special | ||
regardless of where they are in the pattern. | ||
If this bit is not set, then special characters are special only in | ||
- some contexts; otherwise they are ordinary. Specifically, | ||
+ some contexts; otherwise they are ordinary. Specifically, | ||
* + ? and intervals are only special when not after the beginning, | ||
open-group, or alternation operator. */ | ||
#define RE_CONTEXT_INDEP | ||
@@ -920,7 +920,7 @@ typedef struct | ||
#define RE_HAT_LISTS_NOT | ||
/* If this bit is set, either \{...\} or {...} defines an | ||
- interval, depending on RE_NO_BK_BRACES. | ||
+ interval, depending on RE_NO_BK_BRACES. | ||
If not set, \{, \}, {, and } are literals. */ | ||
#define RE_INTERVALS (RE_HAT_LISTS_NO | ||
@@ -945,7 +945,7 @@ typedef struct | ||
If not set, then \<digit> is a back-reference. */ | ||
#define RE_NO_BK_REFS (RE_NO_BK_PARENS | ||
-/* If this bit is set, then | is an alternation operator, and \| is literal. | ||
+/* If this bit is set, then | is an alternation operator, and \| is literal. | ||
If not set, then \| is an alternation operator, and | is literal. */ | ||
#define RE_NO_BK_VBAR (RE_NO_BK_REFS << 1) | ||
@@ -967,7 +967,7 @@ extern reg_syntax_t re_syntax_option | ||
/* Define combinations of the above bits for the standard possibilities. | ||
(The [[[ comments delimit what gets put into the Texinfo file, so | ||
- don't delete them!) */ | ||
+ don't delete them!) */ | ||
/* [[[begin syntaxes]]] */ | ||
#define RE_SYNTAX_EMACS 0 | ||
@@ -1031,7 +1031,7 @@ extern reg_syntax_t re_syntax_option | ||
#ifdef RE_DUP_MAX | ||
#undef RE_DUP_MAX | ||
#endif | ||
-#define RE_DUP_MAX ((1 << 15) - 1) | ||
+#define RE_DUP_MAX ((1 << 15) - 1) | ||
#if !defined(BSD) || (BSD < 199306) | ||
@@ -1044,7 +1044,7 @@ extern reg_syntax_t re_syntax_option | ||
/* If this bit is set, then ignore case when matching. | ||
If not set, then case is significant. */ | ||
#define REG_ICASE (REG_EXTENDED << 1) | ||
- | ||
+ | ||
/* If this bit is set, then anchors do not match at newline | ||
characters in the string. | ||
If not set, then anchors do match at newlines. */ | ||
@@ -1070,7 +1070,7 @@ extern reg_syntax_t re_syntax_option | ||
/* If `regs_allocated' | ||
* `re_match_2' returns information about at least this many registers | ||
- * the first time a `regs' structure is passed. | ||
+ * the first time a `regs' structure is passed. | ||
* | ||
* Also, this is the greatest number of backreferenced subexpressions | ||
* allowed in a pattern being matched without caller-supplied registers. | ||
@@ -1087,7 +1087,7 @@ extern char rx_version_strin | ||
#ifdef RX_WANT_RX_DEFS | ||
/* This is decls to the interesting subsystems and lower layers | ||
- * of rx. Everything which doesn't have a public counterpart in | ||
+ * of rx. Everything which doesn't have a public counterpart in | ||
* regex.c is declared here. | ||
*/ | ||
@@ -1318,7 +1318,7 @@ struct rx_backtrack_fra | ||
{ | ||
char * counter_stack_sp | ||
- /* A frame is used to save the matchers state when it crosses a | ||
+ /* A frame is used to save the matchers state when it crosses a | ||
* backtracking point. The `stk_' fields correspond to variables | ||
* in re_search_2 (just strip off thes `stk_'). They are documented | ||
* tere. | ||
@@ -1331,7 +1331,7 @@ struct rx_backtrack_fra | ||
int stk_test_ret; | ||
/* This is the list of options left to explore at the backtrack | ||
- * point for which this frame was created. | ||
+ * point for which this frame was created. | ||
*/ | ||
struct rx_distinct_futu | ||
struct rx_distinct_futu | ||
@@ -1407,15 +1407,15 @@ struct rx_search_state | ||
int * best_lpspace; /* in case the user doesn't want these */ | ||
int * best_rpspace; /* values, we still need space to store | ||
* them. Normally, this memoryis unused | ||
- * and the space pointed to by REGS is | ||
+ * and the space pointed to by REGS is | ||
* used instead. | ||
*/ | ||
- | ||
+ | ||
int last_l; /* Highest index of a valid lparen. */ | ||
int last_r; /* It's dual. */ | ||
- | ||
+ | ||
int * best_lparen; /* This contains the best known register */ | ||
- int * best_rparen; /* assignments. | ||
+ int * best_rparen; /* assignments. | ||
* This may point to the same mem as | ||
* best_lpspace, or it might point to memory | ||
* passed by the caller. | ||
@@ -1424,7 +1424,7 @@ struct rx_search_state | ||
int best_last_r; | ||
- unsigned char * translate; | ||
+ unsigned char * translate; | ||
struct rx_string_positi | ||
@@ -1443,7 +1443,7 @@ struct rx_search_state | ||
rx_get_burst_fn saved_get_burst; | ||
rx_back_check_fn | ||
struct re_registers * saved_regs; | ||
- | ||
+ | ||
/** | ||
** state for fastmap | ||
**/ | ||
@@ -1455,23 +1455,23 @@ struct rx_search_state | ||
enum rx_fastmap_entry | ||
/** | ||
- ** state for test_match | ||
+ ** state for test_match | ||
**/ | ||
/* The current superNFA position of the matcher. */ | ||
struct rx_superstate * super; | ||
- | ||
+ | ||
/* The matcher interprets a series of instruction frames. | ||
* This is the `instruction counter' for the interpretation. | ||
*/ | ||
struct rx_inx * ifr; | ||
- | ||
+ | ||
/* We insert a ghost character in the string to prime | ||
* the nfa. test_pos.pos, test_pos.str_hal | ||
* keep track of the test-match position and string-half. | ||
*/ | ||
unsigned char c; | ||
- | ||
+ | ||
/* Position within the string. */ | ||
struct rx_string_positi | ||
@@ -1481,7 +1481,7 @@ struct rx_search_state | ||
int chunk_bytes; | ||
struct rx_stack_chunk * free_chunks; | ||
- /* To return from this function, set test_ret and | ||
+ /* To return from this function, set test_ret and | ||
* `goto test_do_return'. | ||
* | ||
* Possible return values are: | ||
@@ -1501,14 +1501,14 @@ struct rx_search_state | ||
int test_ret; | ||
int could_have_conti | ||
- | ||
+ | ||
#ifdef RX_DEBUG | ||
int backtrack_depth; | ||
/* There is a search tree with every node as set of deterministic | ||
- * transitions in the super nfa. For every branch of a | ||
+ * transitions in the super nfa. For every branch of a | ||
* backtrack point is an edge in the tree. | ||
* This counts up a pre-order of nodes in that tree. | ||
- * It's saved on the search stack and printed when debugging. | ||
+ * It's saved on the search stack and printed when debugging. | ||
*/ | ||
int line_no; | ||
int lines_found; | ||
@@ -1521,7 +1521,7 @@ struct rx_search_state | ||
struct rx_inx * saved_this_tr_ta | ||
int saved_reg; | ||
struct rx_backtrack_fra | ||
- | ||
+ | ||
}; | ||
@@ -1536,7 +1536,7 @@ init_fastmap (rxb, search_state) | ||
search_state->fa | ||
? (char *)rxb->fastmap | ||
: (char *)rx_slowmap); | ||
- /* Update the fastmap now if not correct already. | ||
+ /* Update the fastmap now if not correct already. | ||
* When the regexp was compiled, the fastmap was computed | ||
* and stored in a bitset. This expands the bitset into a | ||
* character array containing 1s and 0s. | ||
@@ -1586,7 +1586,7 @@ fastmap_search (rxb, stop, get_burst, app_closure, search_state) | ||
* This sentinal will trap the fastmap loop when it reaches the last | ||
* valid character in a string half. | ||
* | ||
- * This must be reset when the fastmap/search loop crosses a string | ||
+ * This must be reset when the fastmap/search loop crosses a string | ||
* boundry, and before returning to the caller. So sometimes, | ||
* the fastmap loop is restarted with `continue', othertimes by | ||
* `goto init_fastmap_sen | ||
@@ -1605,7 +1605,7 @@ fastmap_search (rxb, stop, get_burst, app_closure, search_state) | ||
search_state->fa | ||
search_state->fa | ||
} | ||
- | ||
+ | ||
if (search_state->o | ||
goto fastmap_hit_boun | ||
else | ||
@@ -1629,7 +1629,7 @@ fastmap_search (rxb, stop, get_burst, app_closure, search_state) | ||
++search_state-> | ||
if (*search_state-> | ||
return rx_fastmap_ok; | ||
- else | ||
+ else | ||
{ | ||
++search_state-> | ||
if (search_state->o | ||
@@ -1659,7 +1659,7 @@ fastmap_search (rxb, stop, get_burst, app_closure, search_state) | ||
--search_state-> | ||
if ((*search_state- | ||
return rx_fastmap_ok; | ||
- else | ||
+ else | ||
{ | ||
--search_state-> | ||
if (search_state->o | ||
@@ -1669,12 +1669,12 @@ fastmap_search (rxb, stop, get_burst, app_closure, search_state) | ||
} | ||
} | ||
} | ||
- | ||
+ | ||
case rx_fastmap_strin | ||
fastmap_hit_boun | ||
{ | ||
/* If we hit a bound, it may be time to fetch another burst | ||
- * of string, or it may be time to return a continuation to | ||
+ * of string, or it may be time to return a continuation to | ||
* the caller, or it might be time to fail. | ||
*/ | ||
@@ -1692,7 +1692,7 @@ fastmap_search (rxb, stop, get_burst, app_closure, search_state) | ||
case rx_get_burst_ok: | ||
goto init_fastmap_sen | ||
case rx_get_burst_no_ | ||
- /* ...not a string split, simply no more string. | ||
+ /* ...not a string split, simply no more string. | ||
* | ||
* When searching backward, running out of string | ||
* is reason to quit. | ||
@@ -1714,7 +1714,7 @@ fastmap_search (rxb, stop, get_burst, app_closure, search_state) | ||
#ifdef emacs | ||
/* The `emacs' switch turns on certain matching commands | ||
- * that make sense only in Emacs. | ||
+ * that make sense only in Emacs. | ||
*/ | ||
#include "config.h" | ||
#include "lisp.h" | ||
@@ -1731,7 +1731,7 @@ fastmap_search (rxb, stop, get_burst, app_closure, search_state) | ||
#else /* not RX_RX_MEMDBUG */ | ||
/* We used to test for `BSTRING' here, but only GCC and Emacs define | ||
- * `BSTRING', as far as I know, and neither of them use this code. | ||
+ * `BSTRING', as far as I know, and neither of them use this code. | ||
*/ | ||
#if HAVE_STRING_H || STDC_HEADERS | ||
#include <string.h> | ||
@@ -1767,7 +1767,7 @@ char *realloc (); | ||
* This must be nonzero for the wordchar and notwordchar pattern | ||
* commands in re_match_2. | ||
*/ | ||
-#ifndef Sword | ||
+#ifndef Sword | ||
#define Sword 1 | ||
#endif | ||
@@ -1780,7 +1780,7 @@ RX_DECL char re_syntax_table[ | ||
/* Test if at very beginning or at very end of the virtual concatenation | ||
- * of `string1' and `string2'. If only one string, it's `string2'. | ||
+ * of `string1' and `string2'. If only one string, it's `string2'. | ||
*/ | ||
#define AT_STRINGS_BEG() | ||
@@ -1799,14 +1799,14 @@ RX_DECL char re_syntax_table[ | ||
* the first character in string2; and if before the beginning of | ||
* string2, look at the last character in string1. | ||
* | ||
- * Assumes `string1' exists, so use in conjunction with AT_STRINGS_BEG (). | ||
+ * Assumes `string1' exists, so use in conjunction with AT_STRINGS_BEG (). | ||
*/ | ||
#define LETTER_P(POS,OFF | ||
( SYNTAX (fetch_char(POS, | ||
== Sword) | ||
/* Test if the character at D and the one after D differ with respect | ||
- * to being word-constituent | ||
+ * to being word-constituent | ||
*/ | ||
#define AT_WORD_BOUNDARY | ||
(AT_STRINGS_BEG () || AT_STRINGS_END () || LETTER_P (d,0) != LETTER_P (d, 1)) | ||
@@ -1948,17 +1948,17 @@ rx_search (rxb, startpos, range, stop, total_size, | ||
= search_state.bes | ||
= search_state.bes | ||
= 0); | ||
- | ||
+ | ||
/* figure the number of registers we may need for use in backreferences. | ||
- * the number here includes an element for register zero. | ||
+ * the number here includes an element for register zero. | ||
*/ | ||
search_state.num | ||
- | ||
- | ||
+ | ||
+ | ||
/* check for out-of-range startpos. */ | ||
if ((startpos < 0) || (startpos > total_size)) | ||
return rx_search_fail; | ||
- | ||
+ | ||
/* fix up range if it might eventually take us outside the string. */ | ||
{ | ||
int endpos; | ||
@@ -1968,7 +1968,7 @@ rx_search (rxb, startpos, range, stop, total_size, | ||
else if (endpos > total_size) | ||
range = total_size - startpos; | ||
} | ||
- | ||
+ | ||
/* if the search isn't to be a backwards one, don't waste time in a | ||
* long search for a pattern that says it is anchored. | ||
*/ | ||
@@ -1979,7 +1979,7 @@ rx_search (rxb, startpos, range, stop, total_size, | ||
else | ||
range = 1; | ||
} | ||
- | ||
+ | ||
/* decide whether to use internal or user-provided reg buffers. */ | ||
if (!regs || rxb->no_sub) | ||
{ | ||
@@ -1991,7 +1991,7 @@ rx_search (rxb, startpos, range, stop, total_size, | ||
search_state.bes | ||
} | ||
else | ||
- { | ||
+ { | ||
/* have the register data arrays been allocated? */ | ||
if (rxb->regs_alloc | ||
{ /* no. so allocate them with malloc. we need one | ||
@@ -2025,7 +2025,7 @@ rx_search (rxb, startpos, range, stop, total_size, | ||
} | ||
else if (rxb->regs_alloc | ||
return rx_search_error; | ||
- | ||
+ | ||
if (regs->num_regs < search_state.num | ||
{ | ||
search_state.bes | ||
@@ -2043,38 +2043,38 @@ rx_search (rxb, startpos, range, stop, total_size, | ||
search_state.bes | ||
} | ||
} | ||
- | ||
+ | ||
search_state.lpa | ||
(int *) REGEX_ALLOCATE (search_state.nu | ||
search_state.rpa | ||
(int *) REGEX_ALLOCATE (search_state.nu | ||
- | ||
+ | ||
if (! ( search_state.bes | ||
&& search_state.bes | ||
&& search_state.lpa | ||
return rx_search_error; | ||
- | ||
+ | ||
search_state.bes | ||
- | ||
+ | ||
search_state.tra | ||
? rxb->translate | ||
: rx_id_translatio | ||
- | ||
- | ||
- | ||
+ | ||
+ | ||
+ | ||
/* | ||
- * two nfa's were compiled. | ||
+ * two nfa's were compiled. | ||
* `0' is complete. | ||
* `1' faster but gets registers wrong and ends too soon. | ||
*/ | ||
search_state.nfa | ||
- | ||
+ | ||
/* we have the option to look for the best match or the first | ||
* one we can find. if the user isn't asking for register information, | ||
* we don't need to find the best match. | ||
*/ | ||
search_state.fir | ||
- | ||
+ | ||
if (range >= 0) | ||
{ | ||
search_state.out | ||
@@ -2085,20 +2085,20 @@ rx_search (rxb, startpos, range, stop, total_size, | ||
search_state.out | ||
search_state.out | ||
} | ||
- | ||
+ | ||
/* the vacuous search always turns up nothing. */ | ||
if ((search_state.o | ||
? (startpos > search_state.out | ||
: (startpos < search_state.out | ||
return rx_search_fail; | ||
- | ||
+ | ||
/* now we build the starting state of the supernfa. */ | ||
{ | ||
struct rx_superset * start_contents; | ||
struct rx_nfa_state_set | ||
- | ||
+ | ||
/* we presume here that the nfa start state has only one | ||
- * possible future with no side effects. | ||
+ * possible future with no side effects. | ||
*/ | ||
start_nfa_set = rxb->start->futu | ||
if ( rxb->rx.start_se | ||
@@ -2110,10 +2110,10 @@ rx_search (rxb, startpos, range, stop, total_size, | ||
rx_superstate_ec | ||
rx_superset_cons | ||
start_nfa_set); | ||
- | ||
+ | ||
if (!start_contents | ||
return rx_search_fail; | ||
- | ||
+ | ||
start_contents-> | ||
rxb->rx.start_se | ||
} | ||
@@ -2126,7 +2126,7 @@ rx_search (rxb, startpos, range, stop, total_size, | ||
else | ||
{ | ||
rx_protect_super | ||
- | ||
+ | ||
search_state.sta | ||
if (!search_state.s | ||
return rx_search_fail; | ||
@@ -2134,9 +2134,9 @@ rx_search (rxb, startpos, range, stop, total_size, | ||
rx_release_super | ||
} | ||
} | ||
- | ||
- | ||
- | ||
+ | ||
+ | ||
+ | ||
( search_state.out | ||
= search_state.out | ||
= 0); | ||
@@ -2166,8 +2166,8 @@ rx_search (rxb, startpos, range, stop, total_size, | ||
break; | ||
} | ||
} | ||
- | ||
- /* now the fastmap loop has brought us to a plausible | ||
+ | ||
+ /* now the fastmap loop has brought us to a plausible | ||
* starting point for a match. so, it's time to run the | ||
* nfa and see if a match occured. | ||
*/ | ||
@@ -2225,12 +2225,12 @@ rx_search (rxb, startpos, range, stop, total_size, | ||
: (startpos > search_state.out | ||
goto pseudo_do; | ||
- | ||
+ | ||
finish: | ||
uninit_fastmap (rxb, &search_state); | ||
if (search_state.st | ||
rx_unlock_supers | ||
- | ||
+ | ||
#ifdef regex_malloc | ||
if (search_state.lp | ||
if (search_state.rp | ||
@@ -2255,7 +2255,7 @@ rx_search (rxb, startpos, range, stop, total_size, | ||
search_state.lpa | ||
search_state.sup | ||
search_state.c = search_state.nfa | ||
- search_state.tes | ||
+ search_state.tes | ||
search_state.tes | ||
search_state.tes | ||
search_state.tes | ||
@@ -2272,8 +2272,8 @@ rx_search (rxb, startpos, range, stop, total_size, | ||
search_state.fre | ||
search_state.tes | ||
search_state.cou | ||
- } | ||
- /* This is while (1)...except that the body of the loop is interrupted | ||
+ } | ||
+ /* This is while (1)...except that the body of the loop is interrupted | ||
* by some alternative entry points. | ||
*/ | ||
pseudo_while_1: | ||
@@ -2288,42 +2288,42 @@ rx_search (rxb, startpos, range, stop, total_size, | ||
case rx_test_start: | ||
#ifdef RX_DEBUG | ||
/* There is a search tree with every node as set of deterministic | ||
- * transitions in the super nfa. For every branch of a | ||
+ * transitions in the super nfa. For every branch of a | ||
* backtrack point is an edge in the tree. | ||
* This counts up a pre-order of nodes in that tree. | ||
- * It's saved on the search stack and printed when debugging. | ||
+ * It's saved on the search stack and printed when debugging. | ||
*/ | ||
search_state.lin | ||
search_state.lin | ||
#endif | ||
- | ||
+ | ||
top_of_cycle: | ||
- /* A superstate is basicly a transition table, indexed by | ||
- * characters from the string being tested, and containing | ||
+ /* A superstate is basicly a transition table, indexed by | ||
+ * characters from the string being tested, and containing | ||
* RX_INX (`instruction frame') structures. | ||
*/ | ||
search_state.ifr | ||
- | ||
+ | ||
recurse_test_mat | ||
/* This is the point to which control is sent when the | ||
* test matcher `recurses'. Before jumping here, some variables | ||
* need to be saved on the stack and the next instruction frame | ||
* has to be computed. | ||
*/ | ||
- | ||
+ | ||
restart: | ||
/* Some instructions don't advance the matcher, but just | ||
* carry out some side effects and fetch a new instruction. | ||
* To dispatch that new instruction, `goto restart'. | ||
*/ | ||
- | ||
+ | ||
{ | ||
struct rx_inx * next_tr_table; | ||
struct rx_inx * this_tr_table; | ||
- /* The fastest route through the loop is when the instruction | ||
+ /* The fastest route through the loop is when the instruction | ||
* is RX_NEXT_CHAR. This case is detected when SEARCH_STATE.IFR | ||
* is non-zero. In that case, it points to the next | ||
- * superstate. | ||
+ * superstate. | ||
* | ||
* This allows us to not bother fetching the bytecode. | ||
*/ | ||
@@ -2335,19 +2335,19 @@ rx_search (rxb, startpos, range, stop, total_size, | ||
if (rx_debug_trace) | ||
{ | ||
struct rx_superset * setp; | ||
- | ||
+ | ||
fprintf (stderr, "%d %d>> re_next_char @ %d (%d)", | ||
search_state.lin | ||
search_state.bac | ||
(search_state.te | ||
+ search_state.tes | ||
- | ||
+ | ||
search_state.sup | ||
((struct rx_superstate *) | ||
((char *)this_tr_table | ||
- ((unsigned long) | ||
((struct rx_superstate *)0)->transition | ||
- | ||
+ | ||
setp = search_state.sup | ||
fprintf (stderr, " superstet (rx=%d, &=%x: ", | ||
rxb->rx.rx_id, setp); | ||
@@ -2374,22 +2374,22 @@ rx_search (rxb, startpos, range, stop, total_size, | ||
search_state.sav | ||
test_pc = rx_test_cache_hi | ||
goto test_return_cont | ||
- | ||
+ | ||
resume_continuat | ||
/* Continuation one jumps here to do its work: */ | ||
search_state.sav | ||
search_state.sav | ||
goto try_burst_1; | ||
- | ||
+ | ||
case rx_get_burst_ok: | ||
/* get_burst succeeded...keep | ||
break; | ||
- | ||
+ | ||
case rx_get_burst_no_ | ||
search_state.tes | ||
search_state.cou | ||
goto test_do_return; | ||
- | ||
+ | ||
case rx_get_burst_err | ||
/* An error... */ | ||
search_state.tes | ||
@@ -2400,8 +2400,8 @@ rx_search (rxb, startpos, range, stop, total_size, | ||
search_state.ifr | ||
next_tr_table = (struct rx_inx *)search_state.i | ||
} /* Fast loop through cached transition tables */ | ||
- | ||
- /* Here when we ran out of cached next-char transitions. | ||
+ | ||
+ /* Here when we ran out of cached next-char transitions. | ||
* So, it will be necessary to do a more expensive | ||
* dispatch on the current instruction. The superstate | ||
* pointer is allowed to become invalid during next-char | ||
@@ -2413,7 +2413,7 @@ rx_search (rxb, startpos, range, stop, total_size, | ||
- ((unsigned long) | ||
((struct rx_superstate *)0)->transition | ||
} | ||
- | ||
+ | ||
/* We've encountered an instruction other than next-char. | ||
* Dispatch that instruction: | ||
*/ | ||
@@ -2422,13 +2422,13 @@ rx_search (rxb, startpos, range, stop, total_size, | ||
if (rx_debug_trace) | ||
{ | ||
struct rx_superset * setp = search_state.sup | ||
- | ||
+ | ||
fprintf (stderr, "%d %d>> %s @ %d (%d)", search_state.lin | ||
search_state.bac | ||
inx_names[inx], | ||
(search_state.te | ||
+ (test_pos.half == 0 ? 0 : size1)), search_state.c); | ||
- | ||
+ | ||
fprintf (stderr, " superstet (rx=%d, &=%x: ", | ||
rxb->rx.rx_id, setp); | ||
while (setp) | ||
@@ -2442,8 +2442,8 @@ rx_search (rxb, startpos, range, stop, total_size, | ||
switch ((enum rx_opcode)inx) | ||
{ | ||
case rx_do_side_effec | ||
- | ||
- /* RX_DO_SIDE_EFFEC | ||
+ | ||
+ /* RX_DO_SIDE_EFFEC | ||
* edges associated with parentheses, backreferencing, | ||
*/ | ||
{ | ||
@@ -2463,7 +2463,7 @@ rx_search (rxb, startpos, range, stop, total_size, | ||
if (rx_debug_trace) | ||
{ | ||
struct rx_superset * setp = search_state.sup | ||
- | ||
+ | ||
fprintf (stderr, "....%d %d>> %s\n", search_state.lin | ||
search_state.bac | ||
efnames[-effect] | ||
@@ -2590,7 +2590,7 @@ rx_search (rxb, startpos, range, stop, total_size, | ||
else | ||
goto test_do_return; | ||
} | ||
- | ||
+ | ||
case re_se_try: | ||
/* This is the first side effect in every | ||
* expression. | ||
@@ -2598,7 +2598,7 @@ rx_search (rxb, startpos, range, stop, total_size, | ||
* FOR NO GOOD REASON...get rid of it... | ||
*/ | ||
break; | ||
- | ||
+ | ||
case re_se_pushpos: | ||
{ | ||
int urhere = | ||
@@ -2621,7 +2621,7 @@ rx_search (rxb, startpos, range, stop, total_size, | ||
cf->cdr = old_cf; | ||
break; | ||
} | ||
- | ||
+ | ||
case re_se_chkpos: | ||
{ | ||
int urhere = | ||
@@ -2637,13 +2637,13 @@ rx_search (rxb, startpos, range, stop, total_size, | ||
break; | ||
} | ||
break; | ||
- | ||
+ | ||
case re_se_poppos: | ||
POP(search_state | ||
sizeof (struct rx_counter_frame | ||
break; | ||
- | ||
- | ||
+ | ||
+ | ||
case re_se_at_dot: | ||
case re_se_syntax: | ||
case re_se_not_syntax | ||
@@ -2677,10 +2677,10 @@ rx_search (rxb, startpos, range, stop, total_size, | ||
switch (rxb->se_params [effect].se) | ||
{ | ||
case re_se_win: | ||
- /* This side effect indicates that we've | ||
- * found a match, though not necessarily the | ||
- * best match. This is a fancy assignment to | ||
- * register 0 unless the caller didn't | ||
+ /* This side effect indicates that we've | ||
+ * found a match, though not necessarily the | ||
+ * best match. This is a fancy assignment to | ||
+ * register 0 unless the caller didn't | ||
* care about registers. In which case, | ||
* this stops the match. | ||
*/ | ||
@@ -2689,7 +2689,7 @@ rx_search (rxb, startpos, range, stop, total_size, | ||
((int)(search_st | ||
- search_state.tes | ||
+ search_state.tes | ||
- | ||
+ | ||
if ( (search_state.be | ||
|| (urhere + 1 > search_state.bes | ||
{ | ||
@@ -2705,7 +2705,7 @@ rx_search (rxb, startpos, range, stop, total_size, | ||
search_state.bes | ||
search_state.bes | ||
} | ||
- /* If we're not reporting the match-length | ||
+ /* If we're not reporting the match-length | ||
* or other register info, we need look no | ||
* further. | ||
*/ | ||
@@ -2722,7 +2722,7 @@ rx_search (rxb, startpos, range, stop, total_size, | ||
((int)(search_st | ||
- search_state.tes | ||
+ search_state.tes | ||
- | ||
+ | ||
int reg = rxb->se_params [effect].op1; | ||
#if 0 | ||
if (reg > search_state.las | ||
@@ -2742,7 +2742,7 @@ rx_search (rxb, startpos, range, stop, total_size, | ||
} | ||
break; | ||
} | ||
- | ||
+ | ||
case re_se_rparen: | ||
{ | ||
int urhere = | ||
@@ -2759,14 +2759,14 @@ rx_search (rxb, startpos, range, stop, total_size, | ||
} | ||
break; | ||
} | ||
- | ||
+ | ||
case re_se_backref: | ||
{ | ||
int reg = rxb->se_params [effect].op1; | ||
if ( reg > search_state.las | ||
|| search_state.rpa | ||
goto test_do_return; | ||
- | ||
+ | ||
{ | ||
int backref_status; | ||
check_backrefere | ||
@@ -2873,7 +2873,7 @@ rx_search (rxb, startpos, range, stop, total_size, | ||
search_state.ifr | ||
goto restart; | ||
} | ||
- | ||
+ | ||
case rx_backtrack_poi | ||
{ | ||
/* A backtrack point indicates that we've reached a | ||
@@ -2883,18 +2883,18 @@ rx_search (rxb, startpos, range, stop, total_size, | ||
* A backtracking strategy is used. We keep track of what | ||
* registers are valid so we can erase side effects. | ||
* | ||
- * First, make sure there is some stack space to hold | ||
+ * First, make sure there is some stack space to hold | ||
* our state. | ||
*/ | ||
- | ||
+ | ||
struct rx_backtrack_fra | ||
- | ||
+ | ||
PUSH(search_stat | ||
search_state.bac | ||
#ifdef RX_DEBUG | ||
++search_state.b | ||
#endif | ||
- | ||
+ | ||
bf = ((struct rx_backtrack_fra | ||
search_state.bac | ||
{ | ||
@@ -2929,30 +2929,30 @@ rx_search (rxb, startpos, range, stop, total_size, | ||
stk[x] = search_state.rpa | ||
} | ||
} | ||
- | ||
+ | ||
/* Here is a while loop whose body is mainly a function | ||
* call and some code to handle a return from that | ||
* function. | ||
* | ||
* From here on for the rest of `case backtrack_point' | ||
- * is unsafe to assume that the search_state copies of | ||
+ * is unsafe to assume that the search_state copies of | ||
* variables saved on the backtracking stack are valid | ||
* -- so read their values from the backtracking stack. | ||
* | ||
* This lets us use one generation fewer stack saves in | ||
* the call-graph of a search. | ||
*/ | ||
- | ||
+ | ||
while_non_det_op | ||
#ifdef RX_DEBUG | ||
++search_state.l | ||
if (rx_debug_trace) | ||
fprintf (stderr, "@@@ %d calls %d @@@\n", | ||
search_state.lin | ||
- | ||
+ | ||
search_state.lin | ||
#endif | ||
- | ||
+ | ||
if (bf->df->next_sa | ||
{ | ||
/* This is a tail-call optimization -- we don't recurse | ||
@@ -2961,7 +2961,7 @@ rx_search (rxb, startpos, range, stop, total_size, | ||
search_state.ifr | ||
? &bf->df->side_ef | ||
: &bf->df->future_ | ||
- | ||
+ | ||
rx_unlock_supers | ||
POP(search_state | ||
search_state.bac | ||
@@ -2983,14 +2983,14 @@ rx_search (rxb, startpos, range, stop, total_size, | ||
cf->val = old_cf->val; | ||
cf->inherited_fr | ||
cf->cdr = 0; | ||
- } | ||
+ } | ||
/* `Call' this test-match block */ | ||
search_state.ifr | ||
? &bf->df->side_ef | ||
: &bf->df->future_ | ||
goto recurse_test_mat | ||
} | ||
- | ||
+ | ||
/* Returns in this block are accomplished by | ||
* goto test_do_return. There are two cases. | ||
* If there is some search-stack left, | ||
@@ -2998,9 +2998,9 @@ rx_search (rxb, startpos, range, stop, total_size, | ||
* If there is no search-stack left, then | ||
* we should return to the fastmap/search loop. | ||
*/ | ||
- | ||
+ | ||
test_do_return: | ||
- | ||
+ | ||
if (!search_state.b | ||
{ | ||
#ifdef RX_DEBUG | ||
@@ -3008,18 +3008,18 @@ rx_search (rxb, startpos, range, stop, total_size, | ||
fprintf (stderr, "!!! %d bails returning %d !!!\n", | ||
search_state.lin | ||
#endif | ||
- | ||
+ | ||
/* No more search-stack -- this test is done. */ | ||
if (search_state.te | ||
goto return_from_test | ||
else | ||
goto error_in_testing | ||
} | ||
- | ||
- /* Returning from a recursive call to | ||
+ | ||
+ /* Returning from a recursive call to | ||
* the test match block: | ||
*/ | ||
- | ||
+ | ||
bf = ((struct rx_backtrack_fra | ||
search_state.bac | ||
#ifdef RX_DEBUG | ||
@@ -3029,7 +3029,7 @@ rx_search (rxb, startpos, range, stop, total_size, | ||
search_state.tes | ||
bf->stk_search_s | ||
#endif | ||
- | ||
+ | ||
while (search_state.co | ||
&& (!bf->counter_st | ||
|| (bf->counter_sta | ||
@@ -3038,15 +3038,15 @@ rx_search (rxb, startpos, range, stop, total_size, | ||
POP(search_state | ||
sizeof (struct rx_counter_frame | ||
} | ||
- | ||
+ | ||
if (search_state.te | ||
{ | ||
POP (search_state.ba | ||
search_state.bac | ||
goto test_do_return; | ||
} | ||
- | ||
- /* If a non-longest match was found and that is good | ||
+ | ||
+ /* If a non-longest match was found and that is good | ||
* enough, return immediately. | ||
*/ | ||
if ( (search_state.te | ||
@@ -3057,7 +3057,7 @@ rx_search (rxb, startpos, range, stop, total_size, | ||
search_state.bac | ||
goto test_do_return; | ||
} | ||
- | ||
+ | ||
search_state.tes | ||
search_state.las | ||
search_state.las | ||
@@ -3067,7 +3067,7 @@ rx_search (rxb, startpos, range, stop, total_size, | ||
#ifdef RX_DEBUG | ||
search_state.lin | ||
#endif | ||
- | ||
+ | ||
if (rxb->match_regs | ||
{ | ||
int x; | ||
@@ -3079,7 +3079,7 @@ rx_search (rxb, startpos, range, stop, total_size, | ||
for (x = 0; x <= search_state.las | ||
search_state.rpa | ||
} | ||
- | ||
+ | ||
{ | ||
int x; | ||
try_burst_2: | ||
@@ -3107,8 +3107,8 @@ rx_search (rxb, startpos, range, stop, total_size, | ||
search_state.tes | ||
goto while_non_det_op | ||
} | ||
- | ||
- | ||
+ | ||
+ | ||
case rx_cache_miss: | ||
/* Because the superstate NFA is lazily constructed, | ||
* and in fact may erode from underneath us, we sometimes | ||
@@ -3125,14 +3125,14 @@ rx_search (rxb, startpos, range, stop, total_size, | ||
goto test_do_return; | ||
} | ||
goto restart; | ||
- | ||
+ | ||
case rx_backtrack: | ||
/* RX_BACKTRACK means that we've reached the empty | ||
* superstate, indicating that match can't succeed | ||
* from this point. | ||
*/ | ||
goto test_do_return; | ||
- | ||
+ | ||
case rx_next_char: | ||
case rx_error_inx: | ||
case rx_num_instructi | ||
@@ -3141,21 +3141,21 @@ rx_search (rxb, startpos, range, stop, total_size, | ||
} | ||
goto pseudo_while_1; | ||
} | ||
- | ||
- /* Healthy exits from the test-match loop do a | ||
- * `goto return_from_test | ||
+ | ||
+ /* Healthy exits from the test-match loop do a | ||
+ * `goto return_from_test | ||
* we might end up here. | ||
*/ | ||
error_in_testing | ||
test_state = rx_test_error; | ||
goto test_returns_to_ | ||
- | ||
+ | ||
/***** fastmap/search loop body | ||
* considering the results testing for a match | ||
*/ | ||
- | ||
+ | ||
return_from_test | ||
- | ||
+ | ||
if (search_state.be | ||
{ | ||
if (regs && (regs->start != search_state.bes | ||
@@ -3185,7 +3185,7 @@ rx_search (rxb, startpos, range, stop, total_size, | ||
test_state = rx_test_fail; | ||
goto test_returns_to_ | ||
} | ||
- | ||
+ | ||
test_return_cont | ||
search_state.tes | ||
test_state = rx_test_continua | ||
@@ -3203,16 +3203,16 @@ rx_search (rxb, startpos, range, stop, total_size, | ||
/* Integers are used to represent side effects. | ||
* | ||
* Simple side effects are given negative integer names by these enums. | ||
- * | ||
+ * | ||
* Non-negative names are reserved for complex effects. | ||
* | ||
- * Complex effects are those that take arguments. For example, | ||
+ * Complex effects are those that take arguments. For example, | ||
* a register assignment associated with a group is complex because | ||
* it requires an argument to tell which group is being matched. | ||
- * | ||
+ * | ||
* The integer name of a complex effect is an index into rxb->se_params. | ||
*/ | ||
- | ||
+ | ||
RX_DEF_SE(1, re_se_try, = -1) /* Epsilon from start state */ | ||
RX_DEF_SE(0, re_se_pushback, = re_se_try - 1) | ||
@@ -3228,15 +3228,15 @@ rx_search (rxb, startpos, range, stop, total_size, | ||
RX_DEF_SE(1, re_se_begbuf, = re_se_not_syntax | ||
RX_DEF_SE(1, re_se_hat, = re_se_begbuf - 1) /* match beginning of line */ | ||
- RX_DEF_SE(1, re_se_wordbeg, = re_se_hat - 1) | ||
+ RX_DEF_SE(1, re_se_wordbeg, = re_se_hat - 1) | ||
RX_DEF_SE(1, re_se_wordbound, | ||
RX_DEF_SE(1, re_se_notwordbou | ||
RX_DEF_SE(1, re_se_wordend, = re_se_notwordbou | ||
RX_DEF_SE(1, re_se_endbuf, = re_se_wordend - 1) | ||
- /* This fails except at the end of a line. | ||
- * It deserves to go here since it is typicly one of the last steps | ||
+ /* This fails except at the end of a line. | ||
+ * It deserves to go here since it is typicly one of the last steps | ||
* in a match. | ||
*/ | ||
RX_DEF_SE(1, re_se_dollar, = re_se_endbuf - 1) | ||
@@ -3244,7 +3244,7 @@ rx_search (rxb, startpos, range, stop, total_size, | ||
/* Simple effects: */ | ||
RX_DEF_SE(1, re_se_fail, = re_se_dollar - 1) | ||
- /* Complex effects. These are used in the 'se' field of | ||
+ /* Complex effects. These are used in the 'se' field of | ||
* a struct re_se_params. Indexes into the se array | ||
* are stored as instructions on nfa edges. | ||
*/ | ||
@@ -3252,7 +3252,7 @@ rx_search (rxb, startpos, range, stop, total_size, | ||
RX_DEF_CPLX_SE(1 | ||
RX_DEF_CPLX_SE(1 | ||
RX_DEF_CPLX_SE(0 | ||
- RX_DEF_CPLX_SE(0 | ||
+ RX_DEF_CPLX_SE(0 | ||
RX_DEF_CPLX_SE(0 | ||
RX_DEF_CPLX_SE(0 | ||
@@ -1,5 +1,5 @@ | ||
// This may look like C code, but it is really -*- C++ -*- | ||
-/* | ||
+/* | ||
Copyright (C) 1988, 1992 Free Software Foundation | ||
written by Doug Lea (dl@rocky.oswego | ||
@@ -24,7 +24,7 @@ Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. | ||
#include <stdlib.h> | ||
#include <string.h> | ||
#include <unistd.h> | ||
-#include <stdio.h> | ||
+#include <stdio.h> | ||
#include <errno.h> | ||
#include <fcntl.h> | ||
@@ -32,4 +32,4 @@ extern "C" { | ||
int strcasecmp _G_ARGS((const char*, const char*)); | ||
} | ||
-#endif | ||
+#endif |
@@ -1,4 +1,4 @@ | ||
-/* | ||
+/* | ||
Copyright (C) 1993 Free Software Foundation | ||
This file is part of the GNU IO Library. This library is free |
@@ -314,7 +314,7 @@ struct streambuf : public _IO_FILE { // protected?? | ||
void setp(char* p, char* ep) | ||
{ _IO_write_base=_ | ||
void setg(char* eb, char* g, char *eg) { | ||
- if (_IO_file_flags & _IO_IN_BACKUP) _IO_free_backup_ | ||
+ if (_IO_file_flags & _IO_IN_BACKUP) _IO_free_backup_ | ||
_IO_read_base = eb; _IO_read_ptr = g; _IO_read_end = eg; } | ||
char *shortbuf() { return _shortbuf; } | ||
@@ -336,7 +336,7 @@ struct streambuf : public _IO_FILE { // protected?? | ||
void unsave_markers() | ||
int put_mode() { return _flags & _IO_CURRENTLY_PU | ||
int switch_to_get_mo | ||
- | ||
+ | ||
streambuf(int flags=0); | ||
public: | ||
static int flush_all(); |
@@ -1,4 +1,4 @@ | ||
-/* | ||
+/* | ||
Copyright (C) 1993 Free Software Foundation | ||
This file is part of the GNU IO Library. This library is free |
@@ -1,4 +1,4 @@ | ||
-/* | ||
+/* | ||
Copyright (C) 1990, 1992 Free Software Foundation | ||
written by Doug Lea (dl@rocky.oswego | ||
@@ -22,9 +22,9 @@ Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. | ||
/* Timing functions from Doug Schmidt... */ | ||
/* no such thing as "negative time"! */ | ||
-#define TIMER_ERROR_VALU | ||
+#define TIMER_ERROR_VALU | ||
-/* If this does not work on your system, change this to #if 0, and | ||
+/* If this does not work on your system, change this to #if 0, and | ||
report the problem. */ | ||
#if 1 | ||
@@ -73,7 +73,7 @@ return_elapsed_t | ||
{ | ||
if (!Timer_Set) { | ||
return(TIMER_ERR | ||
- } | ||
+ } | ||
else { | ||
/* get process time */ | ||
#ifdef USE_TIMES | ||
@@ -85,8 +85,8 @@ return_elapsed_t | ||
#ifdef USE_TIMES | ||
return((double) (New_Time.tms_ut | ||
#else | ||
- return((New_Time | ||
- ((New_Time.ru_ut | ||
+ return((New_Time | ||
+ ((New_Time.ru_ut | ||
/ 1000000.0)); | ||
#endif | ||
} | ||
@@ -94,7 +94,7 @@ return_elapsed_t | ||
#ifdef USE_TIMES | ||
return((double) New_Time.tms_uti | ||
#else | ||
- return((New_Time | ||
+ return((New_Time | ||
(New_Time.ru_uti | ||
#endif | ||
} | ||
@@ -115,7 +115,7 @@ getrusage(int dummy,struct rusage* time){ | ||
/* we subtract an offset to make sure that the number fits in a long int*/ | ||
rtime=rtime/1.0e | ||
time->ru_utime.t | ||
- rtime=(rtime-tim | ||
+ rtime=(rtime-tim | ||
time->ru_utime.t | ||
} | ||
#endif |
@@ -666,7 +666,7 @@ strerror (errnoval) | ||
/* In range, and a valid message. Just return the message. */ | ||
msg = (char *) sys_errlist[errn | ||
} | ||
- | ||
+ | ||
return (msg); | ||
} | ||
@@ -448,7 +448,7 @@ strsignal (signo) | ||
/* In range, and a valid message. Just return the message. */ | ||
msg = (const char *) sys_siglist[sign | ||
} | ||
- | ||
+ | ||
return (msg); | ||
} | ||
@@ -1,4 +1,4 @@ | ||
-/* | ||
+/* | ||
Copyright (C) 1993 Free Software Foundation | ||
This file is part of the GNU IO Library. This library is free | ||
@@ -74,7 +74,7 @@ _IO_file_doalloc | ||
if (_IO_cleanup_reg | ||
(*_IO_cleanup_re | ||
- | ||
+ | ||
if (fp->_fileno < 0 || fp->_jumps->__st | ||
{ | ||
couldbetty = 0; |
@@ -1,4 +1,4 @@ | ||
-/* | ||
+/* | ||
Copyright (C) 1993 Free Software Foundation | ||
This file is part of the GNU IO Library. This library is free | ||
@@ -68,14 +68,14 @@ extern int errno; | ||
(The pointers save_gptr() and save_egptr() are the values | ||
of gptr() and egptr() at the time putback mode was entered.) | ||
The OS position corresponds to that of save_egptr(). | ||
- | ||
+ | ||
LINE BUFFERED OUTPUT: | ||
During line buffered output, pbase()==base() && epptr()==base(). | ||
However, ptr() may be anywhere between base() and ebuf(). | ||
This forces a call to filebuf::overflo | ||
If there is more space in the buffer, and C is not a '\n', | ||
then C is inserted, and pptr() incremented. | ||
- | ||
+ | ||
UNBUFFERED STREAMS: | ||
If a filebuf is unbuffered(), the _shortbuf[1] is used as the buffer. | ||
*/ | ||
@@ -108,7 +108,7 @@ _IO_file_close_i | ||
_IO_unsave_marke | ||
status = fp->_jumps->__cl | ||
- | ||
+ | ||
/* Free buffer. */ | ||
_IO_setb(fp, NULL, NULL, 0); | ||
_IO_setg(fp, NULL, NULL, NULL); | ||
@@ -228,7 +228,7 @@ _IO_do_write(fp, | ||
unpredictable. */ | ||
fp->_offset = _IO_pos_BAD; | ||
else if (fp->_IO_read_en | ||
- { | ||
+ { | ||
_IO_pos_t new_pos = fp->_jumps->__se | ||
if (new_pos == _IO_pos_BAD) | ||
return EOF; | ||
@@ -337,7 +337,7 @@ _IO_file_sync(fp | ||
/* char* ptr = cur_ptr(); */ | ||
if (fp->_IO_write_p | ||
if (_IO_do_flush(fp | ||
- delta = fp->_IO_read_ptr | ||
+ delta = fp->_IO_read_ptr | ||
if (delta != 0) | ||
{ | ||
#ifdef TODO | ||
@@ -643,7 +643,7 @@ _IO_file_xsputn( | ||
if (_IO_do_write(f, | ||
return n - to_do; | ||
to_do = dont_write; | ||
- | ||
+ | ||
/* Now write out the remainder. Normally, this will fit in the | ||
buffer, but it's somewhat messier for line-buffered files, | ||
so we let _IO_default_xspu | ||
@@ -710,7 +710,7 @@ _IO_file_xsgetn( | ||
else | ||
fp->_flags |= _IO_ERR_SEEN, count = 0; | ||
} | ||
- | ||
+ | ||
s += count; | ||
more -= count; | ||
} |
@@ -1,4 +1,4 @@ | ||
-/* | ||
+/* | ||
Copyright (C) 1993 Free Software Foundation | ||
This file is part of the GNU IO Library. This library is free |
@@ -1,4 +1,4 @@ | ||
-/* | ||
+/* | ||
Copyright (C) 1993 Free Software Foundation | ||
This file is part of the GNU IO Library. This library is free | ||
@@ -589,7 +589,7 @@ int | ||
_IO_get_column(f | ||
register _IO_FILE *fp; | ||
{ | ||
- if (fp->_cur_column | ||
+ if (fp->_cur_column | ||
return _IO_adjust_colum | ||
fp->_IO_write_ba | ||
fp->_IO_write_pt | ||
@@ -636,7 +636,7 @@ _IO_cleanup () | ||
So it is possible that other static destructord might want to | ||
write to cout - and they're supposed to be able to do so. | ||
- The following will make the standard streambufs be unbuffered, | ||
+ The following will make the standard streambufs be unbuffered, | ||
which forces any output from late destructors to be written out. */ | ||
_IO_unbuffer_all | ||
} | ||
@@ -652,7 +652,7 @@ void _IO_init_marker( | ||
marker->_pos = fp->_IO_read_ptr | ||
else | ||
marker->_pos = fp->_IO_read_ptr | ||
- | ||
+ | ||
/* Should perhaps sort the chain? */ | ||
marker->_next = fp->_markers; | ||
fp->_markers = marker; | ||
@@ -776,7 +776,7 @@ _IO_default_pbac | ||
/* Need to handle a filebuf in write mode (switch to read mode). FIXME!*/ | ||
if (_IO_have_backup | ||
_IO_switch_to_ba | ||
- | ||
+ | ||
if (!_IO_have_backu | ||
{ | ||
/* No backup buffer: allocate one. */ | ||
@@ -860,7 +860,7 @@ _IO_default_writ | ||
struct __io_defs { | ||
__io_defs() { } | ||
~__io_defs() { _IO_cleanup(); } | ||
-}; | ||
+}; | ||
__io_defs io_defs__; | ||
#endif | ||
@@ -1,4 +1,4 @@ | ||
-/* | ||
+/* | ||
Copyright (C) 1993 Free Software Foundation | ||
This file is part of the GNU IO Library. This library is free |
@@ -1,4 +1,4 @@ | ||
-/* | ||
+/* | ||
Copyright (C) 1993 Free Software Foundation | ||
This file is part of the GNU IO Library. This library is free |
@@ -1,4 +1,4 @@ | ||
-/* | ||
+/* | ||
Copyright (C) 1993 Free Software Foundation | ||
This file is part of the GNU IO Library. This library is free |
@@ -1,4 +1,4 @@ | ||
-/* | ||
+/* | ||
Copyright (C) 1993 Free Software Foundation | ||
This file is part of the GNU IO Library. This library is free |
@@ -1,4 +1,4 @@ | ||
-/* | ||
+/* | ||
Copyright (C) 1993 Free Software Foundation | ||
This file is part of the GNU IO Library. This library is free |
@@ -1,4 +1,4 @@ | ||
-/* | ||
+/* | ||
Copyright (C) 1994 Free Software Foundation | ||
This file is part of the GNU IO Library. This library is free |
@@ -1,4 +1,4 @@ | ||
-/* | ||
+/* | ||
Copyright (C) 1993 Free Software Foundation | ||
This file is part of the GNU IO Library. This library is free |
@@ -1,4 +1,4 @@ | ||
-/* | ||
+/* | ||
Copyright (C) 1993 Free Software Foundation | ||
This file is part of the GNU IO Library. This library is free |
@@ -1,4 +1,4 @@ | ||
-/* | ||
+/* | ||
Copyright (C) 1993 Free Software Foundation | ||
This file is part of the GNU IO Library. This library is free | ||
@@ -40,7 +40,7 @@ _IO_padn(fp, pad, count) | ||
const char *padptr; | ||
register int i; | ||
_IO_size_t written = 0, w; | ||
- | ||
+ | ||
if (pad == ' ') | ||
padptr = blanks; | ||
else if (pad == '0') | ||
@@ -57,7 +57,7 @@ _IO_padn(fp, pad, count) | ||
if (w != PADSIZE) | ||
return written; | ||
} | ||
- | ||
+ | ||
if (i > 0) | ||
{ | ||
w = _IO_sputn(fp, padptr, i); |
@@ -1,4 +1,4 @@ | ||
-/* | ||
+/* | ||
Copyright (C) 1993 Free Software Foundation | ||
This file is part of the GNU IO Library. This library is free | ||
@@ -170,7 +170,7 @@ _IO_proc_close(f | ||
_IO_proc_file **ptr = &proc_file_chain | ||
_IO_pid_t wait_pid; | ||
int status = -1; | ||
- | ||
+ | ||
/* Unlink from proc_file_chain. | ||
[diff truncated] |