- return 0;
-}
-
-
-/*********************************************************************
- *
- * Function : actions_to_text
- *
- * Description : Converts a actionsfile entry from numeric form
- * ("mask" and "add") to text.
- *
- * Parameters :
- * 1 : mask = As from struct url_actions
- * 2 : add = As from struct url_actions
- *
- * Returns : A string. Caller must free it.
- *
- *********************************************************************/
-char * actions_to_text(struct action_spec *action)
-{
- unsigned mask = action->mask;
- unsigned add = action->add;
- char * result = strdup("");
- struct list_entry * lst;
-
- /* sanity - prevents "-feature +feature" */
- mask |= add;
-
-
-#define DEFINE_ACTION_BOOL(__name, __bit) \
- if (!(mask & __bit)) \
- { \
- result = strsav(result, " -" __name); \
- } \
- else if (add & __bit) \
- { \
- result = strsav(result, " +" __name); \
- }
-
-#define DEFINE_ACTION_STRING(__name, __bit, __index) \
- if (!(mask & __bit)) \
- { \
- result = strsav(result, " -" __name); \
- } \
- else if (add & __bit) \
- { \
- result = strsav(result, " +" __name "{"); \
- result = strsav(result, action->string[__index]); \
- result = strsav(result, "}"); \
- }
-
-#define DEFINE_ACTION_MULTI(__name, __index) \
- if (action->multi_remove_all[__index]) \
- { \
- result = strsav(result, " -" __name "{*}"); \
- } \
- else \
- { \
- lst = action->multi_remove[__index]->first; \
- while (lst) \
- { \
- result = strsav(result, " -" __name "{"); \
- result = strsav(result, lst->str); \
- result = strsav(result, "}"); \
- lst = lst->next; \
- } \
- } \
- lst = action->multi_add[__index]->first; \
- while (lst) \
- { \
- result = strsav(result, " +" __name "{"); \
- result = strsav(result, lst->str); \
- result = strsav(result, "}"); \
- lst = lst->next; \
- }
-
-#define DEFINE_ACTION_ALIAS 0 /* No aliases for output */
-
-#include "actionlist.h"
-
-#undef DEFINE_ACTION_MULTI
-#undef DEFINE_ACTION_STRING
-#undef DEFINE_ACTION_BOOL
-#undef DEFINE_ACTION_ALIAS
-
- return result;
-}
-
-
-#ifdef FEATURE_CGI_EDIT_ACTIONS
-/*********************************************************************
- *
- * Function : actions_to_html
- *
- * Description : Converts a actionsfile entry from numeric form
- * ("mask" and "add") to a <br>-seperated HTML string.
- *
- * Parameters :
- * 1 : mask = As from struct url_actions
- * 2 : add = As from struct url_actions
- *
- * Returns : A string. Caller must free it.
- *
- *********************************************************************/
-char * actions_to_html(struct action_spec *action)
-{
- unsigned mask = action->mask;
- unsigned add = action->add;
- char * result = strdup("");
- char * enc_str;
- struct list_entry * lst;
-
- /* sanity - prevents "-feature +feature" */
- mask |= add;
-
-
-#define DEFINE_ACTION_BOOL(__name, __bit) \
- if (!(mask & __bit)) \
- { \
- result = strsav(result, "\n<br>-" __name); \
- } \
- else if (add & __bit) \
- { \
- result = strsav(result, "\n<br>+" __name); \
- }
-
-#define DEFINE_ACTION_STRING(__name, __bit, __index) \
- if (!(mask & __bit)) \
- { \
- result = strsav(result, "\n<br>-" __name); \
- } \
- else if (add & __bit) \
- { \
- result = strsav(result, "\n<br>+" __name "{"); \
- enc_str = html_encode(action->string[__index]);\
- result = strsav(result, enc_str); \
- freez(enc_str); \
- result = strsav(result, "}"); \
- }
-
-#define DEFINE_ACTION_MULTI(__name, __index) \
- if (action->multi_remove_all[__index]) \
- { \
- result = strsav(result, "\n<br>-" __name "{*}"); \
- } \
- else \
- { \
- lst = action->multi_remove[__index]->first; \
- while (lst) \
- { \
- result = strsav(result, "\n<br>-" __name "{");\
- enc_str = html_encode(lst->str); \
- result = strsav(result, enc_str); \
- freez(enc_str); \
- result = strsav(result, "}"); \
- lst = lst->next; \
- } \
- } \
- lst = action->multi_add[__index]->first; \
- while (lst) \
- { \
- result = strsav(result, "\n<br>+" __name "{"); \
- result = strsav(result, lst->str); \
- result = strsav(result, "}"); \
- lst = lst->next; \
- }
-
-#define DEFINE_ACTION_ALIAS 0 /* No aliases for output */
-
-#include "actionlist.h"
-
-#undef DEFINE_ACTION_MULTI
-#undef DEFINE_ACTION_STRING
-#undef DEFINE_ACTION_BOOL
-#undef DEFINE_ACTION_ALIAS
-
- /* trim leading <br> */
- if (result && *result)
- {
- char * s = result;
- result = strdup(result + 5);
- free(s);
- }
-
- return result;
-}
-#endif /* def FEATURE_CGI_EDIT_ACTIONS */
-
-
-/*********************************************************************
- *
- * Function : current_actions_to_text
- *
- * Description : Converts a actionsfile entry to text.
- *
- * Parameters :
- * 1 : action = Action
- *
- * Returns : A string. Caller must free it.
- *
- *********************************************************************/
-char * current_action_to_text(struct current_action_spec *action)
-{
- unsigned flags = action->flags;
- char * result = strdup("");
- struct list_entry * lst;
-
-#define DEFINE_ACTION_BOOL(__name, __bit) \
- if (flags & __bit) \
- { \
- result = strsav(result, " +" __name); \
- } \
- else \
- { \
- result = strsav(result, " -" __name); \
- }
-
-#define DEFINE_ACTION_STRING(__name, __bit, __index) \
- if (flags & __bit) \
- { \
- result = strsav(result, " +" __name "{"); \
- result = strsav(result, action->string[__index]); \
- result = strsav(result, "}"); \
- } \
- else \
- { \
- result = strsav(result, " -" __name); \
- }
-
-#define DEFINE_ACTION_MULTI(__name, __index) \
- lst = action->multi[__index]->first; \
- if (lst == NULL) \
- { \
- result = strsav(result, " -" __name); \
- } \
- else \
- { \
- while (lst) \
- { \
- result = strsav(result, " +" __name "{"); \
- result = strsav(result, lst->str); \
- result = strsav(result, "}"); \
- lst = lst->next; \
- } \
- }
-
-#define DEFINE_ACTION_ALIAS 0 /* No aliases for output */
-
-#include "actionlist.h"
-
-#undef DEFINE_ACTION_MULTI
-#undef DEFINE_ACTION_STRING
-#undef DEFINE_ACTION_BOOL
-#undef DEFINE_ACTION_ALIAS
-
- return result;