1 /* $Id: issh.c,v 1.6 2002-08-02 19:26:56 adam Exp $
2 Copyright (C) 1995,1996,1997,1998,1999,2000,2001,2002
5 This file is part of the Zebra server.
7 Zebra is free software; you can redistribute it and/or modify it under
8 the terms of the GNU General Public License as published by the Free
9 Software Foundation; either version 2, or (at your option) any later
12 Zebra is distributed in the hope that it will be useful, but WITHOUT ANY
13 WARRANTY; without even the implied warranty of MERCHANTABILITY or
14 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
17 You should have received a copy of the GNU General Public License
18 along with Zebra; see the file LICENSE.zebra. If not, write to the
19 Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
38 int c_rewind(char *p);
75 printf("Usage: open name\n");
78 if (!(is = is_open(p, 1)))
87 printf("Open first.\n");
94 int c_write(char *p) {}
98 char line[100], buf[1024], ch;
105 printf("Open first.\n");
108 if (!sscanf(p, "%d", &val))
110 printf("Usage: merge <address>\n");
113 printf("Enter pairs of <operation> <key>. Terminate with '.'\n");
114 while (gets(line) && *line != '.')
116 if (sscanf(line, "%d %d", &op, &key) < 2)
118 printf("Error in input\n");
123 memcpy(buf + pos, &key, sizeof(key));
127 printf("is_merge(-->%d) returns: %d\n", val, is_merge(is, val, num , buf));
131 int c_rewind(char *p)
135 printf("Open first.\n");
140 int c_read(char *p) {}
151 printf("ISSH: ISAM debugging shell.\n");
152 printf("Commands:\n");
153 for (i = 0; cmdl[i].word; i++)
154 printf(" %s %s\n", cmdl[i].word, cmdl[i].fun ? "": "UNDEFINED");
161 static char word[1024] = "help", arg[1024] = "";
164 log_init(LOG_ALL, "issh", 0);
166 common_resource = res_open("testres");
167 assert(common_resource);
176 if (*line && sscanf(line, "%s %[^;]", word, arg) < 1)
178 for (i = 0; cmdl[i].word; i++)
179 if (!strncmp(cmdl[i].word, word, strlen(word)))
181 printf("%s\n", (*cmdl[i].fun)(arg) == 0 ? "OK" : "FAILED");