-const char cgiedit_rcs[] = "$Id: cgiedit.c,v 1.9 2002/01/17 20:56:22 jongfoster Exp $";
+const char cgiedit_rcs[] = "$Id: cgiedit.c,v 1.13 2002/03/04 02:07:59 david__schmidt Exp $";
/*********************************************************************
*
* File : $Source: /cvsroot/ijbswa/current/cgiedit.c,v $
*
* Revisions :
* $Log: cgiedit.c,v $
+ * Revision 1.13 2002/03/04 02:07:59 david__schmidt
+ * Enable web editing of actions file on OS/2 (it had been broken all this time!)
+ *
+ * Revision 1.12 2002/03/03 09:18:03 joergs
+ * Made jumbjuster work on AmigaOS again.
+ *
+ * Revision 1.11 2002/01/23 01:03:31 jongfoster
+ * Fixing gcc [CygWin] compiler warnings
+ *
+ * Revision 1.10 2002/01/23 00:22:59 jongfoster
+ * Adding new function cgi_edit_actions_section_swap(), to reorder
+ * the actions file.
+ *
+ * Adding get_url_spec_param() to get a validated URL pattern.
+ *
+ * Moving edit_read_line() out of this file and into loaders.c.
+ *
+ * Adding missing html_encode() to many CGI functions.
+ *
+ * Moving the functions that #include actionlist.h to the end of the file,
+ * because the Visual C++ 97 debugger gets extremely confused if you try
+ * to debug any code that comes after them in the file.
+ *
+ * Major optimizations in cgi_edit_actions_list() to reduce the size of
+ * the generated HTML (down 40% from 550k to 304k), with major side-effects
+ * throughout the editor and templates. In particular, the length of the
+ * URLs throughout the editor has been drastically reduced, by cutting
+ * paramater names down to 1 character and CGI names down to 3-4
+ * characters, by removing all non-essential CGI paramaters even at the
+ * expense of having to re-read the actions file for the most trivial
+ * page, and by using relative rather than absolute URLs. This means
+ * that this (typical example):
+ *
+ * <a href="http://ijbswa.sourceforge.net/config/edit-actions-url-form?
+ * filename=ijb&ver=1011487572&section=12&pattern=13
+ * &oldval=www.oesterhelt.org%2Fdeanimate-demo">
+ *
+ * is now this:
+ *
+ * <a href="eau?f=ijb&v=1011487572&p=13">
+ *
* Revision 1.9 2002/01/17 20:56:22 jongfoster
* Replacing hard references to the URL of the config interface
* with #defines from project.h
static jb_err map_copy_parameter_html(struct map *out,
const struct map *in,
const char *name);
+#if 0 /* unused function */
static jb_err map_copy_parameter_url(struct map *out,
const struct map *in,
const char *name);
-
+#endif /* unused function */
/*********************************************************************
*
}
+#if 0 /* unused function */
/*********************************************************************
*
* Function : map_copy_parameter_html
return JB_ERR_OK;
}
}
-
+#endif /* 0 - unused function */
/*********************************************************************
*
assert(file);
assert(file->filename);
+#if defined(AMIGA) || defined(__OS2__)
+ if (NULL == (fp = fopen(file->filename, "w")))
+#else
if (NULL == (fp = fopen(file->filename, "wt")))
+#endif /* def AMIGA */
{
return JB_ERR_FILE;
}
}
}
+#if defined(AMIGA) || defined(__OS2__)
+ if (NULL == (fp = fopen(filename,"r")))
+#else
if (NULL == (fp = fopen(filename,"rt")))
+#endif /* def AMIGA */
{
free(filename);
return JB_ERR_FILE;
{
const char *param;
const char *s;
+#if 0 /* Patch to make 3.0.0 work properly. */
char *name;
+#endif /* 0 - Patch to make 3.0.0 work properly. */
char *fullpath;
char ch;
int len;
}
}
+ /*
+ * FIXME Following is a hack to make 3.0.0 work properly.
+ * Change "#if 0" --> "#if 1" below when we have modular action
+ * files.
+ * -- Jon
+ */
+#if 0 /* Patch to make 3.0.0 work properly. */
/* Append extension */
name = malloc(len + strlen(suffix) + 1);
if (name == NULL)
/* Prepend path */
fullpath = make_path(csp->config->confdir, name);
free(name);
+#else /* 1 - Patch to make 3.0.0 work properly. */
+ if ((csp->actions_list == NULL)
+ || (csp->actions_list->filename == NULL))
+ {
+ return JB_ERR_CGI_PARAMS;
+ }
+
+ fullpath = ( (csp->actions_list && csp->actions_list->filename)
+ ? strdup(csp->actions_list->filename) : NULL);
+#endif /* 1 - Patch to make 3.0.0 work properly. */
if (fullpath == NULL)
{
return JB_ERR_MEMORY;