camel-search-utils: Camel Reference Manual

## camel-search-utils camel-search-utils |

## Functions

time_t | camel_search_util_add_months ()
gint64 | camel_search_util_str_to_time ()
time_t | camel_search_util_make_time ()
gint | camel_search_util_compare_date ()
guint64 | camel_search_util_hash_message_id ()

## Description

## Functions

### camel_search_util_add_months ()

    time_t
    camel_search_util_add_months (time_t t,
                                  gint months);

Increases time `t` by the given number of months (or decreases, if `months` is negative).

#### Parameters

t | Initial time |
months | number of months to add or subtract |

#### Returns

a new time_t value

Since: 3.58

### camel_search_util_str_to_time ()

    gint64
    camel_search_util_str_to_time (const gchar *str);

Converts a string representation to a time_t (as gint64). When `str` is `NULL`, returns -1.

#### Parameters

str | string to convert to time, or `NULL`. | [nullable]

#### Returns

a time_t representation of the `str` , -1 on error

Since: 3.58

### camel_search_util_make_time ()

    time_t
    camel_search_util_make_time (gint argc,
                                 CamelSExpResult **argv);

Implementation of 'make-time' function, which expects one argument, a string or an integer, to be converted into time_t.

#### Parameters

argc | number of arguments in `argv` |
argv | array or arguments |

#### Returns

time_t equivalent of the passed in argument, or (time_t) -1 on error.

Since: 3.58

### camel_search_util_compare_date ()

    gint
    camel_search_util_compare_date (gint64 datetime1,
                                    gint64 datetime2);

Compares date portion of the two date-time values, first converted into the local time zone. The returned value is like with `strcmp()`.

#### Parameters

datetime1 | a time_t-like value of the first date-time |
datetime2 | a time_t-like value of the second date-time |

#### Returns

0 when the dates are equal, < 0 when first is before second and > 0 when the first is after the second date

Since: 3.58

### camel_search_util_hash_message_id ()

    guint64
    camel_search_util_hash_message_id (const gchar *message_id,
                                       gboolean needs_decode);

Calculates a hash of the Message-ID header value `message_id` .

#### Parameters

message_id | a raw Message-ID header value |
needs_decode | whether the `message_id` requires `camel_header_msgid_decode()` first |

#### Returns

hash of the `message_id` , or 0 on any error.

Since: 3.58