15 int c_rewind(char *p);
52 printf("Usage: open name\n");
55 if (!(is = is_open(p, 1)))
64 printf("Open first.\n");
71 int c_write(char *p) {}
75 char line[100], buf[1024], ch;
82 printf("Open first.\n");
85 if (!sscanf(p, "%d", &val))
87 printf("Usage: merge <address>\n");
90 printf("Enter pairs of <operation> <key>. Terminate with '.'\n");
91 while (gets(line) && *line != '.')
93 if (sscanf(line, "%d %d", &op, &key) < 2)
95 printf("Error in input\n");
100 memcpy(buf + pos, &key, sizeof(key));
104 printf("is_merge(-->%d) returns: %d\n", val, is_merge(is, val, num , buf));
108 int c_rewind(char *p)
112 printf("Open first.\n");
117 int c_read(char *p) {}
128 printf("ISSH: ISAM debugging shell.\n");
129 printf("Commands:\n");
130 for (i = 0; cmdl[i].word; i++)
131 printf(" %s %s\n", cmdl[i].word, cmdl[i].fun ? "": "UNDEFINED");
138 static char word[1024] = "help", arg[1024] = "";
141 log_init(LOG_ALL, "issh", 0);
143 assert(common_resource = res_open("testres"));
153 if (*line && sscanf(line, "%s %[^;]", word, arg) < 1)
155 for (i = 0; cmdl[i].word; i++)
156 if (!strncmp(cmdl[i].word, word, strlen(word)))
158 printf("%s\n", (*cmdl[i].fun)(arg) == 0 ? "OK" : "FAILED");