-const char actions_rcs[] = "$Id: actions.c,v 1.28 2002/04/26 12:53:15 oes Exp $";
+const char actions_rcs[] = "$Id: actions.c,v 1.29 2002/04/26 19:30:54 jongfoster Exp $";
/*********************************************************************
*
* File : $Source: /cvsroot/ijbswa/current/actions.c,v $
*
* Revisions :
* $Log: actions.c,v $
+ * Revision 1.29 2002/04/26 19:30:54 jongfoster
+ * - current_action_to_html(): Adding help link for the "-" form of
+ * one-string actions.
+ * - Some actions had "<br>-", some "<br> -" (note the space).
+ * Standardizing on no space.
+ * - Greatly simplifying some of the code by using string_join()
+ * where appropriate.
+ *
* Revision 1.28 2002/04/26 12:53:15 oes
* - CGI AF editor now writes action lines split into
* single lines with line continuation
* the user manual.
*
* Parameters :
- * 1 : mask = As from struct url_actions
- * 2 : add = As from struct url_actions
+ * 1 : csp = Client state (for config)
+ * 2 : action = Action spec to be converted
*
* Returns : A string. Caller must free it.
* NULL on out-of-memory error.
*
*********************************************************************/
-char * actions_to_html(struct action_spec *action,
- struct client_state *csp)
+char * actions_to_html(struct client_state *csp,
+ struct action_spec *action)
{
unsigned mask = action->mask;
unsigned add = action->add;
* the user manual.
*
* Parameters :
- * 1 : action = Action
+ * 1 : csp = Client state (for config)
+ * 2 : action = Current action spec to be converted
*
* Returns : A string. Caller must free it.
* NULL on out-of-memory error.
*
*********************************************************************/
-char *current_action_to_html(struct current_action_spec *action,
- struct client_state *csp)
+char *current_action_to_html(struct client_state *csp,
+ struct current_action_spec *action)
{
unsigned long flags = action->flags;
char * result = strdup("");
#ifndef ACTIONS_H_INCLUDED
#define ACTIONS_H_INCLUDED
-#define ACTIONS_H_VERSION "$Id: actions.h,v 1.9 2002/03/26 22:29:54 swa Exp $"
+#define ACTIONS_H_VERSION "$Id: actions.h,v 1.10 2002/04/26 12:53:33 oes Exp $"
/*********************************************************************
*
* File : $Source: /cvsroot/ijbswa/current/actions.h,v $
*
* Revisions :
* $Log: actions.h,v $
+ * Revision 1.10 2002/04/26 12:53:33 oes
+ * - actions_to_html signature change
+ * - current_action_to_text: renamed to current_action_to_html
+ * and signature change
+ *
* Revision 1.9 2002/03/26 22:29:54 swa
* we have a new homepage!
*
const struct action_spec *src);
extern char * actions_to_text (struct action_spec *action);
#ifdef FEATURE_CGI_EDIT_ACTIONS
-extern char * actions_to_html (struct action_spec *action, struct client_state *csp);
+extern char * actions_to_html (struct client_state *csp,
+ struct action_spec *action);
#endif /* def FEATURE_CGI_EDIT_ACTIONS */
extern void init_current_action (struct current_action_spec *dest);
extern void free_current_action (struct current_action_spec *src);
extern jb_err merge_current_action (struct current_action_spec *dest,
const struct action_spec *src);
-extern char * current_action_to_html(struct current_action_spec *action, struct client_state *csp);
+extern char * current_action_to_html(struct client_state *csp,
+ struct current_action_spec *action);
extern jb_err get_action_token(char **line, char **name, char **value);
extern void unload_actions_file(void *file_data);
-const char cgiedit_rcs[] = "$Id: cgiedit.c,v 1.35 2002/04/26 21:50:02 jongfoster Exp $";
+const char cgiedit_rcs[] = "$Id: cgiedit.c,v 1.36 2002/04/26 21:53:30 jongfoster Exp $";
/*********************************************************************
*
* File : $Source: /cvsroot/ijbswa/current/cgiedit.c,v $
*
* Revisions :
* $Log: cgiedit.c,v $
+ * Revision 1.36 2002/04/26 21:53:30 jongfoster
+ * Fixing a memory leak. (Near, but not caused by, my earlier commit).
+ *
* Revision 1.35 2002/04/26 21:50:02 jongfoster
* Honouring default exports in edit-actions-for-url-filter template.
*
snprintf(buf, 150, "%d", line_number + 2);
if (!err) err = map(exports, "all-urls-s-next", 1, buf, 1);
if (!err) err = map(exports, "all-urls-actions", 1,
- actions_to_html(cur_line->data.action, csp), 0);
+ actions_to_html(csp, cur_line->data.action), 0);
/* Skip the 2 lines */
cur_line = cur_line->next->next;
snprintf(buf, 150, "%d", line_number);
err = map(section_exports, "s", 1, buf, 1);
if (!err) err = map(section_exports, "actions", 1,
- actions_to_html(cur_line->data.action, csp), 0);
+ actions_to_html(csp, cur_line->data.action), 0);
if ( (!err)
&& (cur_line->next != NULL)
-const char cgisimple_rcs[] = "$Id: cgisimple.c,v 1.31 2002/04/26 12:54:36 oes Exp $";
+const char cgisimple_rcs[] = "$Id: cgisimple.c,v 1.32 2002/04/26 18:29:13 jongfoster Exp $";
/*********************************************************************
*
* File : $Source: /cvsroot/ijbswa/current/cgisimple.c,v $
*
* Revisions :
* $Log: cgisimple.c,v $
+ * Revision 1.32 2002/04/26 18:29:13 jongfoster
+ * Fixing this Visual C++ warning:
+ * cgisimple.c(775) : warning C4018: '<' : signed/unsigned mismatch
+ *
* Revision 1.31 2002/04/26 12:54:36 oes
* - Kill obsolete REDIRECT_URL code
* - Error handling fixes
init_current_action(action);
- if (map(exports, "default", 1, current_action_to_html(action, csp), 0))
+ if (map(exports, "default", 1, current_action_to_html(csp, action), 0))
{
free_current_action(action);
free(url_param);
if (url_match(b->url, url_to_query))
{
string_append(&matches, "<tr><td>{");
- string_join (&matches, actions_to_html(b->action, csp));
+ string_join (&matches, actions_to_html(csp, b->action));
string_append(&matches, " }</b><br>\n<code>");
string_join (&matches, html_encode(b->url->spec));
string_append(&matches, "</code></td></tr>\n");
return JB_ERR_MEMORY;
}
- s = current_action_to_html(action, csp);
+ s = current_action_to_html(csp, action);
free_current_action(action);