+
+static int
+cmd_del (char *args)
+{
+ if (STRNEQ (args, "")) {
+ fprintf (stderr, _("hivexsh: '%s' command should not be given arguments\n"),
+ "del");
+ return -1;
+ }
+
+ if (cwd == hivex_root (h)) {
+ fprintf (stderr, _("hivexsh: del: the root node cannot be deleted\n"));
+ return -1;
+ }
+
+ hive_node_h new_cwd = hivex_node_parent (h, cwd);
+
+ if (hivex_node_delete_child (h, cwd) == -1) {
+ perror ("hivexsh: del");
+ return -1;
+ }
+
+ cwd = new_cwd;
+ set_prompt_string ();
+ return 0;
+}
+
+static int
+cmd_add (char *name)
+{
+ hive_node_h node = hivex_node_add_child (h, cwd, name);
+ if (node == 0) {
+ perror ("hivexsh: add");
+ return -1;
+ }
+ return 0;
+}