darktable  3.6.1
About: darktable is an open source photography workflow application and RAW developer. A virtual lighttable and darkroom for photographers.
  Fossies Dox: darktable-3.6.1.tar.xz  ("unofficial" and yet experimental doxygen-generated source code documentation)  

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:

Go to the source code of this file.

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)

Definition at line 34 of file backend_libsecret.c.

◆ SECRET_COLLECTION_DARKTABLE

#define SECRET_COLLECTION_DARKTABLE   SECRET_COLLECTION_DEFAULT

Definition at line 32 of file backend_libsecret.c.

◆ 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

Definition at line 170 of file backend_libsecret.c.

References key.

Referenced by attributes_to_secret().

Here is the caller graph for this function:

◆ attributes_to_secret()

static gchar * attributes_to_secret ( GHashTable *  attributes)
static

Definition at line 178 of file backend_libsecret.c.

References append_pair_to_json().

Referenced by dt_pwstorage_libsecret_set().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ dt_pwstorage_libsecret_destroy()

void dt_pwstorage_libsecret_destroy ( const backend_libsecret_context_t context)

Destroys the libsecret backend context.

Parameters
contextThe libsecret context

Definition at line 80 of file backend_libsecret.c.

Referenced by dt_pwstorage_destroy(), and dt_pwstorage_libsecret_new().

Here is the caller graph for this function:

◆ 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

Definition at line 129 of file backend_libsecret.c.

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

Referenced by dt_pwstorage_get().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ dt_pwstorage_libsecret_new()

const backend_libsecret_context_t * dt_pwstorage_libsecret_new ( )

Initializes a new libsecret backend context.

Returns
The libsecret context

Definition at line 55 of file backend_libsecret.c.

References dt_pwstorage_libsecret_destroy(), and error().

Referenced by dt_pwstorage_new().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ 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

Definition at line 85 of file backend_libsecret.c.

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

Referenced by dt_pwstorage_set().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ secret_darktable_get_schema()

static const SecretSchema * secret_darktable_get_schema ( void  )
static

Definition at line 36 of file backend_libsecret.c.

◆ secret_to_attributes()

static GHashTable * secret_to_attributes ( gchar *  secret)
static

Definition at line 197 of file backend_libsecret.c.

References EMPTY_STRING, FALSE, and key.

Referenced by dt_pwstorage_libsecret_get().

Here is the caller graph for this function: