res = event_dup(event);
use_original = FALSE;
}
- event_copy_categories_fields(res, p);
+ event_copy_categories(res, p);
+ event_copy_fields(res, p);
}
}
static struct event_field *
event_find_field_int(struct event *event, const char *key);
-void event_copy_categories_fields(struct event *to, struct event *from)
+void event_copy_categories(struct event *to, struct event *from)
{
unsigned int cat_count;
struct event_category *const *categories = event_get_categories(from, &cat_count);
while (cat_count-- > 0)
event_add_category(to, categories[cat_count]);
+}
+
+void event_copy_fields(struct event *to, struct event *from)
+{
const struct event_field *fld;
if (!array_is_created(&from->fields))
return;
/* Returns the source event duplicated into a new event. */
struct event *event_dup(const struct event *source);
-/* Copy all categories and fields from source to dest.
- Only the fields and categories in source event itself are copied.
- Parent events' fields and categories aren't copied. */
-void event_copy_categories_fields(struct event *dest, struct event *source);
+/* Copy all categories from source to dest.
+ Only the categories in source event itself are copied.
+ Parent events' categories aren't copied. */
+void event_copy_categories(struct event *to, struct event *from);
+/* Copy all fields from source to dest.
+ Only the fields in source event itself are copied.
+ Parent events' fields aren't copied. */
+void event_copy_fields(struct event *to, struct event *from);
/* Create a new empty event under the parent event, or NULL for root event. */
struct event *event_create(struct event *parent, const char *source_filename,