if ((programs + n)->root) {
delelement ((programs + n)->root);
}
+ if ((programs + n)->string) {
+ free ((programs + n)->string);
+ }
}
}
}
void edit (int id)
-{ }
+{
+ int i, n = -1;
+
+ if (programs) {
+
+ /* look for program */
+ for (i = 0; i < nb_programs; i++) {
+ if ((programs + i)->id == id) {
+ n = i;
+ break;
+ }
+ }
+ }
+ if (n == -1) {
+ VERBOSE (WARNING, fprintf (stdout, "error unknown program (%d)\n", id));
+ return;
+ }
+
+ /* set string program */
+ //rl_insert_text ((programs + n)->string);
+ VERBOSE (INFO, fprintf (stdout, "edit: %s\n", (programs + n)->string));
+}
+
+void save_string (int id, char *string)
+{
+ int i, n = -1;
+
+ if (programs) {
+
+ /* look for program */
+ for (i = 0; i < nb_programs; i++) {
+ if ((programs + i)->id == id) {
+ n = i;
+ break;
+ }
+ }
+ }
+ if (n == -1) {
+ VERBOSE (WARNING, fprintf (stdout, "error unknown program (%d)\n", id));
+ return;
+ }
+
+ /* save program */
+ if ((programs + n)->string) {
+ free ((programs + n)->string);
+ }
+ (programs + n)->string = strdup (string);
+}
void del (int id)
{
if ((programs + n)->root) {
delelement ((programs + n)->root);
}
+ if ((programs + n)->string) {
+ free ((programs + n)->string);
+ }
/* remove entry */
workspace_t *tmp = (workspace_t *) callocordie (nb_programs - 1, sizeof (workspace_t));
double *storage;
int storage_size;
element_t *root;
+ char *string;
} workspace_t;
/* parser function */
double evaluate_element (element_t *root, char mask);
+void save_string (int id, char *string);
+
/* completion functions */
char **generate_completion_list ();