Berkeley DB caching API: Evolution-Data-Server Reference Manual

## Berkeley DB caching API Berkeley DB caching API — A Berkeley DB cache facility for addressbooks |

## Functions

EContact * | e_book_backend_db_cache_get_contact ()
gchar * | e_book_backend_db_cache_get_filename ()
void | e_book_backend_db_cache_set_filename ()
gboolean | e_book_backend_db_cache_add_contact ()
gboolean | e_book_backend_db_cache_remove_contact ()
gboolean | e_book_backend_db_cache_check_contact ()
GList * | e_book_backend_db_cache_get_contacts ()
gboolean | e_book_backend_db_cache_exists ()
void | e_book_backend_db_cache_set_populated ()
gboolean | e_book_backend_db_cache_is_populated ()
GPtrArray * | e_book_backend_db_cache_search ()
void | e_book_backend_db_cache_set_time ()
gchar * | e_book_backend_db_cache_get_time ()

## Includes

    #include <libedata-book/libedata-book.h>

## Description

This API is deprecated, use EBookSqlite instead.

## Functions

### e_book_backend_db_cache_get_contact ()

    EContact *
    e_book_backend_db_cache_get_contact (struct __db *db,
                                         const gchar *uid);

`e_book_backend_db_cache_get_contact` has been deprecated since version 3.12 and should not be used in newly-written code.

Use EBookSqlite instead

Get a cached contact. Note that the returned EContact will be newly created, and must be unreffed by the caller when no longer needed.

#### Parameters

db | DB Handle |
uid | a unique contact ID |

#### Returns

A cached EContact, or `NULL` if `uid` is not cached.

### e_book_backend_db_cache_get_filename ()

    gchar *
    e_book_backend_db_cache_get_filename (struct __db *db);

`e_book_backend_db_cache_get_filename` has been deprecated since version 3.12 and should not be used in newly-written code.

Use EBookSqlite instead

Get the filename for db cache file.

#### Parameters

db | DB Handle |

#### Returns

The filename for db cache file. Free with `g_free()` when done with it.

### e_book_backend_db_cache_set_filename ()

    void
    e_book_backend_db_cache_set_filename (struct __db *db,
                                          const gchar *filename);

`e_book_backend_db_cache_set_filename` has been deprecated since version 3.12 and should not be used in newly-written code.

Use EBookSqlite instead

Set the filename for db cacahe file.

#### Parameters

db | DB Handle |
filename | filename to be set |

### e_book_backend_db_cache_add_contact ()

    gboolean
    e_book_backend_db_cache_add_contact (struct __db *db,
                                         EContact *contact);

`e_book_backend_db_cache_add_contact` has been deprecated since version 3.12 and should not be used in newly-written code.

Use EBookSqlite instead

Adds `contact` to `cache` .

#### Parameters

db | DB Handle |
contact | an EContact |

#### Returns

`TRUE` if the contact was cached successfully, `FALSE` otherwise.

### e_book_backend_db_cache_remove_contact ()

    gboolean
    e_book_backend_db_cache_remove_contact
                                   (struct __db *db,
                                    const gchar *uid);

`e_book_backend_db_cache_remove_contact` has been deprecated since version 3.12 and should not be used in newly-written code.

Use EBookSqlite instead

Removes the contact identified by `uid` from `cache` .

#### Parameters

db | DB Handle |
uid | a unique contact ID |

#### Returns

`TRUE` if the contact was found and removed, `FALSE` otherwise.

### e_book_backend_db_cache_check_contact ()

    gboolean
    e_book_backend_db_cache_check_contact (struct __db *db,
                                           const gchar *uid);

`e_book_backend_db_cache_check_contact` has been deprecated since version 3.12 and should not be used in newly-written code.

Use EBookSqlite instead

Checks if the contact identified by `uid` exists in `cache` .

#### Parameters

db | DB Handle |
uid | a unique contact ID |

#### Returns

`TRUE` if the cache contains the contact, `FALSE` otherwise.

### e_book_backend_db_cache_get_contacts ()

    GList *
    e_book_backend_db_cache_get_contacts (struct __db *db,
                                          const gchar *query);

`e_book_backend_db_cache_get_contacts` has been deprecated since version 3.12 and should not be used in newly-written code.

Use EBookSqlite instead

Returns a list of EContact elements from `cache` matching `query` . When done with the list, the caller must unref the contacts and free the list.

#### Parameters

db | DB Handle |
query | an s-expression |

#### Returns

A GList of pointers to EContact.

### e_book_backend_db_cache_exists ()

    gboolean
    e_book_backend_db_cache_exists (const gchar *uri);

`e_book_backend_db_cache_exists` has been deprecated since version 3.12 and should not be used in newly-written code.

Use EBookSqlite instead

Checks if an EBookBackendCache exists at `uri` .

#### Parameters

uri | URI for the cache |

#### Returns

`TRUE` if cache exists, `FALSE` if not.

### e_book_backend_db_cache_set_populated ()

    void
    e_book_backend_db_cache_set_populated (struct __db *db);

`e_book_backend_db_cache_set_populated` has been deprecated since version 3.12 and should not be used in newly-written code.

Use EBookSqlite instead

Flags `cache` as being populated - that is, it is up-to-date on the contents of the book it's caching.

#### Parameters

db | DB handle |

### e_book_backend_db_cache_is_populated ()

    gboolean
    e_book_backend_db_cache_is_populated (struct __db *db);

`e_book_backend_db_cache_is_populated` has been deprecated since version 3.12 and should not be used in newly-written code.

Use EBookSqlite instead

Checks if `cache` is populated.

#### Parameters

db | DB Handle |

#### Returns

`TRUE` if `cache` is populated, `FALSE` otherwise.

### e_book_backend_db_cache_search ()

    GPtrArray *
    e_book_backend_db_cache_search (struct __db *db,
                                    const gchar *query);

`e_book_backend_db_cache_search` has been deprecated since version 3.12 and should not be used in newly-written code.

Use EBookSqlite instead

Returns an array of pointers to unique contact ID strings for contacts in `cache` matching `query` . When done with the array, the caller must free the ID strings and the array.

#### Parameters

db | DB handle |
query | an s-expression |

#### Returns

A GPtrArray of pointers to contact ID strings.

### e_book_backend_db_cache_set_time ()

    void
    e_book_backend_db_cache_set_time (struct __db *db,
                                      const gchar *t);

`e_book_backend_db_cache_set_time` has been deprecated since version 3.12 and should not be used in newly-written code.

Use EBookSqlite instead

#### Parameters

db | A Berkeley DB handle |
t | The time in string format |

Since: 2.26

### e_book_backend_db_cache_get_time ()

    gchar *
    e_book_backend_db_cache_get_time (struct __db *db);

`e_book_backend_db_cache_get_time` has been deprecated since version 3.12 and should not be used in newly-written code.

Use EBookSqlite instead

#### Parameters

db | A Berkeley DB handle |

Since: 2.26

## Types and Values