### Function

# ECal util_diff_categories

since: 3.48

#### Declaration [src]

    void
    e_cal_util_diff_categories (
      ICalComponent* old_comp,
      ICalComponent* new_comp,
      GHashTable** out_added,
      GHashTable** out_removed
    )

#### Description [src]

Compares list of categories on the `old_comp` with the list of categories on the `new_comp` and fills `out_added` categories and `out_removed` categories accordingly, as if the `old_comp` is replaced with the `new_comp`. When either of the components is `NULL`, it’s considered as having no categories set. Rather than returning empty `GHashTable`, the return argument is set to `NULL` when there are no added/removed categories.

The key of the hash table is the category string, the value is an integer (1). There is used the hash table only for speed.

The returned `GHashTable`-s should be freed with g_hash_table_unref(), when no longer needed.

Available since: 3.48

#### Parameters

`old_comp`

  Type: `None`

  An old `ICalComponent`, or `NULL`.

  The argument can be `NULL`.
  The data is owned by the caller of the function.

`new_comp`

  Type: `None`

  A new `ICalComponent`, or `NULL`.

  The argument can be `NULL`.
  The data is owned by the caller of the function.

`out_added`

  Type: `GHashTable`

  A `GHashTable` with added categories.

  The argument will be set by the function.
  The caller of the function takes ownership of the returned data container, but not the data inside it.

`out_removed`

  Type: `GHashTable`

  A `GHashTable` with removed categories.

  The argument will be set by the function.
  The caller of the function takes ownership of the returned data container, but not the data inside it.