+2005-11-07 Carl Worth <cworth@cworth.org>
+
+ * src/ttt.h: Grab some useful definitions from wdo.h:
+ ASSERT_NOT_REACHEED and TTT_PRINTF_FORMAT. Add several needed
+ include directives.
+
+ * src/Makefile.am: Rip out not-yet existing ttt-command and
+ ttt-error.
+
+ * src/ttt-args.c: (ttt_args_parse): Track name change from
+ args_help to ttt_args_help.
+
+ * src/ttt.c: Remove in favor of ttt-server.c and ttt-client.c.
+
+ * src/x.h: Add prototype for xfwrite.
+
2005-11-05 Richard D. Worth <richard@theworths.org>
* src/ttt-board.c: (ttt_board_init): Added for loop counter init.
ttt-args.h \
ttt-board.c \
ttt-board.h \
- ttt-command.c \
- ttt-command.h \
- ttt-error.c \
- ttt-error.h \
x.c \
x.h
break;
case 'h':
- args_help (argv0);
+ ttt_args_help (argv0);
exit (0);
break;
case '?':
- args_help (argv0);
+ ttt_args_help (argv0);
exit (1);
break;
if (argc - optind == 1) {
args->file = argv[optind];
} else {
- args_usage (argv0);
+ ttt_args_usage (argv0);
}
*/
--- /dev/null
+/* ttt.c - client-server tic-tac-toe game
+ *
+ * Copyright © 2005 Carl Worth
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2, or (at your option)
+ * any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ *
+ * Author: Carl Worth <cworth@cworth.org>
+ */
+
+#include "ttt.h"
+
+int
+main (int argc, char **argv)
+{
+ ttt_args_t args;
+ int args_first;
+
+ ttt_args_parse (&args, argc, argv, &args_first);
+
+ /* XXX: insert code here */
+
+ return 0;
+}
--- /dev/null
+/* ttt.c - client-server tic-tac-toe game
+ *
+ * Copyright © 2005 Carl Worth
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2, or (at your option)
+ * any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ *
+ * Author: Carl Worth <cworth@cworth.org>
+ */
+
+#include "ttt.h"
+
+int
+main (int argc, char **argv)
+{
+ ttt_args_t args;
+ int args_first;
+
+ ttt_args_parse (&args, argc, argv, &args_first);
+
+ /* XXX: insert code here */
+
+ return 0;
+}
+++ /dev/null
-/* ttt.c - client-server tic-tac-toe game
- *
- * Copyright © 2005 Carl Worth
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2, or (at your option)
- * any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- *
- * Author: Carl Worth <cworth@cworth.org>
- */
-
-#include "ttt.h"
-
-int
-main (int argc, char **argv)
-{
- args_t args;
- int args_first;
-
- args_parse (&args, argc, argv, &args_first);
-
- /* XXX: insert code here */
-
- return 0;
-}
#include "config.h"
#endif
-#include "args.h"
+/* We use _GNU_SOURCE to get things like asprintf. */
+#define _GNU_SOURCE
+#include <stdio.h>
+#include <stdlib.h>
+#include <unistd.h>
+#include <assert.h>
+#include <string.h>
+#include <errno.h>
+#include <ctype.h>
+
+#define ASSERT_NOT_REACHED \
+do { \
+ static const int NOT_REACHED = 0; \
+ assert (NOT_REACHED); \
+ exit (1); \
+} while (0)
+
+#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ > 4)
+#define TTT_PRINTF_FORMAT(fmt_index, va_index) \
+ __attribute__((__format__(__printf__, fmt_index, va_index)))
+#else
+#define TTT_PRINTF_FORMAT(fmt_index, va_index)
+#endif
+
+#include "ttt-args.h"
+#include "x.h"
#endif
#define _X_H_
void
-xasprintf (char **strp, const char *fmt, ...) WDO_PRINTF_FORMAT(2, 3);
+xasprintf (char **strp, const char *fmt, ...) TTT_PRINTF_FORMAT(2, 3);
void
xvasprintf (char **strp, const char *fmt, va_list ap);
char *
xstrdup (const char *s);
+void
+xfwrite (const void *ptr, size_t size, size_t nmemb, FILE *stream);
+
#endif /* _X_H_ */