- muscle_entry_t pair = { key, 0 };
- muscle_entry_t *result = hash_find_item (&muscle_table, &pair);
- return result ? result->value : 0;
+ muscle_entry probe;
+ muscle_entry *result = NULL;
+
+ probe.key = key;
+ result = hash_lookup (muscle_table, &probe);
+ return result ? result->value : NULL;
+}
+
+
+/*------------------------------------------------.
+| Output the definition of ENTRY as a m4_define. |
+`------------------------------------------------*/
+
+static inline bool
+muscle_m4_output (muscle_entry *entry, FILE *out)
+{
+ fprintf (out, "m4_define([b4_%s],\n", entry->key);
+ fprintf (out, "[[%s]])\n\n\n", entry->value);
+ return true;
+}
+
+static bool
+muscle_m4_output_processor (void *entry, void *out)
+{
+ return muscle_m4_output (entry, out);
+}
+
+
+/*----------------------------------------------------------------.
+| Output the definition of all the current muscles into a list of |
+| m4_defines. |
+`----------------------------------------------------------------*/
+
+void
+muscles_m4_output (FILE *out)
+{
+ hash_do_for_each (muscle_table, muscle_m4_output_processor, out);