Ansel 0.0
A darktable fork - bloat + design vision
Loading...
Searching...
No Matches
backend_libsecret.c File Reference
#include "backend_libsecret.h"
#include "control/conf.h"
#include <glib.h>
#include <json-glib/json-glib.h>
#include <libsecret/secret.h>
+ Include dependency graph for backend_libsecret.c:

Macros

#define SECRET_COLLECTION_DARKTABLE   SECRET_COLLECTION_DEFAULT
 
#define EMPTY_STRING(string)   !*(string)
 
#define SECRET_SCHEMA_DARKTABLE   secret_darktable_get_schema()
 

Functions

static const SecretSchema * secret_darktable_get_schema (void)
 
const backend_libsecret_context_tdt_pwstorage_libsecret_new ()
 
void dt_pwstorage_libsecret_destroy (const backend_libsecret_context_t *context)
 
gboolean dt_pwstorage_libsecret_set (const backend_libsecret_context_t *context, const gchar *slot, GHashTable *attributes)
 
GHashTable * dt_pwstorage_libsecret_get (const backend_libsecret_context_t *context, const gchar *slot)
 
static void append_pair_to_json (gpointer key, gpointer value, gpointer data)
 
static gchar * attributes_to_secret (GHashTable *attributes)
 
static GHashTable * secret_to_attributes (gchar *secret)
 

Macro Definition Documentation

◆ EMPTY_STRING

#define EMPTY_STRING (   string)    !*(string)

◆ SECRET_COLLECTION_DARKTABLE

#define SECRET_COLLECTION_DARKTABLE   SECRET_COLLECTION_DEFAULT

◆ SECRET_SCHEMA_DARKTABLE

#define SECRET_SCHEMA_DARKTABLE   secret_darktable_get_schema()

Function Documentation

◆ append_pair_to_json()

static void append_pair_to_json ( gpointer  key,
gpointer  value,
gpointer  data 
)
static

References key.

Referenced by attributes_to_secret().

◆ attributes_to_secret()

static gchar * attributes_to_secret ( GHashTable *  attributes)
static

◆ dt_pwstorage_libsecret_destroy()

void dt_pwstorage_libsecret_destroy ( const backend_libsecret_context_t context)

Destroys the libsecret backend context.

Parameters
contextThe libsecret context

Referenced by dt_pwstorage_destroy(), and dt_pwstorage_libsecret_new().

◆ dt_pwstorage_libsecret_get()

GHashTable * dt_pwstorage_libsecret_get ( const backend_libsecret_context_t context,
const gchar *  slot 
)

Loads (key, value) pairs

Parameters
contextThe libsecret context
slotThe name of the slot
Returns
table List of (key,value) pairs

References EMPTY_STRING, error(), PACKAGE_NAME, SECRET_SCHEMA_DARKTABLE, and secret_to_attributes().

Referenced by dt_pwstorage_get().

◆ dt_pwstorage_libsecret_new()

const backend_libsecret_context_t * dt_pwstorage_libsecret_new ( )

Initializes a new libsecret backend context.

Returns
The libsecret context

References dt_pwstorage_libsecret_destroy(), and error().

Referenced by dt_pwstorage_new().

◆ dt_pwstorage_libsecret_set()

gboolean dt_pwstorage_libsecret_set ( const backend_libsecret_context_t context,
const gchar *  slot,
GHashTable *  attributes 
)

Store (key,value) pairs.

Parameters
contextThe libsecret context
slotThe name of the slot
attributesList of (key,value) pairs
Returns
TRUE If function succeeded, otherwise FALSE

References attributes_to_secret(), EMPTY_STRING, error(), FALSE, PACKAGE_NAME, SECRET_COLLECTION_DARKTABLE, and SECRET_SCHEMA_DARKTABLE.

Referenced by dt_pwstorage_set().

◆ secret_darktable_get_schema()

static const SecretSchema * secret_darktable_get_schema ( void  )
static

◆ secret_to_attributes()

static GHashTable * secret_to_attributes ( gchar *  secret)
static

References EMPTY_STRING, FALSE, and key.

Referenced by dt_pwstorage_libsecret_get().