-/* $OpenBSD: gomoku.h,v 1.2 1996/12/21 21:17:50 tholo Exp $ */
+/* $OpenBSD: gomoku.h,v 1.3 1997/01/26 08:00:52 downsj Exp $ */
/*
* Copyright (c) 1994
* The Regents of the University of California. All rights reserved.
extern void panic __P((char *));
extern int pickmove __P((int));
extern void printcombo __P((struct combostr *, char *));
+extern void qlog __P((char *));
extern void quit __P((int));
extern int readinput __P((FILE *));
extern void scanframes __P((int));
-/* $OpenBSD: main.c,v 1.6 1997/01/15 23:40:49 millert Exp $ */
+/* $OpenBSD: main.c,v 1.7 1997/01/26 08:00:53 downsj Exp $ */
/*
* Copyright (c) 1994
* The Regents of the University of California. All rights reserved.
printf("%s\n", str);
}
+/*
+ * Deal with a fatal error.
+ */
+void
+qlog(str)
+ char *str;
+{
+ dlog(str);
+ if (interactive)
+ beep();
+ sleep(5);
+ quit(0);
+}
+
/* ARGSUSED */
void
quit(sig)
-/* $OpenBSD: pickmove.c,v 1.3 1996/12/21 21:17:52 tholo Exp $ */
+/* $OpenBSD: pickmove.c,v 1.4 1997/01/26 08:00:54 downsj Exp $ */
/*
* Copyright (c) 1994
* The Regents of the University of California. All rights reserved.
/* make a new combo! */
ncbp = (struct combostr *)malloc(sizeof(struct combostr) +
2 * sizeof(struct combostr *));
+ if (ncbp == (struct combostr *)NULL)
+ qlog("Memory allocation failure.");
scbpp = (struct combostr **)(ncbp + 1);
fcbp = fsp->s_frame[r];
if (ocbp < fcbp) {
/* make a new combo! */
ncbp = (struct combostr *)malloc(sizeof(struct combostr) +
(cbp->c_nframes + 1) * sizeof(struct combostr *));
+ if (ncbp == (struct combostr *)NULL)
+ qlog("Memory allocation failure.");
scbpp = (struct combostr **)(ncbp + 1);
if (sortcombo(scbpp, (struct combostr **)(cbp + 1), ocbp)) {
free(ncbp);
/* add the combo to the list of empty spots */
nep = (struct elist *)malloc(sizeof(struct elist));
+ if (nep == (struct elist *)NULL)
+ qlog("Memory allocation failure.");
nep->e_combo = ocbp;
nep->e_off = s;
nep->e_frameindex = i;