Ansel 0.0
A darktable fork - bloat + design vision
Loading...
Searching...
No Matches
variables.c File Reference
#include "common/debug.h"
#include "common/darktable.h"
#include "bauhaus/bauhaus.h"
#include "common/variables.h"
#include "common/colorlabels.h"
#include "common/file_location.h"
#include "common/image.h"
#include "common/image_cache.h"
#include "common/metadata.h"
#include "common/opencl.h"
#include "common/utility.h"
#include "common/tags.h"
#include "common/datetime.h"
#include "control/conf.h"
#include "common/exif.h"
#include <stdio.h>
#include <string.h>
#include <time.h>
+ Include dependency graph for common/variables.c:

Data Structures

struct  dt_variables_data_t
 

Typedefs

typedef struct dt_variables_data_t dt_variables_data_t
 
typedef enum _image_case _image_case
 

Enumerations

enum  _image_case {
  NONE ,
  FILENAME ,
  IMGID
}
 

Functions

static char * _expand_source (dt_variables_params_t *params, char **source, char extra_stop)
 
gboolean dt_get_user_pictures_dir (const gchar *homedir, gchar *picdir, size_t picdir_size)
 Gets the path to the current OS pictures directory.
 
static void _init_expansion (dt_variables_params_t *params, gboolean iterate)
 
static void _cleanup_expansion (dt_variables_params_t *params)
 
static gboolean _has_prefix (char **str, const char *prefix)
 
static char * _variables_get_longitude (dt_variables_params_t *params)
 
static char * _variables_get_latitude (dt_variables_params_t *params)
 
static char * _get_base_value (dt_variables_params_t *params, char **variable)
 
static char * _variable_get_value (dt_variables_params_t *params, char **variable)
 
static void _grow_buffer (char **result, char **result_iter, size_t *result_length, size_t extra_space)
 
char * dt_variables_expand (dt_variables_params_t *params, gchar *source, gboolean iterate)
 
void dt_variables_params_init (dt_variables_params_t **params)
 
void dt_variables_params_destroy (dt_variables_params_t *params)
 
void dt_variables_set_datetime (dt_variables_params_t *params, GDateTime *datetime)
 
void dt_variables_set_max_width_height (dt_variables_params_t *params, int max_width, int max_height)
 
void dt_variables_reset_sequence (dt_variables_params_t *params)
 
void dt_variables_set_tags_flags (dt_variables_params_t *params, uint32_t flags)
 

Typedef Documentation

◆ _image_case

typedef enum _image_case _image_case

◆ dt_variables_data_t

Enumeration Type Documentation

◆ _image_case

Enumerator
NONE 
FILENAME 
IMGID 

Function Documentation

◆ _cleanup_expansion()

static void _cleanup_expansion ( dt_variables_params_t params)
static

Referenced by dt_variables_expand().

◆ _expand_source()

static char * _expand_source ( dt_variables_params_t params,
char **  source,
char  extra_stop 
)
static

◆ _get_base_value()

◆ _grow_buffer()

static void _grow_buffer ( char **  result,
char **  result_iter,
size_t *  result_length,
size_t  extra_space 
)
static

Referenced by _expand_source().

◆ _has_prefix()

static gboolean _has_prefix ( char **  str,
const char *  prefix 
)
inlinestatic

Referenced by _get_base_value().

◆ _init_expansion()

◆ _variable_get_value()

static char * _variable_get_value ( dt_variables_params_t params,
char **  variable 
)
static
Todo:
: write a dt_util_str_replace that can deal with pattern_length ^^
Todo:
: is there a strstr_len that limits the length of pattern?

References _expand_source(), _get_base_value(), dt_util_str_replace(), MAX, and MIN.

Referenced by _expand_source().

◆ _variables_get_latitude()

static char * _variables_get_latitude ( dt_variables_params_t params)
static

◆ _variables_get_longitude()

static char * _variables_get_longitude ( dt_variables_params_t params)
static

◆ dt_get_user_pictures_dir()

gboolean dt_get_user_pictures_dir ( const gchar *  homedir,
gchar *  picdir,
size_t  picdir_size 
)

Gets the path to the current OS pictures directory.

Parameters
homedirthe user's home directory
picdirthe gchar* to set to the path of the pictures directory
picdir_sizethe size of picdir
Returns
gboolean Returns TRUE if success.

References PATH_MAX.

Referenced by _dt_check_basedir(), and _init_expansion().

◆ dt_variables_expand()

char * dt_variables_expand ( dt_variables_params_t params,
gchar *  source,
gboolean  iterate 
)

◆ dt_variables_params_destroy()

void dt_variables_params_destroy ( dt_variables_params_t params)

◆ dt_variables_params_init()

◆ dt_variables_reset_sequence()

void dt_variables_reset_sequence ( dt_variables_params_t params)

reset sequence number

◆ dt_variables_set_datetime()

void dt_variables_set_datetime ( dt_variables_params_t params,
GDateTime *  datetime 
)

reset the date arbitrarily, decrementing reference count of the previous date

Referenced by dt_build_filename_from_pattern().

◆ dt_variables_set_max_width_height()

void dt_variables_set_max_width_height ( dt_variables_params_t params,
int  max_width,
int  max_height 
)

set max image width and height defined for an export session in a dt_variables_params_t.

Referenced by store().

◆ dt_variables_set_tags_flags()

void dt_variables_set_tags_flags ( dt_variables_params_t params,
uint32_t  flags 
)

set flags for tags to be exported

References flags.

Referenced by _watermark_get_svgdoc(), and dt_exif_xmp_attach_export().