PebbleOS
Loading...
Searching...
No Matches
Functions
App glance database

App glances (BlobDBIdAppGlance), keyed by app UUID. More...

Functions

status_t app_glance_db_insert_glance (const Uuid *uuid, const AppGlance *glance)
 Serialize and store the glance of an app.
 
status_t app_glance_db_read_glance (const Uuid *uuid, AppGlance *glance_out)
 Read and deserialize the glance of an app.
 
status_t app_glance_db_read_creation_time (const Uuid *uuid, time_t *time_out)
 Read the creation time of the glance of an app.
 
status_t app_glance_db_delete_glance (const Uuid *uuid)
 Delete the glance of an app.
 
void app_glance_db_init (void)
 Initialize the app glance database.
 
status_t app_glance_db_flush (void)
 Delete all records of the app glance database.
 
status_t app_glance_db_compact (void)
 Compact the settings file backing the app glance database.
 
status_t app_glance_db_insert (const uint8_t *key, int key_len, const uint8_t *val, int val_len)
 Insert or replace a record in the app glance database.
 
int app_glance_db_get_len (const uint8_t *key, int key_len)
 Get the length of a record in the app glance database.
 
status_t app_glance_db_read (const uint8_t *key, int key_len, uint8_t *val_out, int val_out_len)
 Read a record from the app glance database.
 
status_t app_glance_db_delete (const uint8_t *key, int key_len)
 Delete a record from the app glance database.
 

Detailed Description

App glances (BlobDBIdAppGlance), keyed by app UUID.

Function Documentation

◆ app_glance_db_compact()

status_t app_glance_db_compact ( void  )

Compact the settings file backing the app glance database.

Shrinks a grown file back toward its initial allocation.

Returns
S_SUCCESS on success, an error code otherwise.

◆ app_glance_db_delete()

status_t app_glance_db_delete ( const uint8_t *  key,
int  key_len 
)

Delete a record from the app glance database.

The key is the app UUID.

Parameters
keyKey data.
key_lenLength of key in bytes.
Returns
S_SUCCESS on success, an error code otherwise.

◆ app_glance_db_delete_glance()

status_t app_glance_db_delete_glance ( const Uuid *  uuid)

Delete the glance of an app.

Parameters
uuidApp UUID.
Returns
S_SUCCESS on success, an error code otherwise.

◆ app_glance_db_flush()

status_t app_glance_db_flush ( void  )

Delete all records of the app glance database.

Returns
S_SUCCESS on success, an error code otherwise.

◆ app_glance_db_get_len()

int app_glance_db_get_len ( const uint8_t *  key,
int  key_len 
)

Get the length of a record in the app glance database.

The key is the app UUID.

Parameters
keyKey data.
key_lenLength of key in bytes.
Returns
Length of the value in bytes, 0 if not found, or a negative error code.

◆ app_glance_db_init()

void app_glance_db_init ( void  )

Initialize the app glance database.

◆ app_glance_db_insert()

status_t app_glance_db_insert ( const uint8_t *  key,
int  key_len,
const uint8_t *  val,
int  val_len 
)

Insert or replace a record in the app glance database.

The key is the app UUID and the value a serialized glance (SerializedAppGlanceHeader). The glance must have the current version, be newer than the stored one, and belong to an installed or system app; excess slices are trimmed. Triggers a fetch of uncached apps.

Parameters
keyKey data.
key_lenLength of key in bytes.
valValue data.
val_lenLength of val in bytes.
Returns
S_SUCCESS on success, an error code otherwise.

◆ app_glance_db_insert_glance()

status_t app_glance_db_insert_glance ( const Uuid *  uuid,
const AppGlance *  glance 
)

Serialize and store the glance of an app.

Parameters
uuidApp UUID.
glanceGlance to store.
Returns
S_SUCCESS on success, an error code otherwise.

◆ app_glance_db_read()

status_t app_glance_db_read ( const uint8_t *  key,
int  key_len,
uint8_t *  val_out,
int  val_out_len 
)

Read a record from the app glance database.

The key is the app UUID. Records with an outdated version are deleted and reported as E_DOES_NOT_EXIST.

Parameters
keyKey data.
key_lenLength of key in bytes.
[out]val_outBuffer for the value.
val_out_lenSize of val_out in bytes.
Returns
S_SUCCESS on success, an error code otherwise.

◆ app_glance_db_read_creation_time()

status_t app_glance_db_read_creation_time ( const Uuid *  uuid,
time_t *  time_out 
)

Read the creation time of the glance of an app.

Parameters
uuidApp UUID.
[out]time_outCreation time.
Returns
S_SUCCESS on success, an error code otherwise.

◆ app_glance_db_read_glance()

status_t app_glance_db_read_glance ( const Uuid *  uuid,
AppGlance *  glance_out 
)

Read and deserialize the glance of an app.

Parameters
uuidApp UUID.
[out]glance_outGlance.
Return values
S_SUCCESSRead.
E_DOES_NOT_EXISTNo glance stored for the app.
Returns
Other error codes on failure.