2 * Excersizer-application for the isam subsystem. Don't play with it.
18 int c_rewind(char *p);
55 printf("Usage: open name\n");
58 if (!(is = is_open(p, 1)))
67 printf("Open first.\n");
74 int c_write(char *p) {}
78 char line[100], buf[1024], ch;
85 printf("Open first.\n");
88 if (!sscanf(p, "%d", &val))
90 printf("Usage: merge <address>\n");
93 printf("Enter pairs of <operation> <key>. Terminate with '.'\n");
94 while (gets(line) && *line != '.')
96 if (sscanf(line, "%d %d", &op, &key) < 2)
98 printf("Error in input\n");
103 memcpy(buf + pos, &key, sizeof(key));
107 printf("is_merge(-->%d) returns: %d\n", val, is_merge(is, val, num , buf));
111 int c_rewind(char *p)
115 printf("Open first.\n");
120 int c_read(char *p) {}
131 printf("ISSH: ISAM debugging shell.\n");
132 printf("Commands:\n");
133 for (i = 0; cmdl[i].word; i++)
134 printf(" %s %s\n", cmdl[i].word, cmdl[i].fun ? "": "UNDEFINED");
141 static char word[1024] = "help", arg[1024] = "";
144 log_init(LOG_ALL, "issh", 0);
146 common_resource = res_open("testres");
147 assert(common_resource);
156 if (*line && sscanf(line, "%s %[^;]", word, arg) < 1)
158 for (i = 0; cmdl[i].word; i++)
159 if (!strncmp(cmdl[i].word, word, strlen(word)))
161 printf("%s\n", (*cmdl[i].fun)(arg) == 0 ? "OK" : "FAILED");