Made csp the first parameter in *action_to_html
authoroes <oes@users.sourceforge.net>
Tue, 30 Apr 2002 11:14:52 +0000 (11:14 +0000)
committeroes <oes@users.sourceforge.net>
Tue, 30 Apr 2002 11:14:52 +0000 (11:14 +0000)
actions.c
actions.h
cgiedit.c
cgisimple.c

index b8c3845..e5d320b 100644 (file)
--- a/actions.c
+++ b/actions.c
@@ -1,4 +1,4 @@
-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 $
@@ -33,6 +33,14 @@ const char actions_rcs[] = "$Id: actions.c,v 1.28 2002/04/26 12:53:15 oes Exp $"
  *
  * 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
@@ -1463,15 +1471,15 @@ char * actions_to_text(struct action_spec *action)
  *                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;
@@ -1570,14 +1578,15 @@ char * actions_to_html(struct action_spec *action,
  *                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("");
index f9888d9..f02f026 100644 (file)
--- a/actions.h
+++ b/actions.h
@@ -1,6 +1,6 @@
 #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!
  *
@@ -115,14 +120,16 @@ extern jb_err copy_action (struct action_spec *dest,
                            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);
index 18e1856..1547518 100644 (file)
--- a/cgiedit.c
+++ b/cgiedit.c
@@ -1,4 +1,4 @@
-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 $
@@ -42,6 +42,9 @@ const char cgiedit_rcs[] = "$Id: cgiedit.c,v 1.35 2002/04/26 21:50:02 jongfoster
  *
  * 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.
  *
@@ -2424,7 +2427,7 @@ jb_err cgi_edit_actions_list(struct client_state *csp,
       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;
@@ -2535,7 +2538,7 @@ jb_err cgi_edit_actions_list(struct client_state *csp,
       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)
index 9f855a7..3ddf01a 100644 (file)
@@ -1,4 +1,4 @@
-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 $
@@ -36,6 +36,10 @@ const char cgisimple_rcs[] = "$Id: cgisimple.c,v 1.31 2002/04/26 12:54:36 oes Ex
  *
  * 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
@@ -1031,7 +1035,7 @@ jb_err cgi_show_url_info(struct client_state *csp,
 
       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);
@@ -1112,7 +1116,7 @@ jb_err cgi_show_url_info(struct client_state *csp,
             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");
@@ -1152,7 +1156,7 @@ jb_err cgi_show_url_info(struct client_state *csp,
          return JB_ERR_MEMORY;
       }
 
-      s = current_action_to_html(action, csp);
+      s = current_action_to_html(csp, action);
 
       free_current_action(action);