PebbleOS
Loading...
Searching...
No Matches
Functions
pin_db.h File Reference
#include "api.h"
#include "timeline_item_storage.h"
#include <system/status_codes.h>
#include <pbl/services/timeline/item.h>
#include <pbl/util/iterator.h>
#include <stdint.h>

Functions

status_t pin_db_get (const TimelineItemId *id, TimelineItem *pin)
 Read and deserialize a pin.
 
status_t pin_db_insert_item (TimelineItem *item)
 Serialize and insert a pin, emitting a BlobDB insert event.
 
status_t pin_db_insert_item_without_event (TimelineItem *item)
 pin_db_insert_item() without the BlobDB event.
 
status_t pin_db_set_status_bits (const TimelineItemId *id, uint8_t status)
 Overwrite the status bits of a pin.
 
status_t pin_db_each (TimelineItemStorageEachCallback each, void *data)
 Call a function for every record in the pin database.
 
status_t pin_db_delete_with_parent (const TimelineItemId *parent_id)
 Delete the pins of a parent (app or data source).
 
bool pin_db_exists_with_parent (const TimelineItemId *parent_id)
 Check whether a parent has pins.
 
status_t pin_db_read_item_header (TimelineItem *item_out, TimelineItemId *id)
 Read the header of a pin.
 
status_t pin_db_next_item_header (TimelineItem *next_item_out, TimelineItemStorageFilterCallback filter)
 Read the header of the earliest pin within the maximum age.
 
bool pin_db_has_entry_expired (time_t pin_end_timestamp)
 Check whether a pin is older than the pin database keeps.
 
void pin_db_init (void)
 Initialize the pin database.
 
void pin_db_deinit (void)
 Close the settings file backing the pin database.
 
status_t pin_db_insert (const uint8_t *key, int key_len, const uint8_t *val, int val_len)
 Insert or replace a record in the pin database.
 
int pin_db_get_len (const uint8_t *key, int key_len)
 Get the length of a record in the pin database.
 
status_t pin_db_read (const uint8_t *key, int key_len, uint8_t *val_out, int val_out_len)
 Read a record from the pin database.
 
status_t pin_db_delete (const uint8_t *key, int key_len)
 Delete a record from the pin database.
 
status_t pin_db_flush (void)
 Delete all records of the pin database.
 
status_t pin_db_compact (void)
 Compact the settings file backing the pin database.
 
status_t pin_db_is_dirty (bool *is_dirty_out)
 Check whether the pin database holds records not yet synced to the phone.
 
BlobDBDirtyItem * pin_db_get_dirty_list (void)
 Build the list of records of the pin database not yet synced to the phone.
 
status_t pin_db_mark_synced (const uint8_t *key, int key_len)
 Mark a record of the pin database as synced.