X-Git-Url: https://plomlompom.com/repos/foo.html?a=blobdiff_plain;ds=sidebyside;f=src%2Fclient%2Fcommand_db.c;h=68d4ce2dfd7f8908dd188d85b39195e7337fef59;hb=f4993573d69a6a5b1887ad6a9fa65b3fdcd565de;hp=29ef83dbbea5d59a8f15b656e60b4fa8aa6bfc3c;hpb=d361b21fb63d9e1fd2ff7774c2322fab3e4eb239;p=plomrogue
diff --git a/src/client/command_db.c b/src/client/command_db.c
index 29ef83d..68d4ce2 100644
--- a/src/client/command_db.c
+++ b/src/client/command_db.c
@@ -1,4 +1,9 @@
-/* src/client/command_db.c */
+/* src/client/command_db.c
+ *
+ * This file is part of PlomRogue. PlomRogue is licensed under the GPL version 3
+ * or any later version. For details on its copyright, license, and warranties,
+ * see the file NOTICE in the root directory of the PlomRogue source package.
+ */
#define _POSIX_C_SOURCE 200809L /* strdup() */
#include "command_db.h"
@@ -6,12 +11,12 @@
#include /* uint8_t */
#include /* free() */
#include /* strcmp(), strdup() */
-#include "../common/parse_file.h" /* EDIT_STARTED,parse_init_entry(),
- * parse_id_uniq(), parse_unknown_arg(),
- * parsetest_too_many_values(), parse_file(),
- * parse_and_reduce_to_readyflag(),parse_val()
- */
#include "array_append.h" /* array_append() */
+#include "parse.h" /* EDIT_STARTED, parse_init_entry(), parse_id_uniq(),
+ * parse_unknown_arg(), parsetest_too_many_values(),
+ * parse_file(), parse_and_reduce_to_readyflag(),
+ * parse_flagval()
+ */
#include "world.h" /* global world */
#include "cleanup.h" /* set_cleanup_flag() */
@@ -64,14 +69,14 @@ static void tokens_into_entries(char * token0, char * token1)
cmd = (struct Command *) parse_init_entry(&cmd_flags,
sizeof(struct Command));
cmd->dsc_short = strdup(token1);
- parse_id_uniq(NULL != get_command(cmd->dsc_short));
+ parse_id_uniq(!(!get_command(cmd->dsc_short)));
}
- else if (!( parse_val(token0, token1, "DESCRIPTION", &cmd_flags,
- DESC_SET, 's', (char *) &cmd->dsc_long)
- || parse_val(token0, token1, "SERVER_COMMAND", &cmd_flags,
- SERVERCMD_SET, 's', (char *) &cmd->server_msg)
- || parse_val(token0, token1, "SERVER_ARGUMENT", &cmd_flags,
- SERVERARG_SET, 'c', (char *) &cmd->arg)))
+ else if (!( parse_flagval(token0, token1, "DESCRIPTION", &cmd_flags,
+ DESC_SET, 's', (char *) &cmd->dsc_long)
+ || parse_flagval(token0, token1,"SERVER_COMMAND", &cmd_flags,
+ SERVERCMD_SET, 's',(char *)&cmd->server_msg)
+ || parse_flagval(token0, token1,"SERVER_ARGUMENT",&cmd_flags,
+ SERVERARG_SET, 'c', (char *) &cmd->arg)))
{
parse_unknown_arg();
}