Redundant information. Allows making sense of input without context.
The redundancy could help making a journal replay tool more robust.
* journal.h: Log a journal of events to a file
*
* Known contributors to this file:
- * Markus Armbruster, 2004-2008
+ * Markus Armbruster, 2004-2011
*/
#ifndef JOURNAL_H
void journal_logout(void);
void journal_prng(unsigned);
void journal_input(char *);
+void journal_command(char *);
void journal_update(int);
#endif
* Known contributors to this file:
* Dave Pare, 1994
* Steve McClure, 1998
- * Markus Armbruster, 2007-2009
+ * Markus Armbruster, 2007-2011
*/
#include <config.h>
#include "com.h"
#include "empio.h"
#include "file.h"
+#include "journal.h"
#include "match.h"
#include "misc.h"
#include "nat.h"
uprnf(buf);
pr("\n");
}
+ journal_command(command->c_form);
switch (command->c_addr()) {
case RET_OK:
player->btused += command->c_cost;
* journal.c: Log a journal of events to a file
*
* Known contributors to this file:
- * Markus Armbruster, 2004-2008
+ * Markus Armbruster, 2004-2011
* Ron Koenderink, 2008
*/
* prng NAME SEED
* login CNUM HOSTADDR USER
* logout CNUM
+ * command NAME
* input INPUT
* update ETU
*/
journal_entry("input %s", input);
}
+void
+journal_command(char *cmd)
+{
+ char *eptr = strchr(cmd, ' ');
+ journal_entry("command %.*s", eptr ? (int)(eptr - cmd) : -1, cmd);
+}
+
void
journal_update(int etu)
{