2005-07-22 01:48:47 +04:00
|
|
|
/* $NetBSD: scanform.c,v 1.45 2005/07/21 21:48:47 peter Exp $ */
|
Initial import of sushi.
Sushi is an interactive, menu-based program that is designed to aid
the user or administrator with administrative and complex tasks on thier
machines.
Sushi provides a menu of various functions that the user can perform on
his or her machine. Once the user selects a desired function, the
function is either performed outright, or in most cases, the user is
asked to fill in a simple form with required and option information,
which is then processed by sushi, and the action occurs.
The programming interface for sushi is very simple. There are
directories containing various files, such as menu indexes, or forms for
the user to fill out. These files are interpreted by sushi to generate
the menus the user sees on his/her screen. When the form is filled out
by the user, the entries are passed as command-line arguments to a
program, or script contained in one of the subdirectories. In this way,
it is possible to add new entries to the sushi menu structure, by simply
adding a new menu item, form and script, the binary does not need to be
recompiled to take advantage of this new menu.
2001-01-05 04:28:33 +03:00
|
|
|
|
|
|
|
/*
|
|
|
|
* Copyright (c) 2000 The NetBSD Foundation, Inc.
|
|
|
|
* All rights reserved.
|
|
|
|
*
|
2003-11-12 16:31:07 +03:00
|
|
|
* Copyright (c) 2000 Tim Rightnour <garbled@NetBSD.org>
|
Initial import of sushi.
Sushi is an interactive, menu-based program that is designed to aid
the user or administrator with administrative and complex tasks on thier
machines.
Sushi provides a menu of various functions that the user can perform on
his or her machine. Once the user selects a desired function, the
function is either performed outright, or in most cases, the user is
asked to fill in a simple form with required and option information,
which is then processed by sushi, and the action occurs.
The programming interface for sushi is very simple. There are
directories containing various files, such as menu indexes, or forms for
the user to fill out. These files are interpreted by sushi to generate
the menus the user sees on his/her screen. When the form is filled out
by the user, the entries are passed as command-line arguments to a
program, or script contained in one of the subdirectories. In this way,
it is possible to add new entries to the sushi menu structure, by simply
adding a new menu item, form and script, the binary does not need to be
recompiled to take advantage of this new menu.
2001-01-05 04:28:33 +03:00
|
|
|
*
|
|
|
|
* Redistribution and use in source and binary forms, with or without
|
|
|
|
* modification, are permitted provided that the following conditions
|
|
|
|
* are met:
|
|
|
|
* 1. Redistributions of source code must retain the above copyright
|
|
|
|
* notice, this list of conditions and the following disclaimer.
|
|
|
|
* 2. Redistributions in binary form must reproduce the above copyright
|
|
|
|
* notice, this list of conditions and the following disclaimer in the
|
|
|
|
* documentation and/or other materials provided with the distribution.
|
|
|
|
* 3. All advertising materials mentioning features or use of this software
|
|
|
|
* must display the following acknowledgement:
|
|
|
|
* This product includes software developed by the NetBSD
|
|
|
|
* Foundation, Inc. and its contributors.
|
|
|
|
* 4. Neither the name of The NetBSD Foundation nor the names of its
|
|
|
|
* contributors may be used to endorse or promote products derived
|
|
|
|
* from this software without specific prior written permission.
|
|
|
|
*
|
|
|
|
* THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
|
|
|
|
* ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
|
|
|
|
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
|
|
|
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
|
|
|
|
* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
|
|
|
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
|
|
|
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
|
|
|
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
|
|
|
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
|
|
|
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
|
|
|
* POSSIBILITY OF SUCH DAMAGE.
|
|
|
|
*/
|
|
|
|
|
2005-01-12 20:38:40 +03:00
|
|
|
#include <sys/param.h>
|
Initial import of sushi.
Sushi is an interactive, menu-based program that is designed to aid
the user or administrator with administrative and complex tasks on thier
machines.
Sushi provides a menu of various functions that the user can perform on
his or her machine. Once the user selects a desired function, the
function is either performed outright, or in most cases, the user is
asked to fill in a simple form with required and option information,
which is then processed by sushi, and the action occurs.
The programming interface for sushi is very simple. There are
directories containing various files, such as menu indexes, or forms for
the user to fill out. These files are interpreted by sushi to generate
the menus the user sees on his/her screen. When the form is filled out
by the user, the entries are passed as command-line arguments to a
program, or script contained in one of the subdirectories. In this way,
it is possible to add new entries to the sushi menu structure, by simply
adding a new menu item, form and script, the binary does not need to be
recompiled to take advantage of this new menu.
2001-01-05 04:28:33 +03:00
|
|
|
#include <sys/ioctl.h>
|
|
|
|
#include <sys/queue.h>
|
|
|
|
#include <sys/cdefs.h>
|
|
|
|
#include <sys/stat.h>
|
|
|
|
#include <sys/wait.h>
|
2005-01-12 20:38:40 +03:00
|
|
|
|
Initial import of sushi.
Sushi is an interactive, menu-based program that is designed to aid
the user or administrator with administrative and complex tasks on thier
machines.
Sushi provides a menu of various functions that the user can perform on
his or her machine. Once the user selects a desired function, the
function is either performed outright, or in most cases, the user is
asked to fill in a simple form with required and option information,
which is then processed by sushi, and the action occurs.
The programming interface for sushi is very simple. There are
directories containing various files, such as menu indexes, or forms for
the user to fill out. These files are interpreted by sushi to generate
the menus the user sees on his/her screen. When the form is filled out
by the user, the entries are passed as command-line arguments to a
program, or script contained in one of the subdirectories. In this way,
it is possible to add new entries to the sushi menu structure, by simply
adding a new menu item, form and script, the binary does not need to be
recompiled to take advantage of this new menu.
2001-01-05 04:28:33 +03:00
|
|
|
#include <ctype.h>
|
|
|
|
#include <dirent.h>
|
|
|
|
#include <err.h>
|
|
|
|
#include <errno.h>
|
|
|
|
#include <stdio.h>
|
|
|
|
#include <stdlib.h>
|
|
|
|
#include <string.h>
|
|
|
|
#include <unistd.h>
|
|
|
|
|
|
|
|
#include <curses.h>
|
|
|
|
#include <form.h>
|
|
|
|
#include <cdk/cdk.h>
|
|
|
|
|
|
|
|
#include "sushi.h"
|
|
|
|
#include "functions.h"
|
|
|
|
#include "scanform.h"
|
|
|
|
#include "formtree.h"
|
|
|
|
#include "handlers.h"
|
|
|
|
#include "run.h"
|
|
|
|
#include "blabel.h"
|
|
|
|
|
|
|
|
extern func_record func_map[];
|
|
|
|
extern CDKSCREEN *cdkscreen;
|
|
|
|
extern struct winsize ws;
|
|
|
|
extern nl_catd catalog;
|
|
|
|
extern char *lang_id;
|
2001-01-10 13:00:29 +03:00
|
|
|
extern char *keylabel[10];
|
|
|
|
extern chtype keybinding[10];
|
Initial import of sushi.
Sushi is an interactive, menu-based program that is designed to aid
the user or administrator with administrative and complex tasks on thier
machines.
Sushi provides a menu of various functions that the user can perform on
his or her machine. Once the user selects a desired function, the
function is either performed outright, or in most cases, the user is
asked to fill in a simple form with required and option information,
which is then processed by sushi, and the action occurs.
The programming interface for sushi is very simple. There are
directories containing various files, such as menu indexes, or forms for
the user to fill out. These files are interpreted by sushi to generate
the menus the user sees on his/her screen. When the form is filled out
by the user, the entries are passed as command-line arguments to a
program, or script contained in one of the subdirectories. In this way,
it is possible to add new entries to the sushi menu structure, by simply
adding a new menu item, form and script, the binary does not need to be
recompiled to take advantage of this new menu.
2001-01-05 04:28:33 +03:00
|
|
|
|
2005-01-12 20:38:40 +03:00
|
|
|
static void scan_formindex(struct cqForm *, char *);
|
2001-01-10 06:05:48 +03:00
|
|
|
|
Initial import of sushi.
Sushi is an interactive, menu-based program that is designed to aid
the user or administrator with administrative and complex tasks on thier
machines.
Sushi provides a menu of various functions that the user can perform on
his or her machine. Once the user selects a desired function, the
function is either performed outright, or in most cases, the user is
asked to fill in a simple form with required and option information,
which is then processed by sushi, and the action occurs.
The programming interface for sushi is very simple. There are
directories containing various files, such as menu indexes, or forms for
the user to fill out. These files are interpreted by sushi to generate
the menus the user sees on his/her screen. When the form is filled out
by the user, the entries are passed as command-line arguments to a
program, or script contained in one of the subdirectories. In this way,
it is possible to add new entries to the sushi menu structure, by simply
adding a new menu item, form and script, the binary does not need to be
recompiled to take advantage of this new menu.
2001-01-05 04:28:33 +03:00
|
|
|
static void
|
|
|
|
form_status(FORM *form)
|
|
|
|
{
|
|
|
|
char buf[20];
|
|
|
|
|
|
|
|
wstandout(stdscr);
|
2005-01-12 20:38:40 +03:00
|
|
|
mvwaddstr(stdscr, ws.ws_row - 3, 0, catgets(catalog, 4, 9,
|
2004-03-24 22:10:58 +03:00
|
|
|
"PGUP/PGDN to change page, UP/DOWN switch field, ENTER submit."));
|
Initial import of sushi.
Sushi is an interactive, menu-based program that is designed to aid
the user or administrator with administrative and complex tasks on thier
machines.
Sushi provides a menu of various functions that the user can perform on
his or her machine. Once the user selects a desired function, the
function is either performed outright, or in most cases, the user is
asked to fill in a simple form with required and option information,
which is then processed by sushi, and the action occurs.
The programming interface for sushi is very simple. There are
directories containing various files, such as menu indexes, or forms for
the user to fill out. These files are interpreted by sushi to generate
the menus the user sees on his/her screen. When the form is filled out
by the user, the entries are passed as command-line arguments to a
program, or script contained in one of the subdirectories. In this way,
it is possible to add new entries to the sushi menu structure, by simply
adding a new menu item, form and script, the binary does not need to be
recompiled to take advantage of this new menu.
2001-01-05 04:28:33 +03:00
|
|
|
wstandend(stdscr);
|
2003-07-16 10:40:47 +04:00
|
|
|
snprintf(buf, sizeof(buf), "%s (%d/%d)",
|
|
|
|
catgets(catalog, 4, 8, "Form Page:"),
|
2005-01-12 20:38:40 +03:00
|
|
|
form_page(form) + 1, form->max_page); /* XXX */
|
|
|
|
mvwaddstr(stdscr, ws.ws_row - 3, 62, buf);
|
Initial import of sushi.
Sushi is an interactive, menu-based program that is designed to aid
the user or administrator with administrative and complex tasks on thier
machines.
Sushi provides a menu of various functions that the user can perform on
his or her machine. Once the user selects a desired function, the
function is either performed outright, or in most cases, the user is
asked to fill in a simple form with required and option information,
which is then processed by sushi, and the action occurs.
The programming interface for sushi is very simple. There are
directories containing various files, such as menu indexes, or forms for
the user to fill out. These files are interpreted by sushi to generate
the menus the user sees on his/her screen. When the form is filled out
by the user, the entries are passed as command-line arguments to a
program, or script contained in one of the subdirectories. In this way,
it is possible to add new entries to the sushi menu structure, by simply
adding a new menu item, form and script, the binary does not need to be
recompiled to take advantage of this new menu.
2001-01-05 04:28:33 +03:00
|
|
|
wrefresh(stdscr);
|
|
|
|
}
|
|
|
|
|
2001-01-10 06:05:48 +03:00
|
|
|
static int
|
|
|
|
scan_form(struct cqForm *cqf, char *path)
|
Initial import of sushi.
Sushi is an interactive, menu-based program that is designed to aid
the user or administrator with administrative and complex tasks on thier
machines.
Sushi provides a menu of various functions that the user can perform on
his or her machine. Once the user selects a desired function, the
function is either performed outright, or in most cases, the user is
asked to fill in a simple form with required and option information,
which is then processed by sushi, and the action occurs.
The programming interface for sushi is very simple. There are
directories containing various files, such as menu indexes, or forms for
the user to fill out. These files are interpreted by sushi to generate
the menus the user sees on his/her screen. When the form is filled out
by the user, the entries are passed as command-line arguments to a
program, or script contained in one of the subdirectories. In this way,
it is possible to add new entries to the sushi menu structure, by simply
adding a new menu item, form and script, the binary does not need to be
recompiled to take advantage of this new menu.
2001-01-05 04:28:33 +03:00
|
|
|
{
|
|
|
|
FILE *filep;
|
|
|
|
int lcnt;
|
|
|
|
char *p, *t;
|
2001-01-06 18:04:05 +03:00
|
|
|
size_t len;
|
Initial import of sushi.
Sushi is an interactive, menu-based program that is designed to aid
the user or administrator with administrative and complex tasks on thier
machines.
Sushi provides a menu of various functions that the user can perform on
his or her machine. Once the user selects a desired function, the
function is either performed outright, or in most cases, the user is
asked to fill in a simple form with required and option information,
which is then processed by sushi, and the action occurs.
The programming interface for sushi is very simple. There are
directories containing various files, such as menu indexes, or forms for
the user to fill out. These files are interpreted by sushi to generate
the menus the user sees on his/her screen. When the form is filled out
by the user, the entries are passed as command-line arguments to a
program, or script contained in one of the subdirectories. In this way,
it is possible to add new entries to the sushi menu structure, by simply
adding a new menu item, form and script, the binary does not need to be
recompiled to take advantage of this new menu.
2001-01-05 04:28:33 +03:00
|
|
|
|
2005-01-12 20:38:40 +03:00
|
|
|
if ((filep = fopen(path, "r")) != NULL) {
|
Initial import of sushi.
Sushi is an interactive, menu-based program that is designed to aid
the user or administrator with administrative and complex tasks on thier
machines.
Sushi provides a menu of various functions that the user can perform on
his or her machine. Once the user selects a desired function, the
function is either performed outright, or in most cases, the user is
asked to fill in a simple form with required and option information,
which is then processed by sushi, and the action occurs.
The programming interface for sushi is very simple. There are
directories containing various files, such as menu indexes, or forms for
the user to fill out. These files are interpreted by sushi to generate
the menus the user sees on his/her screen. When the form is filled out
by the user, the entries are passed as command-line arguments to a
program, or script contained in one of the subdirectories. In this way,
it is possible to add new entries to the sushi menu structure, by simply
adding a new menu item, form and script, the binary does not need to be
recompiled to take advantage of this new menu.
2001-01-05 04:28:33 +03:00
|
|
|
for (lcnt = 1; (p = fgetln(filep, &len)) != NULL; ++lcnt) {
|
|
|
|
if (len == 1) /* Skip empty lines. */
|
|
|
|
continue;
|
|
|
|
if (p[len - 1] == '#') /* Skip remarked lines. */
|
|
|
|
continue;
|
|
|
|
if (p[len - 1] != '\n') {/* Skip corrupted lines. */
|
|
|
|
warnx("%s: line %d corrupted", path, lcnt);
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
p[len - 1] = '\0'; /* Terminate the line. */
|
|
|
|
|
|
|
|
/* Skip leading spaces. */
|
2005-01-12 20:38:40 +03:00
|
|
|
for (; *p != '\0' && isspace((unsigned char)*p); ++p)
|
|
|
|
continue;
|
Initial import of sushi.
Sushi is an interactive, menu-based program that is designed to aid
the user or administrator with administrative and complex tasks on thier
machines.
Sushi provides a menu of various functions that the user can perform on
his or her machine. Once the user selects a desired function, the
function is either performed outright, or in most cases, the user is
asked to fill in a simple form with required and option information,
which is then processed by sushi, and the action occurs.
The programming interface for sushi is very simple. There are
directories containing various files, such as menu indexes, or forms for
the user to fill out. These files are interpreted by sushi to generate
the menus the user sees on his/her screen. When the form is filled out
by the user, the entries are passed as command-line arguments to a
program, or script contained in one of the subdirectories. In this way,
it is possible to add new entries to the sushi menu structure, by simply
adding a new menu item, form and script, the binary does not need to be
recompiled to take advantage of this new menu.
2001-01-05 04:28:33 +03:00
|
|
|
/* Skip empty/comment lines. */
|
|
|
|
if (*p == '\0' || *p == '#')
|
|
|
|
continue;
|
|
|
|
/* Find first token. */
|
2005-01-12 20:38:40 +03:00
|
|
|
for (t = p; *t && !isspace((unsigned char)*t); ++t)
|
|
|
|
continue;
|
Initial import of sushi.
Sushi is an interactive, menu-based program that is designed to aid
the user or administrator with administrative and complex tasks on thier
machines.
Sushi provides a menu of various functions that the user can perform on
his or her machine. Once the user selects a desired function, the
function is either performed outright, or in most cases, the user is
asked to fill in a simple form with required and option information,
which is then processed by sushi, and the action occurs.
The programming interface for sushi is very simple. There are
directories containing various files, such as menu indexes, or forms for
the user to fill out. These files are interpreted by sushi to generate
the menus the user sees on his/her screen. When the form is filled out
by the user, the entries are passed as command-line arguments to a
program, or script contained in one of the subdirectories. In this way,
it is possible to add new entries to the sushi menu structure, by simply
adding a new menu item, form and script, the binary does not need to be
recompiled to take advantage of this new menu.
2001-01-05 04:28:33 +03:00
|
|
|
if (*t == '\0') /* Need more than one token.*/
|
|
|
|
continue;
|
|
|
|
*t = '\0';
|
|
|
|
|
2001-01-10 06:05:48 +03:00
|
|
|
scan_formindex(cqf, p);
|
Initial import of sushi.
Sushi is an interactive, menu-based program that is designed to aid
the user or administrator with administrative and complex tasks on thier
machines.
Sushi provides a menu of various functions that the user can perform on
his or her machine. Once the user selects a desired function, the
function is either performed outright, or in most cases, the user is
asked to fill in a simple form with required and option information,
which is then processed by sushi, and the action occurs.
The programming interface for sushi is very simple. There are
directories containing various files, such as menu indexes, or forms for
the user to fill out. These files are interpreted by sushi to generate
the menus the user sees on his/her screen. When the form is filled out
by the user, the entries are passed as command-line arguments to a
program, or script contained in one of the subdirectories. In this way,
it is possible to add new entries to the sushi menu structure, by simply
adding a new menu item, form and script, the binary does not need to be
recompiled to take advantage of this new menu.
2001-01-05 04:28:33 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
fclose(filep);
|
|
|
|
} else
|
2005-01-12 20:38:40 +03:00
|
|
|
return (1);
|
|
|
|
return (0);
|
Initial import of sushi.
Sushi is an interactive, menu-based program that is designed to aid
the user or administrator with administrative and complex tasks on thier
machines.
Sushi provides a menu of various functions that the user can perform on
his or her machine. Once the user selects a desired function, the
function is either performed outright, or in most cases, the user is
asked to fill in a simple form with required and option information,
which is then processed by sushi, and the action occurs.
The programming interface for sushi is very simple. There are
directories containing various files, such as menu indexes, or forms for
the user to fill out. These files are interpreted by sushi to generate
the menus the user sees on his/her screen. When the form is filled out
by the user, the entries are passed as command-line arguments to a
program, or script contained in one of the subdirectories. In this way,
it is possible to add new entries to the sushi menu structure, by simply
adding a new menu item, form and script, the binary does not need to be
recompiled to take advantage of this new menu.
2001-01-05 04:28:33 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
form_appenditem(struct cqForm *cqf, char *desc, int type, char *data, int req)
|
|
|
|
{
|
2005-01-12 20:38:40 +03:00
|
|
|
FTREE_ENTRY *fte;
|
Initial import of sushi.
Sushi is an interactive, menu-based program that is designed to aid
the user or administrator with administrative and complex tasks on thier
machines.
Sushi provides a menu of various functions that the user can perform on
his or her machine. Once the user selects a desired function, the
function is either performed outright, or in most cases, the user is
asked to fill in a simple form with required and option information,
which is then processed by sushi, and the action occurs.
The programming interface for sushi is very simple. There are
directories containing various files, such as menu indexes, or forms for
the user to fill out. These files are interpreted by sushi to generate
the menus the user sees on his/her screen. When the form is filled out
by the user, the entries are passed as command-line arguments to a
program, or script contained in one of the subdirectories. In this way,
it is possible to add new entries to the sushi menu structure, by simply
adding a new menu item, form and script, the binary does not need to be
recompiled to take advantage of this new menu.
2001-01-05 04:28:33 +03:00
|
|
|
|
2005-01-12 20:38:40 +03:00
|
|
|
if ((fte = malloc(sizeof(FTREE_ENTRY))) == NULL ||
|
|
|
|
((fte->desc = strdup(desc)) == NULL) ||
|
|
|
|
((fte->type = type) == 0) ||
|
|
|
|
((fte->data = strdup(data)) == NULL))
|
|
|
|
bailout("malloc: %s", strerror(errno));
|
Initial import of sushi.
Sushi is an interactive, menu-based program that is designed to aid
the user or administrator with administrative and complex tasks on thier
machines.
Sushi provides a menu of various functions that the user can perform on
his or her machine. Once the user selects a desired function, the
function is either performed outright, or in most cases, the user is
asked to fill in a simple form with required and option information,
which is then processed by sushi, and the action occurs.
The programming interface for sushi is very simple. There are
directories containing various files, such as menu indexes, or forms for
the user to fill out. These files are interpreted by sushi to generate
the menus the user sees on his/her screen. When the form is filled out
by the user, the entries are passed as command-line arguments to a
program, or script contained in one of the subdirectories. In this way,
it is possible to add new entries to the sushi menu structure, by simply
adding a new menu item, form and script, the binary does not need to be
recompiled to take advantage of this new menu.
2001-01-05 04:28:33 +03:00
|
|
|
fte->required = req;
|
|
|
|
fte->elen = 0;
|
2001-01-31 12:35:42 +03:00
|
|
|
fte->origdata = fte->data;
|
2002-07-25 16:42:39 +04:00
|
|
|
fte->list = NULL;
|
Initial import of sushi.
Sushi is an interactive, menu-based program that is designed to aid
the user or administrator with administrative and complex tasks on thier
machines.
Sushi provides a menu of various functions that the user can perform on
his or her machine. Once the user selects a desired function, the
function is either performed outright, or in most cases, the user is
asked to fill in a simple form with required and option information,
which is then processed by sushi, and the action occurs.
The programming interface for sushi is very simple. There are
directories containing various files, such as menu indexes, or forms for
the user to fill out. These files are interpreted by sushi to generate
the menus the user sees on his/her screen. When the form is filled out
by the user, the entries are passed as command-line arguments to a
program, or script contained in one of the subdirectories. In this way,
it is possible to add new entries to the sushi menu structure, by simply
adding a new menu item, form and script, the binary does not need to be
recompiled to take advantage of this new menu.
2001-01-05 04:28:33 +03:00
|
|
|
|
|
|
|
CIRCLEQ_INIT(&fte->cqSubFormHead);
|
|
|
|
CIRCLEQ_INSERT_TAIL(cqf, fte, cqFormEntries);
|
|
|
|
}
|
|
|
|
|
2001-01-10 06:05:48 +03:00
|
|
|
static void
|
|
|
|
scan_formindex(struct cqForm *cqf, char *row)
|
Initial import of sushi.
Sushi is an interactive, menu-based program that is designed to aid
the user or administrator with administrative and complex tasks on thier
machines.
Sushi provides a menu of various functions that the user can perform on
his or her machine. Once the user selects a desired function, the
function is either performed outright, or in most cases, the user is
asked to fill in a simple form with required and option information,
which is then processed by sushi, and the action occurs.
The programming interface for sushi is very simple. There are
directories containing various files, such as menu indexes, or forms for
the user to fill out. These files are interpreted by sushi to generate
the menus the user sees on his/her screen. When the form is filled out
by the user, the entries are passed as command-line arguments to a
program, or script contained in one of the subdirectories. In this way,
it is possible to add new entries to the sushi menu structure, by simply
adding a new menu item, form and script, the binary does not need to be
recompiled to take advantage of this new menu.
2001-01-05 04:28:33 +03:00
|
|
|
{
|
|
|
|
char *t = row;
|
|
|
|
char *x;
|
|
|
|
char desc[80];
|
2005-06-02 13:41:12 +04:00
|
|
|
int type = 0;
|
Initial import of sushi.
Sushi is an interactive, menu-based program that is designed to aid
the user or administrator with administrative and complex tasks on thier
machines.
Sushi provides a menu of various functions that the user can perform on
his or her machine. Once the user selects a desired function, the
function is either performed outright, or in most cases, the user is
asked to fill in a simple form with required and option information,
which is then processed by sushi, and the action occurs.
The programming interface for sushi is very simple. There are
directories containing various files, such as menu indexes, or forms for
the user to fill out. These files are interpreted by sushi to generate
the menus the user sees on his/her screen. When the form is filled out
by the user, the entries are passed as command-line arguments to a
program, or script contained in one of the subdirectories. In this way,
it is possible to add new entries to the sushi menu structure, by simply
adding a new menu item, form and script, the binary does not need to be
recompiled to take advantage of this new menu.
2001-01-05 04:28:33 +03:00
|
|
|
int req = 0;
|
|
|
|
|
2005-01-12 20:38:40 +03:00
|
|
|
while (*++t && !isspace((unsigned char)*t))
|
|
|
|
continue;
|
Initial import of sushi.
Sushi is an interactive, menu-based program that is designed to aid
the user or administrator with administrative and complex tasks on thier
machines.
Sushi provides a menu of various functions that the user can perform on
his or her machine. Once the user selects a desired function, the
function is either performed outright, or in most cases, the user is
asked to fill in a simple form with required and option information,
which is then processed by sushi, and the action occurs.
The programming interface for sushi is very simple. There are
directories containing various files, such as menu indexes, or forms for
the user to fill out. These files are interpreted by sushi to generate
the menus the user sees on his/her screen. When the form is filled out
by the user, the entries are passed as command-line arguments to a
program, or script contained in one of the subdirectories. In this way,
it is possible to add new entries to the sushi menu structure, by simply
adding a new menu item, form and script, the binary does not need to be
recompiled to take advantage of this new menu.
2001-01-05 04:28:33 +03:00
|
|
|
x = (char *)strsep(&row, ":");
|
2005-01-12 20:38:40 +03:00
|
|
|
if (strcmp(x, "entry") == 0) {
|
Initial import of sushi.
Sushi is an interactive, menu-based program that is designed to aid
the user or administrator with administrative and complex tasks on thier
machines.
Sushi provides a menu of various functions that the user can perform on
his or her machine. Once the user selects a desired function, the
function is either performed outright, or in most cases, the user is
asked to fill in a simple form with required and option information,
which is then processed by sushi, and the action occurs.
The programming interface for sushi is very simple. There are
directories containing various files, such as menu indexes, or forms for
the user to fill out. These files are interpreted by sushi to generate
the menus the user sees on his/her screen. When the form is filled out
by the user, the entries are passed as command-line arguments to a
program, or script contained in one of the subdirectories. In this way,
it is possible to add new entries to the sushi menu structure, by simply
adding a new menu item, form and script, the binary does not need to be
recompiled to take advantage of this new menu.
2001-01-05 04:28:33 +03:00
|
|
|
type = DATAT_ENTRY;
|
2005-01-12 20:38:40 +03:00
|
|
|
} else if (strcmp(x, "req-entry") == 0) {
|
Initial import of sushi.
Sushi is an interactive, menu-based program that is designed to aid
the user or administrator with administrative and complex tasks on thier
machines.
Sushi provides a menu of various functions that the user can perform on
his or her machine. Once the user selects a desired function, the
function is either performed outright, or in most cases, the user is
asked to fill in a simple form with required and option information,
which is then processed by sushi, and the action occurs.
The programming interface for sushi is very simple. There are
directories containing various files, such as menu indexes, or forms for
the user to fill out. These files are interpreted by sushi to generate
the menus the user sees on his/her screen. When the form is filled out
by the user, the entries are passed as command-line arguments to a
program, or script contained in one of the subdirectories. In this way,
it is possible to add new entries to the sushi menu structure, by simply
adding a new menu item, form and script, the binary does not need to be
recompiled to take advantage of this new menu.
2001-01-05 04:28:33 +03:00
|
|
|
type = DATAT_ENTRY;
|
|
|
|
req = 1;
|
2005-01-12 20:38:40 +03:00
|
|
|
} else if (strcmp(x, "escript") == 0) {
|
Initial import of sushi.
Sushi is an interactive, menu-based program that is designed to aid
the user or administrator with administrative and complex tasks on thier
machines.
Sushi provides a menu of various functions that the user can perform on
his or her machine. Once the user selects a desired function, the
function is either performed outright, or in most cases, the user is
asked to fill in a simple form with required and option information,
which is then processed by sushi, and the action occurs.
The programming interface for sushi is very simple. There are
directories containing various files, such as menu indexes, or forms for
the user to fill out. These files are interpreted by sushi to generate
the menus the user sees on his/her screen. When the form is filled out
by the user, the entries are passed as command-line arguments to a
program, or script contained in one of the subdirectories. In this way,
it is possible to add new entries to the sushi menu structure, by simply
adding a new menu item, form and script, the binary does not need to be
recompiled to take advantage of this new menu.
2001-01-05 04:28:33 +03:00
|
|
|
type = DATAT_ESCRIPT;
|
2005-01-12 20:38:40 +03:00
|
|
|
} else if (strcmp(x, "req-escript") == 0) {
|
Initial import of sushi.
Sushi is an interactive, menu-based program that is designed to aid
the user or administrator with administrative and complex tasks on thier
machines.
Sushi provides a menu of various functions that the user can perform on
his or her machine. Once the user selects a desired function, the
function is either performed outright, or in most cases, the user is
asked to fill in a simple form with required and option information,
which is then processed by sushi, and the action occurs.
The programming interface for sushi is very simple. There are
directories containing various files, such as menu indexes, or forms for
the user to fill out. These files are interpreted by sushi to generate
the menus the user sees on his/her screen. When the form is filled out
by the user, the entries are passed as command-line arguments to a
program, or script contained in one of the subdirectories. In this way,
it is possible to add new entries to the sushi menu structure, by simply
adding a new menu item, form and script, the binary does not need to be
recompiled to take advantage of this new menu.
2001-01-05 04:28:33 +03:00
|
|
|
type = DATAT_ESCRIPT;
|
|
|
|
req = 1;
|
2005-01-12 20:38:40 +03:00
|
|
|
} else if (strcmp(x, "nescript") == 0) {
|
Initial import of sushi.
Sushi is an interactive, menu-based program that is designed to aid
the user or administrator with administrative and complex tasks on thier
machines.
Sushi provides a menu of various functions that the user can perform on
his or her machine. Once the user selects a desired function, the
function is either performed outright, or in most cases, the user is
asked to fill in a simple form with required and option information,
which is then processed by sushi, and the action occurs.
The programming interface for sushi is very simple. There are
directories containing various files, such as menu indexes, or forms for
the user to fill out. These files are interpreted by sushi to generate
the menus the user sees on his/her screen. When the form is filled out
by the user, the entries are passed as command-line arguments to a
program, or script contained in one of the subdirectories. In this way,
it is possible to add new entries to the sushi menu structure, by simply
adding a new menu item, form and script, the binary does not need to be
recompiled to take advantage of this new menu.
2001-01-05 04:28:33 +03:00
|
|
|
type = DATAT_NESCRIPT;
|
2005-01-12 20:38:40 +03:00
|
|
|
} else if (strcmp(x, "list") == 0) {
|
Initial import of sushi.
Sushi is an interactive, menu-based program that is designed to aid
the user or administrator with administrative and complex tasks on thier
machines.
Sushi provides a menu of various functions that the user can perform on
his or her machine. Once the user selects a desired function, the
function is either performed outright, or in most cases, the user is
asked to fill in a simple form with required and option information,
which is then processed by sushi, and the action occurs.
The programming interface for sushi is very simple. There are
directories containing various files, such as menu indexes, or forms for
the user to fill out. These files are interpreted by sushi to generate
the menus the user sees on his/her screen. When the form is filled out
by the user, the entries are passed as command-line arguments to a
program, or script contained in one of the subdirectories. In this way,
it is possible to add new entries to the sushi menu structure, by simply
adding a new menu item, form and script, the binary does not need to be
recompiled to take advantage of this new menu.
2001-01-05 04:28:33 +03:00
|
|
|
type = DATAT_LIST;
|
2005-01-12 20:38:40 +03:00
|
|
|
} else if (strcmp(x, "multilist") == 0) {
|
Initial import of sushi.
Sushi is an interactive, menu-based program that is designed to aid
the user or administrator with administrative and complex tasks on thier
machines.
Sushi provides a menu of various functions that the user can perform on
his or her machine. Once the user selects a desired function, the
function is either performed outright, or in most cases, the user is
asked to fill in a simple form with required and option information,
which is then processed by sushi, and the action occurs.
The programming interface for sushi is very simple. There are
directories containing various files, such as menu indexes, or forms for
the user to fill out. These files are interpreted by sushi to generate
the menus the user sees on his/her screen. When the form is filled out
by the user, the entries are passed as command-line arguments to a
program, or script contained in one of the subdirectories. In this way,
it is possible to add new entries to the sushi menu structure, by simply
adding a new menu item, form and script, the binary does not need to be
recompiled to take advantage of this new menu.
2001-01-05 04:28:33 +03:00
|
|
|
type = DATAT_MLIST;
|
2005-01-12 20:38:40 +03:00
|
|
|
} else if (strcmp(x, "req-list") == 0) {
|
Initial import of sushi.
Sushi is an interactive, menu-based program that is designed to aid
the user or administrator with administrative and complex tasks on thier
machines.
Sushi provides a menu of various functions that the user can perform on
his or her machine. Once the user selects a desired function, the
function is either performed outright, or in most cases, the user is
asked to fill in a simple form with required and option information,
which is then processed by sushi, and the action occurs.
The programming interface for sushi is very simple. There are
directories containing various files, such as menu indexes, or forms for
the user to fill out. These files are interpreted by sushi to generate
the menus the user sees on his/her screen. When the form is filled out
by the user, the entries are passed as command-line arguments to a
program, or script contained in one of the subdirectories. In this way,
it is possible to add new entries to the sushi menu structure, by simply
adding a new menu item, form and script, the binary does not need to be
recompiled to take advantage of this new menu.
2001-01-05 04:28:33 +03:00
|
|
|
type = DATAT_LIST;
|
|
|
|
req = 1;
|
2005-01-12 20:38:40 +03:00
|
|
|
} else if (strcmp(x, "blank") == 0) {
|
Initial import of sushi.
Sushi is an interactive, menu-based program that is designed to aid
the user or administrator with administrative and complex tasks on thier
machines.
Sushi provides a menu of various functions that the user can perform on
his or her machine. Once the user selects a desired function, the
function is either performed outright, or in most cases, the user is
asked to fill in a simple form with required and option information,
which is then processed by sushi, and the action occurs.
The programming interface for sushi is very simple. There are
directories containing various files, such as menu indexes, or forms for
the user to fill out. These files are interpreted by sushi to generate
the menus the user sees on his/her screen. When the form is filled out
by the user, the entries are passed as command-line arguments to a
program, or script contained in one of the subdirectories. In this way,
it is possible to add new entries to the sushi menu structure, by simply
adding a new menu item, form and script, the binary does not need to be
recompiled to take advantage of this new menu.
2001-01-05 04:28:33 +03:00
|
|
|
type = DATAT_BLANK;
|
2005-01-12 20:38:40 +03:00
|
|
|
} else if (strcmp(x, "func") == 0) {
|
Initial import of sushi.
Sushi is an interactive, menu-based program that is designed to aid
the user or administrator with administrative and complex tasks on thier
machines.
Sushi provides a menu of various functions that the user can perform on
his or her machine. Once the user selects a desired function, the
function is either performed outright, or in most cases, the user is
asked to fill in a simple form with required and option information,
which is then processed by sushi, and the action occurs.
The programming interface for sushi is very simple. There are
directories containing various files, such as menu indexes, or forms for
the user to fill out. These files are interpreted by sushi to generate
the menus the user sees on his/her screen. When the form is filled out
by the user, the entries are passed as command-line arguments to a
program, or script contained in one of the subdirectories. In this way,
it is possible to add new entries to the sushi menu structure, by simply
adding a new menu item, form and script, the binary does not need to be
recompiled to take advantage of this new menu.
2001-01-05 04:28:33 +03:00
|
|
|
type = DATAT_FUNC;
|
2005-01-12 20:38:40 +03:00
|
|
|
} else if (strcmp(x, "multifunc") == 0) {
|
Initial import of sushi.
Sushi is an interactive, menu-based program that is designed to aid
the user or administrator with administrative and complex tasks on thier
machines.
Sushi provides a menu of various functions that the user can perform on
his or her machine. Once the user selects a desired function, the
function is either performed outright, or in most cases, the user is
asked to fill in a simple form with required and option information,
which is then processed by sushi, and the action occurs.
The programming interface for sushi is very simple. There are
directories containing various files, such as menu indexes, or forms for
the user to fill out. These files are interpreted by sushi to generate
the menus the user sees on his/her screen. When the form is filled out
by the user, the entries are passed as command-line arguments to a
program, or script contained in one of the subdirectories. In this way,
it is possible to add new entries to the sushi menu structure, by simply
adding a new menu item, form and script, the binary does not need to be
recompiled to take advantage of this new menu.
2001-01-05 04:28:33 +03:00
|
|
|
type = DATAT_MFUNC;
|
2005-01-12 20:38:40 +03:00
|
|
|
} else if (strcmp(x, "req-func") == 0) {
|
Initial import of sushi.
Sushi is an interactive, menu-based program that is designed to aid
the user or administrator with administrative and complex tasks on thier
machines.
Sushi provides a menu of various functions that the user can perform on
his or her machine. Once the user selects a desired function, the
function is either performed outright, or in most cases, the user is
asked to fill in a simple form with required and option information,
which is then processed by sushi, and the action occurs.
The programming interface for sushi is very simple. There are
directories containing various files, such as menu indexes, or forms for
the user to fill out. These files are interpreted by sushi to generate
the menus the user sees on his/her screen. When the form is filled out
by the user, the entries are passed as command-line arguments to a
program, or script contained in one of the subdirectories. In this way,
it is possible to add new entries to the sushi menu structure, by simply
adding a new menu item, form and script, the binary does not need to be
recompiled to take advantage of this new menu.
2001-01-05 04:28:33 +03:00
|
|
|
type = DATAT_FUNC;
|
|
|
|
req = 1;
|
2005-01-12 20:38:40 +03:00
|
|
|
} else if (strcmp(x, "script") == 0) {
|
Initial import of sushi.
Sushi is an interactive, menu-based program that is designed to aid
the user or administrator with administrative and complex tasks on thier
machines.
Sushi provides a menu of various functions that the user can perform on
his or her machine. Once the user selects a desired function, the
function is either performed outright, or in most cases, the user is
asked to fill in a simple form with required and option information,
which is then processed by sushi, and the action occurs.
The programming interface for sushi is very simple. There are
directories containing various files, such as menu indexes, or forms for
the user to fill out. These files are interpreted by sushi to generate
the menus the user sees on his/her screen. When the form is filled out
by the user, the entries are passed as command-line arguments to a
program, or script contained in one of the subdirectories. In this way,
it is possible to add new entries to the sushi menu structure, by simply
adding a new menu item, form and script, the binary does not need to be
recompiled to take advantage of this new menu.
2001-01-05 04:28:33 +03:00
|
|
|
type = DATAT_SCRIPT;
|
2005-01-12 20:38:40 +03:00
|
|
|
} else if (strcmp(x, "multiscript") == 0) {
|
Initial import of sushi.
Sushi is an interactive, menu-based program that is designed to aid
the user or administrator with administrative and complex tasks on thier
machines.
Sushi provides a menu of various functions that the user can perform on
his or her machine. Once the user selects a desired function, the
function is either performed outright, or in most cases, the user is
asked to fill in a simple form with required and option information,
which is then processed by sushi, and the action occurs.
The programming interface for sushi is very simple. There are
directories containing various files, such as menu indexes, or forms for
the user to fill out. These files are interpreted by sushi to generate
the menus the user sees on his/her screen. When the form is filled out
by the user, the entries are passed as command-line arguments to a
program, or script contained in one of the subdirectories. In this way,
it is possible to add new entries to the sushi menu structure, by simply
adding a new menu item, form and script, the binary does not need to be
recompiled to take advantage of this new menu.
2001-01-05 04:28:33 +03:00
|
|
|
type = DATAT_MSCRIPT;
|
2005-01-12 20:38:40 +03:00
|
|
|
} else if (strcmp(x, "req-script") == 0) {
|
Initial import of sushi.
Sushi is an interactive, menu-based program that is designed to aid
the user or administrator with administrative and complex tasks on thier
machines.
Sushi provides a menu of various functions that the user can perform on
his or her machine. Once the user selects a desired function, the
function is either performed outright, or in most cases, the user is
asked to fill in a simple form with required and option information,
which is then processed by sushi, and the action occurs.
The programming interface for sushi is very simple. There are
directories containing various files, such as menu indexes, or forms for
the user to fill out. These files are interpreted by sushi to generate
the menus the user sees on his/her screen. When the form is filled out
by the user, the entries are passed as command-line arguments to a
program, or script contained in one of the subdirectories. In this way,
it is possible to add new entries to the sushi menu structure, by simply
adding a new menu item, form and script, the binary does not need to be
recompiled to take advantage of this new menu.
2001-01-05 04:28:33 +03:00
|
|
|
type = DATAT_SCRIPT;
|
|
|
|
req = 1;
|
2005-01-12 20:38:40 +03:00
|
|
|
} else if (strcmp(x, "noedit") == 0) {
|
Initial import of sushi.
Sushi is an interactive, menu-based program that is designed to aid
the user or administrator with administrative and complex tasks on thier
machines.
Sushi provides a menu of various functions that the user can perform on
his or her machine. Once the user selects a desired function, the
function is either performed outright, or in most cases, the user is
asked to fill in a simple form with required and option information,
which is then processed by sushi, and the action occurs.
The programming interface for sushi is very simple. There are
directories containing various files, such as menu indexes, or forms for
the user to fill out. These files are interpreted by sushi to generate
the menus the user sees on his/her screen. When the form is filled out
by the user, the entries are passed as command-line arguments to a
program, or script contained in one of the subdirectories. In this way,
it is possible to add new entries to the sushi menu structure, by simply
adding a new menu item, form and script, the binary does not need to be
recompiled to take advantage of this new menu.
2001-01-05 04:28:33 +03:00
|
|
|
type = DATAT_NOEDIT;
|
2005-01-12 20:38:40 +03:00
|
|
|
} else if (strcmp(x, "invis") == 0) {
|
Initial import of sushi.
Sushi is an interactive, menu-based program that is designed to aid
the user or administrator with administrative and complex tasks on thier
machines.
Sushi provides a menu of various functions that the user can perform on
his or her machine. Once the user selects a desired function, the
function is either performed outright, or in most cases, the user is
asked to fill in a simple form with required and option information,
which is then processed by sushi, and the action occurs.
The programming interface for sushi is very simple. There are
directories containing various files, such as menu indexes, or forms for
the user to fill out. These files are interpreted by sushi to generate
the menus the user sees on his/her screen. When the form is filled out
by the user, the entries are passed as command-line arguments to a
program, or script contained in one of the subdirectories. In this way,
it is possible to add new entries to the sushi menu structure, by simply
adding a new menu item, form and script, the binary does not need to be
recompiled to take advantage of this new menu.
2001-01-05 04:28:33 +03:00
|
|
|
type = DATAT_INVIS;
|
2005-01-12 20:38:40 +03:00
|
|
|
} else if (strcmp(x, "integer") == 0) {
|
Initial import of sushi.
Sushi is an interactive, menu-based program that is designed to aid
the user or administrator with administrative and complex tasks on thier
machines.
Sushi provides a menu of various functions that the user can perform on
his or her machine. Once the user selects a desired function, the
function is either performed outright, or in most cases, the user is
asked to fill in a simple form with required and option information,
which is then processed by sushi, and the action occurs.
The programming interface for sushi is very simple. There are
directories containing various files, such as menu indexes, or forms for
the user to fill out. These files are interpreted by sushi to generate
the menus the user sees on his/her screen. When the form is filled out
by the user, the entries are passed as command-line arguments to a
program, or script contained in one of the subdirectories. In this way,
it is possible to add new entries to the sushi menu structure, by simply
adding a new menu item, form and script, the binary does not need to be
recompiled to take advantage of this new menu.
2001-01-05 04:28:33 +03:00
|
|
|
type = DATAT_INTEGER;
|
2005-01-12 20:38:40 +03:00
|
|
|
} else if (strcmp(x, "req-integer") == 0) {
|
Initial import of sushi.
Sushi is an interactive, menu-based program that is designed to aid
the user or administrator with administrative and complex tasks on thier
machines.
Sushi provides a menu of various functions that the user can perform on
his or her machine. Once the user selects a desired function, the
function is either performed outright, or in most cases, the user is
asked to fill in a simple form with required and option information,
which is then processed by sushi, and the action occurs.
The programming interface for sushi is very simple. There are
directories containing various files, such as menu indexes, or forms for
the user to fill out. These files are interpreted by sushi to generate
the menus the user sees on his/her screen. When the form is filled out
by the user, the entries are passed as command-line arguments to a
program, or script contained in one of the subdirectories. In this way,
it is possible to add new entries to the sushi menu structure, by simply
adding a new menu item, form and script, the binary does not need to be
recompiled to take advantage of this new menu.
2001-01-05 04:28:33 +03:00
|
|
|
type = DATAT_INTEGER;
|
|
|
|
req = 1;
|
2005-01-12 20:38:40 +03:00
|
|
|
} else if (strcmp(x, "iscript") == 0) {
|
2001-01-31 12:35:42 +03:00
|
|
|
type = DATAT_ISCRIPT;
|
2005-01-12 20:38:40 +03:00
|
|
|
} else if (strcmp(x, "req-iscript") == 0) {
|
2001-01-31 12:35:42 +03:00
|
|
|
type = DATAT_ISCRIPT;
|
|
|
|
req = 1;
|
2005-01-12 20:38:40 +03:00
|
|
|
} else if (strcmp(x, "ipv4") == 0) {
|
2001-03-07 13:10:20 +03:00
|
|
|
type = DATAT_V4;
|
2005-01-12 20:38:40 +03:00
|
|
|
} else if (strcmp(x, "req-ipv4") == 0) {
|
2001-03-07 13:10:20 +03:00
|
|
|
type = DATAT_V4;
|
|
|
|
req = 1;
|
2005-01-12 20:38:40 +03:00
|
|
|
} else if (strcmp(x, "ipv4script") == 0) {
|
2001-03-07 13:10:20 +03:00
|
|
|
type = DATAT_V4SCRIPT;
|
2005-01-12 20:38:40 +03:00
|
|
|
} else if (strcmp(x, "req-ipv4script") == 0) {
|
2001-03-07 13:10:20 +03:00
|
|
|
type = DATAT_V4SCRIPT;
|
|
|
|
req = 1;
|
2005-01-12 20:38:40 +03:00
|
|
|
} else if (strcmp(x, "ipv6") == 0) {
|
2001-03-07 13:10:20 +03:00
|
|
|
type = DATAT_V6;
|
2005-01-12 20:38:40 +03:00
|
|
|
} else if (strcmp(x, "req-ipv6") == 0) {
|
2001-03-07 13:10:20 +03:00
|
|
|
type = DATAT_V6;
|
|
|
|
req = 1;
|
2005-01-12 20:38:40 +03:00
|
|
|
} else if (strcmp(x, "ipv6script") == 0) {
|
2001-03-07 13:10:20 +03:00
|
|
|
type = DATAT_V6SCRIPT;
|
2005-01-12 20:38:40 +03:00
|
|
|
} else if (strcmp(x, "req-ipv6script") == 0) {
|
2001-03-07 13:10:20 +03:00
|
|
|
type = DATAT_V6SCRIPT;
|
|
|
|
req = 1;
|
2005-01-12 20:38:40 +03:00
|
|
|
} else {
|
Initial import of sushi.
Sushi is an interactive, menu-based program that is designed to aid
the user or administrator with administrative and complex tasks on thier
machines.
Sushi provides a menu of various functions that the user can perform on
his or her machine. Once the user selects a desired function, the
function is either performed outright, or in most cases, the user is
asked to fill in a simple form with required and option information,
which is then processed by sushi, and the action occurs.
The programming interface for sushi is very simple. There are
directories containing various files, such as menu indexes, or forms for
the user to fill out. These files are interpreted by sushi to generate
the menus the user sees on his/her screen. When the form is filled out
by the user, the entries are passed as command-line arguments to a
program, or script contained in one of the subdirectories. In this way,
it is possible to add new entries to the sushi menu structure, by simply
adding a new menu item, form and script, the binary does not need to be
recompiled to take advantage of this new menu.
2001-01-05 04:28:33 +03:00
|
|
|
bailout("%s: %s",
|
|
|
|
catgets(catalog, 1, 11, "invalid data type"), x);
|
2005-01-12 20:38:40 +03:00
|
|
|
}
|
Initial import of sushi.
Sushi is an interactive, menu-based program that is designed to aid
the user or administrator with administrative and complex tasks on thier
machines.
Sushi provides a menu of various functions that the user can perform on
his or her machine. Once the user selects a desired function, the
function is either performed outright, or in most cases, the user is
asked to fill in a simple form with required and option information,
which is then processed by sushi, and the action occurs.
The programming interface for sushi is very simple. There are
directories containing various files, such as menu indexes, or forms for
the user to fill out. These files are interpreted by sushi to generate
the menus the user sees on his/her screen. When the form is filled out
by the user, the entries are passed as command-line arguments to a
program, or script contained in one of the subdirectories. In this way,
it is possible to add new entries to the sushi menu structure, by simply
adding a new menu item, form and script, the binary does not need to be
recompiled to take advantage of this new menu.
2001-01-05 04:28:33 +03:00
|
|
|
|
2005-01-12 20:38:40 +03:00
|
|
|
while (*++t && isspace((unsigned char)*t))
|
|
|
|
continue;
|
Initial import of sushi.
Sushi is an interactive, menu-based program that is designed to aid
the user or administrator with administrative and complex tasks on thier
machines.
Sushi provides a menu of various functions that the user can perform on
his or her machine. Once the user selects a desired function, the
function is either performed outright, or in most cases, the user is
asked to fill in a simple form with required and option information,
which is then processed by sushi, and the action occurs.
The programming interface for sushi is very simple. There are
directories containing various files, such as menu indexes, or forms for
the user to fill out. These files are interpreted by sushi to generate
the menus the user sees on his/her screen. When the form is filled out
by the user, the entries are passed as command-line arguments to a
program, or script contained in one of the subdirectories. In this way,
it is possible to add new entries to the sushi menu structure, by simply
adding a new menu item, form and script, the binary does not need to be
recompiled to take advantage of this new menu.
2001-01-05 04:28:33 +03:00
|
|
|
if (strlen(t) > 50)
|
2005-01-12 01:51:26 +03:00
|
|
|
bailout("'%s': %s", t,
|
|
|
|
catgets(catalog, 1, 12, "description too long"));
|
Initial import of sushi.
Sushi is an interactive, menu-based program that is designed to aid
the user or administrator with administrative and complex tasks on thier
machines.
Sushi provides a menu of various functions that the user can perform on
his or her machine. Once the user selects a desired function, the
function is either performed outright, or in most cases, the user is
asked to fill in a simple form with required and option information,
which is then processed by sushi, and the action occurs.
The programming interface for sushi is very simple. There are
directories containing various files, such as menu indexes, or forms for
the user to fill out. These files are interpreted by sushi to generate
the menus the user sees on his/her screen. When the form is filled out
by the user, the entries are passed as command-line arguments to a
program, or script contained in one of the subdirectories. In this way,
it is possible to add new entries to the sushi menu structure, by simply
adding a new menu item, form and script, the binary does not need to be
recompiled to take advantage of this new menu.
2001-01-05 04:28:33 +03:00
|
|
|
|
|
|
|
snprintf(desc, sizeof(desc), "%s", t);
|
|
|
|
if (strcmp(desc, "BLANK") == 0)
|
2003-07-16 10:40:47 +04:00
|
|
|
snprintf(desc, sizeof(desc), " ");
|
Initial import of sushi.
Sushi is an interactive, menu-based program that is designed to aid
the user or administrator with administrative and complex tasks on thier
machines.
Sushi provides a menu of various functions that the user can perform on
his or her machine. Once the user selects a desired function, the
function is either performed outright, or in most cases, the user is
asked to fill in a simple form with required and option information,
which is then processed by sushi, and the action occurs.
The programming interface for sushi is very simple. There are
directories containing various files, such as menu indexes, or forms for
the user to fill out. These files are interpreted by sushi to generate
the menus the user sees on his/her screen. When the form is filled out
by the user, the entries are passed as command-line arguments to a
program, or script contained in one of the subdirectories. In this way,
it is possible to add new entries to the sushi menu structure, by simply
adding a new menu item, form and script, the binary does not need to be
recompiled to take advantage of this new menu.
2001-01-05 04:28:33 +03:00
|
|
|
|
2004-03-24 22:14:07 +03:00
|
|
|
form_appenditem(cqf, desc, type, row, req);
|
Initial import of sushi.
Sushi is an interactive, menu-based program that is designed to aid
the user or administrator with administrative and complex tasks on thier
machines.
Sushi provides a menu of various functions that the user can perform on
his or her machine. Once the user selects a desired function, the
function is either performed outright, or in most cases, the user is
asked to fill in a simple form with required and option information,
which is then processed by sushi, and the action occurs.
The programming interface for sushi is very simple. There are
directories containing various files, such as menu indexes, or forms for
the user to fill out. These files are interpreted by sushi to generate
the menus the user sees on his/her screen. When the form is filled out
by the user, the entries are passed as command-line arguments to a
program, or script contained in one of the subdirectories. In this way,
it is possible to add new entries to the sushi menu structure, by simply
adding a new menu item, form and script, the binary does not need to be
recompiled to take advantage of this new menu.
2001-01-05 04:28:33 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
int
|
|
|
|
form_entries(struct cqForm *cqf)
|
|
|
|
{
|
|
|
|
FTREE_ENTRY *fte;
|
|
|
|
int entries = 0;
|
|
|
|
|
|
|
|
for (fte = CIRCLEQ_FIRST(cqf); fte != (void *)cqf;
|
2005-01-12 20:38:40 +03:00
|
|
|
fte = CIRCLEQ_NEXT(fte, cqFormEntries))
|
Initial import of sushi.
Sushi is an interactive, menu-based program that is designed to aid
the user or administrator with administrative and complex tasks on thier
machines.
Sushi provides a menu of various functions that the user can perform on
his or her machine. Once the user selects a desired function, the
function is either performed outright, or in most cases, the user is
asked to fill in a simple form with required and option information,
which is then processed by sushi, and the action occurs.
The programming interface for sushi is very simple. There are
directories containing various files, such as menu indexes, or forms for
the user to fill out. These files are interpreted by sushi to generate
the menus the user sees on his/her screen. When the form is filled out
by the user, the entries are passed as command-line arguments to a
program, or script contained in one of the subdirectories. In this way,
it is possible to add new entries to the sushi menu structure, by simply
adding a new menu item, form and script, the binary does not need to be
recompiled to take advantage of this new menu.
2001-01-05 04:28:33 +03:00
|
|
|
++entries;
|
|
|
|
|
2005-01-12 20:38:40 +03:00
|
|
|
return (entries);
|
Initial import of sushi.
Sushi is an interactive, menu-based program that is designed to aid
the user or administrator with administrative and complex tasks on thier
machines.
Sushi provides a menu of various functions that the user can perform on
his or her machine. Once the user selects a desired function, the
function is either performed outright, or in most cases, the user is
asked to fill in a simple form with required and option information,
which is then processed by sushi, and the action occurs.
The programming interface for sushi is very simple. There are
directories containing various files, such as menu indexes, or forms for
the user to fill out. These files are interpreted by sushi to generate
the menus the user sees on his/her screen. When the form is filled out
by the user, the entries are passed as command-line arguments to a
program, or script contained in one of the subdirectories. In this way,
it is possible to add new entries to the sushi menu structure, by simply
adding a new menu item, form and script, the binary does not need to be
recompiled to take advantage of this new menu.
2001-01-05 04:28:33 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
FTREE_ENTRY *
|
|
|
|
form_getentry(struct cqForm *cqf, int entry)
|
|
|
|
{
|
|
|
|
FTREE_ENTRY *fte;
|
|
|
|
int entries = 0;
|
|
|
|
|
|
|
|
for (fte = CIRCLEQ_FIRST(cqf); (fte != (void *)cqf);
|
|
|
|
fte = CIRCLEQ_NEXT(fte, cqFormEntries)) {
|
2005-01-12 20:38:40 +03:00
|
|
|
if (entry == entries)
|
|
|
|
return (fte);
|
Initial import of sushi.
Sushi is an interactive, menu-based program that is designed to aid
the user or administrator with administrative and complex tasks on thier
machines.
Sushi provides a menu of various functions that the user can perform on
his or her machine. Once the user selects a desired function, the
function is either performed outright, or in most cases, the user is
asked to fill in a simple form with required and option information,
which is then processed by sushi, and the action occurs.
The programming interface for sushi is very simple. There are
directories containing various files, such as menu indexes, or forms for
the user to fill out. These files are interpreted by sushi to generate
the menus the user sees on his/her screen. When the form is filled out
by the user, the entries are passed as command-line arguments to a
program, or script contained in one of the subdirectories. In this way,
it is possible to add new entries to the sushi menu structure, by simply
adding a new menu item, form and script, the binary does not need to be
recompiled to take advantage of this new menu.
2001-01-05 04:28:33 +03:00
|
|
|
++entries;
|
|
|
|
}
|
|
|
|
|
2005-01-12 20:38:40 +03:00
|
|
|
return (NULL);
|
Initial import of sushi.
Sushi is an interactive, menu-based program that is designed to aid
the user or administrator with administrative and complex tasks on thier
machines.
Sushi provides a menu of various functions that the user can perform on
his or her machine. Once the user selects a desired function, the
function is either performed outright, or in most cases, the user is
asked to fill in a simple form with required and option information,
which is then processed by sushi, and the action occurs.
The programming interface for sushi is very simple. There are
directories containing various files, such as menu indexes, or forms for
the user to fill out. These files are interpreted by sushi to generate
the menus the user sees on his/her screen. When the form is filled out
by the user, the entries are passed as command-line arguments to a
program, or script contained in one of the subdirectories. In this way,
it is possible to add new entries to the sushi menu structure, by simply
adding a new menu item, form and script, the binary does not need to be
recompiled to take advantage of this new menu.
2001-01-05 04:28:33 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
form_printtree(struct cqForm *cqf)
|
|
|
|
{
|
|
|
|
FTREE_ENTRY *ftp;
|
|
|
|
|
|
|
|
for (ftp = CIRCLEQ_FIRST(cqf); ftp != (void *)cqf;
|
|
|
|
ftp = CIRCLEQ_NEXT(ftp, cqFormEntries))
|
|
|
|
printf("%s\t- %d:%s\n", ftp->desc, ftp->type, ftp->data);
|
|
|
|
}
|
|
|
|
|
|
|
|
/* This is the keymap for the forms */
|
|
|
|
static int
|
|
|
|
get_request(WINDOW *w) /* virtual key mapping */
|
|
|
|
{
|
2005-01-12 20:38:40 +03:00
|
|
|
static int mode = REQ_INS_MODE;
|
|
|
|
int i, c = wgetch(w); /* read a character */
|
Initial import of sushi.
Sushi is an interactive, menu-based program that is designed to aid
the user or administrator with administrative and complex tasks on thier
machines.
Sushi provides a menu of various functions that the user can perform on
his or her machine. Once the user selects a desired function, the
function is either performed outright, or in most cases, the user is
asked to fill in a simple form with required and option information,
which is then processed by sushi, and the action occurs.
The programming interface for sushi is very simple. There are
directories containing various files, such as menu indexes, or forms for
the user to fill out. These files are interpreted by sushi to generate
the menus the user sees on his/her screen. When the form is filled out
by the user, the entries are passed as command-line arguments to a
program, or script contained in one of the subdirectories. In this way,
it is possible to add new entries to the sushi menu structure, by simply
adding a new menu item, form and script, the binary does not need to be
recompiled to take advantage of this new menu.
2001-01-05 04:28:33 +03:00
|
|
|
|
|
|
|
/* printf("GOT A THINGIE: 0x%x %d\n", c, c); */
|
2001-01-10 13:00:29 +03:00
|
|
|
|
|
|
|
/* convert to an FKEY for case */
|
|
|
|
if (c != 0)
|
2005-01-12 20:38:40 +03:00
|
|
|
for (i = 0; i < 10; i++)
|
|
|
|
if (c == keybinding[i])
|
|
|
|
c = KEY_F(i+1);
|
2001-01-10 13:00:29 +03:00
|
|
|
|
Initial import of sushi.
Sushi is an interactive, menu-based program that is designed to aid
the user or administrator with administrative and complex tasks on thier
machines.
Sushi provides a menu of various functions that the user can perform on
his or her machine. Once the user selects a desired function, the
function is either performed outright, or in most cases, the user is
asked to fill in a simple form with required and option information,
which is then processed by sushi, and the action occurs.
The programming interface for sushi is very simple. There are
directories containing various files, such as menu indexes, or forms for
the user to fill out. These files are interpreted by sushi to generate
the menus the user sees on his/her screen. When the form is filled out
by the user, the entries are passed as command-line arguments to a
program, or script contained in one of the subdirectories. In this way,
it is possible to add new entries to the sushi menu structure, by simply
adding a new menu item, form and script, the binary does not need to be
recompiled to take advantage of this new menu.
2001-01-05 04:28:33 +03:00
|
|
|
switch (c) {
|
|
|
|
case KEY_F(1):
|
2005-01-12 20:38:40 +03:00
|
|
|
return (SHOWHELP);
|
Initial import of sushi.
Sushi is an interactive, menu-based program that is designed to aid
the user or administrator with administrative and complex tasks on thier
machines.
Sushi provides a menu of various functions that the user can perform on
his or her machine. Once the user selects a desired function, the
function is either performed outright, or in most cases, the user is
asked to fill in a simple form with required and option information,
which is then processed by sushi, and the action occurs.
The programming interface for sushi is very simple. There are
directories containing various files, such as menu indexes, or forms for
the user to fill out. These files are interpreted by sushi to generate
the menus the user sees on his/her screen. When the form is filled out
by the user, the entries are passed as command-line arguments to a
program, or script contained in one of the subdirectories. In this way,
it is possible to add new entries to the sushi menu structure, by simply
adding a new menu item, form and script, the binary does not need to be
recompiled to take advantage of this new menu.
2001-01-05 04:28:33 +03:00
|
|
|
case KEY_F(2):
|
2005-01-12 20:38:40 +03:00
|
|
|
return (REFRESH);
|
Initial import of sushi.
Sushi is an interactive, menu-based program that is designed to aid
the user or administrator with administrative and complex tasks on thier
machines.
Sushi provides a menu of various functions that the user can perform on
his or her machine. Once the user selects a desired function, the
function is either performed outright, or in most cases, the user is
asked to fill in a simple form with required and option information,
which is then processed by sushi, and the action occurs.
The programming interface for sushi is very simple. There are
directories containing various files, such as menu indexes, or forms for
the user to fill out. These files are interpreted by sushi to generate
the menus the user sees on his/her screen. When the form is filled out
by the user, the entries are passed as command-line arguments to a
program, or script contained in one of the subdirectories. In this way,
it is possible to add new entries to the sushi menu structure, by simply
adding a new menu item, form and script, the binary does not need to be
recompiled to take advantage of this new menu.
2001-01-05 04:28:33 +03:00
|
|
|
case KEY_F(3):
|
2005-01-12 20:38:40 +03:00
|
|
|
return (BAIL);
|
Initial import of sushi.
Sushi is an interactive, menu-based program that is designed to aid
the user or administrator with administrative and complex tasks on thier
machines.
Sushi provides a menu of various functions that the user can perform on
his or her machine. Once the user selects a desired function, the
function is either performed outright, or in most cases, the user is
asked to fill in a simple form with required and option information,
which is then processed by sushi, and the action occurs.
The programming interface for sushi is very simple. There are
directories containing various files, such as menu indexes, or forms for
the user to fill out. These files are interpreted by sushi to generate
the menus the user sees on his/her screen. When the form is filled out
by the user, the entries are passed as command-line arguments to a
program, or script contained in one of the subdirectories. In this way,
it is possible to add new entries to the sushi menu structure, by simply
adding a new menu item, form and script, the binary does not need to be
recompiled to take advantage of this new menu.
2001-01-05 04:28:33 +03:00
|
|
|
case KEY_F(4):
|
2005-01-12 20:38:40 +03:00
|
|
|
return (GENLIST);
|
Initial import of sushi.
Sushi is an interactive, menu-based program that is designed to aid
the user or administrator with administrative and complex tasks on thier
machines.
Sushi provides a menu of various functions that the user can perform on
his or her machine. Once the user selects a desired function, the
function is either performed outright, or in most cases, the user is
asked to fill in a simple form with required and option information,
which is then processed by sushi, and the action occurs.
The programming interface for sushi is very simple. There are
directories containing various files, such as menu indexes, or forms for
the user to fill out. These files are interpreted by sushi to generate
the menus the user sees on his/her screen. When the form is filled out
by the user, the entries are passed as command-line arguments to a
program, or script contained in one of the subdirectories. In this way,
it is possible to add new entries to the sushi menu structure, by simply
adding a new menu item, form and script, the binary does not need to be
recompiled to take advantage of this new menu.
2001-01-05 04:28:33 +03:00
|
|
|
case KEY_F(5):
|
2005-01-12 20:38:40 +03:00
|
|
|
return (RESET);
|
Initial import of sushi.
Sushi is an interactive, menu-based program that is designed to aid
the user or administrator with administrative and complex tasks on thier
machines.
Sushi provides a menu of various functions that the user can perform on
his or her machine. Once the user selects a desired function, the
function is either performed outright, or in most cases, the user is
asked to fill in a simple form with required and option information,
which is then processed by sushi, and the action occurs.
The programming interface for sushi is very simple. There are
directories containing various files, such as menu indexes, or forms for
the user to fill out. These files are interpreted by sushi to generate
the menus the user sees on his/her screen. When the form is filled out
by the user, the entries are passed as command-line arguments to a
program, or script contained in one of the subdirectories. In this way,
it is possible to add new entries to the sushi menu structure, by simply
adding a new menu item, form and script, the binary does not need to be
recompiled to take advantage of this new menu.
2001-01-05 04:28:33 +03:00
|
|
|
case KEY_F(6):
|
2005-01-12 20:38:40 +03:00
|
|
|
return (COMMAND);
|
Initial import of sushi.
Sushi is an interactive, menu-based program that is designed to aid
the user or administrator with administrative and complex tasks on thier
machines.
Sushi provides a menu of various functions that the user can perform on
his or her machine. Once the user selects a desired function, the
function is either performed outright, or in most cases, the user is
asked to fill in a simple form with required and option information,
which is then processed by sushi, and the action occurs.
The programming interface for sushi is very simple. There are
directories containing various files, such as menu indexes, or forms for
the user to fill out. These files are interpreted by sushi to generate
the menus the user sees on his/her screen. When the form is filled out
by the user, the entries are passed as command-line arguments to a
program, or script contained in one of the subdirectories. In this way,
it is possible to add new entries to the sushi menu structure, by simply
adding a new menu item, form and script, the binary does not need to be
recompiled to take advantage of this new menu.
2001-01-05 04:28:33 +03:00
|
|
|
case KEY_F(7):
|
2005-01-12 20:38:40 +03:00
|
|
|
return (EDIT);
|
Initial import of sushi.
Sushi is an interactive, menu-based program that is designed to aid
the user or administrator with administrative and complex tasks on thier
machines.
Sushi provides a menu of various functions that the user can perform on
his or her machine. Once the user selects a desired function, the
function is either performed outright, or in most cases, the user is
asked to fill in a simple form with required and option information,
which is then processed by sushi, and the action occurs.
The programming interface for sushi is very simple. There are
directories containing various files, such as menu indexes, or forms for
the user to fill out. These files are interpreted by sushi to generate
the menus the user sees on his/her screen. When the form is filled out
by the user, the entries are passed as command-line arguments to a
program, or script contained in one of the subdirectories. In this way,
it is possible to add new entries to the sushi menu structure, by simply
adding a new menu item, form and script, the binary does not need to be
recompiled to take advantage of this new menu.
2001-01-05 04:28:33 +03:00
|
|
|
case KEY_F(8):
|
2005-01-12 20:38:40 +03:00
|
|
|
return (DUMPSCREEN);
|
Initial import of sushi.
Sushi is an interactive, menu-based program that is designed to aid
the user or administrator with administrative and complex tasks on thier
machines.
Sushi provides a menu of various functions that the user can perform on
his or her machine. Once the user selects a desired function, the
function is either performed outright, or in most cases, the user is
asked to fill in a simple form with required and option information,
which is then processed by sushi, and the action occurs.
The programming interface for sushi is very simple. There are
directories containing various files, such as menu indexes, or forms for
the user to fill out. These files are interpreted by sushi to generate
the menus the user sees on his/her screen. When the form is filled out
by the user, the entries are passed as command-line arguments to a
program, or script contained in one of the subdirectories. In this way,
it is possible to add new entries to the sushi menu structure, by simply
adding a new menu item, form and script, the binary does not need to be
recompiled to take advantage of this new menu.
2001-01-05 04:28:33 +03:00
|
|
|
case KEY_F(9):
|
2005-01-12 20:38:40 +03:00
|
|
|
return (SHELL);
|
Initial import of sushi.
Sushi is an interactive, menu-based program that is designed to aid
the user or administrator with administrative and complex tasks on thier
machines.
Sushi provides a menu of various functions that the user can perform on
his or her machine. Once the user selects a desired function, the
function is either performed outright, or in most cases, the user is
asked to fill in a simple form with required and option information,
which is then processed by sushi, and the action occurs.
The programming interface for sushi is very simple. There are
directories containing various files, such as menu indexes, or forms for
the user to fill out. These files are interpreted by sushi to generate
the menus the user sees on his/her screen. When the form is filled out
by the user, the entries are passed as command-line arguments to a
program, or script contained in one of the subdirectories. In this way,
it is possible to add new entries to the sushi menu structure, by simply
adding a new menu item, form and script, the binary does not need to be
recompiled to take advantage of this new menu.
2001-01-05 04:28:33 +03:00
|
|
|
case KEY_F(10):
|
2005-01-12 20:38:40 +03:00
|
|
|
return (FASTBAIL);
|
Initial import of sushi.
Sushi is an interactive, menu-based program that is designed to aid
the user or administrator with administrative and complex tasks on thier
machines.
Sushi provides a menu of various functions that the user can perform on
his or her machine. Once the user selects a desired function, the
function is either performed outright, or in most cases, the user is
asked to fill in a simple form with required and option information,
which is then processed by sushi, and the action occurs.
The programming interface for sushi is very simple. There are
directories containing various files, such as menu indexes, or forms for
the user to fill out. These files are interpreted by sushi to generate
the menus the user sees on his/her screen. When the form is filled out
by the user, the entries are passed as command-line arguments to a
program, or script contained in one of the subdirectories. In this way,
it is possible to add new entries to the sushi menu structure, by simply
adding a new menu item, form and script, the binary does not need to be
recompiled to take advantage of this new menu.
2001-01-05 04:28:33 +03:00
|
|
|
case 0x1b: /* ESC */
|
2005-01-12 20:38:40 +03:00
|
|
|
return (BAIL);
|
Initial import of sushi.
Sushi is an interactive, menu-based program that is designed to aid
the user or administrator with administrative and complex tasks on thier
machines.
Sushi provides a menu of various functions that the user can perform on
his or her machine. Once the user selects a desired function, the
function is either performed outright, or in most cases, the user is
asked to fill in a simple form with required and option information,
which is then processed by sushi, and the action occurs.
The programming interface for sushi is very simple. There are
directories containing various files, such as menu indexes, or forms for
the user to fill out. These files are interpreted by sushi to generate
the menus the user sees on his/her screen. When the form is filled out
by the user, the entries are passed as command-line arguments to a
program, or script contained in one of the subdirectories. In this way,
it is possible to add new entries to the sushi menu structure, by simply
adding a new menu item, form and script, the binary does not need to be
recompiled to take advantage of this new menu.
2001-01-05 04:28:33 +03:00
|
|
|
case 0x0d:
|
2005-01-12 20:38:40 +03:00
|
|
|
return (QUIT);
|
Initial import of sushi.
Sushi is an interactive, menu-based program that is designed to aid
the user or administrator with administrative and complex tasks on thier
machines.
Sushi provides a menu of various functions that the user can perform on
his or her machine. Once the user selects a desired function, the
function is either performed outright, or in most cases, the user is
asked to fill in a simple form with required and option information,
which is then processed by sushi, and the action occurs.
The programming interface for sushi is very simple. There are
directories containing various files, such as menu indexes, or forms for
the user to fill out. These files are interpreted by sushi to generate
the menus the user sees on his/her screen. When the form is filled out
by the user, the entries are passed as command-line arguments to a
program, or script contained in one of the subdirectories. In this way,
it is possible to add new entries to the sushi menu structure, by simply
adding a new menu item, form and script, the binary does not need to be
recompiled to take advantage of this new menu.
2001-01-05 04:28:33 +03:00
|
|
|
case KEY_ENTER:
|
2005-01-12 20:38:40 +03:00
|
|
|
return (QUIT);
|
Initial import of sushi.
Sushi is an interactive, menu-based program that is designed to aid
the user or administrator with administrative and complex tasks on thier
machines.
Sushi provides a menu of various functions that the user can perform on
his or her machine. Once the user selects a desired function, the
function is either performed outright, or in most cases, the user is
asked to fill in a simple form with required and option information,
which is then processed by sushi, and the action occurs.
The programming interface for sushi is very simple. There are
directories containing various files, such as menu indexes, or forms for
the user to fill out. These files are interpreted by sushi to generate
the menus the user sees on his/her screen. When the form is filled out
by the user, the entries are passed as command-line arguments to a
program, or script contained in one of the subdirectories. In this way,
it is possible to add new entries to the sushi menu structure, by simply
adding a new menu item, form and script, the binary does not need to be
recompiled to take advantage of this new menu.
2001-01-05 04:28:33 +03:00
|
|
|
case 0xa: /* LF */
|
2005-01-12 20:38:40 +03:00
|
|
|
return (QUIT);
|
Initial import of sushi.
Sushi is an interactive, menu-based program that is designed to aid
the user or administrator with administrative and complex tasks on thier
machines.
Sushi provides a menu of various functions that the user can perform on
his or her machine. Once the user selects a desired function, the
function is either performed outright, or in most cases, the user is
asked to fill in a simple form with required and option information,
which is then processed by sushi, and the action occurs.
The programming interface for sushi is very simple. There are
directories containing various files, such as menu indexes, or forms for
the user to fill out. These files are interpreted by sushi to generate
the menus the user sees on his/her screen. When the form is filled out
by the user, the entries are passed as command-line arguments to a
program, or script contained in one of the subdirectories. In this way,
it is possible to add new entries to the sushi menu structure, by simply
adding a new menu item, form and script, the binary does not need to be
recompiled to take advantage of this new menu.
2001-01-05 04:28:33 +03:00
|
|
|
case KEY_NPAGE: /* ^F */
|
2005-01-12 20:38:40 +03:00
|
|
|
return (REQ_NEXT_PAGE);
|
Initial import of sushi.
Sushi is an interactive, menu-based program that is designed to aid
the user or administrator with administrative and complex tasks on thier
machines.
Sushi provides a menu of various functions that the user can perform on
his or her machine. Once the user selects a desired function, the
function is either performed outright, or in most cases, the user is
asked to fill in a simple form with required and option information,
which is then processed by sushi, and the action occurs.
The programming interface for sushi is very simple. There are
directories containing various files, such as menu indexes, or forms for
the user to fill out. These files are interpreted by sushi to generate
the menus the user sees on his/her screen. When the form is filled out
by the user, the entries are passed as command-line arguments to a
program, or script contained in one of the subdirectories. In this way,
it is possible to add new entries to the sushi menu structure, by simply
adding a new menu item, form and script, the binary does not need to be
recompiled to take advantage of this new menu.
2001-01-05 04:28:33 +03:00
|
|
|
case KEY_PPAGE: /* ^B */
|
2005-01-12 20:38:40 +03:00
|
|
|
return (REQ_PREV_PAGE);
|
Initial import of sushi.
Sushi is an interactive, menu-based program that is designed to aid
the user or administrator with administrative and complex tasks on thier
machines.
Sushi provides a menu of various functions that the user can perform on
his or her machine. Once the user selects a desired function, the
function is either performed outright, or in most cases, the user is
asked to fill in a simple form with required and option information,
which is then processed by sushi, and the action occurs.
The programming interface for sushi is very simple. There are
directories containing various files, such as menu indexes, or forms for
the user to fill out. These files are interpreted by sushi to generate
the menus the user sees on his/her screen. When the form is filled out
by the user, the entries are passed as command-line arguments to a
program, or script contained in one of the subdirectories. In this way,
it is possible to add new entries to the sushi menu structure, by simply
adding a new menu item, form and script, the binary does not need to be
recompiled to take advantage of this new menu.
2001-01-05 04:28:33 +03:00
|
|
|
case KEY_DOWN:
|
2005-01-12 20:38:40 +03:00
|
|
|
return (REQ_NEXT_FIELD);
|
Initial import of sushi.
Sushi is an interactive, menu-based program that is designed to aid
the user or administrator with administrative and complex tasks on thier
machines.
Sushi provides a menu of various functions that the user can perform on
his or her machine. Once the user selects a desired function, the
function is either performed outright, or in most cases, the user is
asked to fill in a simple form with required and option information,
which is then processed by sushi, and the action occurs.
The programming interface for sushi is very simple. There are
directories containing various files, such as menu indexes, or forms for
the user to fill out. These files are interpreted by sushi to generate
the menus the user sees on his/her screen. When the form is filled out
by the user, the entries are passed as command-line arguments to a
program, or script contained in one of the subdirectories. In this way,
it is possible to add new entries to the sushi menu structure, by simply
adding a new menu item, form and script, the binary does not need to be
recompiled to take advantage of this new menu.
2001-01-05 04:28:33 +03:00
|
|
|
case KEY_UP:
|
2005-01-12 20:38:40 +03:00
|
|
|
return (REQ_PREV_FIELD);
|
Initial import of sushi.
Sushi is an interactive, menu-based program that is designed to aid
the user or administrator with administrative and complex tasks on thier
machines.
Sushi provides a menu of various functions that the user can perform on
his or her machine. Once the user selects a desired function, the
function is either performed outright, or in most cases, the user is
asked to fill in a simple form with required and option information,
which is then processed by sushi, and the action occurs.
The programming interface for sushi is very simple. There are
directories containing various files, such as menu indexes, or forms for
the user to fill out. These files are interpreted by sushi to generate
the menus the user sees on his/her screen. When the form is filled out
by the user, the entries are passed as command-line arguments to a
program, or script contained in one of the subdirectories. In this way,
it is possible to add new entries to the sushi menu structure, by simply
adding a new menu item, form and script, the binary does not need to be
recompiled to take advantage of this new menu.
2001-01-05 04:28:33 +03:00
|
|
|
case 0x06: /* ^F */
|
2005-01-12 20:38:40 +03:00
|
|
|
return (REQ_NEXT_PAGE);
|
Initial import of sushi.
Sushi is an interactive, menu-based program that is designed to aid
the user or administrator with administrative and complex tasks on thier
machines.
Sushi provides a menu of various functions that the user can perform on
his or her machine. Once the user selects a desired function, the
function is either performed outright, or in most cases, the user is
asked to fill in a simple form with required and option information,
which is then processed by sushi, and the action occurs.
The programming interface for sushi is very simple. There are
directories containing various files, such as menu indexes, or forms for
the user to fill out. These files are interpreted by sushi to generate
the menus the user sees on his/her screen. When the form is filled out
by the user, the entries are passed as command-line arguments to a
program, or script contained in one of the subdirectories. In this way,
it is possible to add new entries to the sushi menu structure, by simply
adding a new menu item, form and script, the binary does not need to be
recompiled to take advantage of this new menu.
2001-01-05 04:28:33 +03:00
|
|
|
case 0x02: /* ^B */
|
2005-01-12 20:38:40 +03:00
|
|
|
return (REQ_PREV_PAGE);
|
Initial import of sushi.
Sushi is an interactive, menu-based program that is designed to aid
the user or administrator with administrative and complex tasks on thier
machines.
Sushi provides a menu of various functions that the user can perform on
his or her machine. Once the user selects a desired function, the
function is either performed outright, or in most cases, the user is
asked to fill in a simple form with required and option information,
which is then processed by sushi, and the action occurs.
The programming interface for sushi is very simple. There are
directories containing various files, such as menu indexes, or forms for
the user to fill out. These files are interpreted by sushi to generate
the menus the user sees on his/her screen. When the form is filled out
by the user, the entries are passed as command-line arguments to a
program, or script contained in one of the subdirectories. In this way,
it is possible to add new entries to the sushi menu structure, by simply
adding a new menu item, form and script, the binary does not need to be
recompiled to take advantage of this new menu.
2001-01-05 04:28:33 +03:00
|
|
|
case 0x0e: /* ^N */
|
2005-01-12 20:38:40 +03:00
|
|
|
return (REQ_NEXT_FIELD);
|
Initial import of sushi.
Sushi is an interactive, menu-based program that is designed to aid
the user or administrator with administrative and complex tasks on thier
machines.
Sushi provides a menu of various functions that the user can perform on
his or her machine. Once the user selects a desired function, the
function is either performed outright, or in most cases, the user is
asked to fill in a simple form with required and option information,
which is then processed by sushi, and the action occurs.
The programming interface for sushi is very simple. There are
directories containing various files, such as menu indexes, or forms for
the user to fill out. These files are interpreted by sushi to generate
the menus the user sees on his/her screen. When the form is filled out
by the user, the entries are passed as command-line arguments to a
program, or script contained in one of the subdirectories. In this way,
it is possible to add new entries to the sushi menu structure, by simply
adding a new menu item, form and script, the binary does not need to be
recompiled to take advantage of this new menu.
2001-01-05 04:28:33 +03:00
|
|
|
case 0x10: /* ^P */
|
2005-01-12 20:38:40 +03:00
|
|
|
return (REQ_PREV_FIELD);
|
Initial import of sushi.
Sushi is an interactive, menu-based program that is designed to aid
the user or administrator with administrative and complex tasks on thier
machines.
Sushi provides a menu of various functions that the user can perform on
his or her machine. Once the user selects a desired function, the
function is either performed outright, or in most cases, the user is
asked to fill in a simple form with required and option information,
which is then processed by sushi, and the action occurs.
The programming interface for sushi is very simple. There are
directories containing various files, such as menu indexes, or forms for
the user to fill out. These files are interpreted by sushi to generate
the menus the user sees on his/her screen. When the form is filled out
by the user, the entries are passed as command-line arguments to a
program, or script contained in one of the subdirectories. In this way,
it is possible to add new entries to the sushi menu structure, by simply
adding a new menu item, form and script, the binary does not need to be
recompiled to take advantage of this new menu.
2001-01-05 04:28:33 +03:00
|
|
|
case KEY_HOME:
|
2005-01-12 20:38:40 +03:00
|
|
|
return (REQ_FIRST_FIELD);
|
Initial import of sushi.
Sushi is an interactive, menu-based program that is designed to aid
the user or administrator with administrative and complex tasks on thier
machines.
Sushi provides a menu of various functions that the user can perform on
his or her machine. Once the user selects a desired function, the
function is either performed outright, or in most cases, the user is
asked to fill in a simple form with required and option information,
which is then processed by sushi, and the action occurs.
The programming interface for sushi is very simple. There are
directories containing various files, such as menu indexes, or forms for
the user to fill out. These files are interpreted by sushi to generate
the menus the user sees on his/her screen. When the form is filled out
by the user, the entries are passed as command-line arguments to a
program, or script contained in one of the subdirectories. In this way,
it is possible to add new entries to the sushi menu structure, by simply
adding a new menu item, form and script, the binary does not need to be
recompiled to take advantage of this new menu.
2001-01-05 04:28:33 +03:00
|
|
|
case KEY_LL:
|
2005-01-12 20:38:40 +03:00
|
|
|
return (REQ_LAST_FIELD);
|
Initial import of sushi.
Sushi is an interactive, menu-based program that is designed to aid
the user or administrator with administrative and complex tasks on thier
machines.
Sushi provides a menu of various functions that the user can perform on
his or her machine. Once the user selects a desired function, the
function is either performed outright, or in most cases, the user is
asked to fill in a simple form with required and option information,
which is then processed by sushi, and the action occurs.
The programming interface for sushi is very simple. There are
directories containing various files, such as menu indexes, or forms for
the user to fill out. These files are interpreted by sushi to generate
the menus the user sees on his/her screen. When the form is filled out
by the user, the entries are passed as command-line arguments to a
program, or script contained in one of the subdirectories. In this way,
it is possible to add new entries to the sushi menu structure, by simply
adding a new menu item, form and script, the binary does not need to be
recompiled to take advantage of this new menu.
2001-01-05 04:28:33 +03:00
|
|
|
case 0x0c: /* ^L */
|
2005-01-12 20:38:40 +03:00
|
|
|
return (REQ_LEFT_FIELD);
|
Initial import of sushi.
Sushi is an interactive, menu-based program that is designed to aid
the user or administrator with administrative and complex tasks on thier
machines.
Sushi provides a menu of various functions that the user can perform on
his or her machine. Once the user selects a desired function, the
function is either performed outright, or in most cases, the user is
asked to fill in a simple form with required and option information,
which is then processed by sushi, and the action occurs.
The programming interface for sushi is very simple. There are
directories containing various files, such as menu indexes, or forms for
the user to fill out. These files are interpreted by sushi to generate
the menus the user sees on his/her screen. When the form is filled out
by the user, the entries are passed as command-line arguments to a
program, or script contained in one of the subdirectories. In this way,
it is possible to add new entries to the sushi menu structure, by simply
adding a new menu item, form and script, the binary does not need to be
recompiled to take advantage of this new menu.
2001-01-05 04:28:33 +03:00
|
|
|
case 0x12: /* ^R */
|
2005-01-12 20:38:40 +03:00
|
|
|
return (REQ_RIGHT_FIELD);
|
Initial import of sushi.
Sushi is an interactive, menu-based program that is designed to aid
the user or administrator with administrative and complex tasks on thier
machines.
Sushi provides a menu of various functions that the user can perform on
his or her machine. Once the user selects a desired function, the
function is either performed outright, or in most cases, the user is
asked to fill in a simple form with required and option information,
which is then processed by sushi, and the action occurs.
The programming interface for sushi is very simple. There are
directories containing various files, such as menu indexes, or forms for
the user to fill out. These files are interpreted by sushi to generate
the menus the user sees on his/her screen. When the form is filled out
by the user, the entries are passed as command-line arguments to a
program, or script contained in one of the subdirectories. In this way,
it is possible to add new entries to the sushi menu structure, by simply
adding a new menu item, form and script, the binary does not need to be
recompiled to take advantage of this new menu.
2001-01-05 04:28:33 +03:00
|
|
|
case 0x15: /* ^U */
|
2005-01-12 20:38:40 +03:00
|
|
|
return (REQ_UP_FIELD);
|
Initial import of sushi.
Sushi is an interactive, menu-based program that is designed to aid
the user or administrator with administrative and complex tasks on thier
machines.
Sushi provides a menu of various functions that the user can perform on
his or her machine. Once the user selects a desired function, the
function is either performed outright, or in most cases, the user is
asked to fill in a simple form with required and option information,
which is then processed by sushi, and the action occurs.
The programming interface for sushi is very simple. There are
directories containing various files, such as menu indexes, or forms for
the user to fill out. These files are interpreted by sushi to generate
the menus the user sees on his/her screen. When the form is filled out
by the user, the entries are passed as command-line arguments to a
program, or script contained in one of the subdirectories. In this way,
it is possible to add new entries to the sushi menu structure, by simply
adding a new menu item, form and script, the binary does not need to be
recompiled to take advantage of this new menu.
2001-01-05 04:28:33 +03:00
|
|
|
case 0x04: /* ^D */
|
2005-01-12 20:38:40 +03:00
|
|
|
return (REQ_DOWN_FIELD);
|
Initial import of sushi.
Sushi is an interactive, menu-based program that is designed to aid
the user or administrator with administrative and complex tasks on thier
machines.
Sushi provides a menu of various functions that the user can perform on
his or her machine. Once the user selects a desired function, the
function is either performed outright, or in most cases, the user is
asked to fill in a simple form with required and option information,
which is then processed by sushi, and the action occurs.
The programming interface for sushi is very simple. There are
directories containing various files, such as menu indexes, or forms for
the user to fill out. These files are interpreted by sushi to generate
the menus the user sees on his/her screen. When the form is filled out
by the user, the entries are passed as command-line arguments to a
program, or script contained in one of the subdirectories. In this way,
it is possible to add new entries to the sushi menu structure, by simply
adding a new menu item, form and script, the binary does not need to be
recompiled to take advantage of this new menu.
2001-01-05 04:28:33 +03:00
|
|
|
case 0x17: /* ^W */
|
2005-01-12 20:38:40 +03:00
|
|
|
return (REQ_NEXT_WORD);
|
Initial import of sushi.
Sushi is an interactive, menu-based program that is designed to aid
the user or administrator with administrative and complex tasks on thier
machines.
Sushi provides a menu of various functions that the user can perform on
his or her machine. Once the user selects a desired function, the
function is either performed outright, or in most cases, the user is
asked to fill in a simple form with required and option information,
which is then processed by sushi, and the action occurs.
The programming interface for sushi is very simple. There are
directories containing various files, such as menu indexes, or forms for
the user to fill out. These files are interpreted by sushi to generate
the menus the user sees on his/her screen. When the form is filled out
by the user, the entries are passed as command-line arguments to a
program, or script contained in one of the subdirectories. In this way,
it is possible to add new entries to the sushi menu structure, by simply
adding a new menu item, form and script, the binary does not need to be
recompiled to take advantage of this new menu.
2001-01-05 04:28:33 +03:00
|
|
|
case 0x14: /* ^T */
|
2005-01-12 20:38:40 +03:00
|
|
|
return (REQ_PREV_WORD);
|
Initial import of sushi.
Sushi is an interactive, menu-based program that is designed to aid
the user or administrator with administrative and complex tasks on thier
machines.
Sushi provides a menu of various functions that the user can perform on
his or her machine. Once the user selects a desired function, the
function is either performed outright, or in most cases, the user is
asked to fill in a simple form with required and option information,
which is then processed by sushi, and the action occurs.
The programming interface for sushi is very simple. There are
directories containing various files, such as menu indexes, or forms for
the user to fill out. These files are interpreted by sushi to generate
the menus the user sees on his/her screen. When the form is filled out
by the user, the entries are passed as command-line arguments to a
program, or script contained in one of the subdirectories. In this way,
it is possible to add new entries to the sushi menu structure, by simply
adding a new menu item, form and script, the binary does not need to be
recompiled to take advantage of this new menu.
2001-01-05 04:28:33 +03:00
|
|
|
case 0x01: /* ^A */
|
2005-01-12 20:38:40 +03:00
|
|
|
return (REQ_BEG_FIELD);
|
Initial import of sushi.
Sushi is an interactive, menu-based program that is designed to aid
the user or administrator with administrative and complex tasks on thier
machines.
Sushi provides a menu of various functions that the user can perform on
his or her machine. Once the user selects a desired function, the
function is either performed outright, or in most cases, the user is
asked to fill in a simple form with required and option information,
which is then processed by sushi, and the action occurs.
The programming interface for sushi is very simple. There are
directories containing various files, such as menu indexes, or forms for
the user to fill out. These files are interpreted by sushi to generate
the menus the user sees on his/her screen. When the form is filled out
by the user, the entries are passed as command-line arguments to a
program, or script contained in one of the subdirectories. In this way,
it is possible to add new entries to the sushi menu structure, by simply
adding a new menu item, form and script, the binary does not need to be
recompiled to take advantage of this new menu.
2001-01-05 04:28:33 +03:00
|
|
|
case 0x05: /* ^E */
|
2005-01-12 20:38:40 +03:00
|
|
|
return (REQ_END_FIELD);
|
Initial import of sushi.
Sushi is an interactive, menu-based program that is designed to aid
the user or administrator with administrative and complex tasks on thier
machines.
Sushi provides a menu of various functions that the user can perform on
his or her machine. Once the user selects a desired function, the
function is either performed outright, or in most cases, the user is
asked to fill in a simple form with required and option information,
which is then processed by sushi, and the action occurs.
The programming interface for sushi is very simple. There are
directories containing various files, such as menu indexes, or forms for
the user to fill out. These files are interpreted by sushi to generate
the menus the user sees on his/her screen. When the form is filled out
by the user, the entries are passed as command-line arguments to a
program, or script contained in one of the subdirectories. In this way,
it is possible to add new entries to the sushi menu structure, by simply
adding a new menu item, form and script, the binary does not need to be
recompiled to take advantage of this new menu.
2001-01-05 04:28:33 +03:00
|
|
|
case KEY_LEFT:
|
2005-01-12 20:38:40 +03:00
|
|
|
return (REQ_PREV_CHAR);
|
Initial import of sushi.
Sushi is an interactive, menu-based program that is designed to aid
the user or administrator with administrative and complex tasks on thier
machines.
Sushi provides a menu of various functions that the user can perform on
his or her machine. Once the user selects a desired function, the
function is either performed outright, or in most cases, the user is
asked to fill in a simple form with required and option information,
which is then processed by sushi, and the action occurs.
The programming interface for sushi is very simple. There are
directories containing various files, such as menu indexes, or forms for
the user to fill out. These files are interpreted by sushi to generate
the menus the user sees on his/her screen. When the form is filled out
by the user, the entries are passed as command-line arguments to a
program, or script contained in one of the subdirectories. In this way,
it is possible to add new entries to the sushi menu structure, by simply
adding a new menu item, form and script, the binary does not need to be
recompiled to take advantage of this new menu.
2001-01-05 04:28:33 +03:00
|
|
|
case KEY_RIGHT:
|
2005-01-12 20:38:40 +03:00
|
|
|
return (REQ_NEXT_CHAR);
|
Initial import of sushi.
Sushi is an interactive, menu-based program that is designed to aid
the user or administrator with administrative and complex tasks on thier
machines.
Sushi provides a menu of various functions that the user can perform on
his or her machine. Once the user selects a desired function, the
function is either performed outright, or in most cases, the user is
asked to fill in a simple form with required and option information,
which is then processed by sushi, and the action occurs.
The programming interface for sushi is very simple. There are
directories containing various files, such as menu indexes, or forms for
the user to fill out. These files are interpreted by sushi to generate
the menus the user sees on his/her screen. When the form is filled out
by the user, the entries are passed as command-line arguments to a
program, or script contained in one of the subdirectories. In this way,
it is possible to add new entries to the sushi menu structure, by simply
adding a new menu item, form and script, the binary does not need to be
recompiled to take advantage of this new menu.
2001-01-05 04:28:33 +03:00
|
|
|
case 0x0f: /* ^O */
|
2005-01-12 20:38:40 +03:00
|
|
|
return (REQ_INS_LINE);
|
2001-02-01 11:43:46 +03:00
|
|
|
case KEY_DC:
|
Initial import of sushi.
Sushi is an interactive, menu-based program that is designed to aid
the user or administrator with administrative and complex tasks on thier
machines.
Sushi provides a menu of various functions that the user can perform on
his or her machine. Once the user selects a desired function, the
function is either performed outright, or in most cases, the user is
asked to fill in a simple form with required and option information,
which is then processed by sushi, and the action occurs.
The programming interface for sushi is very simple. There are
directories containing various files, such as menu indexes, or forms for
the user to fill out. These files are interpreted by sushi to generate
the menus the user sees on his/her screen. When the form is filled out
by the user, the entries are passed as command-line arguments to a
program, or script contained in one of the subdirectories. In this way,
it is possible to add new entries to the sushi menu structure, by simply
adding a new menu item, form and script, the binary does not need to be
recompiled to take advantage of this new menu.
2001-01-05 04:28:33 +03:00
|
|
|
case 0x16: /* ^V */
|
2005-01-12 20:38:40 +03:00
|
|
|
return (REQ_DEL_CHAR);
|
2001-02-01 11:43:46 +03:00
|
|
|
case KEY_BACKSPACE:
|
Initial import of sushi.
Sushi is an interactive, menu-based program that is designed to aid
the user or administrator with administrative and complex tasks on thier
machines.
Sushi provides a menu of various functions that the user can perform on
his or her machine. Once the user selects a desired function, the
function is either performed outright, or in most cases, the user is
asked to fill in a simple form with required and option information,
which is then processed by sushi, and the action occurs.
The programming interface for sushi is very simple. There are
directories containing various files, such as menu indexes, or forms for
the user to fill out. These files are interpreted by sushi to generate
the menus the user sees on his/her screen. When the form is filled out
by the user, the entries are passed as command-line arguments to a
program, or script contained in one of the subdirectories. In this way,
it is possible to add new entries to the sushi menu structure, by simply
adding a new menu item, form and script, the binary does not need to be
recompiled to take advantage of this new menu.
2001-01-05 04:28:33 +03:00
|
|
|
case 0x08: /* ^H */
|
2005-01-12 20:38:40 +03:00
|
|
|
return (REQ_DEL_PREV);
|
Initial import of sushi.
Sushi is an interactive, menu-based program that is designed to aid
the user or administrator with administrative and complex tasks on thier
machines.
Sushi provides a menu of various functions that the user can perform on
his or her machine. Once the user selects a desired function, the
function is either performed outright, or in most cases, the user is
asked to fill in a simple form with required and option information,
which is then processed by sushi, and the action occurs.
The programming interface for sushi is very simple. There are
directories containing various files, such as menu indexes, or forms for
the user to fill out. These files are interpreted by sushi to generate
the menus the user sees on his/her screen. When the form is filled out
by the user, the entries are passed as command-line arguments to a
program, or script contained in one of the subdirectories. In this way,
it is possible to add new entries to the sushi menu structure, by simply
adding a new menu item, form and script, the binary does not need to be
recompiled to take advantage of this new menu.
2001-01-05 04:28:33 +03:00
|
|
|
case 0x19: /* ^Y */
|
2005-01-12 20:38:40 +03:00
|
|
|
return (REQ_DEL_LINE);
|
Initial import of sushi.
Sushi is an interactive, menu-based program that is designed to aid
the user or administrator with administrative and complex tasks on thier
machines.
Sushi provides a menu of various functions that the user can perform on
his or her machine. Once the user selects a desired function, the
function is either performed outright, or in most cases, the user is
asked to fill in a simple form with required and option information,
which is then processed by sushi, and the action occurs.
The programming interface for sushi is very simple. There are
directories containing various files, such as menu indexes, or forms for
the user to fill out. These files are interpreted by sushi to generate
the menus the user sees on his/her screen. When the form is filled out
by the user, the entries are passed as command-line arguments to a
program, or script contained in one of the subdirectories. In this way,
it is possible to add new entries to the sushi menu structure, by simply
adding a new menu item, form and script, the binary does not need to be
recompiled to take advantage of this new menu.
2001-01-05 04:28:33 +03:00
|
|
|
case 0x07: /* ^G */
|
2005-01-12 20:38:40 +03:00
|
|
|
return (REQ_DEL_WORD);
|
Initial import of sushi.
Sushi is an interactive, menu-based program that is designed to aid
the user or administrator with administrative and complex tasks on thier
machines.
Sushi provides a menu of various functions that the user can perform on
his or her machine. Once the user selects a desired function, the
function is either performed outright, or in most cases, the user is
asked to fill in a simple form with required and option information,
which is then processed by sushi, and the action occurs.
The programming interface for sushi is very simple. There are
directories containing various files, such as menu indexes, or forms for
the user to fill out. These files are interpreted by sushi to generate
the menus the user sees on his/her screen. When the form is filled out
by the user, the entries are passed as command-line arguments to a
program, or script contained in one of the subdirectories. In this way,
it is possible to add new entries to the sushi menu structure, by simply
adding a new menu item, form and script, the binary does not need to be
recompiled to take advantage of this new menu.
2001-01-05 04:28:33 +03:00
|
|
|
case 0x03: /* ^C */
|
2005-01-12 20:38:40 +03:00
|
|
|
return (REQ_CLR_EOL);
|
Initial import of sushi.
Sushi is an interactive, menu-based program that is designed to aid
the user or administrator with administrative and complex tasks on thier
machines.
Sushi provides a menu of various functions that the user can perform on
his or her machine. Once the user selects a desired function, the
function is either performed outright, or in most cases, the user is
asked to fill in a simple form with required and option information,
which is then processed by sushi, and the action occurs.
The programming interface for sushi is very simple. There are
directories containing various files, such as menu indexes, or forms for
the user to fill out. These files are interpreted by sushi to generate
the menus the user sees on his/her screen. When the form is filled out
by the user, the entries are passed as command-line arguments to a
program, or script contained in one of the subdirectories. In this way,
it is possible to add new entries to the sushi menu structure, by simply
adding a new menu item, form and script, the binary does not need to be
recompiled to take advantage of this new menu.
2001-01-05 04:28:33 +03:00
|
|
|
case 0x0b: /* ^K */
|
2005-01-12 20:38:40 +03:00
|
|
|
return (REQ_CLR_EOF);
|
Initial import of sushi.
Sushi is an interactive, menu-based program that is designed to aid
the user or administrator with administrative and complex tasks on thier
machines.
Sushi provides a menu of various functions that the user can perform on
his or her machine. Once the user selects a desired function, the
function is either performed outright, or in most cases, the user is
asked to fill in a simple form with required and option information,
which is then processed by sushi, and the action occurs.
The programming interface for sushi is very simple. There are
directories containing various files, such as menu indexes, or forms for
the user to fill out. These files are interpreted by sushi to generate
the menus the user sees on his/her screen. When the form is filled out
by the user, the entries are passed as command-line arguments to a
program, or script contained in one of the subdirectories. In this way,
it is possible to add new entries to the sushi menu structure, by simply
adding a new menu item, form and script, the binary does not need to be
recompiled to take advantage of this new menu.
2001-01-05 04:28:33 +03:00
|
|
|
case 0x18: /* ^X */
|
2005-01-12 20:38:40 +03:00
|
|
|
return (REQ_CLR_FIELD);
|
Initial import of sushi.
Sushi is an interactive, menu-based program that is designed to aid
the user or administrator with administrative and complex tasks on thier
machines.
Sushi provides a menu of various functions that the user can perform on
his or her machine. Once the user selects a desired function, the
function is either performed outright, or in most cases, the user is
asked to fill in a simple form with required and option information,
which is then processed by sushi, and the action occurs.
The programming interface for sushi is very simple. There are
directories containing various files, such as menu indexes, or forms for
the user to fill out. These files are interpreted by sushi to generate
the menus the user sees on his/her screen. When the form is filled out
by the user, the entries are passed as command-line arguments to a
program, or script contained in one of the subdirectories. In this way,
it is possible to add new entries to the sushi menu structure, by simply
adding a new menu item, form and script, the binary does not need to be
recompiled to take advantage of this new menu.
2001-01-05 04:28:33 +03:00
|
|
|
case 0x9: /* tab*/
|
2005-01-12 20:38:40 +03:00
|
|
|
return (REQ_NEXT_CHOICE);
|
Initial import of sushi.
Sushi is an interactive, menu-based program that is designed to aid
the user or administrator with administrative and complex tasks on thier
machines.
Sushi provides a menu of various functions that the user can perform on
his or her machine. Once the user selects a desired function, the
function is either performed outright, or in most cases, the user is
asked to fill in a simple form with required and option information,
which is then processed by sushi, and the action occurs.
The programming interface for sushi is very simple. There are
directories containing various files, such as menu indexes, or forms for
the user to fill out. These files are interpreted by sushi to generate
the menus the user sees on his/her screen. When the form is filled out
by the user, the entries are passed as command-line arguments to a
program, or script contained in one of the subdirectories. In this way,
it is possible to add new entries to the sushi menu structure, by simply
adding a new menu item, form and script, the binary does not need to be
recompiled to take advantage of this new menu.
2001-01-05 04:28:33 +03:00
|
|
|
case 0x1a: /* ^Z 0x1a*/
|
2005-01-12 20:38:40 +03:00
|
|
|
return (REQ_PREV_CHOICE);
|
Initial import of sushi.
Sushi is an interactive, menu-based program that is designed to aid
the user or administrator with administrative and complex tasks on thier
machines.
Sushi provides a menu of various functions that the user can perform on
his or her machine. Once the user selects a desired function, the
function is either performed outright, or in most cases, the user is
asked to fill in a simple form with required and option information,
which is then processed by sushi, and the action occurs.
The programming interface for sushi is very simple. There are
directories containing various files, such as menu indexes, or forms for
the user to fill out. These files are interpreted by sushi to generate
the menus the user sees on his/her screen. When the form is filled out
by the user, the entries are passed as command-line arguments to a
program, or script contained in one of the subdirectories. In this way,
it is possible to add new entries to the sushi menu structure, by simply
adding a new menu item, form and script, the binary does not need to be
recompiled to take advantage of this new menu.
2001-01-05 04:28:33 +03:00
|
|
|
case KEY_IC: /* INS */
|
|
|
|
if (mode == REQ_INS_MODE)
|
2005-01-12 20:38:40 +03:00
|
|
|
return (mode = REQ_OVL_MODE);
|
Initial import of sushi.
Sushi is an interactive, menu-based program that is designed to aid
the user or administrator with administrative and complex tasks on thier
machines.
Sushi provides a menu of various functions that the user can perform on
his or her machine. Once the user selects a desired function, the
function is either performed outright, or in most cases, the user is
asked to fill in a simple form with required and option information,
which is then processed by sushi, and the action occurs.
The programming interface for sushi is very simple. There are
directories containing various files, such as menu indexes, or forms for
the user to fill out. These files are interpreted by sushi to generate
the menus the user sees on his/her screen. When the form is filled out
by the user, the entries are passed as command-line arguments to a
program, or script contained in one of the subdirectories. In this way,
it is possible to add new entries to the sushi menu structure, by simply
adding a new menu item, form and script, the binary does not need to be
recompiled to take advantage of this new menu.
2001-01-05 04:28:33 +03:00
|
|
|
else
|
2005-01-12 20:38:40 +03:00
|
|
|
return (mode = REQ_INS_MODE);
|
Initial import of sushi.
Sushi is an interactive, menu-based program that is designed to aid
the user or administrator with administrative and complex tasks on thier
machines.
Sushi provides a menu of various functions that the user can perform on
his or her machine. Once the user selects a desired function, the
function is either performed outright, or in most cases, the user is
asked to fill in a simple form with required and option information,
which is then processed by sushi, and the action occurs.
The programming interface for sushi is very simple. There are
directories containing various files, such as menu indexes, or forms for
the user to fill out. These files are interpreted by sushi to generate
the menus the user sees on his/her screen. When the form is filled out
by the user, the entries are passed as command-line arguments to a
program, or script contained in one of the subdirectories. In this way,
it is possible to add new entries to the sushi menu structure, by simply
adding a new menu item, form and script, the binary does not need to be
recompiled to take advantage of this new menu.
2001-01-05 04:28:33 +03:00
|
|
|
}
|
2005-01-12 20:38:40 +03:00
|
|
|
return (c);
|
Initial import of sushi.
Sushi is an interactive, menu-based program that is designed to aid
the user or administrator with administrative and complex tasks on thier
machines.
Sushi provides a menu of various functions that the user can perform on
his or her machine. Once the user selects a desired function, the
function is either performed outright, or in most cases, the user is
asked to fill in a simple form with required and option information,
which is then processed by sushi, and the action occurs.
The programming interface for sushi is very simple. There are
directories containing various files, such as menu indexes, or forms for
the user to fill out. These files are interpreted by sushi to generate
the menus the user sees on his/her screen. When the form is filled out
by the user, the entries are passed as command-line arguments to a
program, or script contained in one of the subdirectories. In this way,
it is possible to add new entries to the sushi menu structure, by simply
adding a new menu item, form and script, the binary does not need to be
recompiled to take advantage of this new menu.
2001-01-05 04:28:33 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
static int
|
|
|
|
my_driver(FORM * form, int c, char *path)
|
|
|
|
{
|
|
|
|
CDKSCROLL *plist;
|
|
|
|
CDKSELECTION *slist;
|
|
|
|
CDKENTRY *entry;
|
|
|
|
FIELD *curfield;
|
|
|
|
char **list;
|
2001-01-24 10:17:10 +03:00
|
|
|
int i, j, y, n, dcols, drows, dmax;
|
2001-01-31 12:35:42 +03:00
|
|
|
char *tmp, *otmp, *p;
|
Initial import of sushi.
Sushi is an interactive, menu-based program that is designed to aid
the user or administrator with administrative and complex tasks on thier
machines.
Sushi provides a menu of various functions that the user can perform on
his or her machine. Once the user selects a desired function, the
function is either performed outright, or in most cases, the user is
asked to fill in a simple form with required and option information,
which is then processed by sushi, and the action occurs.
The programming interface for sushi is very simple. There are
directories containing various files, such as menu indexes, or forms for
the user to fill out. These files are interpreted by sushi to generate
the menus the user sees on his/her screen. When the form is filled out
by the user, the entries are passed as command-line arguments to a
program, or script contained in one of the subdirectories. In this way,
it is possible to add new entries to the sushi menu structure, by simply
adding a new menu item, form and script, the binary does not need to be
recompiled to take advantage of this new menu.
2001-01-05 04:28:33 +03:00
|
|
|
char *choices[] = {" ", "+"};
|
|
|
|
char buf[1024];
|
|
|
|
|
|
|
|
switch (c) {
|
|
|
|
case EDIT:
|
|
|
|
curfield = current_field(form);
|
2001-01-24 10:17:10 +03:00
|
|
|
if (field_opts(curfield) & O_STATIC) {
|
|
|
|
field_info(curfield, &drows, &dcols, &j, &j, &j, &j);
|
|
|
|
dmax = 0;
|
|
|
|
} else
|
|
|
|
dynamic_field_info(curfield, &drows, &dcols, &dmax);
|
Initial import of sushi.
Sushi is an interactive, menu-based program that is designed to aid
the user or administrator with administrative and complex tasks on thier
machines.
Sushi provides a menu of various functions that the user can perform on
his or her machine. Once the user selects a desired function, the
function is either performed outright, or in most cases, the user is
asked to fill in a simple form with required and option information,
which is then processed by sushi, and the action occurs.
The programming interface for sushi is very simple. There are
directories containing various files, such as menu indexes, or forms for
the user to fill out. These files are interpreted by sushi to generate
the menus the user sees on his/her screen. When the form is filled out
by the user, the entries are passed as command-line arguments to a
program, or script contained in one of the subdirectories. In this way,
it is possible to add new entries to the sushi menu structure, by simply
adding a new menu item, form and script, the binary does not need to be
recompiled to take advantage of this new menu.
2001-01-05 04:28:33 +03:00
|
|
|
if (dmax == 0)
|
|
|
|
dmax = dcols;
|
|
|
|
entry = newCDKEntry(cdkscreen, BOTTOM, CENTER,
|
|
|
|
catgets(catalog, 4, 6, "Enter the field data "
|
|
|
|
"below, and hit enter to return to the form."),
|
2001-01-24 10:23:51 +03:00
|
|
|
catgets(catalog, 4, 7, "Data Entry: "),
|
2005-01-12 20:38:40 +03:00
|
|
|
A_REVERSE, field_pad(curfield), vMIXED, ws.ws_col - 20,
|
Initial import of sushi.
Sushi is an interactive, menu-based program that is designed to aid
the user or administrator with administrative and complex tasks on thier
machines.
Sushi provides a menu of various functions that the user can perform on
his or her machine. Once the user selects a desired function, the
function is either performed outright, or in most cases, the user is
asked to fill in a simple form with required and option information,
which is then processed by sushi, and the action occurs.
The programming interface for sushi is very simple. There are
directories containing various files, such as menu indexes, or forms for
the user to fill out. These files are interpreted by sushi to generate
the menus the user sees on his/her screen. When the form is filled out
by the user, the entries are passed as command-line arguments to a
program, or script contained in one of the subdirectories. In this way,
it is possible to add new entries to the sushi menu structure, by simply
adding a new menu item, form and script, the binary does not need to be
recompiled to take advantage of this new menu.
2001-01-05 04:28:33 +03:00
|
|
|
0, dmax, TRUE, FALSE);
|
2001-01-24 10:17:10 +03:00
|
|
|
if (field_buffer(curfield, 0) == NULL)
|
|
|
|
setCDKEntry(entry, "", 0, dmax, TRUE);
|
|
|
|
else
|
|
|
|
setCDKEntry(entry, field_buffer(curfield, 0), 0,
|
|
|
|
dmax, TRUE);
|
Initial import of sushi.
Sushi is an interactive, menu-based program that is designed to aid
the user or administrator with administrative and complex tasks on thier
machines.
Sushi provides a menu of various functions that the user can perform on
his or her machine. Once the user selects a desired function, the
function is either performed outright, or in most cases, the user is
asked to fill in a simple form with required and option information,
which is then processed by sushi, and the action occurs.
The programming interface for sushi is very simple. There are
directories containing various files, such as menu indexes, or forms for
the user to fill out. These files are interpreted by sushi to generate
the menus the user sees on his/her screen. When the form is filled out
by the user, the entries are passed as command-line arguments to a
program, or script contained in one of the subdirectories. In this way,
it is possible to add new entries to the sushi menu structure, by simply
adding a new menu item, form and script, the binary does not need to be
recompiled to take advantage of this new menu.
2001-01-05 04:28:33 +03:00
|
|
|
injectCDKEntry(entry, CDK_BEGOFLINE);
|
|
|
|
tmp = activateCDKEntry(entry, NULL);
|
|
|
|
if (entry->exitType == vESCAPE_HIT) {
|
|
|
|
destroyCDKEntry(entry);
|
2005-01-12 20:38:40 +03:00
|
|
|
return (FALSE);
|
Initial import of sushi.
Sushi is an interactive, menu-based program that is designed to aid
the user or administrator with administrative and complex tasks on thier
machines.
Sushi provides a menu of various functions that the user can perform on
his or her machine. Once the user selects a desired function, the
function is either performed outright, or in most cases, the user is
asked to fill in a simple form with required and option information,
which is then processed by sushi, and the action occurs.
The programming interface for sushi is very simple. There are
directories containing various files, such as menu indexes, or forms for
the user to fill out. These files are interpreted by sushi to generate
the menus the user sees on his/her screen. When the form is filled out
by the user, the entries are passed as command-line arguments to a
program, or script contained in one of the subdirectories. In this way,
it is possible to add new entries to the sushi menu structure, by simply
adding a new menu item, form and script, the binary does not need to be
recompiled to take advantage of this new menu.
2001-01-05 04:28:33 +03:00
|
|
|
}
|
|
|
|
set_field_buffer(curfield, 0, tmp);
|
|
|
|
destroyCDKEntry(entry);
|
2001-02-01 11:29:46 +03:00
|
|
|
touchwin(stdscr);
|
|
|
|
wrefresh(stdscr);
|
2005-01-12 20:38:40 +03:00
|
|
|
return (FALSE);
|
2001-01-10 06:05:48 +03:00
|
|
|
/* NOTREACHED */
|
Initial import of sushi.
Sushi is an interactive, menu-based program that is designed to aid
the user or administrator with administrative and complex tasks on thier
machines.
Sushi provides a menu of various functions that the user can perform on
his or her machine. Once the user selects a desired function, the
function is either performed outright, or in most cases, the user is
asked to fill in a simple form with required and option information,
which is then processed by sushi, and the action occurs.
The programming interface for sushi is very simple. There are
directories containing various files, such as menu indexes, or forms for
the user to fill out. These files are interpreted by sushi to generate
the menus the user sees on his/her screen. When the form is filled out
by the user, the entries are passed as command-line arguments to a
program, or script contained in one of the subdirectories. In this way,
it is possible to add new entries to the sushi menu structure, by simply
adding a new menu item, form and script, the binary does not need to be
recompiled to take advantage of this new menu.
2001-01-05 04:28:33 +03:00
|
|
|
break;
|
|
|
|
case COMMAND:
|
|
|
|
/* for now, ignore this.. it's messy */
|
2005-01-12 20:38:40 +03:00
|
|
|
return (FALSE);
|
2001-01-10 06:05:48 +03:00
|
|
|
/* NOTREACHED */
|
Initial import of sushi.
Sushi is an interactive, menu-based program that is designed to aid
the user or administrator with administrative and complex tasks on thier
machines.
Sushi provides a menu of various functions that the user can perform on
his or her machine. Once the user selects a desired function, the
function is either performed outright, or in most cases, the user is
asked to fill in a simple form with required and option information,
which is then processed by sushi, and the action occurs.
The programming interface for sushi is very simple. There are
directories containing various files, such as menu indexes, or forms for
the user to fill out. These files are interpreted by sushi to generate
the menus the user sees on his/her screen. When the form is filled out
by the user, the entries are passed as command-line arguments to a
program, or script contained in one of the subdirectories. In this way,
it is possible to add new entries to the sushi menu structure, by simply
adding a new menu item, form and script, the binary does not need to be
recompiled to take advantage of this new menu.
2001-01-05 04:28:33 +03:00
|
|
|
break;
|
|
|
|
case RESET:
|
2005-01-12 20:38:40 +03:00
|
|
|
return (2); /* hrmmm... */
|
2001-01-10 06:05:48 +03:00
|
|
|
/* NOTREACHED */
|
Initial import of sushi.
Sushi is an interactive, menu-based program that is designed to aid
the user or administrator with administrative and complex tasks on thier
machines.
Sushi provides a menu of various functions that the user can perform on
his or her machine. Once the user selects a desired function, the
function is either performed outright, or in most cases, the user is
asked to fill in a simple form with required and option information,
which is then processed by sushi, and the action occurs.
The programming interface for sushi is very simple. There are
directories containing various files, such as menu indexes, or forms for
the user to fill out. These files are interpreted by sushi to generate
the menus the user sees on his/her screen. When the form is filled out
by the user, the entries are passed as command-line arguments to a
program, or script contained in one of the subdirectories. In this way,
it is possible to add new entries to the sushi menu structure, by simply
adding a new menu item, form and script, the binary does not need to be
recompiled to take advantage of this new menu.
2001-01-05 04:28:33 +03:00
|
|
|
break;
|
|
|
|
case REFRESH:
|
|
|
|
touchwin(stdscr);
|
|
|
|
wrefresh(stdscr);
|
2005-01-12 20:38:40 +03:00
|
|
|
return (FALSE);
|
2001-01-10 06:05:48 +03:00
|
|
|
/* NOTREACHED */
|
Initial import of sushi.
Sushi is an interactive, menu-based program that is designed to aid
the user or administrator with administrative and complex tasks on thier
machines.
Sushi provides a menu of various functions that the user can perform on
his or her machine. Once the user selects a desired function, the
function is either performed outright, or in most cases, the user is
asked to fill in a simple form with required and option information,
which is then processed by sushi, and the action occurs.
The programming interface for sushi is very simple. There are
directories containing various files, such as menu indexes, or forms for
the user to fill out. These files are interpreted by sushi to generate
the menus the user sees on his/her screen. When the form is filled out
by the user, the entries are passed as command-line arguments to a
program, or script contained in one of the subdirectories. In this way,
it is possible to add new entries to the sushi menu structure, by simply
adding a new menu item, form and script, the binary does not need to be
recompiled to take advantage of this new menu.
2001-01-05 04:28:33 +03:00
|
|
|
break;
|
|
|
|
case SHELL:
|
|
|
|
endwin();
|
|
|
|
system("/bin/sh");
|
|
|
|
wrefresh(stdscr);
|
2005-01-12 20:38:40 +03:00
|
|
|
return (FALSE);
|
2001-01-10 06:05:48 +03:00
|
|
|
/* NOTREACHED */
|
Initial import of sushi.
Sushi is an interactive, menu-based program that is designed to aid
the user or administrator with administrative and complex tasks on thier
machines.
Sushi provides a menu of various functions that the user can perform on
his or her machine. Once the user selects a desired function, the
function is either performed outright, or in most cases, the user is
asked to fill in a simple form with required and option information,
which is then processed by sushi, and the action occurs.
The programming interface for sushi is very simple. There are
directories containing various files, such as menu indexes, or forms for
the user to fill out. These files are interpreted by sushi to generate
the menus the user sees on his/her screen. When the form is filled out
by the user, the entries are passed as command-line arguments to a
program, or script contained in one of the subdirectories. In this way,
it is possible to add new entries to the sushi menu structure, by simply
adding a new menu item, form and script, the binary does not need to be
recompiled to take advantage of this new menu.
2001-01-05 04:28:33 +03:00
|
|
|
break;
|
|
|
|
case DUMPSCREEN:
|
2003-10-21 06:55:43 +04:00
|
|
|
do_scrdump(0, NULL, NULL, 0);
|
2005-01-12 20:38:40 +03:00
|
|
|
return (FALSE);
|
2001-01-10 06:05:48 +03:00
|
|
|
/* NOTREACHED */
|
Initial import of sushi.
Sushi is an interactive, menu-based program that is designed to aid
the user or administrator with administrative and complex tasks on thier
machines.
Sushi provides a menu of various functions that the user can perform on
his or her machine. Once the user selects a desired function, the
function is either performed outright, or in most cases, the user is
asked to fill in a simple form with required and option information,
which is then processed by sushi, and the action occurs.
The programming interface for sushi is very simple. There are
directories containing various files, such as menu indexes, or forms for
the user to fill out. These files are interpreted by sushi to generate
the menus the user sees on his/her screen. When the form is filled out
by the user, the entries are passed as command-line arguments to a
program, or script contained in one of the subdirectories. In this way,
it is possible to add new entries to the sushi menu structure, by simply
adding a new menu item, form and script, the binary does not need to be
recompiled to take advantage of this new menu.
2001-01-05 04:28:33 +03:00
|
|
|
break;
|
|
|
|
case SHOWHELP:
|
2004-03-24 22:10:58 +03:00
|
|
|
curs_set(0);
|
2005-01-12 20:38:40 +03:00
|
|
|
if (simple_lang_handler(path, HELPFILE, handle_help) == -2)
|
2001-01-10 06:05:48 +03:00
|
|
|
nohelp();
|
2002-07-26 12:43:26 +04:00
|
|
|
touchwin(stdscr);
|
|
|
|
wrefresh(stdscr);
|
2005-01-12 20:38:40 +03:00
|
|
|
curs_set(1);
|
|
|
|
return (FALSE);
|
2001-01-10 06:05:48 +03:00
|
|
|
/* NOTREACHED */
|
Initial import of sushi.
Sushi is an interactive, menu-based program that is designed to aid
the user or administrator with administrative and complex tasks on thier
machines.
Sushi provides a menu of various functions that the user can perform on
his or her machine. Once the user selects a desired function, the
function is either performed outright, or in most cases, the user is
asked to fill in a simple form with required and option information,
which is then processed by sushi, and the action occurs.
The programming interface for sushi is very simple. There are
directories containing various files, such as menu indexes, or forms for
the user to fill out. These files are interpreted by sushi to generate
the menus the user sees on his/her screen. When the form is filled out
by the user, the entries are passed as command-line arguments to a
program, or script contained in one of the subdirectories. In this way,
it is possible to add new entries to the sushi menu structure, by simply
adding a new menu item, form and script, the binary does not need to be
recompiled to take advantage of this new menu.
2001-01-05 04:28:33 +03:00
|
|
|
break;
|
|
|
|
case GENLIST:
|
|
|
|
/* pull the grand popup list */
|
|
|
|
curfield = current_field(form);
|
2005-01-12 20:38:40 +03:00
|
|
|
list = (char **)field_userptr(curfield);
|
2001-01-09 22:32:35 +03:00
|
|
|
if (list == NULL)
|
|
|
|
break;
|
2005-01-12 20:38:40 +03:00
|
|
|
for (i = 0, y = 0; list[i] != NULL; i++)
|
2001-01-24 10:46:23 +03:00
|
|
|
if ((strlen(list[i]) + 1) > y)
|
|
|
|
y = strlen(list[i]) + 1;
|
2001-01-24 10:17:10 +03:00
|
|
|
if (field_buffer(curfield, 1) == NULL ||
|
|
|
|
field_buffer(curfield, 0) == NULL)
|
2005-01-12 20:38:40 +03:00
|
|
|
return (FALSE);
|
|
|
|
curs_set(0);
|
2001-01-31 12:35:42 +03:00
|
|
|
otmp = tmp = strdup(field_buffer(curfield, 1));
|
Initial import of sushi.
Sushi is an interactive, menu-based program that is designed to aid
the user or administrator with administrative and complex tasks on thier
machines.
Sushi provides a menu of various functions that the user can perform on
his or her machine. Once the user selects a desired function, the
function is either performed outright, or in most cases, the user is
asked to fill in a simple form with required and option information,
which is then processed by sushi, and the action occurs.
The programming interface for sushi is very simple. There are
directories containing various files, such as menu indexes, or forms for
the user to fill out. These files are interpreted by sushi to generate
the menus the user sees on his/her screen. When the form is filled out
by the user, the entries are passed as command-line arguments to a
program, or script contained in one of the subdirectories. In this way,
it is possible to add new entries to the sushi menu structure, by simply
adding a new menu item, form and script, the binary does not need to be
recompiled to take advantage of this new menu.
2001-01-05 04:28:33 +03:00
|
|
|
stripWhiteSpace(vBOTH, tmp);
|
|
|
|
if (*tmp == 'm') {
|
|
|
|
slist = newCDKSelection(cdkscreen, RIGHT, CENTER,
|
2005-01-12 20:38:40 +03:00
|
|
|
RIGHT, 10, y + 2,
|
Initial import of sushi.
Sushi is an interactive, menu-based program that is designed to aid
the user or administrator with administrative and complex tasks on thier
machines.
Sushi provides a menu of various functions that the user can perform on
his or her machine. Once the user selects a desired function, the
function is either performed outright, or in most cases, the user is
asked to fill in a simple form with required and option information,
which is then processed by sushi, and the action occurs.
The programming interface for sushi is very simple. There are
directories containing various files, such as menu indexes, or forms for
the user to fill out. These files are interpreted by sushi to generate
the menus the user sees on his/her screen. When the form is filled out
by the user, the entries are passed as command-line arguments to a
program, or script contained in one of the subdirectories. In this way,
it is possible to add new entries to the sushi menu structure, by simply
adding a new menu item, form and script, the binary does not need to be
recompiled to take advantage of this new menu.
2001-01-05 04:28:33 +03:00
|
|
|
catgets(catalog, 4, 1, "Select choices"),
|
|
|
|
list, i, choices, 2, A_REVERSE ,TRUE, FALSE);
|
2001-01-31 12:35:42 +03:00
|
|
|
free(otmp);
|
|
|
|
otmp = tmp = strdup(field_buffer(curfield, 0));
|
Initial import of sushi.
Sushi is an interactive, menu-based program that is designed to aid
the user or administrator with administrative and complex tasks on thier
machines.
Sushi provides a menu of various functions that the user can perform on
his or her machine. Once the user selects a desired function, the
function is either performed outright, or in most cases, the user is
asked to fill in a simple form with required and option information,
which is then processed by sushi, and the action occurs.
The programming interface for sushi is very simple. There are
directories containing various files, such as menu indexes, or forms for
the user to fill out. These files are interpreted by sushi to generate
the menus the user sees on his/her screen. When the form is filled out
by the user, the entries are passed as command-line arguments to a
program, or script contained in one of the subdirectories. In this way,
it is possible to add new entries to the sushi menu structure, by simply
adding a new menu item, form and script, the binary does not need to be
recompiled to take advantage of this new menu.
2001-01-05 04:28:33 +03:00
|
|
|
stripWhiteSpace(vBOTH, tmp);
|
|
|
|
if (*tmp != '\0')
|
|
|
|
for (p = tmp; p != NULL; p = strsep(&tmp, ","))
|
|
|
|
for (y = 0; y < i; y++)
|
|
|
|
if (strcmp(p, list[y]) == 0)
|
|
|
|
slist->selections[y] = 1;
|
|
|
|
activateCDKSelection(slist, NULL);
|
|
|
|
for (y = 0; y < i; y++)
|
|
|
|
if (slist->selections[y] == 1) {
|
|
|
|
memset(&buf, '\0', sizeof(buf));
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
for (y = 0, n = 0; y < i; y++)
|
|
|
|
if (slist->selections[y] == 1) {
|
2005-01-12 20:38:40 +03:00
|
|
|
if (++n != 1)
|
2003-07-16 10:40:47 +04:00
|
|
|
snprintf(buf, sizeof(buf),
|
|
|
|
"%s,", buf);
|
|
|
|
snprintf(buf, sizeof(buf), "%s%s",
|
|
|
|
buf, list[y]);
|
Initial import of sushi.
Sushi is an interactive, menu-based program that is designed to aid
the user or administrator with administrative and complex tasks on thier
machines.
Sushi provides a menu of various functions that the user can perform on
his or her machine. Once the user selects a desired function, the
function is either performed outright, or in most cases, the user is
asked to fill in a simple form with required and option information,
which is then processed by sushi, and the action occurs.
The programming interface for sushi is very simple. There are
directories containing various files, such as menu indexes, or forms for
the user to fill out. These files are interpreted by sushi to generate
the menus the user sees on his/her screen. When the form is filled out
by the user, the entries are passed as command-line arguments to a
program, or script contained in one of the subdirectories. In this way,
it is possible to add new entries to the sushi menu structure, by simply
adding a new menu item, form and script, the binary does not need to be
recompiled to take advantage of this new menu.
2001-01-05 04:28:33 +03:00
|
|
|
}
|
2001-01-31 12:35:42 +03:00
|
|
|
free(otmp);
|
Initial import of sushi.
Sushi is an interactive, menu-based program that is designed to aid
the user or administrator with administrative and complex tasks on thier
machines.
Sushi provides a menu of various functions that the user can perform on
his or her machine. Once the user selects a desired function, the
function is either performed outright, or in most cases, the user is
asked to fill in a simple form with required and option information,
which is then processed by sushi, and the action occurs.
The programming interface for sushi is very simple. There are
directories containing various files, such as menu indexes, or forms for
the user to fill out. These files are interpreted by sushi to generate
the menus the user sees on his/her screen. When the form is filled out
by the user, the entries are passed as command-line arguments to a
program, or script contained in one of the subdirectories. In this way,
it is possible to add new entries to the sushi menu structure, by simply
adding a new menu item, form and script, the binary does not need to be
recompiled to take advantage of this new menu.
2001-01-05 04:28:33 +03:00
|
|
|
tmp = buf;
|
2001-08-01 13:08:55 +04:00
|
|
|
if (n)
|
|
|
|
set_field_buffer(curfield, 0, tmp);
|
Initial import of sushi.
Sushi is an interactive, menu-based program that is designed to aid
the user or administrator with administrative and complex tasks on thier
machines.
Sushi provides a menu of various functions that the user can perform on
his or her machine. Once the user selects a desired function, the
function is either performed outright, or in most cases, the user is
asked to fill in a simple form with required and option information,
which is then processed by sushi, and the action occurs.
The programming interface for sushi is very simple. There are
directories containing various files, such as menu indexes, or forms for
the user to fill out. These files are interpreted by sushi to generate
the menus the user sees on his/her screen. When the form is filled out
by the user, the entries are passed as command-line arguments to a
program, or script contained in one of the subdirectories. In this way,
it is possible to add new entries to the sushi menu structure, by simply
adding a new menu item, form and script, the binary does not need to be
recompiled to take advantage of this new menu.
2001-01-05 04:28:33 +03:00
|
|
|
destroyCDKSelection(slist);
|
|
|
|
} else if (*tmp == 's') {
|
|
|
|
plist = newCDKScroll(cdkscreen, RIGHT, CENTER, RIGHT,
|
2005-01-12 20:38:40 +03:00
|
|
|
10, y + 2, catgets(catalog, 4, 1, "Select choice"),
|
Initial import of sushi.
Sushi is an interactive, menu-based program that is designed to aid
the user or administrator with administrative and complex tasks on thier
machines.
Sushi provides a menu of various functions that the user can perform on
his or her machine. Once the user selects a desired function, the
function is either performed outright, or in most cases, the user is
asked to fill in a simple form with required and option information,
which is then processed by sushi, and the action occurs.
The programming interface for sushi is very simple. There are
directories containing various files, such as menu indexes, or forms for
the user to fill out. These files are interpreted by sushi to generate
the menus the user sees on his/her screen. When the form is filled out
by the user, the entries are passed as command-line arguments to a
program, or script contained in one of the subdirectories. In this way,
it is possible to add new entries to the sushi menu structure, by simply
adding a new menu item, form and script, the binary does not need to be
recompiled to take advantage of this new menu.
2001-01-05 04:28:33 +03:00
|
|
|
list, i, FALSE, A_REVERSE ,TRUE, FALSE);
|
|
|
|
i = activateCDKScroll(plist, NULL);
|
2001-01-09 22:32:35 +03:00
|
|
|
if (i != -1)
|
|
|
|
set_field_buffer(curfield, 0, list[i]);
|
Initial import of sushi.
Sushi is an interactive, menu-based program that is designed to aid
the user or administrator with administrative and complex tasks on thier
machines.
Sushi provides a menu of various functions that the user can perform on
his or her machine. Once the user selects a desired function, the
function is either performed outright, or in most cases, the user is
asked to fill in a simple form with required and option information,
which is then processed by sushi, and the action occurs.
The programming interface for sushi is very simple. There are
directories containing various files, such as menu indexes, or forms for
the user to fill out. These files are interpreted by sushi to generate
the menus the user sees on his/her screen. When the form is filled out
by the user, the entries are passed as command-line arguments to a
program, or script contained in one of the subdirectories. In this way,
it is possible to add new entries to the sushi menu structure, by simply
adding a new menu item, form and script, the binary does not need to be
recompiled to take advantage of this new menu.
2001-01-05 04:28:33 +03:00
|
|
|
destroyCDKScroll(plist);
|
2001-01-31 12:35:42 +03:00
|
|
|
free(otmp);
|
Initial import of sushi.
Sushi is an interactive, menu-based program that is designed to aid
the user or administrator with administrative and complex tasks on thier
machines.
Sushi provides a menu of various functions that the user can perform on
his or her machine. Once the user selects a desired function, the
function is either performed outright, or in most cases, the user is
asked to fill in a simple form with required and option information,
which is then processed by sushi, and the action occurs.
The programming interface for sushi is very simple. There are
directories containing various files, such as menu indexes, or forms for
the user to fill out. These files are interpreted by sushi to generate
the menus the user sees on his/her screen. When the form is filled out
by the user, the entries are passed as command-line arguments to a
program, or script contained in one of the subdirectories. In this way,
it is possible to add new entries to the sushi menu structure, by simply
adding a new menu item, form and script, the binary does not need to be
recompiled to take advantage of this new menu.
2001-01-05 04:28:33 +03:00
|
|
|
}
|
2004-03-24 22:10:58 +03:00
|
|
|
touchwin(stdscr);
|
|
|
|
wrefresh(stdscr);
|
|
|
|
curs_set(1);
|
2005-01-12 20:38:40 +03:00
|
|
|
return (FALSE);
|
2001-01-10 06:05:48 +03:00
|
|
|
/* NOTREACHED */
|
Initial import of sushi.
Sushi is an interactive, menu-based program that is designed to aid
the user or administrator with administrative and complex tasks on thier
machines.
Sushi provides a menu of various functions that the user can perform on
his or her machine. Once the user selects a desired function, the
function is either performed outright, or in most cases, the user is
asked to fill in a simple form with required and option information,
which is then processed by sushi, and the action occurs.
The programming interface for sushi is very simple. There are
directories containing various files, such as menu indexes, or forms for
the user to fill out. These files are interpreted by sushi to generate
the menus the user sees on his/her screen. When the form is filled out
by the user, the entries are passed as command-line arguments to a
program, or script contained in one of the subdirectories. In this way,
it is possible to add new entries to the sushi menu structure, by simply
adding a new menu item, form and script, the binary does not need to be
recompiled to take advantage of this new menu.
2001-01-05 04:28:33 +03:00
|
|
|
break;
|
|
|
|
case QUIT:
|
|
|
|
/* do something useful */
|
|
|
|
if (form_driver(form, REQ_VALIDATION) == E_OK) {
|
2004-03-09 23:26:24 +03:00
|
|
|
if ((i = process_form(form, path)) == 0)
|
2005-01-12 20:38:40 +03:00
|
|
|
return (TRUE);
|
2004-03-09 23:26:24 +03:00
|
|
|
else if (i == -1)
|
2005-01-12 20:38:40 +03:00
|
|
|
return (FALSE);
|
Initial import of sushi.
Sushi is an interactive, menu-based program that is designed to aid
the user or administrator with administrative and complex tasks on thier
machines.
Sushi provides a menu of various functions that the user can perform on
his or her machine. Once the user selects a desired function, the
function is either performed outright, or in most cases, the user is
asked to fill in a simple form with required and option information,
which is then processed by sushi, and the action occurs.
The programming interface for sushi is very simple. There are
directories containing various files, such as menu indexes, or forms for
the user to fill out. These files are interpreted by sushi to generate
the menus the user sees on his/her screen. When the form is filled out
by the user, the entries are passed as command-line arguments to a
program, or script contained in one of the subdirectories. In this way,
it is possible to add new entries to the sushi menu structure, by simply
adding a new menu item, form and script, the binary does not need to be
recompiled to take advantage of this new menu.
2001-01-05 04:28:33 +03:00
|
|
|
else
|
2005-01-12 20:38:40 +03:00
|
|
|
return (2); /* special meaning */
|
Initial import of sushi.
Sushi is an interactive, menu-based program that is designed to aid
the user or administrator with administrative and complex tasks on thier
machines.
Sushi provides a menu of various functions that the user can perform on
his or her machine. Once the user selects a desired function, the
function is either performed outright, or in most cases, the user is
asked to fill in a simple form with required and option information,
which is then processed by sushi, and the action occurs.
The programming interface for sushi is very simple. There are
directories containing various files, such as menu indexes, or forms for
the user to fill out. These files are interpreted by sushi to generate
the menus the user sees on his/her screen. When the form is filled out
by the user, the entries are passed as command-line arguments to a
program, or script contained in one of the subdirectories. In this way,
it is possible to add new entries to the sushi menu structure, by simply
adding a new menu item, form and script, the binary does not need to be
recompiled to take advantage of this new menu.
2001-01-05 04:28:33 +03:00
|
|
|
}
|
2001-01-10 06:05:48 +03:00
|
|
|
/* NOTREACHED */
|
Initial import of sushi.
Sushi is an interactive, menu-based program that is designed to aid
the user or administrator with administrative and complex tasks on thier
machines.
Sushi provides a menu of various functions that the user can perform on
his or her machine. Once the user selects a desired function, the
function is either performed outright, or in most cases, the user is
asked to fill in a simple form with required and option information,
which is then processed by sushi, and the action occurs.
The programming interface for sushi is very simple. There are
directories containing various files, such as menu indexes, or forms for
the user to fill out. These files are interpreted by sushi to generate
the menus the user sees on his/her screen. When the form is filled out
by the user, the entries are passed as command-line arguments to a
program, or script contained in one of the subdirectories. In this way,
it is possible to add new entries to the sushi menu structure, by simply
adding a new menu item, form and script, the binary does not need to be
recompiled to take advantage of this new menu.
2001-01-05 04:28:33 +03:00
|
|
|
break;
|
|
|
|
case BAIL:
|
2005-01-12 20:38:40 +03:00
|
|
|
return (3); /* TRUE, so handle_preform can free F */
|
2001-01-10 06:05:48 +03:00
|
|
|
/* NOTREACHED */
|
Initial import of sushi.
Sushi is an interactive, menu-based program that is designed to aid
the user or administrator with administrative and complex tasks on thier
machines.
Sushi provides a menu of various functions that the user can perform on
his or her machine. Once the user selects a desired function, the
function is either performed outright, or in most cases, the user is
asked to fill in a simple form with required and option information,
which is then processed by sushi, and the action occurs.
The programming interface for sushi is very simple. There are
directories containing various files, such as menu indexes, or forms for
the user to fill out. These files are interpreted by sushi to generate
the menus the user sees on his/her screen. When the form is filled out
by the user, the entries are passed as command-line arguments to a
program, or script contained in one of the subdirectories. In this way,
it is possible to add new entries to the sushi menu structure, by simply
adding a new menu item, form and script, the binary does not need to be
recompiled to take advantage of this new menu.
2001-01-05 04:28:33 +03:00
|
|
|
break;
|
|
|
|
case FASTBAIL:
|
|
|
|
endwin();
|
|
|
|
exit(EXIT_SUCCESS);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
beep();
|
2005-01-12 20:38:40 +03:00
|
|
|
return (FALSE);
|
Initial import of sushi.
Sushi is an interactive, menu-based program that is designed to aid
the user or administrator with administrative and complex tasks on thier
machines.
Sushi provides a menu of various functions that the user can perform on
his or her machine. Once the user selects a desired function, the
function is either performed outright, or in most cases, the user is
asked to fill in a simple form with required and option information,
which is then processed by sushi, and the action occurs.
The programming interface for sushi is very simple. There are
directories containing various files, such as menu indexes, or forms for
the user to fill out. These files are interpreted by sushi to generate
the menus the user sees on his/her screen. When the form is filled out
by the user, the entries are passed as command-line arguments to a
program, or script contained in one of the subdirectories. In this way,
it is possible to add new entries to the sushi menu structure, by simply
adding a new menu item, form and script, the binary does not need to be
recompiled to take advantage of this new menu.
2001-01-05 04:28:33 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
static FIELD *
|
|
|
|
LABEL(FIELD_RECORD *x)
|
|
|
|
{
|
|
|
|
char *tmp;
|
2001-01-10 06:05:48 +03:00
|
|
|
FIELD *f = new_field(1, (int)(strlen(x->v)+2), x->frow, x->fcol, 0, 0);
|
2003-06-13 11:26:41 +04:00
|
|
|
size_t l;
|
Initial import of sushi.
Sushi is an interactive, menu-based program that is designed to aid
the user or administrator with administrative and complex tasks on thier
machines.
Sushi provides a menu of various functions that the user can perform on
his or her machine. Once the user selects a desired function, the
function is either performed outright, or in most cases, the user is
asked to fill in a simple form with required and option information,
which is then processed by sushi, and the action occurs.
The programming interface for sushi is very simple. There are
directories containing various files, such as menu indexes, or forms for
the user to fill out. These files are interpreted by sushi to generate
the menus the user sees on his/her screen. When the form is filled out
by the user, the entries are passed as command-line arguments to a
program, or script contained in one of the subdirectories. In this way,
it is possible to add new entries to the sushi menu structure, by simply
adding a new menu item, form and script, the binary does not need to be
recompiled to take advantage of this new menu.
2001-01-05 04:28:33 +03:00
|
|
|
|
2005-01-12 20:38:40 +03:00
|
|
|
if (f != NULL) {
|
2004-03-09 22:10:20 +03:00
|
|
|
tmp = realloc(x->v, sizeof(char *) * (strlen(x->v) + 3));
|
2003-10-16 10:19:11 +04:00
|
|
|
if (tmp == NULL)
|
|
|
|
bailout("realloc: %s", strerror(errno));
|
|
|
|
x->v = tmp;
|
2003-06-13 11:26:41 +04:00
|
|
|
l = strlen(x->v);
|
|
|
|
tmp = malloc(sizeof(char *) * l);
|
2003-10-16 10:19:11 +04:00
|
|
|
if (tmp == NULL)
|
2001-01-31 12:35:42 +03:00
|
|
|
bailout("malloc: %s", strerror(errno));
|
|
|
|
|
Initial import of sushi.
Sushi is an interactive, menu-based program that is designed to aid
the user or administrator with administrative and complex tasks on thier
machines.
Sushi provides a menu of various functions that the user can perform on
his or her machine. Once the user selects a desired function, the
function is either performed outright, or in most cases, the user is
asked to fill in a simple form with required and option information,
which is then processed by sushi, and the action occurs.
The programming interface for sushi is very simple. There are
directories containing various files, such as menu indexes, or forms for
the user to fill out. These files are interpreted by sushi to generate
the menus the user sees on his/her screen. When the form is filled out
by the user, the entries are passed as command-line arguments to a
program, or script contained in one of the subdirectories. In this way,
it is possible to add new entries to the sushi menu structure, by simply
adding a new menu item, form and script, the binary does not need to be
recompiled to take advantage of this new menu.
2001-01-05 04:28:33 +03:00
|
|
|
if (x->required == 1)
|
2004-03-09 22:10:20 +03:00
|
|
|
(void)strncpy(tmp, "* ", l);
|
Initial import of sushi.
Sushi is an interactive, menu-based program that is designed to aid
the user or administrator with administrative and complex tasks on thier
machines.
Sushi provides a menu of various functions that the user can perform on
his or her machine. Once the user selects a desired function, the
function is either performed outright, or in most cases, the user is
asked to fill in a simple form with required and option information,
which is then processed by sushi, and the action occurs.
The programming interface for sushi is very simple. There are
directories containing various files, such as menu indexes, or forms for
the user to fill out. These files are interpreted by sushi to generate
the menus the user sees on his/her screen. When the form is filled out
by the user, the entries are passed as command-line arguments to a
program, or script contained in one of the subdirectories. In this way,
it is possible to add new entries to the sushi menu structure, by simply
adding a new menu item, form and script, the binary does not need to be
recompiled to take advantage of this new menu.
2001-01-05 04:28:33 +03:00
|
|
|
else
|
2004-03-09 22:10:20 +03:00
|
|
|
(void)strncpy(tmp, " ", l);
|
|
|
|
(void)strncat(tmp, x->v, l);
|
|
|
|
(void)strlcpy(x->v, tmp, l + 3);
|
2001-01-31 12:35:42 +03:00
|
|
|
set_field_buffer(f, 0, x->v);
|
|
|
|
free(tmp);
|
Initial import of sushi.
Sushi is an interactive, menu-based program that is designed to aid
the user or administrator with administrative and complex tasks on thier
machines.
Sushi provides a menu of various functions that the user can perform on
his or her machine. Once the user selects a desired function, the
function is either performed outright, or in most cases, the user is
asked to fill in a simple form with required and option information,
which is then processed by sushi, and the action occurs.
The programming interface for sushi is very simple. There are
directories containing various files, such as menu indexes, or forms for
the user to fill out. These files are interpreted by sushi to generate
the menus the user sees on his/her screen. When the form is filled out
by the user, the entries are passed as command-line arguments to a
program, or script contained in one of the subdirectories. In this way,
it is possible to add new entries to the sushi menu structure, by simply
adding a new menu item, form and script, the binary does not need to be
recompiled to take advantage of this new menu.
2001-01-05 04:28:33 +03:00
|
|
|
field_opts_off(f, O_ACTIVE);
|
|
|
|
if (x->newpage == 1)
|
|
|
|
set_new_page(f, TRUE);
|
|
|
|
}
|
2005-01-12 20:38:40 +03:00
|
|
|
return (f);
|
Initial import of sushi.
Sushi is an interactive, menu-based program that is designed to aid
the user or administrator with administrative and complex tasks on thier
machines.
Sushi provides a menu of various functions that the user can perform on
his or her machine. Once the user selects a desired function, the
function is either performed outright, or in most cases, the user is
asked to fill in a simple form with required and option information,
which is then processed by sushi, and the action occurs.
The programming interface for sushi is very simple. There are
directories containing various files, such as menu indexes, or forms for
the user to fill out. These files are interpreted by sushi to generate
the menus the user sees on his/her screen. When the form is filled out
by the user, the entries are passed as command-line arguments to a
program, or script contained in one of the subdirectories. In this way,
it is possible to add new entries to the sushi menu structure, by simply
adding a new menu item, form and script, the binary does not need to be
recompiled to take advantage of this new menu.
2001-01-05 04:28:33 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
static FIELD *
|
|
|
|
STRING(FIELD_RECORD *x)
|
|
|
|
{ /* create a STRING field */
|
|
|
|
FIELD *f = new_field(x->rows, x->cols, x->frow, x->fcol, 0, 0);
|
|
|
|
|
2005-01-12 20:38:40 +03:00
|
|
|
if (f != NULL) {
|
Initial import of sushi.
Sushi is an interactive, menu-based program that is designed to aid
the user or administrator with administrative and complex tasks on thier
machines.
Sushi provides a menu of various functions that the user can perform on
his or her machine. Once the user selects a desired function, the
function is either performed outright, or in most cases, the user is
asked to fill in a simple form with required and option information,
which is then processed by sushi, and the action occurs.
The programming interface for sushi is very simple. There are
directories containing various files, such as menu indexes, or forms for
the user to fill out. These files are interpreted by sushi to generate
the menus the user sees on his/her screen. When the form is filled out
by the user, the entries are passed as command-line arguments to a
program, or script contained in one of the subdirectories. In this way,
it is possible to add new entries to the sushi menu structure, by simply
adding a new menu item, form and script, the binary does not need to be
recompiled to take advantage of this new menu.
2001-01-05 04:28:33 +03:00
|
|
|
set_field_back(f, A_UNDERLINE);
|
|
|
|
if (x->newpage == 1)
|
|
|
|
set_new_page(f, TRUE);
|
|
|
|
if (x->required == 1)
|
|
|
|
field_opts_off(f, O_NULLOK);
|
|
|
|
if (x->bigfield) {
|
|
|
|
field_opts_off(f, O_STATIC);
|
|
|
|
set_max_field(f, x->rcols);
|
|
|
|
}
|
|
|
|
set_field_buffer(f, 0, x->v);
|
|
|
|
}
|
2005-01-12 20:38:40 +03:00
|
|
|
return (f);
|
Initial import of sushi.
Sushi is an interactive, menu-based program that is designed to aid
the user or administrator with administrative and complex tasks on thier
machines.
Sushi provides a menu of various functions that the user can perform on
his or her machine. Once the user selects a desired function, the
function is either performed outright, or in most cases, the user is
asked to fill in a simple form with required and option information,
which is then processed by sushi, and the action occurs.
The programming interface for sushi is very simple. There are
directories containing various files, such as menu indexes, or forms for
the user to fill out. These files are interpreted by sushi to generate
the menus the user sees on his/her screen. When the form is filled out
by the user, the entries are passed as command-line arguments to a
program, or script contained in one of the subdirectories. In this way,
it is possible to add new entries to the sushi menu structure, by simply
adding a new menu item, form and script, the binary does not need to be
recompiled to take advantage of this new menu.
2001-01-05 04:28:33 +03:00
|
|
|
}
|
|
|
|
|
2001-03-07 13:10:20 +03:00
|
|
|
static FIELD *
|
|
|
|
IPV4(FIELD_RECORD *x)
|
|
|
|
{ /* create an IPV4 field */
|
|
|
|
FIELD *f = new_field(x->rows, x->cols, x->frow, x->fcol, 0, 0);
|
|
|
|
|
2005-01-12 20:38:40 +03:00
|
|
|
if (f != NULL) {
|
2001-03-07 13:10:20 +03:00
|
|
|
set_field_type(f, TYPE_IPV4);
|
|
|
|
set_field_back(f, A_UNDERLINE);
|
|
|
|
if (x->newpage == 1)
|
|
|
|
set_new_page(f, TRUE);
|
|
|
|
if (x->required == 1)
|
|
|
|
field_opts_off(f, O_NULLOK);
|
|
|
|
if (x->bigfield) {
|
|
|
|
field_opts_off(f, O_STATIC);
|
|
|
|
set_max_field(f, x->rcols);
|
|
|
|
}
|
|
|
|
set_field_buffer(f, 0, x->v);
|
|
|
|
}
|
2005-01-12 20:38:40 +03:00
|
|
|
return (f);
|
2001-03-07 13:10:20 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
static FIELD *
|
|
|
|
IPV6(FIELD_RECORD *x)
|
|
|
|
{ /* create an IPV6 field */
|
|
|
|
FIELD *f = new_field(x->rows, x->cols, x->frow, x->fcol, 0, 0);
|
|
|
|
|
2005-01-12 20:38:40 +03:00
|
|
|
if (f != NULL) {
|
2001-03-07 13:10:20 +03:00
|
|
|
set_field_type(f, TYPE_IPV6);
|
|
|
|
set_field_back(f, A_UNDERLINE);
|
|
|
|
if (x->newpage == 1)
|
|
|
|
set_new_page(f, TRUE);
|
|
|
|
if (x->required == 1)
|
|
|
|
field_opts_off(f, O_NULLOK);
|
|
|
|
if (x->bigfield) {
|
|
|
|
field_opts_off(f, O_STATIC);
|
|
|
|
set_max_field(f, x->rcols);
|
|
|
|
}
|
|
|
|
set_field_buffer(f, 0, x->v);
|
|
|
|
}
|
2005-01-12 20:38:40 +03:00
|
|
|
return (f);
|
2001-03-07 13:10:20 +03:00
|
|
|
}
|
|
|
|
|
Initial import of sushi.
Sushi is an interactive, menu-based program that is designed to aid
the user or administrator with administrative and complex tasks on thier
machines.
Sushi provides a menu of various functions that the user can perform on
his or her machine. Once the user selects a desired function, the
function is either performed outright, or in most cases, the user is
asked to fill in a simple form with required and option information,
which is then processed by sushi, and the action occurs.
The programming interface for sushi is very simple. There are
directories containing various files, such as menu indexes, or forms for
the user to fill out. These files are interpreted by sushi to generate
the menus the user sees on his/her screen. When the form is filled out
by the user, the entries are passed as command-line arguments to a
program, or script contained in one of the subdirectories. In this way,
it is possible to add new entries to the sushi menu structure, by simply
adding a new menu item, form and script, the binary does not need to be
recompiled to take advantage of this new menu.
2001-01-05 04:28:33 +03:00
|
|
|
static FIELD *
|
|
|
|
MULTI(FIELD_RECORD *x)
|
|
|
|
{ /* create a MULTI field */
|
|
|
|
FIELD *f = new_field(x->rows, x->cols, x->frow, x->fcol, 0, 1);
|
|
|
|
|
2005-01-12 20:38:40 +03:00
|
|
|
if (f != NULL) {
|
Initial import of sushi.
Sushi is an interactive, menu-based program that is designed to aid
the user or administrator with administrative and complex tasks on thier
machines.
Sushi provides a menu of various functions that the user can perform on
his or her machine. Once the user selects a desired function, the
function is either performed outright, or in most cases, the user is
asked to fill in a simple form with required and option information,
which is then processed by sushi, and the action occurs.
The programming interface for sushi is very simple. There are
directories containing various files, such as menu indexes, or forms for
the user to fill out. These files are interpreted by sushi to generate
the menus the user sees on his/her screen. When the form is filled out
by the user, the entries are passed as command-line arguments to a
program, or script contained in one of the subdirectories. In this way,
it is possible to add new entries to the sushi menu structure, by simply
adding a new menu item, form and script, the binary does not need to be
recompiled to take advantage of this new menu.
2001-01-05 04:28:33 +03:00
|
|
|
set_field_back(f, A_REVERSE);
|
|
|
|
if (x->newpage == 1)
|
|
|
|
set_new_page(f, TRUE);
|
|
|
|
field_opts_off(f, O_STATIC);
|
|
|
|
field_opts_off(f, O_EDIT);
|
|
|
|
set_field_userptr(f, x->list);
|
|
|
|
set_field_buffer(f, 1, "multi");
|
|
|
|
}
|
2005-01-12 20:38:40 +03:00
|
|
|
return (f);
|
Initial import of sushi.
Sushi is an interactive, menu-based program that is designed to aid
the user or administrator with administrative and complex tasks on thier
machines.
Sushi provides a menu of various functions that the user can perform on
his or her machine. Once the user selects a desired function, the
function is either performed outright, or in most cases, the user is
asked to fill in a simple form with required and option information,
which is then processed by sushi, and the action occurs.
The programming interface for sushi is very simple. There are
directories containing various files, such as menu indexes, or forms for
the user to fill out. These files are interpreted by sushi to generate
the menus the user sees on his/her screen. When the form is filled out
by the user, the entries are passed as command-line arguments to a
program, or script contained in one of the subdirectories. In this way,
it is possible to add new entries to the sushi menu structure, by simply
adding a new menu item, form and script, the binary does not need to be
recompiled to take advantage of this new menu.
2001-01-05 04:28:33 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
static FIELD *
|
|
|
|
INTEGER(FIELD_RECORD *x)
|
|
|
|
{ /* create an INTEGER field */
|
|
|
|
FIELD *f = new_field(x->rows, x->cols, x->frow, x->fcol, 0, 0);
|
|
|
|
int pre, min, max;
|
2001-01-31 12:35:42 +03:00
|
|
|
char *p, *q, *n;
|
Initial import of sushi.
Sushi is an interactive, menu-based program that is designed to aid
the user or administrator with administrative and complex tasks on thier
machines.
Sushi provides a menu of various functions that the user can perform on
his or her machine. Once the user selects a desired function, the
function is either performed outright, or in most cases, the user is
asked to fill in a simple form with required and option information,
which is then processed by sushi, and the action occurs.
The programming interface for sushi is very simple. There are
directories containing various files, such as menu indexes, or forms for
the user to fill out. These files are interpreted by sushi to generate
the menus the user sees on his/her screen. When the form is filled out
by the user, the entries are passed as command-line arguments to a
program, or script contained in one of the subdirectories. In this way,
it is possible to add new entries to the sushi menu structure, by simply
adding a new menu item, form and script, the binary does not need to be
recompiled to take advantage of this new menu.
2001-01-05 04:28:33 +03:00
|
|
|
|
2001-01-31 12:35:42 +03:00
|
|
|
p = x->v;
|
Initial import of sushi.
Sushi is an interactive, menu-based program that is designed to aid
the user or administrator with administrative and complex tasks on thier
machines.
Sushi provides a menu of various functions that the user can perform on
his or her machine. Once the user selects a desired function, the
function is either performed outright, or in most cases, the user is
asked to fill in a simple form with required and option information,
which is then processed by sushi, and the action occurs.
The programming interface for sushi is very simple. There are
directories containing various files, such as menu indexes, or forms for
the user to fill out. These files are interpreted by sushi to generate
the menus the user sees on his/her screen. When the form is filled out
by the user, the entries are passed as command-line arguments to a
program, or script contained in one of the subdirectories. In this way,
it is possible to add new entries to the sushi menu structure, by simply
adding a new menu item, form and script, the binary does not need to be
recompiled to take advantage of this new menu.
2001-01-05 04:28:33 +03:00
|
|
|
q = strsep(&p, ",");
|
|
|
|
pre = atoi(q);
|
|
|
|
q = strsep(&p, ",");
|
|
|
|
min = atoi(q);
|
2001-01-31 12:35:42 +03:00
|
|
|
n = strdup(p);
|
|
|
|
q = strsep(&p, ",");
|
|
|
|
if (p == NULL)
|
|
|
|
max = atoi(n);
|
|
|
|
else
|
|
|
|
max = atoi(q);
|
|
|
|
|
2005-01-12 20:38:40 +03:00
|
|
|
if (f != NULL) {
|
Initial import of sushi.
Sushi is an interactive, menu-based program that is designed to aid
the user or administrator with administrative and complex tasks on thier
machines.
Sushi provides a menu of various functions that the user can perform on
his or her machine. Once the user selects a desired function, the
function is either performed outright, or in most cases, the user is
asked to fill in a simple form with required and option information,
which is then processed by sushi, and the action occurs.
The programming interface for sushi is very simple. There are
directories containing various files, such as menu indexes, or forms for
the user to fill out. These files are interpreted by sushi to generate
the menus the user sees on his/her screen. When the form is filled out
by the user, the entries are passed as command-line arguments to a
program, or script contained in one of the subdirectories. In this way,
it is possible to add new entries to the sushi menu structure, by simply
adding a new menu item, form and script, the binary does not need to be
recompiled to take advantage of this new menu.
2001-01-05 04:28:33 +03:00
|
|
|
set_field_back(f, A_UNDERLINE);
|
|
|
|
set_field_type(f, TYPE_INTEGER, pre, min, max);
|
|
|
|
if (x->newpage == 1)
|
|
|
|
set_new_page(f, TRUE);
|
|
|
|
if (x->required == 1)
|
|
|
|
field_opts_off(f, O_NULLOK);
|
|
|
|
if (x->bigfield)
|
|
|
|
field_opts_off(f, O_STATIC);
|
2001-01-31 12:35:42 +03:00
|
|
|
if (p != NULL)
|
|
|
|
set_field_buffer(f, 0, p);
|
Initial import of sushi.
Sushi is an interactive, menu-based program that is designed to aid
the user or administrator with administrative and complex tasks on thier
machines.
Sushi provides a menu of various functions that the user can perform on
his or her machine. Once the user selects a desired function, the
function is either performed outright, or in most cases, the user is
asked to fill in a simple form with required and option information,
which is then processed by sushi, and the action occurs.
The programming interface for sushi is very simple. There are
directories containing various files, such as menu indexes, or forms for
the user to fill out. These files are interpreted by sushi to generate
the menus the user sees on his/her screen. When the form is filled out
by the user, the entries are passed as command-line arguments to a
program, or script contained in one of the subdirectories. In this way,
it is possible to add new entries to the sushi menu structure, by simply
adding a new menu item, form and script, the binary does not need to be
recompiled to take advantage of this new menu.
2001-01-05 04:28:33 +03:00
|
|
|
}
|
2005-01-12 20:38:40 +03:00
|
|
|
return (f);
|
Initial import of sushi.
Sushi is an interactive, menu-based program that is designed to aid
the user or administrator with administrative and complex tasks on thier
machines.
Sushi provides a menu of various functions that the user can perform on
his or her machine. Once the user selects a desired function, the
function is either performed outright, or in most cases, the user is
asked to fill in a simple form with required and option information,
which is then processed by sushi, and the action occurs.
The programming interface for sushi is very simple. There are
directories containing various files, such as menu indexes, or forms for
the user to fill out. These files are interpreted by sushi to generate
the menus the user sees on his/her screen. When the form is filled out
by the user, the entries are passed as command-line arguments to a
program, or script contained in one of the subdirectories. In this way,
it is possible to add new entries to the sushi menu structure, by simply
adding a new menu item, form and script, the binary does not need to be
recompiled to take advantage of this new menu.
2001-01-05 04:28:33 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
static FIELD *
|
|
|
|
INVIS(FIELD_RECORD *x)
|
|
|
|
{ /* create an INVIS field */
|
|
|
|
FIELD *f = new_field(x->rows, x->cols, x->frow, x->fcol, 0, 0);
|
|
|
|
|
2005-01-12 20:38:40 +03:00
|
|
|
if (f != NULL) {
|
Initial import of sushi.
Sushi is an interactive, menu-based program that is designed to aid
the user or administrator with administrative and complex tasks on thier
machines.
Sushi provides a menu of various functions that the user can perform on
his or her machine. Once the user selects a desired function, the
function is either performed outright, or in most cases, the user is
asked to fill in a simple form with required and option information,
which is then processed by sushi, and the action occurs.
The programming interface for sushi is very simple. There are
directories containing various files, such as menu indexes, or forms for
the user to fill out. These files are interpreted by sushi to generate
the menus the user sees on his/her screen. When the form is filled out
by the user, the entries are passed as command-line arguments to a
program, or script contained in one of the subdirectories. In this way,
it is possible to add new entries to the sushi menu structure, by simply
adding a new menu item, form and script, the binary does not need to be
recompiled to take advantage of this new menu.
2001-01-05 04:28:33 +03:00
|
|
|
set_field_opts(f, field_opts(f) & ~(O_ACTIVE|O_VISIBLE));
|
2001-03-14 11:22:00 +03:00
|
|
|
if (x->bigfield) {
|
|
|
|
field_opts_off(f, O_STATIC);
|
|
|
|
set_max_field(f, x->rcols);
|
|
|
|
}
|
Initial import of sushi.
Sushi is an interactive, menu-based program that is designed to aid
the user or administrator with administrative and complex tasks on thier
machines.
Sushi provides a menu of various functions that the user can perform on
his or her machine. Once the user selects a desired function, the
function is either performed outright, or in most cases, the user is
asked to fill in a simple form with required and option information,
which is then processed by sushi, and the action occurs.
The programming interface for sushi is very simple. There are
directories containing various files, such as menu indexes, or forms for
the user to fill out. These files are interpreted by sushi to generate
the menus the user sees on his/her screen. When the form is filled out
by the user, the entries are passed as command-line arguments to a
program, or script contained in one of the subdirectories. In this way,
it is possible to add new entries to the sushi menu structure, by simply
adding a new menu item, form and script, the binary does not need to be
recompiled to take advantage of this new menu.
2001-01-05 04:28:33 +03:00
|
|
|
if (x->newpage == 1)
|
|
|
|
set_new_page(f, TRUE);
|
2001-03-14 11:22:00 +03:00
|
|
|
set_field_buffer(f, 0, x->v);
|
Initial import of sushi.
Sushi is an interactive, menu-based program that is designed to aid
the user or administrator with administrative and complex tasks on thier
machines.
Sushi provides a menu of various functions that the user can perform on
his or her machine. Once the user selects a desired function, the
function is either performed outright, or in most cases, the user is
asked to fill in a simple form with required and option information,
which is then processed by sushi, and the action occurs.
The programming interface for sushi is very simple. There are
directories containing various files, such as menu indexes, or forms for
the user to fill out. These files are interpreted by sushi to generate
the menus the user sees on his/her screen. When the form is filled out
by the user, the entries are passed as command-line arguments to a
program, or script contained in one of the subdirectories. In this way,
it is possible to add new entries to the sushi menu structure, by simply
adding a new menu item, form and script, the binary does not need to be
recompiled to take advantage of this new menu.
2001-01-05 04:28:33 +03:00
|
|
|
}
|
2005-01-12 20:38:40 +03:00
|
|
|
return (f);
|
Initial import of sushi.
Sushi is an interactive, menu-based program that is designed to aid
the user or administrator with administrative and complex tasks on thier
machines.
Sushi provides a menu of various functions that the user can perform on
his or her machine. Once the user selects a desired function, the
function is either performed outright, or in most cases, the user is
asked to fill in a simple form with required and option information,
which is then processed by sushi, and the action occurs.
The programming interface for sushi is very simple. There are
directories containing various files, such as menu indexes, or forms for
the user to fill out. These files are interpreted by sushi to generate
the menus the user sees on his/her screen. When the form is filled out
by the user, the entries are passed as command-line arguments to a
program, or script contained in one of the subdirectories. In this way,
it is possible to add new entries to the sushi menu structure, by simply
adding a new menu item, form and script, the binary does not need to be
recompiled to take advantage of this new menu.
2001-01-05 04:28:33 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
static FIELD *
|
|
|
|
NOEDIT(FIELD_RECORD *x)
|
|
|
|
{ /* create a NOEDIT field */
|
|
|
|
FIELD *f = new_field(x->rows, x->cols, x->frow, x->fcol, 0, 0);
|
|
|
|
|
2005-01-12 20:38:40 +03:00
|
|
|
if (f != NULL) {
|
Initial import of sushi.
Sushi is an interactive, menu-based program that is designed to aid
the user or administrator with administrative and complex tasks on thier
machines.
Sushi provides a menu of various functions that the user can perform on
his or her machine. Once the user selects a desired function, the
function is either performed outright, or in most cases, the user is
asked to fill in a simple form with required and option information,
which is then processed by sushi, and the action occurs.
The programming interface for sushi is very simple. There are
directories containing various files, such as menu indexes, or forms for
the user to fill out. These files are interpreted by sushi to generate
the menus the user sees on his/her screen. When the form is filled out
by the user, the entries are passed as command-line arguments to a
program, or script contained in one of the subdirectories. In this way,
it is possible to add new entries to the sushi menu structure, by simply
adding a new menu item, form and script, the binary does not need to be
recompiled to take advantage of this new menu.
2001-01-05 04:28:33 +03:00
|
|
|
set_field_opts(f, field_opts(f) & ~(O_EDIT|O_ACTIVE));
|
|
|
|
if (x->newpage == 1)
|
|
|
|
set_new_page(f, TRUE);
|
2001-03-14 11:22:00 +03:00
|
|
|
if (x->bigfield) {
|
Initial import of sushi.
Sushi is an interactive, menu-based program that is designed to aid
the user or administrator with administrative and complex tasks on thier
machines.
Sushi provides a menu of various functions that the user can perform on
his or her machine. Once the user selects a desired function, the
function is either performed outright, or in most cases, the user is
asked to fill in a simple form with required and option information,
which is then processed by sushi, and the action occurs.
The programming interface for sushi is very simple. There are
directories containing various files, such as menu indexes, or forms for
the user to fill out. These files are interpreted by sushi to generate
the menus the user sees on his/her screen. When the form is filled out
by the user, the entries are passed as command-line arguments to a
program, or script contained in one of the subdirectories. In this way,
it is possible to add new entries to the sushi menu structure, by simply
adding a new menu item, form and script, the binary does not need to be
recompiled to take advantage of this new menu.
2001-01-05 04:28:33 +03:00
|
|
|
field_opts_off(f, O_STATIC);
|
2001-03-14 11:22:00 +03:00
|
|
|
set_max_field(f, x->rcols);
|
|
|
|
}
|
|
|
|
set_field_buffer(f, 0, x->v);
|
Initial import of sushi.
Sushi is an interactive, menu-based program that is designed to aid
the user or administrator with administrative and complex tasks on thier
machines.
Sushi provides a menu of various functions that the user can perform on
his or her machine. Once the user selects a desired function, the
function is either performed outright, or in most cases, the user is
asked to fill in a simple form with required and option information,
which is then processed by sushi, and the action occurs.
The programming interface for sushi is very simple. There are
directories containing various files, such as menu indexes, or forms for
the user to fill out. These files are interpreted by sushi to generate
the menus the user sees on his/her screen. When the form is filled out
by the user, the entries are passed as command-line arguments to a
program, or script contained in one of the subdirectories. In this way,
it is possible to add new entries to the sushi menu structure, by simply
adding a new menu item, form and script, the binary does not need to be
recompiled to take advantage of this new menu.
2001-01-05 04:28:33 +03:00
|
|
|
}
|
2005-01-12 20:38:40 +03:00
|
|
|
return (f);
|
Initial import of sushi.
Sushi is an interactive, menu-based program that is designed to aid
the user or administrator with administrative and complex tasks on thier
machines.
Sushi provides a menu of various functions that the user can perform on
his or her machine. Once the user selects a desired function, the
function is either performed outright, or in most cases, the user is
asked to fill in a simple form with required and option information,
which is then processed by sushi, and the action occurs.
The programming interface for sushi is very simple. There are
directories containing various files, such as menu indexes, or forms for
the user to fill out. These files are interpreted by sushi to generate
the menus the user sees on his/her screen. When the form is filled out
by the user, the entries are passed as command-line arguments to a
program, or script contained in one of the subdirectories. In this way,
it is possible to add new entries to the sushi menu structure, by simply
adding a new menu item, form and script, the binary does not need to be
recompiled to take advantage of this new menu.
2001-01-05 04:28:33 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
static FIELD *
|
|
|
|
ENUM(FIELD_RECORD *x)
|
|
|
|
{ /* create a ENUM field */
|
|
|
|
FIELD *f = new_field(x->rows, x->cols, x->frow, x->fcol, 0, 1);
|
|
|
|
|
2005-01-12 20:38:40 +03:00
|
|
|
if (f != NULL) {
|
Initial import of sushi.
Sushi is an interactive, menu-based program that is designed to aid
the user or administrator with administrative and complex tasks on thier
machines.
Sushi provides a menu of various functions that the user can perform on
his or her machine. Once the user selects a desired function, the
function is either performed outright, or in most cases, the user is
asked to fill in a simple form with required and option information,
which is then processed by sushi, and the action occurs.
The programming interface for sushi is very simple. There are
directories containing various files, such as menu indexes, or forms for
the user to fill out. These files are interpreted by sushi to generate
the menus the user sees on his/her screen. When the form is filled out
by the user, the entries are passed as command-line arguments to a
program, or script contained in one of the subdirectories. In this way,
it is possible to add new entries to the sushi menu structure, by simply
adding a new menu item, form and script, the binary does not need to be
recompiled to take advantage of this new menu.
2001-01-05 04:28:33 +03:00
|
|
|
set_field_back(f, A_REVERSE);
|
2004-03-22 22:03:19 +03:00
|
|
|
set_field_type(f, TYPE_ENUM, x->list, FALSE, TRUE);
|
Initial import of sushi.
Sushi is an interactive, menu-based program that is designed to aid
the user or administrator with administrative and complex tasks on thier
machines.
Sushi provides a menu of various functions that the user can perform on
his or her machine. Once the user selects a desired function, the
function is either performed outright, or in most cases, the user is
asked to fill in a simple form with required and option information,
which is then processed by sushi, and the action occurs.
The programming interface for sushi is very simple. There are
directories containing various files, such as menu indexes, or forms for
the user to fill out. These files are interpreted by sushi to generate
the menus the user sees on his/her screen. When the form is filled out
by the user, the entries are passed as command-line arguments to a
program, or script contained in one of the subdirectories. In this way,
it is possible to add new entries to the sushi menu structure, by simply
adding a new menu item, form and script, the binary does not need to be
recompiled to take advantage of this new menu.
2001-01-05 04:28:33 +03:00
|
|
|
set_field_userptr(f, x->list);
|
|
|
|
if (x->newpage == 1)
|
|
|
|
set_new_page(f, TRUE);
|
|
|
|
if (x->required == 1)
|
|
|
|
field_opts_off(f, O_NULLOK);
|
|
|
|
field_opts_off(f, O_EDIT);
|
|
|
|
set_field_buffer(f, 1, "single");
|
|
|
|
if (x->bigfield)
|
|
|
|
field_opts_off(f, O_STATIC);
|
2001-03-14 11:22:00 +03:00
|
|
|
set_field_buffer(f, 0, x->list[0]);
|
Initial import of sushi.
Sushi is an interactive, menu-based program that is designed to aid
the user or administrator with administrative and complex tasks on thier
machines.
Sushi provides a menu of various functions that the user can perform on
his or her machine. Once the user selects a desired function, the
function is either performed outright, or in most cases, the user is
asked to fill in a simple form with required and option information,
which is then processed by sushi, and the action occurs.
The programming interface for sushi is very simple. There are
directories containing various files, such as menu indexes, or forms for
the user to fill out. These files are interpreted by sushi to generate
the menus the user sees on his/her screen. When the form is filled out
by the user, the entries are passed as command-line arguments to a
program, or script contained in one of the subdirectories. In this way,
it is possible to add new entries to the sushi menu structure, by simply
adding a new menu item, form and script, the binary does not need to be
recompiled to take advantage of this new menu.
2001-01-05 04:28:33 +03:00
|
|
|
}
|
2005-01-12 20:38:40 +03:00
|
|
|
return (f);
|
Initial import of sushi.
Sushi is an interactive, menu-based program that is designed to aid
the user or administrator with administrative and complex tasks on thier
machines.
Sushi provides a menu of various functions that the user can perform on
his or her machine. Once the user selects a desired function, the
function is either performed outright, or in most cases, the user is
asked to fill in a simple form with required and option information,
which is then processed by sushi, and the action occurs.
The programming interface for sushi is very simple. There are
directories containing various files, such as menu indexes, or forms for
the user to fill out. These files are interpreted by sushi to generate
the menus the user sees on his/her screen. When the form is filled out
by the user, the entries are passed as command-line arguments to a
program, or script contained in one of the subdirectories. In this way,
it is possible to add new entries to the sushi menu structure, by simply
adding a new menu item, form and script, the binary does not need to be
recompiled to take advantage of this new menu.
2001-01-05 04:28:33 +03:00
|
|
|
}
|
|
|
|
|
2005-01-12 20:38:40 +03:00
|
|
|
static FIELD_RECORD *F;
|
Initial import of sushi.
Sushi is an interactive, menu-based program that is designed to aid
the user or administrator with administrative and complex tasks on thier
machines.
Sushi provides a menu of various functions that the user can perform on
his or her machine. Once the user selects a desired function, the
function is either performed outright, or in most cases, the user is
asked to fill in a simple form with required and option information,
which is then processed by sushi, and the action occurs.
The programming interface for sushi is very simple. There are
directories containing various files, such as menu indexes, or forms for
the user to fill out. These files are interpreted by sushi to generate
the menus the user sees on his/her screen. When the form is filled out
by the user, the entries are passed as command-line arguments to a
program, or script contained in one of the subdirectories. In this way,
it is possible to add new entries to the sushi menu structure, by simply
adding a new menu item, form and script, the binary does not need to be
recompiled to take advantage of this new menu.
2001-01-05 04:28:33 +03:00
|
|
|
|
|
|
|
static int
|
|
|
|
process_preform(FORM *form, char *path)
|
|
|
|
{
|
|
|
|
char file[PATH_MAX];
|
|
|
|
struct stat sb;
|
|
|
|
char *p;
|
2002-07-25 13:38:31 +04:00
|
|
|
int fc, lcnt, i, j;
|
Initial import of sushi.
Sushi is an interactive, menu-based program that is designed to aid
the user or administrator with administrative and complex tasks on thier
machines.
Sushi provides a menu of various functions that the user can perform on
his or her machine. Once the user selects a desired function, the
function is either performed outright, or in most cases, the user is
asked to fill in a simple form with required and option information,
which is then processed by sushi, and the action occurs.
The programming interface for sushi is very simple. There are
directories containing various files, such as menu indexes, or forms for
the user to fill out. These files are interpreted by sushi to generate
the menus the user sees on his/her screen. When the form is filled out
by the user, the entries are passed as command-line arguments to a
program, or script contained in one of the subdirectories. In this way,
it is possible to add new entries to the sushi menu structure, by simply
adding a new menu item, form and script, the binary does not need to be
recompiled to take advantage of this new menu.
2001-01-05 04:28:33 +03:00
|
|
|
FIELD **f;
|
2003-10-16 10:19:11 +04:00
|
|
|
char **args, **nargs;
|
Initial import of sushi.
Sushi is an interactive, menu-based program that is designed to aid
the user or administrator with administrative and complex tasks on thier
machines.
Sushi provides a menu of various functions that the user can perform on
his or her machine. Once the user selects a desired function, the
function is either performed outright, or in most cases, the user is
asked to fill in a simple form with required and option information,
which is then processed by sushi, and the action occurs.
The programming interface for sushi is very simple. There are
directories containing various files, such as menu indexes, or forms for
the user to fill out. These files are interpreted by sushi to generate
the menus the user sees on his/her screen. When the form is filled out
by the user, the entries are passed as command-line arguments to a
program, or script contained in one of the subdirectories. In this way,
it is possible to add new entries to the sushi menu structure, by simply
adding a new menu item, form and script, the binary does not need to be
recompiled to take advantage of this new menu.
2001-01-05 04:28:33 +03:00
|
|
|
|
|
|
|
if (lang_id == NULL) {
|
2003-07-16 10:40:47 +04:00
|
|
|
snprintf(file, sizeof(file), "%s/%s", path, FORMFILE);
|
Initial import of sushi.
Sushi is an interactive, menu-based program that is designed to aid
the user or administrator with administrative and complex tasks on thier
machines.
Sushi provides a menu of various functions that the user can perform on
his or her machine. Once the user selects a desired function, the
function is either performed outright, or in most cases, the user is
asked to fill in a simple form with required and option information,
which is then processed by sushi, and the action occurs.
The programming interface for sushi is very simple. There are
directories containing various files, such as menu indexes, or forms for
the user to fill out. These files are interpreted by sushi to generate
the menus the user sees on his/her screen. When the form is filled out
by the user, the entries are passed as command-line arguments to a
program, or script contained in one of the subdirectories. In this way,
it is possible to add new entries to the sushi menu structure, by simply
adding a new menu item, form and script, the binary does not need to be
recompiled to take advantage of this new menu.
2001-01-05 04:28:33 +03:00
|
|
|
} else {
|
2003-07-16 10:40:47 +04:00
|
|
|
snprintf(file, sizeof(file), "%s/%s.%s", path, FORMFILE,
|
|
|
|
lang_id);
|
Initial import of sushi.
Sushi is an interactive, menu-based program that is designed to aid
the user or administrator with administrative and complex tasks on thier
machines.
Sushi provides a menu of various functions that the user can perform on
his or her machine. Once the user selects a desired function, the
function is either performed outright, or in most cases, the user is
asked to fill in a simple form with required and option information,
which is then processed by sushi, and the action occurs.
The programming interface for sushi is very simple. There are
directories containing various files, such as menu indexes, or forms for
the user to fill out. These files are interpreted by sushi to generate
the menus the user sees on his/her screen. When the form is filled out
by the user, the entries are passed as command-line arguments to a
program, or script contained in one of the subdirectories. In this way,
it is possible to add new entries to the sushi menu structure, by simply
adding a new menu item, form and script, the binary does not need to be
recompiled to take advantage of this new menu.
2001-01-05 04:28:33 +03:00
|
|
|
if (stat(file, &sb) != 0)
|
2003-07-16 10:40:47 +04:00
|
|
|
snprintf(file, sizeof(file), "%s/%s", path, FORMFILE);
|
Initial import of sushi.
Sushi is an interactive, menu-based program that is designed to aid
the user or administrator with administrative and complex tasks on thier
machines.
Sushi provides a menu of various functions that the user can perform on
his or her machine. Once the user selects a desired function, the
function is either performed outright, or in most cases, the user is
asked to fill in a simple form with required and option information,
which is then processed by sushi, and the action occurs.
The programming interface for sushi is very simple. There are
directories containing various files, such as menu indexes, or forms for
the user to fill out. These files are interpreted by sushi to generate
the menus the user sees on his/her screen. When the form is filled out
by the user, the entries are passed as command-line arguments to a
program, or script contained in one of the subdirectories. In this way,
it is possible to add new entries to the sushi menu structure, by simply
adding a new menu item, form and script, the binary does not need to be
recompiled to take advantage of this new menu.
2001-01-05 04:28:33 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
args = malloc(sizeof(char *) * 2);
|
|
|
|
if (args == NULL)
|
|
|
|
bailout("malloc: %s", strerror(errno));
|
2002-07-25 13:38:31 +04:00
|
|
|
fc = lcnt = field_count(form);
|
2005-01-12 20:38:40 +03:00
|
|
|
nargs = realloc(args, sizeof(char *) * (lcnt + 1));
|
2003-10-16 10:19:11 +04:00
|
|
|
if (nargs == NULL)
|
2005-01-12 20:38:40 +03:00
|
|
|
bailout("realloc: %s", strerror(errno));
|
2003-10-16 10:19:11 +04:00
|
|
|
args = nargs;
|
Initial import of sushi.
Sushi is an interactive, menu-based program that is designed to aid
the user or administrator with administrative and complex tasks on thier
machines.
Sushi provides a menu of various functions that the user can perform on
his or her machine. Once the user selects a desired function, the
function is either performed outright, or in most cases, the user is
asked to fill in a simple form with required and option information,
which is then processed by sushi, and the action occurs.
The programming interface for sushi is very simple. There are
directories containing various files, such as menu indexes, or forms for
the user to fill out. These files are interpreted by sushi to generate
the menus the user sees on his/her screen. When the form is filled out
by the user, the entries are passed as command-line arguments to a
program, or script contained in one of the subdirectories. In this way,
it is possible to add new entries to the sushi menu structure, by simply
adding a new menu item, form and script, the binary does not need to be
recompiled to take advantage of this new menu.
2001-01-05 04:28:33 +03:00
|
|
|
|
|
|
|
f = form_fields(form);
|
2005-01-12 20:38:40 +03:00
|
|
|
for (lcnt = 0, i = 0; lcnt < fc; lcnt++) {
|
Initial import of sushi.
Sushi is an interactive, menu-based program that is designed to aid
the user or administrator with administrative and complex tasks on thier
machines.
Sushi provides a menu of various functions that the user can perform on
his or her machine. Once the user selects a desired function, the
function is either performed outright, or in most cases, the user is
asked to fill in a simple form with required and option information,
which is then processed by sushi, and the action occurs.
The programming interface for sushi is very simple. There are
directories containing various files, such as menu indexes, or forms for
the user to fill out. These files are interpreted by sushi to generate
the menus the user sees on his/her screen. When the form is filled out
by the user, the entries are passed as command-line arguments to a
program, or script contained in one of the subdirectories. In this way,
it is possible to add new entries to the sushi menu structure, by simply
adding a new menu item, form and script, the binary does not need to be
recompiled to take advantage of this new menu.
2001-01-05 04:28:33 +03:00
|
|
|
if (F[lcnt].type != (PF_field)LABEL) {
|
2001-01-24 10:17:10 +03:00
|
|
|
if (field_buffer(f[lcnt], 0) == NULL)
|
|
|
|
args[i] = "";
|
|
|
|
else
|
|
|
|
args[i] = strdup(field_buffer(f[lcnt], 0));
|
Initial import of sushi.
Sushi is an interactive, menu-based program that is designed to aid
the user or administrator with administrative and complex tasks on thier
machines.
Sushi provides a menu of various functions that the user can perform on
his or her machine. Once the user selects a desired function, the
function is either performed outright, or in most cases, the user is
asked to fill in a simple form with required and option information,
which is then processed by sushi, and the action occurs.
The programming interface for sushi is very simple. There are
directories containing various files, such as menu indexes, or forms for
the user to fill out. These files are interpreted by sushi to generate
the menus the user sees on his/her screen. When the form is filled out
by the user, the entries are passed as command-line arguments to a
program, or script contained in one of the subdirectories. In this way,
it is possible to add new entries to the sushi menu structure, by simply
adding a new menu item, form and script, the binary does not need to be
recompiled to take advantage of this new menu.
2001-01-05 04:28:33 +03:00
|
|
|
if (args[i] != NULL) {
|
|
|
|
p = &args[i][strlen(args[i]) - 1];
|
2005-01-12 20:38:40 +03:00
|
|
|
while (isspace((unsigned char)*p))
|
Initial import of sushi.
Sushi is an interactive, menu-based program that is designed to aid
the user or administrator with administrative and complex tasks on thier
machines.
Sushi provides a menu of various functions that the user can perform on
his or her machine. Once the user selects a desired function, the
function is either performed outright, or in most cases, the user is
asked to fill in a simple form with required and option information,
which is then processed by sushi, and the action occurs.
The programming interface for sushi is very simple. There are
directories containing various files, such as menu indexes, or forms for
the user to fill out. These files are interpreted by sushi to generate
the menus the user sees on his/her screen. When the form is filled out
by the user, the entries are passed as command-line arguments to a
program, or script contained in one of the subdirectories. In this way,
it is possible to add new entries to the sushi menu structure, by simply
adding a new menu item, form and script, the binary does not need to be
recompiled to take advantage of this new menu.
2001-01-05 04:28:33 +03:00
|
|
|
*p-- = '\0';
|
|
|
|
}
|
|
|
|
i++;
|
|
|
|
}
|
2005-01-12 20:38:40 +03:00
|
|
|
}
|
Initial import of sushi.
Sushi is an interactive, menu-based program that is designed to aid
the user or administrator with administrative and complex tasks on thier
machines.
Sushi provides a menu of various functions that the user can perform on
his or her machine. Once the user selects a desired function, the
function is either performed outright, or in most cases, the user is
asked to fill in a simple form with required and option information,
which is then processed by sushi, and the action occurs.
The programming interface for sushi is very simple. There are
directories containing various files, such as menu indexes, or forms for
the user to fill out. These files are interpreted by sushi to generate
the menus the user sees on his/her screen. When the form is filled out
by the user, the entries are passed as command-line arguments to a
program, or script contained in one of the subdirectories. In this way,
it is possible to add new entries to the sushi menu structure, by simply
adding a new menu item, form and script, the binary does not need to be
recompiled to take advantage of this new menu.
2001-01-05 04:28:33 +03:00
|
|
|
args[i] = NULL;
|
|
|
|
|
2005-01-12 20:38:40 +03:00
|
|
|
for (i = 0; F[i].type != NULL; i++) {
|
2001-01-31 12:35:42 +03:00
|
|
|
free(F[i].v);
|
|
|
|
if (F[i].list != NULL) {
|
2005-01-12 20:38:40 +03:00
|
|
|
for (j = 0; F[i].list[j] != NULL; j++)
|
2001-01-31 12:35:42 +03:00
|
|
|
free(F[i].list[j]);
|
|
|
|
free(F[i].list);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
free(F);
|
|
|
|
|
Initial import of sushi.
Sushi is an interactive, menu-based program that is designed to aid
the user or administrator with administrative and complex tasks on thier
machines.
Sushi provides a menu of various functions that the user can perform on
his or her machine. Once the user selects a desired function, the
function is either performed outright, or in most cases, the user is
asked to fill in a simple form with required and option information,
which is then processed by sushi, and the action occurs.
The programming interface for sushi is very simple. There are
directories containing various files, such as menu indexes, or forms for
the user to fill out. These files are interpreted by sushi to generate
the menus the user sees on his/her screen. When the form is filled out
by the user, the entries are passed as command-line arguments to a
program, or script contained in one of the subdirectories. In this way,
it is possible to add new entries to the sushi menu structure, by simply
adding a new menu item, form and script, the binary does not need to be
recompiled to take advantage of this new menu.
2001-01-05 04:28:33 +03:00
|
|
|
i = handle_form(path, file, args);
|
|
|
|
|
2005-01-12 20:38:40 +03:00
|
|
|
for (j = 0; args[j] != NULL; j++)
|
2001-01-31 12:35:42 +03:00
|
|
|
free(args[j]);
|
Initial import of sushi.
Sushi is an interactive, menu-based program that is designed to aid
the user or administrator with administrative and complex tasks on thier
machines.
Sushi provides a menu of various functions that the user can perform on
his or her machine. Once the user selects a desired function, the
function is either performed outright, or in most cases, the user is
asked to fill in a simple form with required and option information,
which is then processed by sushi, and the action occurs.
The programming interface for sushi is very simple. There are
directories containing various files, such as menu indexes, or forms for
the user to fill out. These files are interpreted by sushi to generate
the menus the user sees on his/her screen. When the form is filled out
by the user, the entries are passed as command-line arguments to a
program, or script contained in one of the subdirectories. In this way,
it is possible to add new entries to the sushi menu structure, by simply
adding a new menu item, form and script, the binary does not need to be
recompiled to take advantage of this new menu.
2001-01-05 04:28:33 +03:00
|
|
|
free(args);
|
2005-01-12 20:38:40 +03:00
|
|
|
|
|
|
|
return (i);
|
Initial import of sushi.
Sushi is an interactive, menu-based program that is designed to aid
the user or administrator with administrative and complex tasks on thier
machines.
Sushi provides a menu of various functions that the user can perform on
his or her machine. Once the user selects a desired function, the
function is either performed outright, or in most cases, the user is
asked to fill in a simple form with required and option information,
which is then processed by sushi, and the action occurs.
The programming interface for sushi is very simple. There are
directories containing various files, such as menu indexes, or forms for
the user to fill out. These files are interpreted by sushi to generate
the menus the user sees on his/her screen. When the form is filled out
by the user, the entries are passed as command-line arguments to a
program, or script contained in one of the subdirectories. In this way,
it is possible to add new entries to the sushi menu structure, by simply
adding a new menu item, form and script, the binary does not need to be
recompiled to take advantage of this new menu.
2001-01-05 04:28:33 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
int
|
|
|
|
process_form(FORM *form, char *path)
|
|
|
|
{
|
|
|
|
FILE *fp;
|
|
|
|
char file[PATH_MAX], file2[PATH_MAX];
|
|
|
|
struct stat sb;
|
|
|
|
char *exec, *t, *p;
|
|
|
|
size_t len;
|
2002-07-25 13:38:31 +04:00
|
|
|
int fc, lcnt, i, j;
|
Initial import of sushi.
Sushi is an interactive, menu-based program that is designed to aid
the user or administrator with administrative and complex tasks on thier
machines.
Sushi provides a menu of various functions that the user can perform on
his or her machine. Once the user selects a desired function, the
function is either performed outright, or in most cases, the user is
asked to fill in a simple form with required and option information,
which is then processed by sushi, and the action occurs.
The programming interface for sushi is very simple. There are
directories containing various files, such as menu indexes, or forms for
the user to fill out. These files are interpreted by sushi to generate
the menus the user sees on his/her screen. When the form is filled out
by the user, the entries are passed as command-line arguments to a
program, or script contained in one of the subdirectories. In this way,
it is possible to add new entries to the sushi menu structure, by simply
adding a new menu item, form and script, the binary does not need to be
recompiled to take advantage of this new menu.
2001-01-05 04:28:33 +03:00
|
|
|
FIELD **f;
|
2003-10-16 10:19:11 +04:00
|
|
|
char **args, **nargs;
|
2004-03-09 23:26:24 +03:00
|
|
|
CDKLABEL *label;
|
|
|
|
char *msg[1];
|
|
|
|
int key;
|
Initial import of sushi.
Sushi is an interactive, menu-based program that is designed to aid
the user or administrator with administrative and complex tasks on thier
machines.
Sushi provides a menu of various functions that the user can perform on
his or her machine. Once the user selects a desired function, the
function is either performed outright, or in most cases, the user is
asked to fill in a simple form with required and option information,
which is then processed by sushi, and the action occurs.
The programming interface for sushi is very simple. There are
directories containing various files, such as menu indexes, or forms for
the user to fill out. These files are interpreted by sushi to generate
the menus the user sees on his/her screen. When the form is filled out
by the user, the entries are passed as command-line arguments to a
program, or script contained in one of the subdirectories. In this way,
it is possible to add new entries to the sushi menu structure, by simply
adding a new menu item, form and script, the binary does not need to be
recompiled to take advantage of this new menu.
2001-01-05 04:28:33 +03:00
|
|
|
|
|
|
|
/* handle the preform somewhere else */
|
|
|
|
if (strcmp("pre", form_userptr(form)) == 0)
|
2005-01-12 20:38:40 +03:00
|
|
|
return (process_preform(form, path));
|
Initial import of sushi.
Sushi is an interactive, menu-based program that is designed to aid
the user or administrator with administrative and complex tasks on thier
machines.
Sushi provides a menu of various functions that the user can perform on
his or her machine. Once the user selects a desired function, the
function is either performed outright, or in most cases, the user is
asked to fill in a simple form with required and option information,
which is then processed by sushi, and the action occurs.
The programming interface for sushi is very simple. There are
directories containing various files, such as menu indexes, or forms for
the user to fill out. These files are interpreted by sushi to generate
the menus the user sees on his/her screen. When the form is filled out
by the user, the entries are passed as command-line arguments to a
program, or script contained in one of the subdirectories. In this way,
it is possible to add new entries to the sushi menu structure, by simply
adding a new menu item, form and script, the binary does not need to be
recompiled to take advantage of this new menu.
2001-01-05 04:28:33 +03:00
|
|
|
|
2005-06-02 13:41:12 +04:00
|
|
|
t = NULL;
|
|
|
|
i = 0;
|
2004-03-24 22:10:58 +03:00
|
|
|
curs_set(0);
|
2004-03-09 23:26:24 +03:00
|
|
|
*msg = catgets(catalog, 3, 17, "Are you sure? (Y/n)");
|
|
|
|
label = newCDKLabel(cdkscreen, CENTER, CENTER, msg, 1, TRUE, FALSE);
|
|
|
|
activateCDKLabel(label, NULL);
|
|
|
|
key = waitCDKLabel(label, 0);
|
|
|
|
destroyCDKLabel(label);
|
|
|
|
touchwin(stdscr);
|
|
|
|
wrefresh(stdscr);
|
2004-03-24 22:10:58 +03:00
|
|
|
curs_set(1);
|
2004-03-09 23:26:24 +03:00
|
|
|
if (key != 13 && key != 10 && key != 121 && key != 89) /* enter y Y */
|
2005-01-12 20:38:40 +03:00
|
|
|
return (-1);
|
2004-03-09 23:26:24 +03:00
|
|
|
|
Initial import of sushi.
Sushi is an interactive, menu-based program that is designed to aid
the user or administrator with administrative and complex tasks on thier
machines.
Sushi provides a menu of various functions that the user can perform on
his or her machine. Once the user selects a desired function, the
function is either performed outright, or in most cases, the user is
asked to fill in a simple form with required and option information,
which is then processed by sushi, and the action occurs.
The programming interface for sushi is very simple. There are
directories containing various files, such as menu indexes, or forms for
the user to fill out. These files are interpreted by sushi to generate
the menus the user sees on his/her screen. When the form is filled out
by the user, the entries are passed as command-line arguments to a
program, or script contained in one of the subdirectories. In this way,
it is possible to add new entries to the sushi menu structure, by simply
adding a new menu item, form and script, the binary does not need to be
recompiled to take advantage of this new menu.
2001-01-05 04:28:33 +03:00
|
|
|
if (lang_id == NULL) {
|
2003-07-16 10:40:47 +04:00
|
|
|
snprintf(file, sizeof(file), "%s/%s", path, EXECFILE);
|
|
|
|
snprintf(file2, sizeof(file2), "%s/%s", path, SCRIPTFILE);
|
Initial import of sushi.
Sushi is an interactive, menu-based program that is designed to aid
the user or administrator with administrative and complex tasks on thier
machines.
Sushi provides a menu of various functions that the user can perform on
his or her machine. Once the user selects a desired function, the
function is either performed outright, or in most cases, the user is
asked to fill in a simple form with required and option information,
which is then processed by sushi, and the action occurs.
The programming interface for sushi is very simple. There are
directories containing various files, such as menu indexes, or forms for
the user to fill out. These files are interpreted by sushi to generate
the menus the user sees on his/her screen. When the form is filled out
by the user, the entries are passed as command-line arguments to a
program, or script contained in one of the subdirectories. In this way,
it is possible to add new entries to the sushi menu structure, by simply
adding a new menu item, form and script, the binary does not need to be
recompiled to take advantage of this new menu.
2001-01-05 04:28:33 +03:00
|
|
|
} else {
|
2003-07-16 10:40:47 +04:00
|
|
|
snprintf(file, sizeof(file), "%s/%s.%s", path, EXECFILE,
|
|
|
|
lang_id);
|
|
|
|
snprintf(file2, sizeof(file2), "%s/%s.%s", path, SCRIPTFILE,
|
|
|
|
lang_id);
|
Initial import of sushi.
Sushi is an interactive, menu-based program that is designed to aid
the user or administrator with administrative and complex tasks on thier
machines.
Sushi provides a menu of various functions that the user can perform on
his or her machine. Once the user selects a desired function, the
function is either performed outright, or in most cases, the user is
asked to fill in a simple form with required and option information,
which is then processed by sushi, and the action occurs.
The programming interface for sushi is very simple. There are
directories containing various files, such as menu indexes, or forms for
the user to fill out. These files are interpreted by sushi to generate
the menus the user sees on his/her screen. When the form is filled out
by the user, the entries are passed as command-line arguments to a
program, or script contained in one of the subdirectories. In this way,
it is possible to add new entries to the sushi menu structure, by simply
adding a new menu item, form and script, the binary does not need to be
recompiled to take advantage of this new menu.
2001-01-05 04:28:33 +03:00
|
|
|
if (stat(file, &sb) != 0)
|
2003-07-16 10:40:47 +04:00
|
|
|
snprintf(file, sizeof(file), "%s/%s", path, EXECFILE);
|
Initial import of sushi.
Sushi is an interactive, menu-based program that is designed to aid
the user or administrator with administrative and complex tasks on thier
machines.
Sushi provides a menu of various functions that the user can perform on
his or her machine. Once the user selects a desired function, the
function is either performed outright, or in most cases, the user is
asked to fill in a simple form with required and option information,
which is then processed by sushi, and the action occurs.
The programming interface for sushi is very simple. There are
directories containing various files, such as menu indexes, or forms for
the user to fill out. These files are interpreted by sushi to generate
the menus the user sees on his/her screen. When the form is filled out
by the user, the entries are passed as command-line arguments to a
program, or script contained in one of the subdirectories. In this way,
it is possible to add new entries to the sushi menu structure, by simply
adding a new menu item, form and script, the binary does not need to be
recompiled to take advantage of this new menu.
2001-01-05 04:28:33 +03:00
|
|
|
if (stat(file2, &sb) != 0)
|
2003-07-16 10:40:47 +04:00
|
|
|
snprintf(file2, sizeof(file2), "%s/%s", path,
|
|
|
|
SCRIPTFILE);
|
Initial import of sushi.
Sushi is an interactive, menu-based program that is designed to aid
the user or administrator with administrative and complex tasks on thier
machines.
Sushi provides a menu of various functions that the user can perform on
his or her machine. Once the user selects a desired function, the
function is either performed outright, or in most cases, the user is
asked to fill in a simple form with required and option information,
which is then processed by sushi, and the action occurs.
The programming interface for sushi is very simple. There are
directories containing various files, such as menu indexes, or forms for
the user to fill out. These files are interpreted by sushi to generate
the menus the user sees on his/her screen. When the form is filled out
by the user, the entries are passed as command-line arguments to a
program, or script contained in one of the subdirectories. In this way,
it is possible to add new entries to the sushi menu structure, by simply
adding a new menu item, form and script, the binary does not need to be
recompiled to take advantage of this new menu.
2001-01-05 04:28:33 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
args = malloc(sizeof(char *) * 2);
|
|
|
|
if (args == NULL)
|
|
|
|
bailout("malloc: %s", strerror(errno));
|
|
|
|
|
2005-01-12 20:38:40 +03:00
|
|
|
if ((fp = fopen(file, "r")) != NULL) {
|
Initial import of sushi.
Sushi is an interactive, menu-based program that is designed to aid
the user or administrator with administrative and complex tasks on thier
machines.
Sushi provides a menu of various functions that the user can perform on
his or her machine. Once the user selects a desired function, the
function is either performed outright, or in most cases, the user is
asked to fill in a simple form with required and option information,
which is then processed by sushi, and the action occurs.
The programming interface for sushi is very simple. There are
directories containing various files, such as menu indexes, or forms for
the user to fill out. These files are interpreted by sushi to generate
the menus the user sees on his/her screen. When the form is filled out
by the user, the entries are passed as command-line arguments to a
program, or script contained in one of the subdirectories. In this way,
it is possible to add new entries to the sushi menu structure, by simply
adding a new menu item, form and script, the binary does not need to be
recompiled to take advantage of this new menu.
2001-01-05 04:28:33 +03:00
|
|
|
for (lcnt = 1; (exec = fgetln(fp, &len)) != NULL; ++lcnt) {
|
|
|
|
if (len == 1) /* skip blank */
|
|
|
|
continue;
|
|
|
|
if (exec[len - 1] == '#') /* Skip comments */
|
|
|
|
continue;
|
2005-01-12 20:38:40 +03:00
|
|
|
if (exec[len - 1] != '\n') { /* corrupted? */
|
Initial import of sushi.
Sushi is an interactive, menu-based program that is designed to aid
the user or administrator with administrative and complex tasks on thier
machines.
Sushi provides a menu of various functions that the user can perform on
his or her machine. Once the user selects a desired function, the
function is either performed outright, or in most cases, the user is
asked to fill in a simple form with required and option information,
which is then processed by sushi, and the action occurs.
The programming interface for sushi is very simple. There are
directories containing various files, such as menu indexes, or forms for
the user to fill out. These files are interpreted by sushi to generate
the menus the user sees on his/her screen. When the form is filled out
by the user, the entries are passed as command-line arguments to a
program, or script contained in one of the subdirectories. In this way,
it is possible to add new entries to the sushi menu structure, by simply
adding a new menu item, form and script, the binary does not need to be
recompiled to take advantage of this new menu.
2001-01-05 04:28:33 +03:00
|
|
|
warnx("%s: line %d corrupted", path, lcnt);
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
exec[len - 1] = '\0'; /* NUL terminate */
|
2005-01-12 20:38:40 +03:00
|
|
|
while (*exec != '\0' && isspace((unsigned char)*exec))
|
|
|
|
++exec;
|
Initial import of sushi.
Sushi is an interactive, menu-based program that is designed to aid
the user or administrator with administrative and complex tasks on thier
machines.
Sushi provides a menu of various functions that the user can perform on
his or her machine. Once the user selects a desired function, the
function is either performed outright, or in most cases, the user is
asked to fill in a simple form with required and option information,
which is then processed by sushi, and the action occurs.
The programming interface for sushi is very simple. There are
directories containing various files, such as menu indexes, or forms for
the user to fill out. These files are interpreted by sushi to generate
the menus the user sees on his/her screen. When the form is filled out
by the user, the entries are passed as command-line arguments to a
program, or script contained in one of the subdirectories. In this way,
it is possible to add new entries to the sushi menu structure, by simply
adding a new menu item, form and script, the binary does not need to be
recompiled to take advantage of this new menu.
2001-01-05 04:28:33 +03:00
|
|
|
if (*exec == '\0' || *exec == '#')
|
|
|
|
continue;
|
|
|
|
p = strsep(&exec, " ");
|
|
|
|
for (i = 0; p != NULL; p = strsep(&exec, " "), i++) {
|
2005-01-12 20:38:40 +03:00
|
|
|
nargs = realloc(args, sizeof(char *) * (i + 2));
|
2003-10-16 10:19:11 +04:00
|
|
|
if (nargs == NULL)
|
Initial import of sushi.
Sushi is an interactive, menu-based program that is designed to aid
the user or administrator with administrative and complex tasks on thier
machines.
Sushi provides a menu of various functions that the user can perform on
his or her machine. Once the user selects a desired function, the
function is either performed outright, or in most cases, the user is
asked to fill in a simple form with required and option information,
which is then processed by sushi, and the action occurs.
The programming interface for sushi is very simple. There are
directories containing various files, such as menu indexes, or forms for
the user to fill out. These files are interpreted by sushi to generate
the menus the user sees on his/her screen. When the form is filled out
by the user, the entries are passed as command-line arguments to a
program, or script contained in one of the subdirectories. In this way,
it is possible to add new entries to the sushi menu structure, by simply
adding a new menu item, form and script, the binary does not need to be
recompiled to take advantage of this new menu.
2001-01-05 04:28:33 +03:00
|
|
|
bailout("realloc: %s", strerror(errno));
|
2003-10-16 10:19:11 +04:00
|
|
|
args = nargs;
|
Initial import of sushi.
Sushi is an interactive, menu-based program that is designed to aid
the user or administrator with administrative and complex tasks on thier
machines.
Sushi provides a menu of various functions that the user can perform on
his or her machine. Once the user selects a desired function, the
function is either performed outright, or in most cases, the user is
asked to fill in a simple form with required and option information,
which is then processed by sushi, and the action occurs.
The programming interface for sushi is very simple. There are
directories containing various files, such as menu indexes, or forms for
the user to fill out. These files are interpreted by sushi to generate
the menus the user sees on his/her screen. When the form is filled out
by the user, the entries are passed as command-line arguments to a
program, or script contained in one of the subdirectories. In this way,
it is possible to add new entries to the sushi menu structure, by simply
adding a new menu item, form and script, the binary does not need to be
recompiled to take advantage of this new menu.
2001-01-05 04:28:33 +03:00
|
|
|
args[i] = strdup(p);
|
|
|
|
}
|
|
|
|
t = NULL;
|
|
|
|
}
|
|
|
|
fclose(fp);
|
|
|
|
} else if (stat(file2, &sb) == 0) {
|
|
|
|
t = strdup(file2);
|
|
|
|
i = 1;
|
|
|
|
} else
|
|
|
|
bailout(catgets(catalog, 1, 13, "no files"));
|
|
|
|
|
2002-07-25 13:38:31 +04:00
|
|
|
fc = lcnt = field_count(form);
|
2005-01-12 20:38:40 +03:00
|
|
|
nargs = realloc(args, sizeof(char *) * (lcnt + 1 + i));
|
2003-10-16 10:19:11 +04:00
|
|
|
if (nargs == NULL)
|
2005-01-12 20:38:40 +03:00
|
|
|
bailout("realloc: %s", strerror(errno));
|
2003-10-16 10:19:11 +04:00
|
|
|
args = nargs;
|
Initial import of sushi.
Sushi is an interactive, menu-based program that is designed to aid
the user or administrator with administrative and complex tasks on thier
machines.
Sushi provides a menu of various functions that the user can perform on
his or her machine. Once the user selects a desired function, the
function is either performed outright, or in most cases, the user is
asked to fill in a simple form with required and option information,
which is then processed by sushi, and the action occurs.
The programming interface for sushi is very simple. There are
directories containing various files, such as menu indexes, or forms for
the user to fill out. These files are interpreted by sushi to generate
the menus the user sees on his/her screen. When the form is filled out
by the user, the entries are passed as command-line arguments to a
program, or script contained in one of the subdirectories. In this way,
it is possible to add new entries to the sushi menu structure, by simply
adding a new menu item, form and script, the binary does not need to be
recompiled to take advantage of this new menu.
2001-01-05 04:28:33 +03:00
|
|
|
|
|
|
|
f = form_fields(form);
|
2005-01-12 20:38:40 +03:00
|
|
|
for (lcnt = 0; lcnt < fc; lcnt++) {
|
Initial import of sushi.
Sushi is an interactive, menu-based program that is designed to aid
the user or administrator with administrative and complex tasks on thier
machines.
Sushi provides a menu of various functions that the user can perform on
his or her machine. Once the user selects a desired function, the
function is either performed outright, or in most cases, the user is
asked to fill in a simple form with required and option information,
which is then processed by sushi, and the action occurs.
The programming interface for sushi is very simple. There are
directories containing various files, such as menu indexes, or forms for
the user to fill out. These files are interpreted by sushi to generate
the menus the user sees on his/her screen. When the form is filled out
by the user, the entries are passed as command-line arguments to a
program, or script contained in one of the subdirectories. In this way,
it is possible to add new entries to the sushi menu structure, by simply
adding a new menu item, form and script, the binary does not need to be
recompiled to take advantage of this new menu.
2001-01-05 04:28:33 +03:00
|
|
|
if (F[lcnt].type != (PF_field)LABEL) {
|
2001-01-24 10:17:10 +03:00
|
|
|
if (field_buffer(f[lcnt], 0) == NULL)
|
|
|
|
args[i] = "";
|
|
|
|
else
|
|
|
|
args[i] = strdup(field_buffer(f[lcnt], 0));
|
Initial import of sushi.
Sushi is an interactive, menu-based program that is designed to aid
the user or administrator with administrative and complex tasks on thier
machines.
Sushi provides a menu of various functions that the user can perform on
his or her machine. Once the user selects a desired function, the
function is either performed outright, or in most cases, the user is
asked to fill in a simple form with required and option information,
which is then processed by sushi, and the action occurs.
The programming interface for sushi is very simple. There are
directories containing various files, such as menu indexes, or forms for
the user to fill out. These files are interpreted by sushi to generate
the menus the user sees on his/her screen. When the form is filled out
by the user, the entries are passed as command-line arguments to a
program, or script contained in one of the subdirectories. In this way,
it is possible to add new entries to the sushi menu structure, by simply
adding a new menu item, form and script, the binary does not need to be
recompiled to take advantage of this new menu.
2001-01-05 04:28:33 +03:00
|
|
|
if (args[i] != NULL) {
|
|
|
|
p = &args[i][strlen(args[i]) - 1];
|
2005-01-12 20:38:40 +03:00
|
|
|
while (isspace((unsigned char)*p))
|
Initial import of sushi.
Sushi is an interactive, menu-based program that is designed to aid
the user or administrator with administrative and complex tasks on thier
machines.
Sushi provides a menu of various functions that the user can perform on
his or her machine. Once the user selects a desired function, the
function is either performed outright, or in most cases, the user is
asked to fill in a simple form with required and option information,
which is then processed by sushi, and the action occurs.
The programming interface for sushi is very simple. There are
directories containing various files, such as menu indexes, or forms for
the user to fill out. These files are interpreted by sushi to generate
the menus the user sees on his/her screen. When the form is filled out
by the user, the entries are passed as command-line arguments to a
program, or script contained in one of the subdirectories. In this way,
it is possible to add new entries to the sushi menu structure, by simply
adding a new menu item, form and script, the binary does not need to be
recompiled to take advantage of this new menu.
2001-01-05 04:28:33 +03:00
|
|
|
*p-- = '\0';
|
|
|
|
}
|
|
|
|
i++;
|
|
|
|
}
|
2005-01-12 20:38:40 +03:00
|
|
|
}
|
Initial import of sushi.
Sushi is an interactive, menu-based program that is designed to aid
the user or administrator with administrative and complex tasks on thier
machines.
Sushi provides a menu of various functions that the user can perform on
his or her machine. Once the user selects a desired function, the
function is either performed outright, or in most cases, the user is
asked to fill in a simple form with required and option information,
which is then processed by sushi, and the action occurs.
The programming interface for sushi is very simple. There are
directories containing various files, such as menu indexes, or forms for
the user to fill out. These files are interpreted by sushi to generate
the menus the user sees on his/her screen. When the form is filled out
by the user, the entries are passed as command-line arguments to a
program, or script contained in one of the subdirectories. In this way,
it is possible to add new entries to the sushi menu structure, by simply
adding a new menu item, form and script, the binary does not need to be
recompiled to take advantage of this new menu.
2001-01-05 04:28:33 +03:00
|
|
|
if (t != NULL)
|
|
|
|
args[0] = t;
|
|
|
|
args[i] = NULL;
|
|
|
|
|
|
|
|
i = run_prog(1, args);
|
|
|
|
|
2005-01-12 20:38:40 +03:00
|
|
|
for (j = 0; args[j] != NULL; j++)
|
2001-01-31 12:35:42 +03:00
|
|
|
free(args[j]);
|
Initial import of sushi.
Sushi is an interactive, menu-based program that is designed to aid
the user or administrator with administrative and complex tasks on thier
machines.
Sushi provides a menu of various functions that the user can perform on
his or her machine. Once the user selects a desired function, the
function is either performed outright, or in most cases, the user is
asked to fill in a simple form with required and option information,
which is then processed by sushi, and the action occurs.
The programming interface for sushi is very simple. There are
directories containing various files, such as menu indexes, or forms for
the user to fill out. These files are interpreted by sushi to generate
the menus the user sees on his/her screen. When the form is filled out
by the user, the entries are passed as command-line arguments to a
program, or script contained in one of the subdirectories. In this way,
it is possible to add new entries to the sushi menu structure, by simply
adding a new menu item, form and script, the binary does not need to be
recompiled to take advantage of this new menu.
2001-01-05 04:28:33 +03:00
|
|
|
free(args);
|
2001-01-31 12:35:42 +03:00
|
|
|
|
2005-01-12 20:38:40 +03:00
|
|
|
return (i);
|
Initial import of sushi.
Sushi is an interactive, menu-based program that is designed to aid
the user or administrator with administrative and complex tasks on thier
machines.
Sushi provides a menu of various functions that the user can perform on
his or her machine. Once the user selects a desired function, the
function is either performed outright, or in most cases, the user is
asked to fill in a simple form with required and option information,
which is then processed by sushi, and the action occurs.
The programming interface for sushi is very simple. There are
directories containing various files, such as menu indexes, or forms for
the user to fill out. These files are interpreted by sushi to generate
the menus the user sees on his/her screen. When the form is filled out
by the user, the entries are passed as command-line arguments to a
program, or script contained in one of the subdirectories. In this way,
it is possible to add new entries to the sushi menu structure, by simply
adding a new menu item, form and script, the binary does not need to be
recompiled to take advantage of this new menu.
2001-01-05 04:28:33 +03:00
|
|
|
}
|
|
|
|
|
2005-01-12 20:38:40 +03:00
|
|
|
static FIELD **
|
Initial import of sushi.
Sushi is an interactive, menu-based program that is designed to aid
the user or administrator with administrative and complex tasks on thier
machines.
Sushi provides a menu of various functions that the user can perform on
his or her machine. Once the user selects a desired function, the
function is either performed outright, or in most cases, the user is
asked to fill in a simple form with required and option information,
which is then processed by sushi, and the action occurs.
The programming interface for sushi is very simple. There are
directories containing various files, such as menu indexes, or forms for
the user to fill out. These files are interpreted by sushi to generate
the menus the user sees on his/her screen. When the form is filled out
by the user, the entries are passed as command-line arguments to a
program, or script contained in one of the subdirectories. In this way,
it is possible to add new entries to the sushi menu structure, by simply
adding a new menu item, form and script, the binary does not need to be
recompiled to take advantage of this new menu.
2001-01-05 04:28:33 +03:00
|
|
|
make_fields(void)
|
|
|
|
{ /* create the fields */
|
2001-01-31 12:35:42 +03:00
|
|
|
FIELD **f, **fields;
|
Initial import of sushi.
Sushi is an interactive, menu-based program that is designed to aid
the user or administrator with administrative and complex tasks on thier
machines.
Sushi provides a menu of various functions that the user can perform on
his or her machine. Once the user selects a desired function, the
function is either performed outright, or in most cases, the user is
asked to fill in a simple form with required and option information,
which is then processed by sushi, and the action occurs.
The programming interface for sushi is very simple. There are
directories containing various files, such as menu indexes, or forms for
the user to fill out. These files are interpreted by sushi to generate
the menus the user sees on his/her screen. When the form is filled out
by the user, the entries are passed as command-line arguments to a
program, or script contained in one of the subdirectories. In this way,
it is possible to add new entries to the sushi menu structure, by simply
adding a new menu item, form and script, the binary does not need to be
recompiled to take advantage of this new menu.
2001-01-05 04:28:33 +03:00
|
|
|
int i;
|
|
|
|
|
2005-01-12 20:38:40 +03:00
|
|
|
f = malloc(sizeof(FIELD *) * (MAX_FIELD + 1));
|
2001-01-31 12:35:42 +03:00
|
|
|
if (f == NULL)
|
|
|
|
bailout("malloc: %s", strerror(errno));
|
|
|
|
fields = f;
|
|
|
|
|
Initial import of sushi.
Sushi is an interactive, menu-based program that is designed to aid
the user or administrator with administrative and complex tasks on thier
machines.
Sushi provides a menu of various functions that the user can perform on
his or her machine. Once the user selects a desired function, the
function is either performed outright, or in most cases, the user is
asked to fill in a simple form with required and option information,
which is then processed by sushi, and the action occurs.
The programming interface for sushi is very simple. There are
directories containing various files, such as menu indexes, or forms for
the user to fill out. These files are interpreted by sushi to generate
the menus the user sees on his/her screen. When the form is filled out
by the user, the entries are passed as command-line arguments to a
program, or script contained in one of the subdirectories. In this way,
it is possible to add new entries to the sushi menu structure, by simply
adding a new menu item, form and script, the binary does not need to be
recompiled to take advantage of this new menu.
2001-01-05 04:28:33 +03:00
|
|
|
for (i = 0; i < MAX_FIELD && F[i].type; ++i, ++f)
|
|
|
|
*f = (F[i].type)(&F[i]);
|
|
|
|
|
2005-01-12 20:38:40 +03:00
|
|
|
*f = (FIELD *)0;
|
Initial import of sushi.
Sushi is an interactive, menu-based program that is designed to aid
the user or administrator with administrative and complex tasks on thier
machines.
Sushi provides a menu of various functions that the user can perform on
his or her machine. Once the user selects a desired function, the
function is either performed outright, or in most cases, the user is
asked to fill in a simple form with required and option information,
which is then processed by sushi, and the action occurs.
The programming interface for sushi is very simple. There are
directories containing various files, such as menu indexes, or forms for
the user to fill out. These files are interpreted by sushi to generate
the menus the user sees on his/her screen. When the form is filled out
by the user, the entries are passed as command-line arguments to a
program, or script contained in one of the subdirectories. In this way,
it is possible to add new entries to the sushi menu structure, by simply
adding a new menu item, form and script, the binary does not need to be
recompiled to take advantage of this new menu.
2001-01-05 04:28:33 +03:00
|
|
|
|
2005-01-12 20:38:40 +03:00
|
|
|
return (fields);
|
Initial import of sushi.
Sushi is an interactive, menu-based program that is designed to aid
the user or administrator with administrative and complex tasks on thier
machines.
Sushi provides a menu of various functions that the user can perform on
his or her machine. Once the user selects a desired function, the
function is either performed outright, or in most cases, the user is
asked to fill in a simple form with required and option information,
which is then processed by sushi, and the action occurs.
The programming interface for sushi is very simple. There are
directories containing various files, such as menu indexes, or forms for
the user to fill out. These files are interpreted by sushi to generate
the menus the user sees on his/her screen. When the form is filled out
by the user, the entries are passed as command-line arguments to a
program, or script contained in one of the subdirectories. In this way,
it is possible to add new entries to the sushi menu structure, by simply
adding a new menu item, form and script, the binary does not need to be
recompiled to take advantage of this new menu.
2001-01-05 04:28:33 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
struct cqForm cqFormHead, *cqFormHeadp;
|
|
|
|
|
|
|
|
static int
|
|
|
|
tstring(int max, char *string)
|
|
|
|
{
|
|
|
|
char hold[10];
|
|
|
|
int cur;
|
|
|
|
|
|
|
|
if (max == 0)
|
2005-01-12 20:38:40 +03:00
|
|
|
return (0);
|
|
|
|
for (cur = 0; cur <= max; cur++) {
|
2003-07-16 10:40:47 +04:00
|
|
|
snprintf(hold, sizeof(hold), "@@@%d@@@", cur);
|
2001-01-31 12:35:42 +03:00
|
|
|
if (strcmp(hold, string) == 0)
|
2005-01-12 20:38:40 +03:00
|
|
|
return (cur);
|
Initial import of sushi.
Sushi is an interactive, menu-based program that is designed to aid
the user or administrator with administrative and complex tasks on thier
machines.
Sushi provides a menu of various functions that the user can perform on
his or her machine. Once the user selects a desired function, the
function is either performed outright, or in most cases, the user is
asked to fill in a simple form with required and option information,
which is then processed by sushi, and the action occurs.
The programming interface for sushi is very simple. There are
directories containing various files, such as menu indexes, or forms for
the user to fill out. These files are interpreted by sushi to generate
the menus the user sees on his/her screen. When the form is filled out
by the user, the entries are passed as command-line arguments to a
program, or script contained in one of the subdirectories. In this way,
it is possible to add new entries to the sushi menu structure, by simply
adding a new menu item, form and script, the binary does not need to be
recompiled to take advantage of this new menu.
2001-01-05 04:28:33 +03:00
|
|
|
}
|
2005-01-12 20:38:40 +03:00
|
|
|
return (0);
|
Initial import of sushi.
Sushi is an interactive, menu-based program that is designed to aid
the user or administrator with administrative and complex tasks on thier
machines.
Sushi provides a menu of various functions that the user can perform on
his or her machine. Once the user selects a desired function, the
function is either performed outright, or in most cases, the user is
asked to fill in a simple form with required and option information,
which is then processed by sushi, and the action occurs.
The programming interface for sushi is very simple. There are
directories containing various files, such as menu indexes, or forms for
the user to fill out. These files are interpreted by sushi to generate
the menus the user sees on his/her screen. When the form is filled out
by the user, the entries are passed as command-line arguments to a
program, or script contained in one of the subdirectories. In this way,
it is possible to add new entries to the sushi menu structure, by simply
adding a new menu item, form and script, the binary does not need to be
recompiled to take advantage of this new menu.
2001-01-05 04:28:33 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
static int
|
|
|
|
strlen_data(FTREE_ENTRY *ftp)
|
|
|
|
{
|
|
|
|
int i, j;
|
2001-01-31 12:35:42 +03:00
|
|
|
char *p, *q, *o;
|
Initial import of sushi.
Sushi is an interactive, menu-based program that is designed to aid
the user or administrator with administrative and complex tasks on thier
machines.
Sushi provides a menu of various functions that the user can perform on
his or her machine. Once the user selects a desired function, the
function is either performed outright, or in most cases, the user is
asked to fill in a simple form with required and option information,
which is then processed by sushi, and the action occurs.
The programming interface for sushi is very simple. There are
directories containing various files, such as menu indexes, or forms for
the user to fill out. These files are interpreted by sushi to generate
the menus the user sees on his/her screen. When the form is filled out
by the user, the entries are passed as command-line arguments to a
program, or script contained in one of the subdirectories. In this way,
it is possible to add new entries to the sushi menu structure, by simply
adding a new menu item, form and script, the binary does not need to be
recompiled to take advantage of this new menu.
2001-01-05 04:28:33 +03:00
|
|
|
|
|
|
|
i = 0;
|
2005-01-12 20:38:40 +03:00
|
|
|
switch (ftp->type) {
|
Initial import of sushi.
Sushi is an interactive, menu-based program that is designed to aid
the user or administrator with administrative and complex tasks on thier
machines.
Sushi provides a menu of various functions that the user can perform on
his or her machine. Once the user selects a desired function, the
function is either performed outright, or in most cases, the user is
asked to fill in a simple form with required and option information,
which is then processed by sushi, and the action occurs.
The programming interface for sushi is very simple. There are
directories containing various files, such as menu indexes, or forms for
the user to fill out. These files are interpreted by sushi to generate
the menus the user sees on his/her screen. When the form is filled out
by the user, the entries are passed as command-line arguments to a
program, or script contained in one of the subdirectories. In this way,
it is possible to add new entries to the sushi menu structure, by simply
adding a new menu item, form and script, the binary does not need to be
recompiled to take advantage of this new menu.
2001-01-05 04:28:33 +03:00
|
|
|
case DATAT_BLANK:
|
2005-01-12 20:38:40 +03:00
|
|
|
return (1);
|
2001-01-10 06:05:48 +03:00
|
|
|
/* NOTREACHED */
|
Initial import of sushi.
Sushi is an interactive, menu-based program that is designed to aid
the user or administrator with administrative and complex tasks on thier
machines.
Sushi provides a menu of various functions that the user can perform on
his or her machine. Once the user selects a desired function, the
function is either performed outright, or in most cases, the user is
asked to fill in a simple form with required and option information,
which is then processed by sushi, and the action occurs.
The programming interface for sushi is very simple. There are
directories containing various files, such as menu indexes, or forms for
the user to fill out. These files are interpreted by sushi to generate
the menus the user sees on his/her screen. When the form is filled out
by the user, the entries are passed as command-line arguments to a
program, or script contained in one of the subdirectories. In this way,
it is possible to add new entries to the sushi menu structure, by simply
adding a new menu item, form and script, the binary does not need to be
recompiled to take advantage of this new menu.
2001-01-05 04:28:33 +03:00
|
|
|
break;
|
|
|
|
case DATAT_ENTRY:
|
|
|
|
case DATAT_ESCRIPT:
|
2001-03-07 13:10:20 +03:00
|
|
|
case DATAT_NESCRIPT:
|
|
|
|
case DATAT_V4:
|
|
|
|
case DATAT_V4SCRIPT:
|
|
|
|
case DATAT_V6:
|
|
|
|
case DATAT_V6SCRIPT:
|
2001-03-14 11:22:00 +03:00
|
|
|
case DATAT_INVIS:
|
|
|
|
case DATAT_NOEDIT:
|
2005-01-12 20:38:40 +03:00
|
|
|
return (ftp->elen);
|
2001-01-10 06:05:48 +03:00
|
|
|
/* NOTREACHED */
|
Initial import of sushi.
Sushi is an interactive, menu-based program that is designed to aid
the user or administrator with administrative and complex tasks on thier
machines.
Sushi provides a menu of various functions that the user can perform on
his or her machine. Once the user selects a desired function, the
function is either performed outright, or in most cases, the user is
asked to fill in a simple form with required and option information,
which is then processed by sushi, and the action occurs.
The programming interface for sushi is very simple. There are
directories containing various files, such as menu indexes, or forms for
the user to fill out. These files are interpreted by sushi to generate
the menus the user sees on his/her screen. When the form is filled out
by the user, the entries are passed as command-line arguments to a
program, or script contained in one of the subdirectories. In this way,
it is possible to add new entries to the sushi menu structure, by simply
adding a new menu item, form and script, the binary does not need to be
recompiled to take advantage of this new menu.
2001-01-05 04:28:33 +03:00
|
|
|
break;
|
|
|
|
case DATAT_LIST:
|
|
|
|
case DATAT_FUNC:
|
|
|
|
case DATAT_SCRIPT:
|
|
|
|
case DATAT_MLIST:
|
|
|
|
case DATAT_MFUNC:
|
|
|
|
case DATAT_MSCRIPT:
|
2002-04-02 22:59:54 +04:00
|
|
|
if (ftp->list == NULL)
|
2005-01-12 20:38:40 +03:00
|
|
|
return (0);
|
2002-04-02 22:59:54 +04:00
|
|
|
for (i = 0, j = 0; ftp->list[i] != NULL; i++) {
|
|
|
|
size_t k;
|
|
|
|
if ((k = strlen(ftp->list[i])) > j)
|
|
|
|
j = k;
|
|
|
|
}
|
2005-01-12 20:38:40 +03:00
|
|
|
return (j);
|
2001-01-10 06:05:48 +03:00
|
|
|
/* NOTREACHED */
|
Initial import of sushi.
Sushi is an interactive, menu-based program that is designed to aid
the user or administrator with administrative and complex tasks on thier
machines.
Sushi provides a menu of various functions that the user can perform on
his or her machine. Once the user selects a desired function, the
function is either performed outright, or in most cases, the user is
asked to fill in a simple form with required and option information,
which is then processed by sushi, and the action occurs.
The programming interface for sushi is very simple. There are
directories containing various files, such as menu indexes, or forms for
the user to fill out. These files are interpreted by sushi to generate
the menus the user sees on his/her screen. When the form is filled out
by the user, the entries are passed as command-line arguments to a
program, or script contained in one of the subdirectories. In this way,
it is possible to add new entries to the sushi menu structure, by simply
adding a new menu item, form and script, the binary does not need to be
recompiled to take advantage of this new menu.
2001-01-05 04:28:33 +03:00
|
|
|
break;
|
|
|
|
case DATAT_INTEGER:
|
2001-01-31 12:35:42 +03:00
|
|
|
case DATAT_ISCRIPT:
|
|
|
|
o = p = strdup(ftp->data);
|
Initial import of sushi.
Sushi is an interactive, menu-based program that is designed to aid
the user or administrator with administrative and complex tasks on thier
machines.
Sushi provides a menu of various functions that the user can perform on
his or her machine. Once the user selects a desired function, the
function is either performed outright, or in most cases, the user is
asked to fill in a simple form with required and option information,
which is then processed by sushi, and the action occurs.
The programming interface for sushi is very simple. There are
directories containing various files, such as menu indexes, or forms for
the user to fill out. These files are interpreted by sushi to generate
the menus the user sees on his/her screen. When the form is filled out
by the user, the entries are passed as command-line arguments to a
program, or script contained in one of the subdirectories. In this way,
it is possible to add new entries to the sushi menu structure, by simply
adding a new menu item, form and script, the binary does not need to be
recompiled to take advantage of this new menu.
2001-01-05 04:28:33 +03:00
|
|
|
q = strsep(&p, ",");
|
2001-01-31 12:35:42 +03:00
|
|
|
i = atoi(q);
|
|
|
|
free(o);
|
2005-01-12 20:38:40 +03:00
|
|
|
return (i);
|
2001-01-10 06:05:48 +03:00
|
|
|
/* NOTREACHED */
|
Initial import of sushi.
Sushi is an interactive, menu-based program that is designed to aid
the user or administrator with administrative and complex tasks on thier
machines.
Sushi provides a menu of various functions that the user can perform on
his or her machine. Once the user selects a desired function, the
function is either performed outright, or in most cases, the user is
asked to fill in a simple form with required and option information,
which is then processed by sushi, and the action occurs.
The programming interface for sushi is very simple. There are
directories containing various files, such as menu indexes, or forms for
the user to fill out. These files are interpreted by sushi to generate
the menus the user sees on his/her screen. When the form is filled out
by the user, the entries are passed as command-line arguments to a
program, or script contained in one of the subdirectories. In this way,
it is possible to add new entries to the sushi menu structure, by simply
adding a new menu item, form and script, the binary does not need to be
recompiled to take advantage of this new menu.
2001-01-05 04:28:33 +03:00
|
|
|
break;
|
|
|
|
default:
|
|
|
|
bailout(catgets(catalog, 1, 14, "invalid field type"));
|
|
|
|
break;
|
|
|
|
}
|
2005-01-12 20:38:40 +03:00
|
|
|
return (1); /* eep! */
|
Initial import of sushi.
Sushi is an interactive, menu-based program that is designed to aid
the user or administrator with administrative and complex tasks on thier
machines.
Sushi provides a menu of various functions that the user can perform on
his or her machine. Once the user selects a desired function, the
function is either performed outright, or in most cases, the user is
asked to fill in a simple form with required and option information,
which is then processed by sushi, and the action occurs.
The programming interface for sushi is very simple. There are
directories containing various files, such as menu indexes, or forms for
the user to fill out. These files are interpreted by sushi to generate
the menus the user sees on his/her screen. When the form is filled out
by the user, the entries are passed as command-line arguments to a
program, or script contained in one of the subdirectories. In this way,
it is possible to add new entries to the sushi menu structure, by simply
adding a new menu item, form and script, the binary does not need to be
recompiled to take advantage of this new menu.
2001-01-05 04:28:33 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
gen_list(FTREE_ENTRY *ftp, int max, char **args)
|
|
|
|
{
|
2005-01-12 20:38:40 +03:00
|
|
|
int i = 0;
|
2002-04-02 22:59:54 +04:00
|
|
|
int lmax = 10;
|
Initial import of sushi.
Sushi is an interactive, menu-based program that is designed to aid
the user or administrator with administrative and complex tasks on thier
machines.
Sushi provides a menu of various functions that the user can perform on
his or her machine. Once the user selects a desired function, the
function is either performed outright, or in most cases, the user is
asked to fill in a simple form with required and option information,
which is then processed by sushi, and the action occurs.
The programming interface for sushi is very simple. There are
directories containing various files, such as menu indexes, or forms for
the user to fill out. These files are interpreted by sushi to generate
the menus the user sees on his/her screen. When the form is filled out
by the user, the entries are passed as command-line arguments to a
program, or script contained in one of the subdirectories. In this way,
it is possible to add new entries to the sushi menu structure, by simply
adding a new menu item, form and script, the binary does not need to be
recompiled to take advantage of this new menu.
2001-01-05 04:28:33 +03:00
|
|
|
int cur;
|
|
|
|
char *p, *q;
|
2003-10-16 10:19:11 +04:00
|
|
|
char **nlist;
|
Initial import of sushi.
Sushi is an interactive, menu-based program that is designed to aid
the user or administrator with administrative and complex tasks on thier
machines.
Sushi provides a menu of various functions that the user can perform on
his or her machine. Once the user selects a desired function, the
function is either performed outright, or in most cases, the user is
asked to fill in a simple form with required and option information,
which is then processed by sushi, and the action occurs.
The programming interface for sushi is very simple. There are
directories containing various files, such as menu indexes, or forms for
the user to fill out. These files are interpreted by sushi to generate
the menus the user sees on his/her screen. When the form is filled out
by the user, the entries are passed as command-line arguments to a
program, or script contained in one of the subdirectories. In this way,
it is possible to add new entries to the sushi menu structure, by simply
adding a new menu item, form and script, the binary does not need to be
recompiled to take advantage of this new menu.
2001-01-05 04:28:33 +03:00
|
|
|
|
2005-01-12 20:38:40 +03:00
|
|
|
ftp->list = malloc(sizeof(char *) * lmax);
|
Initial import of sushi.
Sushi is an interactive, menu-based program that is designed to aid
the user or administrator with administrative and complex tasks on thier
machines.
Sushi provides a menu of various functions that the user can perform on
his or her machine. Once the user selects a desired function, the
function is either performed outright, or in most cases, the user is
asked to fill in a simple form with required and option information,
which is then processed by sushi, and the action occurs.
The programming interface for sushi is very simple. There are
directories containing various files, such as menu indexes, or forms for
the user to fill out. These files are interpreted by sushi to generate
the menus the user sees on his/her screen. When the form is filled out
by the user, the entries are passed as command-line arguments to a
program, or script contained in one of the subdirectories. In this way,
it is possible to add new entries to the sushi menu structure, by simply
adding a new menu item, form and script, the binary does not need to be
recompiled to take advantage of this new menu.
2001-01-05 04:28:33 +03:00
|
|
|
if (ftp->list == NULL)
|
|
|
|
bailout("malloc: %s", strerror(errno));
|
|
|
|
for (p = ftp->data; p != NULL;) {
|
|
|
|
q = (char *)strsep(&p, ",");
|
|
|
|
if (q != NULL) {
|
|
|
|
cur = tstring(max, q);
|
|
|
|
if (cur)
|
|
|
|
ftp->list[i++] = strdup(args[cur-1]);
|
|
|
|
else
|
|
|
|
ftp->list[i++] = strdup(q);
|
|
|
|
}
|
2002-04-02 22:59:54 +04:00
|
|
|
if (i == lmax - 2) {
|
2003-10-16 10:19:11 +04:00
|
|
|
nlist = realloc(ftp->list, sizeof(char*) * (lmax + 10));
|
|
|
|
if (nlist == NULL)
|
2002-07-25 16:42:39 +04:00
|
|
|
bailout("realloc: %s", strerror(errno));
|
2003-10-16 10:19:11 +04:00
|
|
|
ftp->list = nlist;
|
|
|
|
lmax += 10;
|
2002-04-02 22:59:54 +04:00
|
|
|
}
|
Initial import of sushi.
Sushi is an interactive, menu-based program that is designed to aid
the user or administrator with administrative and complex tasks on thier
machines.
Sushi provides a menu of various functions that the user can perform on
his or her machine. Once the user selects a desired function, the
function is either performed outright, or in most cases, the user is
asked to fill in a simple form with required and option information,
which is then processed by sushi, and the action occurs.
The programming interface for sushi is very simple. There are
directories containing various files, such as menu indexes, or forms for
the user to fill out. These files are interpreted by sushi to generate
the menus the user sees on his/her screen. When the form is filled out
by the user, the entries are passed as command-line arguments to a
program, or script contained in one of the subdirectories. In this way,
it is possible to add new entries to the sushi menu structure, by simply
adding a new menu item, form and script, the binary does not need to be
recompiled to take advantage of this new menu.
2001-01-05 04:28:33 +03:00
|
|
|
}
|
|
|
|
ftp->list[i] = NULL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2001-01-24 12:30:30 +03:00
|
|
|
gen_func(FTREE_ENTRY *ftp, int max, char **args)
|
Initial import of sushi.
Sushi is an interactive, menu-based program that is designed to aid
the user or administrator with administrative and complex tasks on thier
machines.
Sushi provides a menu of various functions that the user can perform on
his or her machine. Once the user selects a desired function, the
function is either performed outright, or in most cases, the user is
asked to fill in a simple form with required and option information,
which is then processed by sushi, and the action occurs.
The programming interface for sushi is very simple. There are
directories containing various files, such as menu indexes, or forms for
the user to fill out. These files are interpreted by sushi to generate
the menus the user sees on his/her screen. When the form is filled out
by the user, the entries are passed as command-line arguments to a
program, or script contained in one of the subdirectories. In this way,
it is possible to add new entries to the sushi menu structure, by simply
adding a new menu item, form and script, the binary does not need to be
recompiled to take advantage of this new menu.
2001-01-05 04:28:33 +03:00
|
|
|
{
|
2001-01-24 12:30:30 +03:00
|
|
|
int i, cur;
|
Initial import of sushi.
Sushi is an interactive, menu-based program that is designed to aid
the user or administrator with administrative and complex tasks on thier
machines.
Sushi provides a menu of various functions that the user can perform on
his or her machine. Once the user selects a desired function, the
function is either performed outright, or in most cases, the user is
asked to fill in a simple form with required and option information,
which is then processed by sushi, and the action occurs.
The programming interface for sushi is very simple. There are
directories containing various files, such as menu indexes, or forms for
the user to fill out. These files are interpreted by sushi to generate
the menus the user sees on his/her screen. When the form is filled out
by the user, the entries are passed as command-line arguments to a
program, or script contained in one of the subdirectories. In this way,
it is possible to add new entries to the sushi menu structure, by simply
adding a new menu item, form and script, the binary does not need to be
recompiled to take advantage of this new menu.
2001-01-05 04:28:33 +03:00
|
|
|
char *p, *q;
|
|
|
|
|
|
|
|
p = strsep(&ftp->data, ",");
|
|
|
|
q = strsep(&ftp->data, ",");
|
2005-01-12 20:38:40 +03:00
|
|
|
for (i = 0; func_map[i].funcname != NULL; i++)
|
Initial import of sushi.
Sushi is an interactive, menu-based program that is designed to aid
the user or administrator with administrative and complex tasks on thier
machines.
Sushi provides a menu of various functions that the user can perform on
his or her machine. Once the user selects a desired function, the
function is either performed outright, or in most cases, the user is
asked to fill in a simple form with required and option information,
which is then processed by sushi, and the action occurs.
The programming interface for sushi is very simple. There are
directories containing various files, such as menu indexes, or forms for
the user to fill out. These files are interpreted by sushi to generate
the menus the user sees on his/her screen. When the form is filled out
by the user, the entries are passed as command-line arguments to a
program, or script contained in one of the subdirectories. In this way,
it is possible to add new entries to the sushi menu structure, by simply
adding a new menu item, form and script, the binary does not need to be
recompiled to take advantage of this new menu.
2001-01-05 04:28:33 +03:00
|
|
|
if (strcmp(func_map[i].funcname, p) == 0)
|
|
|
|
break;
|
|
|
|
|
|
|
|
if (func_map[i].function == NULL)
|
|
|
|
bailout("%s: %s",
|
|
|
|
catgets(catalog, 1, 5, "function not found"), p);
|
|
|
|
|
2001-01-24 12:30:30 +03:00
|
|
|
cur = tstring(max, q);
|
|
|
|
if (cur)
|
|
|
|
ftp->list = func_map[i].function(args[cur-1]);
|
|
|
|
else
|
|
|
|
ftp->list = func_map[i].function(q);
|
Initial import of sushi.
Sushi is an interactive, menu-based program that is designed to aid
the user or administrator with administrative and complex tasks on thier
machines.
Sushi provides a menu of various functions that the user can perform on
his or her machine. Once the user selects a desired function, the
function is either performed outright, or in most cases, the user is
asked to fill in a simple form with required and option information,
which is then processed by sushi, and the action occurs.
The programming interface for sushi is very simple. There are
directories containing various files, such as menu indexes, or forms for
the user to fill out. These files are interpreted by sushi to generate
the menus the user sees on his/her screen. When the form is filled out
by the user, the entries are passed as command-line arguments to a
program, or script contained in one of the subdirectories. In this way,
it is possible to add new entries to the sushi menu structure, by simply
adding a new menu item, form and script, the binary does not need to be
recompiled to take advantage of this new menu.
2001-01-05 04:28:33 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
gen_script(FTREE_ENTRY *ftp, char *dir, int max, char **args)
|
|
|
|
{
|
2003-10-16 10:19:11 +04:00
|
|
|
char *p, *q, *qo, *po, *comm, *test, *n;
|
Initial import of sushi.
Sushi is an interactive, menu-based program that is designed to aid
the user or administrator with administrative and complex tasks on thier
machines.
Sushi provides a menu of various functions that the user can perform on
his or her machine. Once the user selects a desired function, the
function is either performed outright, or in most cases, the user is
asked to fill in a simple form with required and option information,
which is then processed by sushi, and the action occurs.
The programming interface for sushi is very simple. There are
directories containing various files, such as menu indexes, or forms for
the user to fill out. These files are interpreted by sushi to generate
the menus the user sees on his/her screen. When the form is filled out
by the user, the entries are passed as command-line arguments to a
program, or script contained in one of the subdirectories. In this way,
it is possible to add new entries to the sushi menu structure, by simply
adding a new menu item, form and script, the binary does not need to be
recompiled to take advantage of this new menu.
2001-01-05 04:28:33 +03:00
|
|
|
FILE *file;
|
|
|
|
char buf[PATH_MAX+30];
|
2002-04-02 22:59:54 +04:00
|
|
|
#if 0
|
|
|
|
struct stat sb;
|
|
|
|
#endif
|
2001-01-06 18:04:05 +03:00
|
|
|
size_t len;
|
|
|
|
int i, cur;
|
2002-04-02 22:59:54 +04:00
|
|
|
int lmax = 10;
|
2003-06-13 11:26:41 +04:00
|
|
|
size_t l;
|
2003-10-16 10:19:11 +04:00
|
|
|
char **nlist;
|
Initial import of sushi.
Sushi is an interactive, menu-based program that is designed to aid
the user or administrator with administrative and complex tasks on thier
machines.
Sushi provides a menu of various functions that the user can perform on
his or her machine. Once the user selects a desired function, the
function is either performed outright, or in most cases, the user is
asked to fill in a simple form with required and option information,
which is then processed by sushi, and the action occurs.
The programming interface for sushi is very simple. There are
directories containing various files, such as menu indexes, or forms for
the user to fill out. These files are interpreted by sushi to generate
the menus the user sees on his/her screen. When the form is filled out
by the user, the entries are passed as command-line arguments to a
program, or script contained in one of the subdirectories. In this way,
it is possible to add new entries to the sushi menu structure, by simply
adding a new menu item, form and script, the binary does not need to be
recompiled to take advantage of this new menu.
2001-01-05 04:28:33 +03:00
|
|
|
|
2001-01-31 12:35:42 +03:00
|
|
|
qo = q = strdup(ftp->data);
|
2003-06-13 11:26:41 +04:00
|
|
|
l = strlen(q) + 2;
|
2003-07-16 10:40:47 +04:00
|
|
|
comm = malloc(sizeof(char) * l);
|
Initial import of sushi.
Sushi is an interactive, menu-based program that is designed to aid
the user or administrator with administrative and complex tasks on thier
machines.
Sushi provides a menu of various functions that the user can perform on
his or her machine. Once the user selects a desired function, the
function is either performed outright, or in most cases, the user is
asked to fill in a simple form with required and option information,
which is then processed by sushi, and the action occurs.
The programming interface for sushi is very simple. There are
directories containing various files, such as menu indexes, or forms for
the user to fill out. These files are interpreted by sushi to generate
the menus the user sees on his/her screen. When the form is filled out
by the user, the entries are passed as command-line arguments to a
program, or script contained in one of the subdirectories. In this way,
it is possible to add new entries to the sushi menu structure, by simply
adding a new menu item, form and script, the binary does not need to be
recompiled to take advantage of this new menu.
2001-01-05 04:28:33 +03:00
|
|
|
if (comm == NULL)
|
|
|
|
bailout("malloc: %s", strerror(errno));
|
2001-01-31 12:35:42 +03:00
|
|
|
p = strsep(&q, ",");
|
2003-06-13 11:26:41 +04:00
|
|
|
(void)strlcpy(comm, p, l);
|
2001-01-31 12:35:42 +03:00
|
|
|
po = NULL;
|
2005-01-12 20:38:40 +03:00
|
|
|
if (q != NULL) {
|
|
|
|
for (po = p = strdup(q); p != NULL; p = strsep(&q, ",")) {
|
2003-07-16 10:40:47 +04:00
|
|
|
(void)strlcat(comm, " ", l);
|
2005-01-12 20:38:40 +03:00
|
|
|
for (test = p; *test != '\0'; test++)
|
Initial import of sushi.
Sushi is an interactive, menu-based program that is designed to aid
the user or administrator with administrative and complex tasks on thier
machines.
Sushi provides a menu of various functions that the user can perform on
his or her machine. Once the user selects a desired function, the
function is either performed outright, or in most cases, the user is
asked to fill in a simple form with required and option information,
which is then processed by sushi, and the action occurs.
The programming interface for sushi is very simple. There are
directories containing various files, such as menu indexes, or forms for
the user to fill out. These files are interpreted by sushi to generate
the menus the user sees on his/her screen. When the form is filled out
by the user, the entries are passed as command-line arguments to a
program, or script contained in one of the subdirectories. In this way,
it is possible to add new entries to the sushi menu structure, by simply
adding a new menu item, form and script, the binary does not need to be
recompiled to take advantage of this new menu.
2001-01-05 04:28:33 +03:00
|
|
|
if (*test == ',') {
|
|
|
|
*test = '\0';
|
2001-01-31 12:35:42 +03:00
|
|
|
test++;
|
|
|
|
q = test;
|
Initial import of sushi.
Sushi is an interactive, menu-based program that is designed to aid
the user or administrator with administrative and complex tasks on thier
machines.
Sushi provides a menu of various functions that the user can perform on
his or her machine. Once the user selects a desired function, the
function is either performed outright, or in most cases, the user is
asked to fill in a simple form with required and option information,
which is then processed by sushi, and the action occurs.
The programming interface for sushi is very simple. There are
directories containing various files, such as menu indexes, or forms for
the user to fill out. These files are interpreted by sushi to generate
the menus the user sees on his/her screen. When the form is filled out
by the user, the entries are passed as command-line arguments to a
program, or script contained in one of the subdirectories. In this way,
it is possible to add new entries to the sushi menu structure, by simply
adding a new menu item, form and script, the binary does not need to be
recompiled to take advantage of this new menu.
2001-01-05 04:28:33 +03:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
cur = tstring(max, p);
|
|
|
|
if (cur) {
|
2003-07-16 10:40:47 +04:00
|
|
|
l = strlen(comm) + strlen(args[cur-1]) + 2;
|
2003-10-16 10:19:11 +04:00
|
|
|
n = realloc(comm, sizeof(char) * l);
|
|
|
|
if (n == NULL)
|
2005-01-12 20:38:40 +03:00
|
|
|
bailout("realloc: %s", strerror(errno));
|
2003-10-16 10:19:11 +04:00
|
|
|
comm = n;
|
2003-07-16 10:40:47 +04:00
|
|
|
(void)strlcat(comm, args[cur-1], l);
|
Initial import of sushi.
Sushi is an interactive, menu-based program that is designed to aid
the user or administrator with administrative and complex tasks on thier
machines.
Sushi provides a menu of various functions that the user can perform on
his or her machine. Once the user selects a desired function, the
function is either performed outright, or in most cases, the user is
asked to fill in a simple form with required and option information,
which is then processed by sushi, and the action occurs.
The programming interface for sushi is very simple. There are
directories containing various files, such as menu indexes, or forms for
the user to fill out. These files are interpreted by sushi to generate
the menus the user sees on his/her screen. When the form is filled out
by the user, the entries are passed as command-line arguments to a
program, or script contained in one of the subdirectories. In this way,
it is possible to add new entries to the sushi menu structure, by simply
adding a new menu item, form and script, the binary does not need to be
recompiled to take advantage of this new menu.
2001-01-05 04:28:33 +03:00
|
|
|
} else {
|
2003-07-16 10:40:47 +04:00
|
|
|
l = strlen(comm) + strlen(p) + 2;
|
2003-10-16 10:19:11 +04:00
|
|
|
n = realloc(comm, sizeof(char) * l);
|
|
|
|
if (n == NULL)
|
2005-01-12 20:38:40 +03:00
|
|
|
bailout("realloc: %s", strerror(errno));
|
2003-10-16 10:19:11 +04:00
|
|
|
comm = n;
|
2003-07-16 10:40:47 +04:00
|
|
|
(void)strlcat(comm, p, l);
|
Initial import of sushi.
Sushi is an interactive, menu-based program that is designed to aid
the user or administrator with administrative and complex tasks on thier
machines.
Sushi provides a menu of various functions that the user can perform on
his or her machine. Once the user selects a desired function, the
function is either performed outright, or in most cases, the user is
asked to fill in a simple form with required and option information,
which is then processed by sushi, and the action occurs.
The programming interface for sushi is very simple. There are
directories containing various files, such as menu indexes, or forms for
the user to fill out. These files are interpreted by sushi to generate
the menus the user sees on his/her screen. When the form is filled out
by the user, the entries are passed as command-line arguments to a
program, or script contained in one of the subdirectories. In this way,
it is possible to add new entries to the sushi menu structure, by simply
adding a new menu item, form and script, the binary does not need to be
recompiled to take advantage of this new menu.
2001-01-05 04:28:33 +03:00
|
|
|
}
|
|
|
|
}
|
2005-01-12 20:38:40 +03:00
|
|
|
}
|
2001-01-31 12:35:42 +03:00
|
|
|
free(qo);
|
2005-01-12 20:38:40 +03:00
|
|
|
if (po != NULL)
|
2001-01-31 12:35:42 +03:00
|
|
|
free(po);
|
Initial import of sushi.
Sushi is an interactive, menu-based program that is designed to aid
the user or administrator with administrative and complex tasks on thier
machines.
Sushi provides a menu of various functions that the user can perform on
his or her machine. Once the user selects a desired function, the
function is either performed outright, or in most cases, the user is
asked to fill in a simple form with required and option information,
which is then processed by sushi, and the action occurs.
The programming interface for sushi is very simple. There are
directories containing various files, such as menu indexes, or forms for
the user to fill out. These files are interpreted by sushi to generate
the menus the user sees on his/her screen. When the form is filled out
by the user, the entries are passed as command-line arguments to a
program, or script contained in one of the subdirectories. In this way,
it is possible to add new entries to the sushi menu structure, by simply
adding a new menu item, form and script, the binary does not need to be
recompiled to take advantage of this new menu.
2001-01-05 04:28:33 +03:00
|
|
|
|
2003-07-16 10:40:47 +04:00
|
|
|
snprintf(buf, sizeof(buf), "%s/%s", dir, comm);
|
Initial import of sushi.
Sushi is an interactive, menu-based program that is designed to aid
the user or administrator with administrative and complex tasks on thier
machines.
Sushi provides a menu of various functions that the user can perform on
his or her machine. Once the user selects a desired function, the
function is either performed outright, or in most cases, the user is
asked to fill in a simple form with required and option information,
which is then processed by sushi, and the action occurs.
The programming interface for sushi is very simple. There are
directories containing various files, such as menu indexes, or forms for
the user to fill out. These files are interpreted by sushi to generate
the menus the user sees on his/her screen. When the form is filled out
by the user, the entries are passed as command-line arguments to a
program, or script contained in one of the subdirectories. In this way,
it is possible to add new entries to the sushi menu structure, by simply
adding a new menu item, form and script, the binary does not need to be
recompiled to take advantage of this new menu.
2001-01-05 04:28:33 +03:00
|
|
|
|
2001-04-06 11:57:05 +04:00
|
|
|
#if 0
|
2001-03-15 12:10:31 +03:00
|
|
|
if (stat(buf, &sb) != 0)
|
|
|
|
bailout("%s: %s", buf, strerror(errno));
|
2001-04-06 11:57:05 +04:00
|
|
|
#endif
|
2001-03-15 12:10:31 +03:00
|
|
|
|
Initial import of sushi.
Sushi is an interactive, menu-based program that is designed to aid
the user or administrator with administrative and complex tasks on thier
machines.
Sushi provides a menu of various functions that the user can perform on
his or her machine. Once the user selects a desired function, the
function is either performed outright, or in most cases, the user is
asked to fill in a simple form with required and option information,
which is then processed by sushi, and the action occurs.
The programming interface for sushi is very simple. There are
directories containing various files, such as menu indexes, or forms for
the user to fill out. These files are interpreted by sushi to generate
the menus the user sees on his/her screen. When the form is filled out
by the user, the entries are passed as command-line arguments to a
program, or script contained in one of the subdirectories. In this way,
it is possible to add new entries to the sushi menu structure, by simply
adding a new menu item, form and script, the binary does not need to be
recompiled to take advantage of this new menu.
2001-01-05 04:28:33 +03:00
|
|
|
file = popen(buf, "r");
|
|
|
|
if (file == NULL)
|
|
|
|
bailout("popen: %s", strerror(errno));
|
|
|
|
|
2002-04-02 22:59:54 +04:00
|
|
|
ftp->list = malloc(sizeof(char *) * lmax);
|
Initial import of sushi.
Sushi is an interactive, menu-based program that is designed to aid
the user or administrator with administrative and complex tasks on thier
machines.
Sushi provides a menu of various functions that the user can perform on
his or her machine. Once the user selects a desired function, the
function is either performed outright, or in most cases, the user is
asked to fill in a simple form with required and option information,
which is then processed by sushi, and the action occurs.
The programming interface for sushi is very simple. There are
directories containing various files, such as menu indexes, or forms for
the user to fill out. These files are interpreted by sushi to generate
the menus the user sees on his/her screen. When the form is filled out
by the user, the entries are passed as command-line arguments to a
program, or script contained in one of the subdirectories. In this way,
it is possible to add new entries to the sushi menu structure, by simply
adding a new menu item, form and script, the binary does not need to be
recompiled to take advantage of this new menu.
2001-01-05 04:28:33 +03:00
|
|
|
if (ftp->list == NULL)
|
|
|
|
bailout("malloc: %s", strerror(errno));
|
|
|
|
|
2002-04-02 22:59:54 +04:00
|
|
|
for (i = 0; (p = fgetln(file, &len)) != NULL;) {
|
|
|
|
if (len <= 1)
|
2001-08-03 13:18:58 +04:00
|
|
|
continue;
|
2002-04-02 22:59:54 +04:00
|
|
|
ftp->list[i] = malloc(len);
|
|
|
|
if (ftp->list[i] == NULL)
|
|
|
|
bailout("malloc: %s", strerror(errno));
|
|
|
|
memcpy(ftp->list[i], p, len);
|
|
|
|
ftp->list[i][len - 1] = '\0';
|
|
|
|
if (++i == lmax - 2) {
|
2003-10-16 10:19:11 +04:00
|
|
|
nlist = realloc(ftp->list, sizeof(char *) * (lmax + 10));
|
|
|
|
if (nlist == NULL)
|
2002-04-02 22:59:54 +04:00
|
|
|
bailout("realloc: %s", strerror(errno));
|
2003-10-16 10:19:11 +04:00
|
|
|
ftp->list = nlist;
|
|
|
|
lmax += 10;
|
2002-04-02 22:59:54 +04:00
|
|
|
}
|
Initial import of sushi.
Sushi is an interactive, menu-based program that is designed to aid
the user or administrator with administrative and complex tasks on thier
machines.
Sushi provides a menu of various functions that the user can perform on
his or her machine. Once the user selects a desired function, the
function is either performed outright, or in most cases, the user is
asked to fill in a simple form with required and option information,
which is then processed by sushi, and the action occurs.
The programming interface for sushi is very simple. There are
directories containing various files, such as menu indexes, or forms for
the user to fill out. These files are interpreted by sushi to generate
the menus the user sees on his/her screen. When the form is filled out
by the user, the entries are passed as command-line arguments to a
program, or script contained in one of the subdirectories. In this way,
it is possible to add new entries to the sushi menu structure, by simply
adding a new menu item, form and script, the binary does not need to be
recompiled to take advantage of this new menu.
2001-01-05 04:28:33 +03:00
|
|
|
}
|
|
|
|
pclose(file);
|
2001-01-24 11:29:56 +03:00
|
|
|
if (i == 0) {
|
|
|
|
ftp->list[0] = "";
|
|
|
|
ftp->list[1] = NULL;
|
2002-04-02 22:59:54 +04:00
|
|
|
} else {
|
|
|
|
ftp->list[i] = NULL;
|
2001-01-24 11:29:56 +03:00
|
|
|
}
|
2001-01-31 12:35:42 +03:00
|
|
|
free(comm);
|
Initial import of sushi.
Sushi is an interactive, menu-based program that is designed to aid
the user or administrator with administrative and complex tasks on thier
machines.
Sushi provides a menu of various functions that the user can perform on
his or her machine. Once the user selects a desired function, the
function is either performed outright, or in most cases, the user is
asked to fill in a simple form with required and option information,
which is then processed by sushi, and the action occurs.
The programming interface for sushi is very simple. There are
directories containing various files, such as menu indexes, or forms for
the user to fill out. These files are interpreted by sushi to generate
the menus the user sees on his/her screen. When the form is filled out
by the user, the entries are passed as command-line arguments to a
program, or script contained in one of the subdirectories. In this way,
it is possible to add new entries to the sushi menu structure, by simply
adding a new menu item, form and script, the binary does not need to be
recompiled to take advantage of this new menu.
2001-01-05 04:28:33 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
static char *
|
|
|
|
gen_escript(FTREE_ENTRY *ftp, char *dir, int max, char **args)
|
|
|
|
{
|
2005-06-02 13:41:12 +04:00
|
|
|
char *p, *q, *po, *test, *comm, *n;
|
Initial import of sushi.
Sushi is an interactive, menu-based program that is designed to aid
the user or administrator with administrative and complex tasks on thier
machines.
Sushi provides a menu of various functions that the user can perform on
his or her machine. Once the user selects a desired function, the
function is either performed outright, or in most cases, the user is
asked to fill in a simple form with required and option information,
which is then processed by sushi, and the action occurs.
The programming interface for sushi is very simple. There are
directories containing various files, such as menu indexes, or forms for
the user to fill out. These files are interpreted by sushi to generate
the menus the user sees on his/her screen. When the form is filled out
by the user, the entries are passed as command-line arguments to a
program, or script contained in one of the subdirectories. In this way,
it is possible to add new entries to the sushi menu structure, by simply
adding a new menu item, form and script, the binary does not need to be
recompiled to take advantage of this new menu.
2001-01-05 04:28:33 +03:00
|
|
|
FILE *file;
|
|
|
|
char buf[PATH_MAX+30];
|
2001-01-06 18:04:05 +03:00
|
|
|
size_t len;
|
|
|
|
int cur;
|
2001-03-16 15:54:47 +03:00
|
|
|
/* struct stat sb; */
|
2003-06-13 11:26:41 +04:00
|
|
|
size_t l;
|
Initial import of sushi.
Sushi is an interactive, menu-based program that is designed to aid
the user or administrator with administrative and complex tasks on thier
machines.
Sushi provides a menu of various functions that the user can perform on
his or her machine. Once the user selects a desired function, the
function is either performed outright, or in most cases, the user is
asked to fill in a simple form with required and option information,
which is then processed by sushi, and the action occurs.
The programming interface for sushi is very simple. There are
directories containing various files, such as menu indexes, or forms for
the user to fill out. These files are interpreted by sushi to generate
the menus the user sees on his/her screen. When the form is filled out
by the user, the entries are passed as command-line arguments to a
program, or script contained in one of the subdirectories. In this way,
it is possible to add new entries to the sushi menu structure, by simply
adding a new menu item, form and script, the binary does not need to be
recompiled to take advantage of this new menu.
2001-01-05 04:28:33 +03:00
|
|
|
|
2001-03-15 12:10:31 +03:00
|
|
|
if (ftp->data == NULL)
|
|
|
|
bailout(catgets(catalog, 1, 22,
|
|
|
|
"Null filename in escript argument"));
|
2005-07-22 01:48:47 +04:00
|
|
|
else
|
|
|
|
q = strdup(ftp->data);
|
2001-01-31 12:35:42 +03:00
|
|
|
|
2003-06-13 11:26:41 +04:00
|
|
|
l = strlen(q) + 2;
|
2003-07-16 10:40:47 +04:00
|
|
|
comm = malloc(sizeof(char) * l);
|
Initial import of sushi.
Sushi is an interactive, menu-based program that is designed to aid
the user or administrator with administrative and complex tasks on thier
machines.
Sushi provides a menu of various functions that the user can perform on
his or her machine. Once the user selects a desired function, the
function is either performed outright, or in most cases, the user is
asked to fill in a simple form with required and option information,
which is then processed by sushi, and the action occurs.
The programming interface for sushi is very simple. There are
directories containing various files, such as menu indexes, or forms for
the user to fill out. These files are interpreted by sushi to generate
the menus the user sees on his/her screen. When the form is filled out
by the user, the entries are passed as command-line arguments to a
program, or script contained in one of the subdirectories. In this way,
it is possible to add new entries to the sushi menu structure, by simply
adding a new menu item, form and script, the binary does not need to be
recompiled to take advantage of this new menu.
2001-01-05 04:28:33 +03:00
|
|
|
if (comm == NULL)
|
|
|
|
bailout("malloc: %s", strerror(errno));
|
2001-01-31 12:35:42 +03:00
|
|
|
p = strsep(&q, ",");
|
2003-06-13 11:26:41 +04:00
|
|
|
(void)strlcpy(comm, p, l);
|
2001-01-31 12:35:42 +03:00
|
|
|
po = NULL;
|
2005-01-12 20:38:40 +03:00
|
|
|
if (q != NULL) {
|
|
|
|
for (po = p = strdup(q); p != NULL; p = strsep(&q, ",")) {
|
2003-07-16 10:40:47 +04:00
|
|
|
(void)strlcat(comm, " ", l);
|
2005-01-12 20:38:40 +03:00
|
|
|
for (test = p; *test != '\0'; test++)
|
Initial import of sushi.
Sushi is an interactive, menu-based program that is designed to aid
the user or administrator with administrative and complex tasks on thier
machines.
Sushi provides a menu of various functions that the user can perform on
his or her machine. Once the user selects a desired function, the
function is either performed outright, or in most cases, the user is
asked to fill in a simple form with required and option information,
which is then processed by sushi, and the action occurs.
The programming interface for sushi is very simple. There are
directories containing various files, such as menu indexes, or forms for
the user to fill out. These files are interpreted by sushi to generate
the menus the user sees on his/her screen. When the form is filled out
by the user, the entries are passed as command-line arguments to a
program, or script contained in one of the subdirectories. In this way,
it is possible to add new entries to the sushi menu structure, by simply
adding a new menu item, form and script, the binary does not need to be
recompiled to take advantage of this new menu.
2001-01-05 04:28:33 +03:00
|
|
|
if (*test == ',') {
|
|
|
|
*test = '\0';
|
2001-01-31 12:35:42 +03:00
|
|
|
test++;
|
|
|
|
q = test;
|
Initial import of sushi.
Sushi is an interactive, menu-based program that is designed to aid
the user or administrator with administrative and complex tasks on thier
machines.
Sushi provides a menu of various functions that the user can perform on
his or her machine. Once the user selects a desired function, the
function is either performed outright, or in most cases, the user is
asked to fill in a simple form with required and option information,
which is then processed by sushi, and the action occurs.
The programming interface for sushi is very simple. There are
directories containing various files, such as menu indexes, or forms for
the user to fill out. These files are interpreted by sushi to generate
the menus the user sees on his/her screen. When the form is filled out
by the user, the entries are passed as command-line arguments to a
program, or script contained in one of the subdirectories. In this way,
it is possible to add new entries to the sushi menu structure, by simply
adding a new menu item, form and script, the binary does not need to be
recompiled to take advantage of this new menu.
2001-01-05 04:28:33 +03:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
cur = tstring(max, p);
|
|
|
|
if (cur) {
|
2003-07-16 10:40:47 +04:00
|
|
|
l = strlen(comm) + strlen(args[cur-1]) + 2;
|
2003-10-16 10:19:11 +04:00
|
|
|
n = realloc(comm, sizeof(char) * l);
|
|
|
|
if (n == NULL)
|
2005-01-12 20:38:40 +03:00
|
|
|
bailout("realloc: %s", strerror(errno));
|
2003-10-16 10:19:11 +04:00
|
|
|
comm = n;
|
2003-07-16 10:40:47 +04:00
|
|
|
(void)strlcat(comm, args[cur-1], l);
|
Initial import of sushi.
Sushi is an interactive, menu-based program that is designed to aid
the user or administrator with administrative and complex tasks on thier
machines.
Sushi provides a menu of various functions that the user can perform on
his or her machine. Once the user selects a desired function, the
function is either performed outright, or in most cases, the user is
asked to fill in a simple form with required and option information,
which is then processed by sushi, and the action occurs.
The programming interface for sushi is very simple. There are
directories containing various files, such as menu indexes, or forms for
the user to fill out. These files are interpreted by sushi to generate
the menus the user sees on his/her screen. When the form is filled out
by the user, the entries are passed as command-line arguments to a
program, or script contained in one of the subdirectories. In this way,
it is possible to add new entries to the sushi menu structure, by simply
adding a new menu item, form and script, the binary does not need to be
recompiled to take advantage of this new menu.
2001-01-05 04:28:33 +03:00
|
|
|
} else {
|
2003-07-16 10:40:47 +04:00
|
|
|
l = strlen(comm) + strlen(p) + 2;
|
2003-10-16 10:19:11 +04:00
|
|
|
n = realloc(comm, sizeof(char) * l);
|
|
|
|
if (n == NULL)
|
2005-01-12 20:38:40 +03:00
|
|
|
bailout("realloc: %s", strerror(errno));
|
2003-10-16 10:19:11 +04:00
|
|
|
comm = n;
|
2003-07-16 10:40:47 +04:00
|
|
|
(void)strlcat(comm, p, l);
|
Initial import of sushi.
Sushi is an interactive, menu-based program that is designed to aid
the user or administrator with administrative and complex tasks on thier
machines.
Sushi provides a menu of various functions that the user can perform on
his or her machine. Once the user selects a desired function, the
function is either performed outright, or in most cases, the user is
asked to fill in a simple form with required and option information,
which is then processed by sushi, and the action occurs.
The programming interface for sushi is very simple. There are
directories containing various files, such as menu indexes, or forms for
the user to fill out. These files are interpreted by sushi to generate
the menus the user sees on his/her screen. When the form is filled out
by the user, the entries are passed as command-line arguments to a
program, or script contained in one of the subdirectories. In this way,
it is possible to add new entries to the sushi menu structure, by simply
adding a new menu item, form and script, the binary does not need to be
recompiled to take advantage of this new menu.
2001-01-05 04:28:33 +03:00
|
|
|
}
|
|
|
|
}
|
2005-01-12 20:38:40 +03:00
|
|
|
}
|
Initial import of sushi.
Sushi is an interactive, menu-based program that is designed to aid
the user or administrator with administrative and complex tasks on thier
machines.
Sushi provides a menu of various functions that the user can perform on
his or her machine. Once the user selects a desired function, the
function is either performed outright, or in most cases, the user is
asked to fill in a simple form with required and option information,
which is then processed by sushi, and the action occurs.
The programming interface for sushi is very simple. There are
directories containing various files, such as menu indexes, or forms for
the user to fill out. These files are interpreted by sushi to generate
the menus the user sees on his/her screen. When the form is filled out
by the user, the entries are passed as command-line arguments to a
program, or script contained in one of the subdirectories. In this way,
it is possible to add new entries to the sushi menu structure, by simply
adding a new menu item, form and script, the binary does not need to be
recompiled to take advantage of this new menu.
2001-01-05 04:28:33 +03:00
|
|
|
|
2005-01-12 20:38:40 +03:00
|
|
|
if (po != NULL)
|
2001-01-31 12:35:42 +03:00
|
|
|
free(po);
|
|
|
|
|
2003-07-16 10:40:47 +04:00
|
|
|
snprintf(buf, sizeof(buf), "%s/%s", dir, comm);
|
Initial import of sushi.
Sushi is an interactive, menu-based program that is designed to aid
the user or administrator with administrative and complex tasks on thier
machines.
Sushi provides a menu of various functions that the user can perform on
his or her machine. Once the user selects a desired function, the
function is either performed outright, or in most cases, the user is
asked to fill in a simple form with required and option information,
which is then processed by sushi, and the action occurs.
The programming interface for sushi is very simple. There are
directories containing various files, such as menu indexes, or forms for
the user to fill out. These files are interpreted by sushi to generate
the menus the user sees on his/her screen. When the form is filled out
by the user, the entries are passed as command-line arguments to a
program, or script contained in one of the subdirectories. In this way,
it is possible to add new entries to the sushi menu structure, by simply
adding a new menu item, form and script, the binary does not need to be
recompiled to take advantage of this new menu.
2001-01-05 04:28:33 +03:00
|
|
|
|
2001-03-16 15:54:47 +03:00
|
|
|
#if 0
|
2001-03-15 12:10:31 +03:00
|
|
|
if (stat(buf, &sb) != 0)
|
|
|
|
bailout("%s: %s", buf, strerror(errno));
|
2001-03-16 15:54:47 +03:00
|
|
|
#endif
|
Initial import of sushi.
Sushi is an interactive, menu-based program that is designed to aid
the user or administrator with administrative and complex tasks on thier
machines.
Sushi provides a menu of various functions that the user can perform on
his or her machine. Once the user selects a desired function, the
function is either performed outright, or in most cases, the user is
asked to fill in a simple form with required and option information,
which is then processed by sushi, and the action occurs.
The programming interface for sushi is very simple. There are
directories containing various files, such as menu indexes, or forms for
the user to fill out. These files are interpreted by sushi to generate
the menus the user sees on his/her screen. When the form is filled out
by the user, the entries are passed as command-line arguments to a
program, or script contained in one of the subdirectories. In this way,
it is possible to add new entries to the sushi menu structure, by simply
adding a new menu item, form and script, the binary does not need to be
recompiled to take advantage of this new menu.
2001-01-05 04:28:33 +03:00
|
|
|
file = popen(buf, "r");
|
|
|
|
if (file == NULL)
|
|
|
|
bailout("popen: %s", strerror(errno));
|
|
|
|
|
|
|
|
p = fgetln(file, &len);
|
|
|
|
if (p != NULL) {
|
2002-07-26 11:59:33 +04:00
|
|
|
p[len - 1] = '\0'; /* strip newline & NUL terminate */
|
Initial import of sushi.
Sushi is an interactive, menu-based program that is designed to aid
the user or administrator with administrative and complex tasks on thier
machines.
Sushi provides a menu of various functions that the user can perform on
his or her machine. Once the user selects a desired function, the
function is either performed outright, or in most cases, the user is
asked to fill in a simple form with required and option information,
which is then processed by sushi, and the action occurs.
The programming interface for sushi is very simple. There are
directories containing various files, such as menu indexes, or forms for
the user to fill out. These files are interpreted by sushi to generate
the menus the user sees on his/her screen. When the form is filled out
by the user, the entries are passed as command-line arguments to a
program, or script contained in one of the subdirectories. In this way,
it is possible to add new entries to the sushi menu structure, by simply
adding a new menu item, form and script, the binary does not need to be
recompiled to take advantage of this new menu.
2001-01-05 04:28:33 +03:00
|
|
|
q = strdup(p);
|
|
|
|
} else
|
2004-03-22 22:03:19 +03:00
|
|
|
bailout("fgetln: on command '%s' gave error %s", buf,
|
|
|
|
strerror(errno));
|
Initial import of sushi.
Sushi is an interactive, menu-based program that is designed to aid
the user or administrator with administrative and complex tasks on thier
machines.
Sushi provides a menu of various functions that the user can perform on
his or her machine. Once the user selects a desired function, the
function is either performed outright, or in most cases, the user is
asked to fill in a simple form with required and option information,
which is then processed by sushi, and the action occurs.
The programming interface for sushi is very simple. There are
directories containing various files, such as menu indexes, or forms for
the user to fill out. These files are interpreted by sushi to generate
the menus the user sees on his/her screen. When the form is filled out
by the user, the entries are passed as command-line arguments to a
program, or script contained in one of the subdirectories. In this way,
it is possible to add new entries to the sushi menu structure, by simply
adding a new menu item, form and script, the binary does not need to be
recompiled to take advantage of this new menu.
2001-01-05 04:28:33 +03:00
|
|
|
|
|
|
|
pclose(file);
|
2001-01-31 12:35:42 +03:00
|
|
|
free(comm);
|
2005-01-12 20:38:40 +03:00
|
|
|
return (q);
|
2001-01-31 12:35:42 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
static char *
|
|
|
|
gen_integer(FTREE_ENTRY *ftp, int max, char **args)
|
|
|
|
{
|
|
|
|
char *q, *qo, *tmp;
|
|
|
|
char buf[PATH_MAX+30];
|
|
|
|
int pre, min, maxi, cur;
|
|
|
|
|
|
|
|
qo = q = strdup(ftp->data);
|
|
|
|
tmp = strsep(&q, ",");
|
|
|
|
cur = tstring(max, tmp);
|
|
|
|
if (cur)
|
|
|
|
pre = atoi(args[cur-1]);
|
|
|
|
else
|
|
|
|
pre = atoi(tmp);
|
|
|
|
tmp = strsep(&q, ",");
|
|
|
|
cur = tstring(max, tmp);
|
|
|
|
if (cur)
|
|
|
|
min = atoi(args[cur-1]);
|
|
|
|
else
|
|
|
|
min = atoi(tmp);
|
|
|
|
tmp = strsep(&q, ",");
|
|
|
|
cur = tstring(max, tmp);
|
|
|
|
if (cur)
|
|
|
|
maxi = atoi(args[cur-1]);
|
|
|
|
else
|
|
|
|
maxi = atoi(tmp);
|
|
|
|
if (q == NULL)
|
|
|
|
snprintf(buf, sizeof(buf), "%d,%d,%d", pre, min, maxi);
|
|
|
|
else
|
|
|
|
snprintf(buf, sizeof(buf), "%d,%d,%d,%s", pre, min, maxi, q);
|
|
|
|
q = strdup(buf);
|
|
|
|
free(qo);
|
|
|
|
|
2005-01-12 20:38:40 +03:00
|
|
|
return (q);
|
2001-01-31 12:35:42 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
static char *
|
|
|
|
gen_iscript(FTREE_ENTRY *ftp, char *dir, int max, char **args)
|
|
|
|
{
|
2003-10-16 10:19:11 +04:00
|
|
|
char *p, *q, *qo, *po, *test, *comm, *tmp, *n;
|
2001-01-31 12:35:42 +03:00
|
|
|
FILE *file;
|
|
|
|
char buf[PATH_MAX+30];
|
2001-03-16 15:54:47 +03:00
|
|
|
/* struct stat sb; */
|
2001-01-31 12:35:42 +03:00
|
|
|
size_t len;
|
|
|
|
int cur, min, maxi, pre;
|
2003-06-13 11:26:41 +04:00
|
|
|
size_t l;
|
2001-01-31 12:35:42 +03:00
|
|
|
|
|
|
|
qo = q = strdup(ftp->data);
|
|
|
|
tmp = strsep(&q, ",");
|
|
|
|
pre = atoi(tmp);
|
|
|
|
tmp = strsep(&q, ",");
|
|
|
|
min = atoi(tmp);
|
|
|
|
tmp = strsep(&q, ",");
|
|
|
|
maxi = atoi(tmp);
|
|
|
|
|
2003-06-13 11:26:41 +04:00
|
|
|
l = strlen(q) + 2;
|
2003-07-16 10:40:47 +04:00
|
|
|
comm = malloc(sizeof(char) * l);
|
2001-01-31 12:35:42 +03:00
|
|
|
if (comm == NULL)
|
|
|
|
bailout("malloc: %s", strerror(errno));
|
|
|
|
tmp = strsep(&q, ",");
|
2003-06-13 11:26:41 +04:00
|
|
|
(void)strlcpy(comm, tmp, l);
|
2001-01-31 12:35:42 +03:00
|
|
|
po = NULL;
|
2005-01-12 20:38:40 +03:00
|
|
|
if (q != NULL) {
|
|
|
|
for (po = p = strdup(q); p != NULL; p = strsep(&q, ",")) {
|
2003-07-16 10:40:47 +04:00
|
|
|
(void)strlcat(comm, " ", l);
|
2005-01-12 20:38:40 +03:00
|
|
|
for (test = p; *test != '\0'; test++)
|
2001-01-31 12:35:42 +03:00
|
|
|
if (*test == ',') {
|
|
|
|
*test = '\0';
|
|
|
|
test++;
|
|
|
|
q = test;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
cur = tstring(max, p);
|
|
|
|
if (cur) {
|
2003-07-16 10:40:47 +04:00
|
|
|
l = strlen(comm) + strlen(args[cur-1]) + 2;
|
2003-10-16 10:19:11 +04:00
|
|
|
n = realloc(comm, sizeof(char) * l);
|
|
|
|
if (n == NULL)
|
2005-01-12 20:38:40 +03:00
|
|
|
bailout("realloc: %s", strerror(errno));
|
2003-10-16 10:19:11 +04:00
|
|
|
comm = n;
|
2003-07-16 10:40:47 +04:00
|
|
|
(void)strlcat(comm, args[cur-1], l);
|
2001-01-31 12:35:42 +03:00
|
|
|
} else {
|
2003-07-16 10:40:47 +04:00
|
|
|
l = strlen(comm) + strlen(p) + 2;
|
2003-10-16 10:19:11 +04:00
|
|
|
n = realloc(comm, sizeof(char) * l);
|
|
|
|
if (n == NULL)
|
2005-01-12 20:38:40 +03:00
|
|
|
bailout("realloc: %s", strerror(errno));
|
2003-10-16 10:19:11 +04:00
|
|
|
comm = n;
|
2003-07-16 10:40:47 +04:00
|
|
|
(void)strlcat(comm, p, l);
|
2001-01-31 12:35:42 +03:00
|
|
|
}
|
|
|
|
}
|
2005-01-12 20:38:40 +03:00
|
|
|
}
|
2001-01-31 12:35:42 +03:00
|
|
|
free(qo);
|
2005-01-12 20:38:40 +03:00
|
|
|
if (po != NULL)
|
2001-01-31 12:35:42 +03:00
|
|
|
free(po);
|
|
|
|
|
2003-07-16 10:40:47 +04:00
|
|
|
snprintf(buf, sizeof(buf), "%s/%s", dir, comm);
|
2001-01-31 12:35:42 +03:00
|
|
|
|
2001-03-16 15:54:47 +03:00
|
|
|
#if 0
|
2001-03-15 12:10:31 +03:00
|
|
|
if (stat(buf, &sb) != 0)
|
|
|
|
bailout("%s: %s", buf, strerror(errno));
|
2001-03-16 15:54:47 +03:00
|
|
|
#endif
|
2001-01-31 12:35:42 +03:00
|
|
|
file = popen(buf, "r");
|
|
|
|
if (file == NULL)
|
|
|
|
bailout("popen: %s", strerror(errno));
|
|
|
|
|
|
|
|
p = fgetln(file, &len);
|
|
|
|
if (p != NULL) {
|
2002-07-26 11:59:33 +04:00
|
|
|
p[len - 1] = '\0'; /* strip newline & NUL terminate */
|
2001-01-31 12:35:42 +03:00
|
|
|
q = strdup(p);
|
|
|
|
} else
|
2004-03-22 22:03:19 +03:00
|
|
|
bailout("fgetln: on command '%s' gave error %s", buf,
|
|
|
|
strerror(errno));
|
2001-01-31 12:35:42 +03:00
|
|
|
|
|
|
|
pclose(file);
|
|
|
|
snprintf(buf, sizeof(buf), "%d,%d,%d,%s", pre, min, maxi, q);
|
|
|
|
free(q);
|
|
|
|
q = strdup(buf);
|
|
|
|
|
|
|
|
free(comm);
|
|
|
|
|
2005-01-12 20:38:40 +03:00
|
|
|
return (q);
|
Initial import of sushi.
Sushi is an interactive, menu-based program that is designed to aid
the user or administrator with administrative and complex tasks on thier
machines.
Sushi provides a menu of various functions that the user can perform on
his or her machine. Once the user selects a desired function, the
function is either performed outright, or in most cases, the user is
asked to fill in a simple form with required and option information,
which is then processed by sushi, and the action occurs.
The programming interface for sushi is very simple. There are
directories containing various files, such as menu indexes, or forms for
the user to fill out. These files are interpreted by sushi to generate
the menus the user sees on his/her screen. When the form is filled out
by the user, the entries are passed as command-line arguments to a
program, or script contained in one of the subdirectories. In this way,
it is possible to add new entries to the sushi menu structure, by simply
adding a new menu item, form and script, the binary does not need to be
recompiled to take advantage of this new menu.
2001-01-05 04:28:33 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
form_generate(struct cqForm *cqf, char *basedir, char **args)
|
|
|
|
{
|
2005-01-12 20:38:40 +03:00
|
|
|
int i = 0;
|
|
|
|
int lrow = 0;
|
Initial import of sushi.
Sushi is an interactive, menu-based program that is designed to aid
the user or administrator with administrative and complex tasks on thier
machines.
Sushi provides a menu of various functions that the user can perform on
his or her machine. Once the user selects a desired function, the
function is either performed outright, or in most cases, the user is
asked to fill in a simple form with required and option information,
which is then processed by sushi, and the action occurs.
The programming interface for sushi is very simple. There are
directories containing various files, such as menu indexes, or forms for
the user to fill out. These files are interpreted by sushi to generate
the menus the user sees on his/her screen. When the form is filled out
by the user, the entries are passed as command-line arguments to a
program, or script contained in one of the subdirectories. In this way,
it is possible to add new entries to the sushi menu structure, by simply
adding a new menu item, form and script, the binary does not need to be
recompiled to take advantage of this new menu.
2001-01-05 04:28:33 +03:00
|
|
|
int max, cur;
|
|
|
|
char *p;
|
|
|
|
FTREE_ENTRY *ftp;
|
|
|
|
|
2005-01-12 20:38:40 +03:00
|
|
|
for (max = 0, cur = 0; args[max] != NULL; max++)
|
|
|
|
continue;
|
Initial import of sushi.
Sushi is an interactive, menu-based program that is designed to aid
the user or administrator with administrative and complex tasks on thier
machines.
Sushi provides a menu of various functions that the user can perform on
his or her machine. Once the user selects a desired function, the
function is either performed outright, or in most cases, the user is
asked to fill in a simple form with required and option information,
which is then processed by sushi, and the action occurs.
The programming interface for sushi is very simple. There are
directories containing various files, such as menu indexes, or forms for
the user to fill out. These files are interpreted by sushi to generate
the menus the user sees on his/her screen. When the form is filled out
by the user, the entries are passed as command-line arguments to a
program, or script contained in one of the subdirectories. In this way,
it is possible to add new entries to the sushi menu structure, by simply
adding a new menu item, form and script, the binary does not need to be
recompiled to take advantage of this new menu.
2001-01-05 04:28:33 +03:00
|
|
|
|
|
|
|
for (ftp = CIRCLEQ_FIRST(cqf); ftp != (void *)cqf;
|
|
|
|
ftp = CIRCLEQ_NEXT(ftp, cqFormEntries)) {
|
|
|
|
|
|
|
|
F[i].type = LABEL;
|
|
|
|
F[i].rows = 0;
|
|
|
|
F[i].cols = 0;
|
|
|
|
if (lrow >= ws.ws_row-6) {
|
|
|
|
F[i].newpage = 1;
|
|
|
|
lrow = 0;
|
|
|
|
} else
|
|
|
|
F[i].newpage = 0;
|
|
|
|
F[i].frow = lrow;
|
|
|
|
F[i].fcol = 0;
|
|
|
|
F[i].v = strdup(ftp->desc);
|
|
|
|
F[i].required = ftp->required;
|
2001-01-31 12:35:42 +03:00
|
|
|
F[i].list = (char **)NULL;
|
Initial import of sushi.
Sushi is an interactive, menu-based program that is designed to aid
the user or administrator with administrative and complex tasks on thier
machines.
Sushi provides a menu of various functions that the user can perform on
his or her machine. Once the user selects a desired function, the
function is either performed outright, or in most cases, the user is
asked to fill in a simple form with required and option information,
which is then processed by sushi, and the action occurs.
The programming interface for sushi is very simple. There are
directories containing various files, such as menu indexes, or forms for
the user to fill out. These files are interpreted by sushi to generate
the menus the user sees on his/her screen. When the form is filled out
by the user, the entries are passed as command-line arguments to a
program, or script contained in one of the subdirectories. In this way,
it is possible to add new entries to the sushi menu structure, by simply
adding a new menu item, form and script, the binary does not need to be
recompiled to take advantage of this new menu.
2001-01-05 04:28:33 +03:00
|
|
|
i++;
|
|
|
|
|
|
|
|
if (ftp->type != DATAT_BLANK) {
|
|
|
|
F[i].required = ftp->required;
|
2001-01-31 12:35:42 +03:00
|
|
|
F[i].list = (char **)NULL;
|
2005-01-12 20:38:40 +03:00
|
|
|
switch (ftp->type) {
|
Initial import of sushi.
Sushi is an interactive, menu-based program that is designed to aid
the user or administrator with administrative and complex tasks on thier
machines.
Sushi provides a menu of various functions that the user can perform on
his or her machine. Once the user selects a desired function, the
function is either performed outright, or in most cases, the user is
asked to fill in a simple form with required and option information,
which is then processed by sushi, and the action occurs.
The programming interface for sushi is very simple. There are
directories containing various files, such as menu indexes, or forms for
the user to fill out. These files are interpreted by sushi to generate
the menus the user sees on his/her screen. When the form is filled out
by the user, the entries are passed as command-line arguments to a
program, or script contained in one of the subdirectories. In this way,
it is possible to add new entries to the sushi menu structure, by simply
adding a new menu item, form and script, the binary does not need to be
recompiled to take advantage of this new menu.
2001-01-05 04:28:33 +03:00
|
|
|
case DATAT_ENTRY:
|
|
|
|
F[i].type = STRING;
|
|
|
|
p = strsep(&ftp->data, ",");
|
|
|
|
if (ftp->data == NULL)
|
|
|
|
ftp->data = strdup("");
|
|
|
|
ftp->elen = atoi(p);
|
|
|
|
cur = tstring(max, ftp->data);
|
|
|
|
if (cur)
|
|
|
|
F[i].v = strdup(args[cur-1]);
|
|
|
|
else
|
|
|
|
F[i].v = strdup(ftp->data);
|
|
|
|
break;
|
|
|
|
case DATAT_LIST:
|
|
|
|
F[i].type = ENUM;
|
|
|
|
F[i].v = strdup(ftp->data);
|
|
|
|
gen_list(ftp, max, args);
|
|
|
|
F[i].list = ftp->list;
|
|
|
|
break;
|
|
|
|
case DATAT_FUNC:
|
|
|
|
F[i].type = ENUM;
|
|
|
|
F[i].v = strdup(ftp->data);
|
2001-01-24 12:30:30 +03:00
|
|
|
gen_func(ftp, max, args);
|
Initial import of sushi.
Sushi is an interactive, menu-based program that is designed to aid
the user or administrator with administrative and complex tasks on thier
machines.
Sushi provides a menu of various functions that the user can perform on
his or her machine. Once the user selects a desired function, the
function is either performed outright, or in most cases, the user is
asked to fill in a simple form with required and option information,
which is then processed by sushi, and the action occurs.
The programming interface for sushi is very simple. There are
directories containing various files, such as menu indexes, or forms for
the user to fill out. These files are interpreted by sushi to generate
the menus the user sees on his/her screen. When the form is filled out
by the user, the entries are passed as command-line arguments to a
program, or script contained in one of the subdirectories. In this way,
it is possible to add new entries to the sushi menu structure, by simply
adding a new menu item, form and script, the binary does not need to be
recompiled to take advantage of this new menu.
2001-01-05 04:28:33 +03:00
|
|
|
F[i].list = ftp->list;
|
|
|
|
break;
|
|
|
|
case DATAT_SCRIPT:
|
|
|
|
F[i].type = ENUM;
|
|
|
|
F[i].v = strdup(ftp->data);
|
|
|
|
gen_script(ftp, basedir, max, args);
|
|
|
|
F[i].list = ftp->list;
|
|
|
|
break;
|
|
|
|
case DATAT_MLIST:
|
|
|
|
F[i].type = MULTI;
|
|
|
|
F[i].v = strdup(ftp->data);
|
|
|
|
gen_list(ftp, max, args);
|
|
|
|
F[i].list = ftp->list;
|
|
|
|
break;
|
|
|
|
case DATAT_MFUNC:
|
|
|
|
F[i].type = MULTI;
|
|
|
|
F[i].v = strdup(ftp->data);
|
2001-01-24 12:30:30 +03:00
|
|
|
gen_func(ftp, max, args);
|
Initial import of sushi.
Sushi is an interactive, menu-based program that is designed to aid
the user or administrator with administrative and complex tasks on thier
machines.
Sushi provides a menu of various functions that the user can perform on
his or her machine. Once the user selects a desired function, the
function is either performed outright, or in most cases, the user is
asked to fill in a simple form with required and option information,
which is then processed by sushi, and the action occurs.
The programming interface for sushi is very simple. There are
directories containing various files, such as menu indexes, or forms for
the user to fill out. These files are interpreted by sushi to generate
the menus the user sees on his/her screen. When the form is filled out
by the user, the entries are passed as command-line arguments to a
program, or script contained in one of the subdirectories. In this way,
it is possible to add new entries to the sushi menu structure, by simply
adding a new menu item, form and script, the binary does not need to be
recompiled to take advantage of this new menu.
2001-01-05 04:28:33 +03:00
|
|
|
F[i].list = ftp->list;
|
|
|
|
break;
|
|
|
|
case DATAT_MSCRIPT:
|
|
|
|
F[i].type = MULTI;
|
|
|
|
F[i].v = strdup(ftp->data);
|
|
|
|
gen_script(ftp, basedir, max, args);
|
|
|
|
F[i].list = ftp->list;
|
|
|
|
break;
|
|
|
|
case DATAT_NOEDIT:
|
|
|
|
F[i].type = NOEDIT;
|
|
|
|
cur = tstring(max, ftp->data);
|
|
|
|
if (cur)
|
|
|
|
F[i].v = strdup(args[cur-1]);
|
|
|
|
else
|
|
|
|
F[i].v = strdup(ftp->data);
|
2001-03-14 11:22:00 +03:00
|
|
|
ftp->elen = strlen(F[i].v);
|
Initial import of sushi.
Sushi is an interactive, menu-based program that is designed to aid
the user or administrator with administrative and complex tasks on thier
machines.
Sushi provides a menu of various functions that the user can perform on
his or her machine. Once the user selects a desired function, the
function is either performed outright, or in most cases, the user is
asked to fill in a simple form with required and option information,
which is then processed by sushi, and the action occurs.
The programming interface for sushi is very simple. There are
directories containing various files, such as menu indexes, or forms for
the user to fill out. These files are interpreted by sushi to generate
the menus the user sees on his/her screen. When the form is filled out
by the user, the entries are passed as command-line arguments to a
program, or script contained in one of the subdirectories. In this way,
it is possible to add new entries to the sushi menu structure, by simply
adding a new menu item, form and script, the binary does not need to be
recompiled to take advantage of this new menu.
2001-01-05 04:28:33 +03:00
|
|
|
break;
|
|
|
|
case DATAT_INVIS:
|
|
|
|
F[i].type = INVIS;
|
|
|
|
cur = tstring(max, ftp->data);
|
|
|
|
if (cur)
|
|
|
|
F[i].v = strdup(args[cur-1]);
|
|
|
|
else
|
|
|
|
F[i].v = strdup(ftp->data);
|
2001-03-14 11:22:00 +03:00
|
|
|
ftp->elen = strlen(F[i].v);
|
Initial import of sushi.
Sushi is an interactive, menu-based program that is designed to aid
the user or administrator with administrative and complex tasks on thier
machines.
Sushi provides a menu of various functions that the user can perform on
his or her machine. Once the user selects a desired function, the
function is either performed outright, or in most cases, the user is
asked to fill in a simple form with required and option information,
which is then processed by sushi, and the action occurs.
The programming interface for sushi is very simple. There are
directories containing various files, such as menu indexes, or forms for
the user to fill out. These files are interpreted by sushi to generate
the menus the user sees on his/her screen. When the form is filled out
by the user, the entries are passed as command-line arguments to a
program, or script contained in one of the subdirectories. In this way,
it is possible to add new entries to the sushi menu structure, by simply
adding a new menu item, form and script, the binary does not need to be
recompiled to take advantage of this new menu.
2001-01-05 04:28:33 +03:00
|
|
|
break;
|
|
|
|
case DATAT_INTEGER:
|
|
|
|
F[i].type = INTEGER;
|
2001-01-31 12:35:42 +03:00
|
|
|
F[i].v = gen_integer(ftp, max, args);
|
Initial import of sushi.
Sushi is an interactive, menu-based program that is designed to aid
the user or administrator with administrative and complex tasks on thier
machines.
Sushi provides a menu of various functions that the user can perform on
his or her machine. Once the user selects a desired function, the
function is either performed outright, or in most cases, the user is
asked to fill in a simple form with required and option information,
which is then processed by sushi, and the action occurs.
The programming interface for sushi is very simple. There are
directories containing various files, such as menu indexes, or forms for
the user to fill out. These files are interpreted by sushi to generate
the menus the user sees on his/her screen. When the form is filled out
by the user, the entries are passed as command-line arguments to a
program, or script contained in one of the subdirectories. In this way,
it is possible to add new entries to the sushi menu structure, by simply
adding a new menu item, form and script, the binary does not need to be
recompiled to take advantage of this new menu.
2001-01-05 04:28:33 +03:00
|
|
|
break;
|
2001-01-31 12:35:42 +03:00
|
|
|
case DATAT_ISCRIPT:
|
|
|
|
F[i].type = INTEGER;
|
|
|
|
F[i].v = gen_iscript(ftp, basedir, max, args);
|
|
|
|
break;
|
Initial import of sushi.
Sushi is an interactive, menu-based program that is designed to aid
the user or administrator with administrative and complex tasks on thier
machines.
Sushi provides a menu of various functions that the user can perform on
his or her machine. Once the user selects a desired function, the
function is either performed outright, or in most cases, the user is
asked to fill in a simple form with required and option information,
which is then processed by sushi, and the action occurs.
The programming interface for sushi is very simple. There are
directories containing various files, such as menu indexes, or forms for
the user to fill out. These files are interpreted by sushi to generate
the menus the user sees on his/her screen. When the form is filled out
by the user, the entries are passed as command-line arguments to a
program, or script contained in one of the subdirectories. In this way,
it is possible to add new entries to the sushi menu structure, by simply
adding a new menu item, form and script, the binary does not need to be
recompiled to take advantage of this new menu.
2001-01-05 04:28:33 +03:00
|
|
|
case DATAT_ESCRIPT:
|
|
|
|
F[i].type = STRING;
|
|
|
|
p = strsep(&ftp->data, ",");
|
|
|
|
ftp->elen = atoi(p);
|
|
|
|
F[i].v = gen_escript(ftp, basedir, max, args);
|
2001-03-07 13:10:20 +03:00
|
|
|
if (strlen(F[i].v) > ftp->elen)
|
|
|
|
ftp->elen = strlen(F[i].v);
|
Initial import of sushi.
Sushi is an interactive, menu-based program that is designed to aid
the user or administrator with administrative and complex tasks on thier
machines.
Sushi provides a menu of various functions that the user can perform on
his or her machine. Once the user selects a desired function, the
function is either performed outright, or in most cases, the user is
asked to fill in a simple form with required and option information,
which is then processed by sushi, and the action occurs.
The programming interface for sushi is very simple. There are
directories containing various files, such as menu indexes, or forms for
the user to fill out. These files are interpreted by sushi to generate
the menus the user sees on his/her screen. When the form is filled out
by the user, the entries are passed as command-line arguments to a
program, or script contained in one of the subdirectories. In this way,
it is possible to add new entries to the sushi menu structure, by simply
adding a new menu item, form and script, the binary does not need to be
recompiled to take advantage of this new menu.
2001-01-05 04:28:33 +03:00
|
|
|
break;
|
|
|
|
case DATAT_NESCRIPT:
|
|
|
|
F[i].type = NOEDIT;
|
|
|
|
F[i].v = gen_escript(ftp, basedir, max, args);
|
2001-03-07 13:10:20 +03:00
|
|
|
ftp->elen = strlen(F[i].v);
|
|
|
|
break;
|
|
|
|
case DATAT_V4SCRIPT:
|
|
|
|
F[i].type = IPV4;
|
|
|
|
F[i].v = gen_escript(ftp, basedir, max, args);
|
|
|
|
ftp->elen = 18;
|
|
|
|
break;
|
|
|
|
case DATAT_V4:
|
|
|
|
F[i].type = IPV4;
|
|
|
|
cur = tstring(max, ftp->data);
|
|
|
|
if (cur)
|
|
|
|
F[i].v = strdup(args[cur-1]);
|
|
|
|
else {
|
|
|
|
if (ftp->data == NULL)
|
|
|
|
ftp->data = strdup("");
|
|
|
|
F[i].v = strdup(ftp->data);
|
|
|
|
}
|
|
|
|
ftp->elen = 18;
|
|
|
|
break;
|
|
|
|
case DATAT_V6SCRIPT:
|
|
|
|
F[i].type = IPV6;
|
|
|
|
F[i].v = gen_escript(ftp, basedir, max, args);
|
|
|
|
ftp->elen = 48;
|
|
|
|
break;
|
|
|
|
case DATAT_V6:
|
|
|
|
F[i].type = IPV6;
|
|
|
|
cur = tstring(max, ftp->data);
|
|
|
|
if (cur)
|
|
|
|
F[i].v = strdup(args[cur-1]);
|
|
|
|
else {
|
|
|
|
if (ftp->data == NULL)
|
|
|
|
ftp->data = strdup("");
|
|
|
|
F[i].v = strdup(ftp->data);
|
|
|
|
}
|
|
|
|
ftp->elen = 48;
|
Initial import of sushi.
Sushi is an interactive, menu-based program that is designed to aid
the user or administrator with administrative and complex tasks on thier
machines.
Sushi provides a menu of various functions that the user can perform on
his or her machine. Once the user selects a desired function, the
function is either performed outright, or in most cases, the user is
asked to fill in a simple form with required and option information,
which is then processed by sushi, and the action occurs.
The programming interface for sushi is very simple. There are
directories containing various files, such as menu indexes, or forms for
the user to fill out. These files are interpreted by sushi to generate
the menus the user sees on his/her screen. When the form is filled out
by the user, the entries are passed as command-line arguments to a
program, or script contained in one of the subdirectories. In this way,
it is possible to add new entries to the sushi menu structure, by simply
adding a new menu item, form and script, the binary does not need to be
recompiled to take advantage of this new menu.
2001-01-05 04:28:33 +03:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
F[i].rows = 1;
|
|
|
|
F[i].rcols = F[i].cols = strlen_data(ftp);
|
2001-03-14 11:22:00 +03:00
|
|
|
if (F[i].cols > 19) {
|
Initial import of sushi.
Sushi is an interactive, menu-based program that is designed to aid
the user or administrator with administrative and complex tasks on thier
machines.
Sushi provides a menu of various functions that the user can perform on
his or her machine. Once the user selects a desired function, the
function is either performed outright, or in most cases, the user is
asked to fill in a simple form with required and option information,
which is then processed by sushi, and the action occurs.
The programming interface for sushi is very simple. There are
directories containing various files, such as menu indexes, or forms for
the user to fill out. These files are interpreted by sushi to generate
the menus the user sees on his/her screen. When the form is filled out
by the user, the entries are passed as command-line arguments to a
program, or script contained in one of the subdirectories. In this way,
it is possible to add new entries to the sushi menu structure, by simply
adding a new menu item, form and script, the binary does not need to be
recompiled to take advantage of this new menu.
2001-01-05 04:28:33 +03:00
|
|
|
F[i].bigfield = 1;
|
2001-03-14 11:22:00 +03:00
|
|
|
F[i].cols = 19;
|
Initial import of sushi.
Sushi is an interactive, menu-based program that is designed to aid
the user or administrator with administrative and complex tasks on thier
machines.
Sushi provides a menu of various functions that the user can perform on
his or her machine. Once the user selects a desired function, the
function is either performed outright, or in most cases, the user is
asked to fill in a simple form with required and option information,
which is then processed by sushi, and the action occurs.
The programming interface for sushi is very simple. There are
directories containing various files, such as menu indexes, or forms for
the user to fill out. These files are interpreted by sushi to generate
the menus the user sees on his/her screen. When the form is filled out
by the user, the entries are passed as command-line arguments to a
program, or script contained in one of the subdirectories. In this way,
it is possible to add new entries to the sushi menu structure, by simply
adding a new menu item, form and script, the binary does not need to be
recompiled to take advantage of this new menu.
2001-01-05 04:28:33 +03:00
|
|
|
} else
|
|
|
|
F[i].bigfield = 0;
|
|
|
|
F[i].newpage = 0;
|
|
|
|
F[i].fcol = 55;
|
|
|
|
F[i].frow = lrow;
|
|
|
|
i++;
|
|
|
|
}
|
|
|
|
lrow++;
|
|
|
|
}
|
|
|
|
/* generate the final entry */
|
|
|
|
F[i].type = (PF_field)NULL;
|
|
|
|
F[i].rows = 0;
|
|
|
|
F[i].cols = 0;
|
|
|
|
F[i].frow = 0;
|
|
|
|
F[i].fcol = 0;
|
|
|
|
F[i].v = (char *)NULL;
|
|
|
|
F[i].list = (char **)NULL;
|
|
|
|
F[i].newpage = 0;
|
|
|
|
}
|
|
|
|
|
2001-02-01 11:29:46 +03:00
|
|
|
static void
|
|
|
|
tab_help(FORM *form)
|
|
|
|
{
|
|
|
|
CDKLABEL *label;
|
|
|
|
char *msg[4];
|
|
|
|
char *buffer;
|
|
|
|
FIELD *curfield;
|
|
|
|
int lines;
|
|
|
|
|
|
|
|
curfield = current_field(form);
|
|
|
|
buffer = field_buffer(curfield, 1);
|
|
|
|
if (buffer == NULL)
|
|
|
|
return;
|
|
|
|
if (*buffer == 's') {
|
|
|
|
msg[0] = catgets(catalog, 3, 10, "The current field is a list "
|
|
|
|
"field, and selections can only be made from");
|
|
|
|
msg[1] = catgets(catalog, 3, 11, "the pre-defined list. "
|
|
|
|
"Please use TAB or the List(F4) command to edit.");
|
|
|
|
msg[2] = catgets(catalog, 3, 12, "Press the ENTER key to "
|
|
|
|
"return from the list popup.");
|
|
|
|
lines = 3;
|
|
|
|
} else if (*buffer == 'm') {
|
|
|
|
msg[0] = catgets(catalog, 3, 13, "The current field is a "
|
|
|
|
"multiple-selection list field. The field can only");
|
2005-01-12 02:07:12 +03:00
|
|
|
msg[1] = catgets(catalog, 3, 14, "be edited by issueing "
|
2001-02-01 11:29:46 +03:00
|
|
|
"the List(F4) command, and toggling desired options");
|
|
|
|
msg[2] = catgets(catalog, 3, 15, "with the spacebar. "
|
|
|
|
"Press the ENTER key to return from the list popup.");
|
|
|
|
lines = 3;
|
|
|
|
} else
|
|
|
|
return;
|
|
|
|
|
2004-03-24 22:10:58 +03:00
|
|
|
curs_set(0);
|
2001-02-01 11:29:46 +03:00
|
|
|
label = newCDKLabel(cdkscreen, CENTER, CENTER, msg, lines, TRUE, FALSE);
|
|
|
|
activateCDKLabel(label, NULL);
|
2003-10-21 06:55:43 +04:00
|
|
|
waitCDKLabel(label, 0);
|
2001-02-01 11:29:46 +03:00
|
|
|
destroyCDKLabel(label);
|
|
|
|
touchwin(stdscr);
|
|
|
|
wrefresh(stdscr);
|
2004-03-24 22:10:58 +03:00
|
|
|
curs_set(1);
|
2001-02-01 11:29:46 +03:00
|
|
|
}
|
|
|
|
|
2004-04-05 14:25:12 +04:00
|
|
|
static void
|
|
|
|
invalid_field_help(void)
|
|
|
|
{
|
|
|
|
CDKLABEL *label;
|
|
|
|
char *msg[2];
|
|
|
|
|
|
|
|
msg[0] = catgets(catalog, 3, 18, "The data entered in this field is "
|
|
|
|
"invalid.");
|
|
|
|
msg[1] = catgets(catalog, 3, 19, "Please enter the correct "
|
|
|
|
"information before continuing.");
|
|
|
|
|
|
|
|
curs_set(0);
|
|
|
|
label = newCDKLabel(cdkscreen, CENTER, CENTER, msg, 2, TRUE, FALSE);
|
|
|
|
activateCDKLabel(label, NULL);
|
|
|
|
waitCDKLabel(label, 0);
|
|
|
|
destroyCDKLabel(label);
|
|
|
|
touchwin(stdscr);
|
|
|
|
wrefresh(stdscr);
|
|
|
|
curs_set(1);
|
|
|
|
}
|
|
|
|
|
Initial import of sushi.
Sushi is an interactive, menu-based program that is designed to aid
the user or administrator with administrative and complex tasks on thier
machines.
Sushi provides a menu of various functions that the user can perform on
his or her machine. Once the user selects a desired function, the
function is either performed outright, or in most cases, the user is
asked to fill in a simple form with required and option information,
which is then processed by sushi, and the action occurs.
The programming interface for sushi is very simple. There are
directories containing various files, such as menu indexes, or forms for
the user to fill out. These files are interpreted by sushi to generate
the menus the user sees on his/her screen. When the form is filled out
by the user, the entries are passed as command-line arguments to a
program, or script contained in one of the subdirectories. In this way,
it is possible to add new entries to the sushi menu structure, by simply
adding a new menu item, form and script, the binary does not need to be
recompiled to take advantage of this new menu.
2001-01-05 04:28:33 +03:00
|
|
|
int
|
|
|
|
handle_form(char *basedir, char *path, char **args)
|
|
|
|
{
|
|
|
|
WINDOW *formwin, *boxwin;
|
|
|
|
CDKLABEL *label;
|
|
|
|
char *msg[1];
|
|
|
|
FORM *menuform;
|
|
|
|
FIELD **f;
|
|
|
|
int done = FALSE;
|
2002-07-25 13:38:31 +04:00
|
|
|
int c, i, j, fc;
|
2001-01-31 12:35:42 +03:00
|
|
|
FTREE_ENTRY *ftp;
|
Initial import of sushi.
Sushi is an interactive, menu-based program that is designed to aid
the user or administrator with administrative and complex tasks on thier
machines.
Sushi provides a menu of various functions that the user can perform on
his or her machine. Once the user selects a desired function, the
function is either performed outright, or in most cases, the user is
asked to fill in a simple form with required and option information,
which is then processed by sushi, and the action occurs.
The programming interface for sushi is very simple. There are
directories containing various files, such as menu indexes, or forms for
the user to fill out. These files are interpreted by sushi to generate
the menus the user sees on his/her screen. When the form is filled out
by the user, the entries are passed as command-line arguments to a
program, or script contained in one of the subdirectories. In this way,
it is possible to add new entries to the sushi menu structure, by simply
adding a new menu item, form and script, the binary does not need to be
recompiled to take advantage of this new menu.
2001-01-05 04:28:33 +03:00
|
|
|
|
|
|
|
CIRCLEQ_INIT(&cqFormHead);
|
|
|
|
cqFormHeadp = &cqFormHead;
|
2001-01-10 06:05:48 +03:00
|
|
|
if (scan_form(cqFormHeadp, path))
|
2005-01-12 20:38:40 +03:00
|
|
|
return (1);
|
Initial import of sushi.
Sushi is an interactive, menu-based program that is designed to aid
the user or administrator with administrative and complex tasks on thier
machines.
Sushi provides a menu of various functions that the user can perform on
his or her machine. Once the user selects a desired function, the
function is either performed outright, or in most cases, the user is
asked to fill in a simple form with required and option information,
which is then processed by sushi, and the action occurs.
The programming interface for sushi is very simple. There are
directories containing various files, such as menu indexes, or forms for
the user to fill out. These files are interpreted by sushi to generate
the menus the user sees on his/her screen. When the form is filled out
by the user, the entries are passed as command-line arguments to a
program, or script contained in one of the subdirectories. In this way,
it is possible to add new entries to the sushi menu structure, by simply
adding a new menu item, form and script, the binary does not need to be
recompiled to take advantage of this new menu.
2001-01-05 04:28:33 +03:00
|
|
|
|
2005-01-12 20:38:40 +03:00
|
|
|
F = calloc(sizeof(FIELD_RECORD), form_entries(&cqFormHead) * 2 + 1);
|
Initial import of sushi.
Sushi is an interactive, menu-based program that is designed to aid
the user or administrator with administrative and complex tasks on thier
machines.
Sushi provides a menu of various functions that the user can perform on
his or her machine. Once the user selects a desired function, the
function is either performed outright, or in most cases, the user is
asked to fill in a simple form with required and option information,
which is then processed by sushi, and the action occurs.
The programming interface for sushi is very simple. There are
directories containing various files, such as menu indexes, or forms for
the user to fill out. These files are interpreted by sushi to generate
the menus the user sees on his/her screen. When the form is filled out
by the user, the entries are passed as command-line arguments to a
program, or script contained in one of the subdirectories. In this way,
it is possible to add new entries to the sushi menu structure, by simply
adding a new menu item, form and script, the binary does not need to be
recompiled to take advantage of this new menu.
2001-01-05 04:28:33 +03:00
|
|
|
if (F == NULL)
|
2005-01-12 20:38:40 +03:00
|
|
|
bailout("calloc: %s", strerror(errno));
|
Initial import of sushi.
Sushi is an interactive, menu-based program that is designed to aid
the user or administrator with administrative and complex tasks on thier
machines.
Sushi provides a menu of various functions that the user can perform on
his or her machine. Once the user selects a desired function, the
function is either performed outright, or in most cases, the user is
asked to fill in a simple form with required and option information,
which is then processed by sushi, and the action occurs.
The programming interface for sushi is very simple. There are
directories containing various files, such as menu indexes, or forms for
the user to fill out. These files are interpreted by sushi to generate
the menus the user sees on his/her screen. When the form is filled out
by the user, the entries are passed as command-line arguments to a
program, or script contained in one of the subdirectories. In this way,
it is possible to add new entries to the sushi menu structure, by simply
adding a new menu item, form and script, the binary does not need to be
recompiled to take advantage of this new menu.
2001-01-05 04:28:33 +03:00
|
|
|
fflush(NULL);
|
|
|
|
|
2004-03-24 22:10:58 +03:00
|
|
|
curs_set(0);
|
Initial import of sushi.
Sushi is an interactive, menu-based program that is designed to aid
the user or administrator with administrative and complex tasks on thier
machines.
Sushi provides a menu of various functions that the user can perform on
his or her machine. Once the user selects a desired function, the
function is either performed outright, or in most cases, the user is
asked to fill in a simple form with required and option information,
which is then processed by sushi, and the action occurs.
The programming interface for sushi is very simple. There are
directories containing various files, such as menu indexes, or forms for
the user to fill out. These files are interpreted by sushi to generate
the menus the user sees on his/her screen. When the form is filled out
by the user, the entries are passed as command-line arguments to a
program, or script contained in one of the subdirectories. In this way,
it is possible to add new entries to the sushi menu structure, by simply
adding a new menu item, form and script, the binary does not need to be
recompiled to take advantage of this new menu.
2001-01-05 04:28:33 +03:00
|
|
|
/* generate a label to let the user know we are thinking */
|
|
|
|
msg[0] = catgets(catalog, 4, 2, "Generating form data, please wait");
|
|
|
|
label = newCDKLabel(cdkscreen, CENTER, CENTER, msg, 1, TRUE, FALSE);
|
|
|
|
activateCDKLabel(label, NULL);
|
|
|
|
|
|
|
|
if (args == NULL)
|
|
|
|
form_generate(&cqFormHead, basedir, (char **)NULL);
|
|
|
|
else
|
|
|
|
form_generate(&cqFormHead, basedir, args);
|
|
|
|
|
2005-01-12 20:38:40 +03:00
|
|
|
if ((menuform = new_form(make_fields())) == NULL)
|
Initial import of sushi.
Sushi is an interactive, menu-based program that is designed to aid
the user or administrator with administrative and complex tasks on thier
machines.
Sushi provides a menu of various functions that the user can perform on
his or her machine. Once the user selects a desired function, the
function is either performed outright, or in most cases, the user is
asked to fill in a simple form with required and option information,
which is then processed by sushi, and the action occurs.
The programming interface for sushi is very simple. There are
directories containing various files, such as menu indexes, or forms for
the user to fill out. These files are interpreted by sushi to generate
the menus the user sees on his/her screen. When the form is filled out
by the user, the entries are passed as command-line arguments to a
program, or script contained in one of the subdirectories. In this way,
it is possible to add new entries to the sushi menu structure, by simply
adding a new menu item, form and script, the binary does not need to be
recompiled to take advantage of this new menu.
2001-01-05 04:28:33 +03:00
|
|
|
bailout(catgets(catalog, 1, 15, "error return from new_form"));
|
|
|
|
|
|
|
|
set_form_userptr(menuform, "post");
|
|
|
|
|
|
|
|
destroyCDKLabel(label);
|
|
|
|
|
|
|
|
wclear(stdscr);
|
|
|
|
formwin = subwin(stdscr, ws.ws_row-5, ws.ws_col-2, 1, 1);
|
|
|
|
boxwin = subwin(stdscr, ws.ws_row-3, ws.ws_col, 0, 0);
|
|
|
|
bottom_help(2);
|
|
|
|
box(boxwin, 0, 0);
|
|
|
|
keypad(formwin, TRUE);
|
|
|
|
set_form_sub(menuform, formwin);
|
|
|
|
post_form(menuform);
|
|
|
|
wrefresh(stdscr);
|
2001-01-24 10:46:23 +03:00
|
|
|
wrefresh(boxwin);
|
Initial import of sushi.
Sushi is an interactive, menu-based program that is designed to aid
the user or administrator with administrative and complex tasks on thier
machines.
Sushi provides a menu of various functions that the user can perform on
his or her machine. Once the user selects a desired function, the
function is either performed outright, or in most cases, the user is
asked to fill in a simple form with required and option information,
which is then processed by sushi, and the action occurs.
The programming interface for sushi is very simple. There are
directories containing various files, such as menu indexes, or forms for
the user to fill out. These files are interpreted by sushi to generate
the menus the user sees on his/her screen. When the form is filled out
by the user, the entries are passed as command-line arguments to a
program, or script contained in one of the subdirectories. In this way,
it is possible to add new entries to the sushi menu structure, by simply
adding a new menu item, form and script, the binary does not need to be
recompiled to take advantage of this new menu.
2001-01-05 04:28:33 +03:00
|
|
|
form_status(menuform);
|
2004-03-24 22:10:58 +03:00
|
|
|
curs_set(1);
|
Initial import of sushi.
Sushi is an interactive, menu-based program that is designed to aid
the user or administrator with administrative and complex tasks on thier
machines.
Sushi provides a menu of various functions that the user can perform on
his or her machine. Once the user selects a desired function, the
function is either performed outright, or in most cases, the user is
asked to fill in a simple form with required and option information,
which is then processed by sushi, and the action occurs.
The programming interface for sushi is very simple. There are
directories containing various files, such as menu indexes, or forms for
the user to fill out. These files are interpreted by sushi to generate
the menus the user sees on his/her screen. When the form is filled out
by the user, the entries are passed as command-line arguments to a
program, or script contained in one of the subdirectories. In this way,
it is possible to add new entries to the sushi menu structure, by simply
adding a new menu item, form and script, the binary does not need to be
recompiled to take advantage of this new menu.
2001-01-05 04:28:33 +03:00
|
|
|
while (!done) {
|
2004-03-24 22:10:58 +03:00
|
|
|
pos_form_cursor(menuform);
|
|
|
|
wrefresh(formwin);
|
Initial import of sushi.
Sushi is an interactive, menu-based program that is designed to aid
the user or administrator with administrative and complex tasks on thier
machines.
Sushi provides a menu of various functions that the user can perform on
his or her machine. Once the user selects a desired function, the
function is either performed outright, or in most cases, the user is
asked to fill in a simple form with required and option information,
which is then processed by sushi, and the action occurs.
The programming interface for sushi is very simple. There are
directories containing various files, such as menu indexes, or forms for
the user to fill out. These files are interpreted by sushi to generate
the menus the user sees on his/her screen. When the form is filled out
by the user, the entries are passed as command-line arguments to a
program, or script contained in one of the subdirectories. In this way,
it is possible to add new entries to the sushi menu structure, by simply
adding a new menu item, form and script, the binary does not need to be
recompiled to take advantage of this new menu.
2001-01-05 04:28:33 +03:00
|
|
|
switch (form_driver(menuform, c = get_request(formwin))) {
|
|
|
|
case E_OK:
|
|
|
|
if (c == REQ_NEXT_PAGE || c == REQ_PREV_PAGE ||
|
2004-03-24 22:10:58 +03:00
|
|
|
c == REQ_FIRST_PAGE || c == REQ_LAST_PAGE ||
|
|
|
|
c == REQ_NEXT_FIELD || c == REQ_PREV_FIELD)
|
Initial import of sushi.
Sushi is an interactive, menu-based program that is designed to aid
the user or administrator with administrative and complex tasks on thier
machines.
Sushi provides a menu of various functions that the user can perform on
his or her machine. Once the user selects a desired function, the
function is either performed outright, or in most cases, the user is
asked to fill in a simple form with required and option information,
which is then processed by sushi, and the action occurs.
The programming interface for sushi is very simple. There are
directories containing various files, such as menu indexes, or forms for
the user to fill out. These files are interpreted by sushi to generate
the menus the user sees on his/her screen. When the form is filled out
by the user, the entries are passed as command-line arguments to a
program, or script contained in one of the subdirectories. In this way,
it is possible to add new entries to the sushi menu structure, by simply
adding a new menu item, form and script, the binary does not need to be
recompiled to take advantage of this new menu.
2001-01-05 04:28:33 +03:00
|
|
|
form_status(menuform);
|
|
|
|
break;
|
|
|
|
case E_UNKNOWN_COMMAND:
|
|
|
|
done = my_driver(menuform, c, basedir);
|
|
|
|
break;
|
2001-02-01 11:29:46 +03:00
|
|
|
case E_REQUEST_DENIED:
|
|
|
|
tab_help(menuform);
|
|
|
|
break;
|
2004-04-05 14:25:12 +04:00
|
|
|
case E_INVALID_FIELD:
|
|
|
|
invalid_field_help();
|
|
|
|
break;
|
Initial import of sushi.
Sushi is an interactive, menu-based program that is designed to aid
the user or administrator with administrative and complex tasks on thier
machines.
Sushi provides a menu of various functions that the user can perform on
his or her machine. Once the user selects a desired function, the
function is either performed outright, or in most cases, the user is
asked to fill in a simple form with required and option information,
which is then processed by sushi, and the action occurs.
The programming interface for sushi is very simple. There are
directories containing various files, such as menu indexes, or forms for
the user to fill out. These files are interpreted by sushi to generate
the menus the user sees on his/her screen. When the form is filled out
by the user, the entries are passed as command-line arguments to a
program, or script contained in one of the subdirectories. In this way,
it is possible to add new entries to the sushi menu structure, by simply
adding a new menu item, form and script, the binary does not need to be
recompiled to take advantage of this new menu.
2001-01-05 04:28:33 +03:00
|
|
|
}
|
|
|
|
}
|
2004-03-24 22:10:58 +03:00
|
|
|
curs_set(0);
|
2002-07-25 13:38:31 +04:00
|
|
|
fc = field_count(menuform);
|
Initial import of sushi.
Sushi is an interactive, menu-based program that is designed to aid
the user or administrator with administrative and complex tasks on thier
machines.
Sushi provides a menu of various functions that the user can perform on
his or her machine. Once the user selects a desired function, the
function is either performed outright, or in most cases, the user is
asked to fill in a simple form with required and option information,
which is then processed by sushi, and the action occurs.
The programming interface for sushi is very simple. There are
directories containing various files, such as menu indexes, or forms for
the user to fill out. These files are interpreted by sushi to generate
the menus the user sees on his/her screen. When the form is filled out
by the user, the entries are passed as command-line arguments to a
program, or script contained in one of the subdirectories. In this way,
it is possible to add new entries to the sushi menu structure, by simply
adding a new menu item, form and script, the binary does not need to be
recompiled to take advantage of this new menu.
2001-01-05 04:28:33 +03:00
|
|
|
f = form_fields(menuform);
|
|
|
|
unpost_form(menuform);
|
2005-01-12 20:38:40 +03:00
|
|
|
for (; fc > 0; fc--)
|
Initial import of sushi.
Sushi is an interactive, menu-based program that is designed to aid
the user or administrator with administrative and complex tasks on thier
machines.
Sushi provides a menu of various functions that the user can perform on
his or her machine. Once the user selects a desired function, the
function is either performed outright, or in most cases, the user is
asked to fill in a simple form with required and option information,
which is then processed by sushi, and the action occurs.
The programming interface for sushi is very simple. There are
directories containing various files, such as menu indexes, or forms for
the user to fill out. These files are interpreted by sushi to generate
the menus the user sees on his/her screen. When the form is filled out
by the user, the entries are passed as command-line arguments to a
program, or script contained in one of the subdirectories. In this way,
it is possible to add new entries to the sushi menu structure, by simply
adding a new menu item, form and script, the binary does not need to be
recompiled to take advantage of this new menu.
2001-01-05 04:28:33 +03:00
|
|
|
free_field(*f++);
|
2001-01-31 12:35:42 +03:00
|
|
|
free_form(menuform);
|
2005-01-12 20:38:40 +03:00
|
|
|
for (i = 0; F[i].type != NULL; i++) {
|
2001-01-31 12:35:42 +03:00
|
|
|
free(F[i].v);
|
|
|
|
if (F[i].list != NULL) {
|
2005-01-12 20:38:40 +03:00
|
|
|
for (j = 0; F[i].list[j] != NULL; j++)
|
2001-01-31 12:35:42 +03:00
|
|
|
free(F[i].list[j]);
|
|
|
|
free(F[i].list);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
free(F);
|
|
|
|
ftp = CIRCLEQ_FIRST(&cqFormHead);
|
|
|
|
for (; !CIRCLEQ_EMPTY(&cqFormHead); ftp = CIRCLEQ_FIRST(&cqFormHead)) {
|
|
|
|
CIRCLEQ_REMOVE(&cqFormHead, ftp, cqFormEntries);
|
|
|
|
free(ftp->desc);
|
|
|
|
free(ftp->origdata);
|
|
|
|
free(ftp);
|
|
|
|
}
|
Initial import of sushi.
Sushi is an interactive, menu-based program that is designed to aid
the user or administrator with administrative and complex tasks on thier
machines.
Sushi provides a menu of various functions that the user can perform on
his or her machine. Once the user selects a desired function, the
function is either performed outright, or in most cases, the user is
asked to fill in a simple form with required and option information,
which is then processed by sushi, and the action occurs.
The programming interface for sushi is very simple. There are
directories containing various files, such as menu indexes, or forms for
the user to fill out. These files are interpreted by sushi to generate
the menus the user sees on his/her screen. When the form is filled out
by the user, the entries are passed as command-line arguments to a
program, or script contained in one of the subdirectories. In this way,
it is possible to add new entries to the sushi menu structure, by simply
adding a new menu item, form and script, the binary does not need to be
recompiled to take advantage of this new menu.
2001-01-05 04:28:33 +03:00
|
|
|
delwin(formwin);
|
|
|
|
delwin(boxwin);
|
|
|
|
wclear(stdscr);
|
|
|
|
wrefresh(stdscr);
|
|
|
|
if (done == 2)
|
2005-01-12 20:38:40 +03:00
|
|
|
return (1);
|
Initial import of sushi.
Sushi is an interactive, menu-based program that is designed to aid
the user or administrator with administrative and complex tasks on thier
machines.
Sushi provides a menu of various functions that the user can perform on
his or her machine. Once the user selects a desired function, the
function is either performed outright, or in most cases, the user is
asked to fill in a simple form with required and option information,
which is then processed by sushi, and the action occurs.
The programming interface for sushi is very simple. There are
directories containing various files, such as menu indexes, or forms for
the user to fill out. These files are interpreted by sushi to generate
the menus the user sees on his/her screen. When the form is filled out
by the user, the entries are passed as command-line arguments to a
program, or script contained in one of the subdirectories. In this way,
it is possible to add new entries to the sushi menu structure, by simply
adding a new menu item, form and script, the binary does not need to be
recompiled to take advantage of this new menu.
2001-01-05 04:28:33 +03:00
|
|
|
|
2005-01-12 20:38:40 +03:00
|
|
|
return (0);
|
Initial import of sushi.
Sushi is an interactive, menu-based program that is designed to aid
the user or administrator with administrative and complex tasks on thier
machines.
Sushi provides a menu of various functions that the user can perform on
his or her machine. Once the user selects a desired function, the
function is either performed outright, or in most cases, the user is
asked to fill in a simple form with required and option information,
which is then processed by sushi, and the action occurs.
The programming interface for sushi is very simple. There are
directories containing various files, such as menu indexes, or forms for
the user to fill out. These files are interpreted by sushi to generate
the menus the user sees on his/her screen. When the form is filled out
by the user, the entries are passed as command-line arguments to a
program, or script contained in one of the subdirectories. In this way,
it is possible to add new entries to the sushi menu structure, by simply
adding a new menu item, form and script, the binary does not need to be
recompiled to take advantage of this new menu.
2001-01-05 04:28:33 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
int
|
|
|
|
handle_preform(char *basedir, char *path)
|
|
|
|
{
|
|
|
|
WINDOW *formwin, *boxwin;
|
|
|
|
CDKLABEL *label;
|
|
|
|
char *msg[1];
|
|
|
|
FORM *menuform;
|
|
|
|
FIELD **f;
|
|
|
|
int done = FALSE;
|
2002-07-25 13:38:31 +04:00
|
|
|
int c, i, j, fc;
|
Initial import of sushi.
Sushi is an interactive, menu-based program that is designed to aid
the user or administrator with administrative and complex tasks on thier
machines.
Sushi provides a menu of various functions that the user can perform on
his or her machine. Once the user selects a desired function, the
function is either performed outright, or in most cases, the user is
asked to fill in a simple form with required and option information,
which is then processed by sushi, and the action occurs.
The programming interface for sushi is very simple. There are
directories containing various files, such as menu indexes, or forms for
the user to fill out. These files are interpreted by sushi to generate
the menus the user sees on his/her screen. When the form is filled out
by the user, the entries are passed as command-line arguments to a
program, or script contained in one of the subdirectories. In this way,
it is possible to add new entries to the sushi menu structure, by simply
adding a new menu item, form and script, the binary does not need to be
recompiled to take advantage of this new menu.
2001-01-05 04:28:33 +03:00
|
|
|
char *args[2];
|
2001-01-31 12:35:42 +03:00
|
|
|
FTREE_ENTRY *ftp;
|
Initial import of sushi.
Sushi is an interactive, menu-based program that is designed to aid
the user or administrator with administrative and complex tasks on thier
machines.
Sushi provides a menu of various functions that the user can perform on
his or her machine. Once the user selects a desired function, the
function is either performed outright, or in most cases, the user is
asked to fill in a simple form with required and option information,
which is then processed by sushi, and the action occurs.
The programming interface for sushi is very simple. There are
directories containing various files, such as menu indexes, or forms for
the user to fill out. These files are interpreted by sushi to generate
the menus the user sees on his/her screen. When the form is filled out
by the user, the entries are passed as command-line arguments to a
program, or script contained in one of the subdirectories. In this way,
it is possible to add new entries to the sushi menu structure, by simply
adding a new menu item, form and script, the binary does not need to be
recompiled to take advantage of this new menu.
2001-01-05 04:28:33 +03:00
|
|
|
|
|
|
|
CIRCLEQ_INIT(&cqFormHead);
|
|
|
|
cqFormHeadp = &cqFormHead;
|
2001-01-10 06:05:48 +03:00
|
|
|
if (scan_form(cqFormHeadp, path))
|
2005-01-12 20:38:40 +03:00
|
|
|
return (1);
|
Initial import of sushi.
Sushi is an interactive, menu-based program that is designed to aid
the user or administrator with administrative and complex tasks on thier
machines.
Sushi provides a menu of various functions that the user can perform on
his or her machine. Once the user selects a desired function, the
function is either performed outright, or in most cases, the user is
asked to fill in a simple form with required and option information,
which is then processed by sushi, and the action occurs.
The programming interface for sushi is very simple. There are
directories containing various files, such as menu indexes, or forms for
the user to fill out. These files are interpreted by sushi to generate
the menus the user sees on his/her screen. When the form is filled out
by the user, the entries are passed as command-line arguments to a
program, or script contained in one of the subdirectories. In this way,
it is possible to add new entries to the sushi menu structure, by simply
adding a new menu item, form and script, the binary does not need to be
recompiled to take advantage of this new menu.
2001-01-05 04:28:33 +03:00
|
|
|
|
2005-01-12 20:38:40 +03:00
|
|
|
F = calloc(sizeof(FIELD_RECORD), form_entries(&cqFormHead) * 2 + 1);
|
Initial import of sushi.
Sushi is an interactive, menu-based program that is designed to aid
the user or administrator with administrative and complex tasks on thier
machines.
Sushi provides a menu of various functions that the user can perform on
his or her machine. Once the user selects a desired function, the
function is either performed outright, or in most cases, the user is
asked to fill in a simple form with required and option information,
which is then processed by sushi, and the action occurs.
The programming interface for sushi is very simple. There are
directories containing various files, such as menu indexes, or forms for
the user to fill out. These files are interpreted by sushi to generate
the menus the user sees on his/her screen. When the form is filled out
by the user, the entries are passed as command-line arguments to a
program, or script contained in one of the subdirectories. In this way,
it is possible to add new entries to the sushi menu structure, by simply
adding a new menu item, form and script, the binary does not need to be
recompiled to take advantage of this new menu.
2001-01-05 04:28:33 +03:00
|
|
|
if (F == NULL)
|
2005-01-12 20:38:40 +03:00
|
|
|
bailout("calloc: %s", strerror(errno));
|
Initial import of sushi.
Sushi is an interactive, menu-based program that is designed to aid
the user or administrator with administrative and complex tasks on thier
machines.
Sushi provides a menu of various functions that the user can perform on
his or her machine. Once the user selects a desired function, the
function is either performed outright, or in most cases, the user is
asked to fill in a simple form with required and option information,
which is then processed by sushi, and the action occurs.
The programming interface for sushi is very simple. There are
directories containing various files, such as menu indexes, or forms for
the user to fill out. These files are interpreted by sushi to generate
the menus the user sees on his/her screen. When the form is filled out
by the user, the entries are passed as command-line arguments to a
program, or script contained in one of the subdirectories. In this way,
it is possible to add new entries to the sushi menu structure, by simply
adding a new menu item, form and script, the binary does not need to be
recompiled to take advantage of this new menu.
2001-01-05 04:28:33 +03:00
|
|
|
fflush(NULL);
|
|
|
|
|
2004-03-24 22:10:58 +03:00
|
|
|
curs_set(0);
|
Initial import of sushi.
Sushi is an interactive, menu-based program that is designed to aid
the user or administrator with administrative and complex tasks on thier
machines.
Sushi provides a menu of various functions that the user can perform on
his or her machine. Once the user selects a desired function, the
function is either performed outright, or in most cases, the user is
asked to fill in a simple form with required and option information,
which is then processed by sushi, and the action occurs.
The programming interface for sushi is very simple. There are
directories containing various files, such as menu indexes, or forms for
the user to fill out. These files are interpreted by sushi to generate
the menus the user sees on his/her screen. When the form is filled out
by the user, the entries are passed as command-line arguments to a
program, or script contained in one of the subdirectories. In this way,
it is possible to add new entries to the sushi menu structure, by simply
adding a new menu item, form and script, the binary does not need to be
recompiled to take advantage of this new menu.
2001-01-05 04:28:33 +03:00
|
|
|
/* generate a label to let the user know we are thinking */
|
|
|
|
msg[0] = catgets(catalog, 4, 2, "Generating form data, please wait");
|
|
|
|
label = newCDKLabel(cdkscreen, CENTER, CENTER, msg, 1, TRUE, FALSE);
|
|
|
|
activateCDKLabel(label, NULL);
|
|
|
|
|
|
|
|
args[0] = NULL;
|
|
|
|
form_generate(&cqFormHead, basedir, args);
|
|
|
|
|
2005-01-12 20:38:40 +03:00
|
|
|
if ((menuform = new_form(make_fields())) == NULL)
|
Initial import of sushi.
Sushi is an interactive, menu-based program that is designed to aid
the user or administrator with administrative and complex tasks on thier
machines.
Sushi provides a menu of various functions that the user can perform on
his or her machine. Once the user selects a desired function, the
function is either performed outright, or in most cases, the user is
asked to fill in a simple form with required and option information,
which is then processed by sushi, and the action occurs.
The programming interface for sushi is very simple. There are
directories containing various files, such as menu indexes, or forms for
the user to fill out. These files are interpreted by sushi to generate
the menus the user sees on his/her screen. When the form is filled out
by the user, the entries are passed as command-line arguments to a
program, or script contained in one of the subdirectories. In this way,
it is possible to add new entries to the sushi menu structure, by simply
adding a new menu item, form and script, the binary does not need to be
recompiled to take advantage of this new menu.
2001-01-05 04:28:33 +03:00
|
|
|
bailout(catgets(catalog, 1, 15, "error return from new_form"));
|
|
|
|
|
|
|
|
set_form_userptr(menuform, "pre");
|
|
|
|
|
|
|
|
destroyCDKLabel(label);
|
|
|
|
|
|
|
|
wclear(stdscr);
|
|
|
|
formwin = subwin(stdscr, ws.ws_row-5, ws.ws_col-2, 1, 1);
|
|
|
|
boxwin = subwin(stdscr, ws.ws_row-3, ws.ws_col, 0, 0);
|
|
|
|
bottom_help(2);
|
|
|
|
box(boxwin, 0, 0);
|
|
|
|
keypad(formwin, TRUE);
|
|
|
|
set_form_sub(menuform, formwin);
|
|
|
|
post_form(menuform);
|
|
|
|
wrefresh(stdscr);
|
|
|
|
form_status(menuform);
|
2004-03-24 22:10:58 +03:00
|
|
|
curs_set(1);
|
Initial import of sushi.
Sushi is an interactive, menu-based program that is designed to aid
the user or administrator with administrative and complex tasks on thier
machines.
Sushi provides a menu of various functions that the user can perform on
his or her machine. Once the user selects a desired function, the
function is either performed outright, or in most cases, the user is
asked to fill in a simple form with required and option information,
which is then processed by sushi, and the action occurs.
The programming interface for sushi is very simple. There are
directories containing various files, such as menu indexes, or forms for
the user to fill out. These files are interpreted by sushi to generate
the menus the user sees on his/her screen. When the form is filled out
by the user, the entries are passed as command-line arguments to a
program, or script contained in one of the subdirectories. In this way,
it is possible to add new entries to the sushi menu structure, by simply
adding a new menu item, form and script, the binary does not need to be
recompiled to take advantage of this new menu.
2001-01-05 04:28:33 +03:00
|
|
|
while (!done) {
|
2004-03-24 22:10:58 +03:00
|
|
|
pos_form_cursor(menuform);
|
|
|
|
wrefresh(formwin);
|
Initial import of sushi.
Sushi is an interactive, menu-based program that is designed to aid
the user or administrator with administrative and complex tasks on thier
machines.
Sushi provides a menu of various functions that the user can perform on
his or her machine. Once the user selects a desired function, the
function is either performed outright, or in most cases, the user is
asked to fill in a simple form with required and option information,
which is then processed by sushi, and the action occurs.
The programming interface for sushi is very simple. There are
directories containing various files, such as menu indexes, or forms for
the user to fill out. These files are interpreted by sushi to generate
the menus the user sees on his/her screen. When the form is filled out
by the user, the entries are passed as command-line arguments to a
program, or script contained in one of the subdirectories. In this way,
it is possible to add new entries to the sushi menu structure, by simply
adding a new menu item, form and script, the binary does not need to be
recompiled to take advantage of this new menu.
2001-01-05 04:28:33 +03:00
|
|
|
switch (form_driver(menuform, c = get_request(formwin))) {
|
|
|
|
case E_OK:
|
|
|
|
if (c == REQ_NEXT_PAGE || c == REQ_PREV_PAGE ||
|
2004-03-24 22:10:58 +03:00
|
|
|
c == REQ_FIRST_PAGE || c == REQ_LAST_PAGE ||
|
|
|
|
c == REQ_NEXT_FIELD || c == REQ_PREV_FIELD)
|
Initial import of sushi.
Sushi is an interactive, menu-based program that is designed to aid
the user or administrator with administrative and complex tasks on thier
machines.
Sushi provides a menu of various functions that the user can perform on
his or her machine. Once the user selects a desired function, the
function is either performed outright, or in most cases, the user is
asked to fill in a simple form with required and option information,
which is then processed by sushi, and the action occurs.
The programming interface for sushi is very simple. There are
directories containing various files, such as menu indexes, or forms for
the user to fill out. These files are interpreted by sushi to generate
the menus the user sees on his/her screen. When the form is filled out
by the user, the entries are passed as command-line arguments to a
program, or script contained in one of the subdirectories. In this way,
it is possible to add new entries to the sushi menu structure, by simply
adding a new menu item, form and script, the binary does not need to be
recompiled to take advantage of this new menu.
2001-01-05 04:28:33 +03:00
|
|
|
form_status(menuform);
|
|
|
|
break;
|
|
|
|
case E_UNKNOWN_COMMAND:
|
|
|
|
done = my_driver(menuform, c, basedir);
|
|
|
|
break;
|
2001-02-01 11:29:46 +03:00
|
|
|
case E_REQUEST_DENIED:
|
|
|
|
tab_help(menuform);
|
|
|
|
break;
|
2004-04-05 14:25:12 +04:00
|
|
|
case E_INVALID_FIELD:
|
|
|
|
invalid_field_help();
|
|
|
|
break;
|
Initial import of sushi.
Sushi is an interactive, menu-based program that is designed to aid
the user or administrator with administrative and complex tasks on thier
machines.
Sushi provides a menu of various functions that the user can perform on
his or her machine. Once the user selects a desired function, the
function is either performed outright, or in most cases, the user is
asked to fill in a simple form with required and option information,
which is then processed by sushi, and the action occurs.
The programming interface for sushi is very simple. There are
directories containing various files, such as menu indexes, or forms for
the user to fill out. These files are interpreted by sushi to generate
the menus the user sees on his/her screen. When the form is filled out
by the user, the entries are passed as command-line arguments to a
program, or script contained in one of the subdirectories. In this way,
it is possible to add new entries to the sushi menu structure, by simply
adding a new menu item, form and script, the binary does not need to be
recompiled to take advantage of this new menu.
2001-01-05 04:28:33 +03:00
|
|
|
}
|
|
|
|
}
|
2004-03-24 22:10:58 +03:00
|
|
|
curs_set(0);
|
2002-07-25 13:38:31 +04:00
|
|
|
fc = field_count(menuform);
|
Initial import of sushi.
Sushi is an interactive, menu-based program that is designed to aid
the user or administrator with administrative and complex tasks on thier
machines.
Sushi provides a menu of various functions that the user can perform on
his or her machine. Once the user selects a desired function, the
function is either performed outright, or in most cases, the user is
asked to fill in a simple form with required and option information,
which is then processed by sushi, and the action occurs.
The programming interface for sushi is very simple. There are
directories containing various files, such as menu indexes, or forms for
the user to fill out. These files are interpreted by sushi to generate
the menus the user sees on his/her screen. When the form is filled out
by the user, the entries are passed as command-line arguments to a
program, or script contained in one of the subdirectories. In this way,
it is possible to add new entries to the sushi menu structure, by simply
adding a new menu item, form and script, the binary does not need to be
recompiled to take advantage of this new menu.
2001-01-05 04:28:33 +03:00
|
|
|
f = form_fields(menuform);
|
|
|
|
unpost_form(menuform);
|
2005-01-12 20:38:40 +03:00
|
|
|
for (; fc > 0; fc--)
|
Initial import of sushi.
Sushi is an interactive, menu-based program that is designed to aid
the user or administrator with administrative and complex tasks on thier
machines.
Sushi provides a menu of various functions that the user can perform on
his or her machine. Once the user selects a desired function, the
function is either performed outright, or in most cases, the user is
asked to fill in a simple form with required and option information,
which is then processed by sushi, and the action occurs.
The programming interface for sushi is very simple. There are
directories containing various files, such as menu indexes, or forms for
the user to fill out. These files are interpreted by sushi to generate
the menus the user sees on his/her screen. When the form is filled out
by the user, the entries are passed as command-line arguments to a
program, or script contained in one of the subdirectories. In this way,
it is possible to add new entries to the sushi menu structure, by simply
adding a new menu item, form and script, the binary does not need to be
recompiled to take advantage of this new menu.
2001-01-05 04:28:33 +03:00
|
|
|
free_field(*f++);
|
2001-01-31 12:35:42 +03:00
|
|
|
free_form(menuform);
|
|
|
|
if (done == 3) {
|
2005-01-12 20:38:40 +03:00
|
|
|
for (i = 0; F[i].type != NULL; i++) {
|
2001-01-31 12:35:42 +03:00
|
|
|
free(F[i].v);
|
|
|
|
if (F[i].list != NULL) {
|
2005-01-12 20:38:40 +03:00
|
|
|
for (j = 0; F[i].list[j] != NULL; j++)
|
2001-01-31 12:35:42 +03:00
|
|
|
free(F[i].list[j]);
|
|
|
|
free(F[i].list);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
free(F);
|
|
|
|
}
|
|
|
|
ftp = CIRCLEQ_FIRST(&cqFormHead);
|
|
|
|
for (; !CIRCLEQ_EMPTY(&cqFormHead); ftp = CIRCLEQ_FIRST(&cqFormHead)) {
|
|
|
|
CIRCLEQ_REMOVE(&cqFormHead, ftp, cqFormEntries);
|
|
|
|
free(ftp->desc);
|
|
|
|
free(ftp->origdata);
|
|
|
|
free(ftp);
|
|
|
|
}
|
Initial import of sushi.
Sushi is an interactive, menu-based program that is designed to aid
the user or administrator with administrative and complex tasks on thier
machines.
Sushi provides a menu of various functions that the user can perform on
his or her machine. Once the user selects a desired function, the
function is either performed outright, or in most cases, the user is
asked to fill in a simple form with required and option information,
which is then processed by sushi, and the action occurs.
The programming interface for sushi is very simple. There are
directories containing various files, such as menu indexes, or forms for
the user to fill out. These files are interpreted by sushi to generate
the menus the user sees on his/her screen. When the form is filled out
by the user, the entries are passed as command-line arguments to a
program, or script contained in one of the subdirectories. In this way,
it is possible to add new entries to the sushi menu structure, by simply
adding a new menu item, form and script, the binary does not need to be
recompiled to take advantage of this new menu.
2001-01-05 04:28:33 +03:00
|
|
|
delwin(formwin);
|
|
|
|
delwin(boxwin);
|
|
|
|
wclear(stdscr);
|
|
|
|
wrefresh(stdscr);
|
|
|
|
if (done == 2)
|
2005-01-12 20:38:40 +03:00
|
|
|
return (1);
|
Initial import of sushi.
Sushi is an interactive, menu-based program that is designed to aid
the user or administrator with administrative and complex tasks on thier
machines.
Sushi provides a menu of various functions that the user can perform on
his or her machine. Once the user selects a desired function, the
function is either performed outright, or in most cases, the user is
asked to fill in a simple form with required and option information,
which is then processed by sushi, and the action occurs.
The programming interface for sushi is very simple. There are
directories containing various files, such as menu indexes, or forms for
the user to fill out. These files are interpreted by sushi to generate
the menus the user sees on his/her screen. When the form is filled out
by the user, the entries are passed as command-line arguments to a
program, or script contained in one of the subdirectories. In this way,
it is possible to add new entries to the sushi menu structure, by simply
adding a new menu item, form and script, the binary does not need to be
recompiled to take advantage of this new menu.
2001-01-05 04:28:33 +03:00
|
|
|
|
2005-01-12 20:38:40 +03:00
|
|
|
return (0);
|
Initial import of sushi.
Sushi is an interactive, menu-based program that is designed to aid
the user or administrator with administrative and complex tasks on thier
machines.
Sushi provides a menu of various functions that the user can perform on
his or her machine. Once the user selects a desired function, the
function is either performed outright, or in most cases, the user is
asked to fill in a simple form with required and option information,
which is then processed by sushi, and the action occurs.
The programming interface for sushi is very simple. There are
directories containing various files, such as menu indexes, or forms for
the user to fill out. These files are interpreted by sushi to generate
the menus the user sees on his/her screen. When the form is filled out
by the user, the entries are passed as command-line arguments to a
program, or script contained in one of the subdirectories. In this way,
it is possible to add new entries to the sushi menu structure, by simply
adding a new menu item, form and script, the binary does not need to be
recompiled to take advantage of this new menu.
2001-01-05 04:28:33 +03:00
|
|
|
}
|