14 int c_rewind(char *p);
51 printf("Usage: open name\n");
54 if (!(is = is_open(p, 1)))
63 printf("Open first.\n");
70 int c_write(char *p) {}
74 char line[100], buf[1024], ch;
81 printf("Open first.\n");
84 if (!sscanf(p, "%d", &val))
86 printf("Usage: merge <address>\n");
89 printf("Enter pairs of <operation> <key>. Terminate with '.'\n");
90 while (gets(line) && *line != '.')
92 if (sscanf(line, "%d %d", &op, &key) < 2)
94 printf("Error in input\n");
99 memcpy(buf + pos, &key, sizeof(key));
103 printf("is_merge(-->%d) returns: %d\n", val, is_merge(is, val, num , buf));
107 int c_rewind(char *p)
111 printf("Open first.\n");
116 int c_read(char *p) {}
127 printf("ISSH: ISAM debugging shell.\n");
128 printf("Commands:\n");
129 for (i = 0; cmdl[i].word; i++)
130 printf(" %s %s\n", cmdl[i].word, cmdl[i].fun ? "": "UNDEFINED");
137 static char word[1024] = "help", arg[1024] = "";
140 log_init(LOG_ALL, "issh", 0);
142 assert(common_resource = res_open("testres"));
152 if (*line && sscanf(line, "%s %[^;]", word, arg) < 1)
154 for (i = 0; cmdl[i].word; i++)
155 if (!strncmp(cmdl[i].word, word, strlen(word)))
157 printf("%s\n", (*cmdl[i].fun)(arg) == 0 ? "OK" : "FAILED");