lensfun: Database functions

lensfun 0.3.95.0

Classes | Enumerations | Functions | Variables
Database functions

Create, destroy and search database for objects. More...

## Classes
struct | lfDatabase
| A lens database object. More...

## Enumerations
enum | { LF_SEARCH_LOOSE = 1 , LF_SEARCH_SORT_AND_UNIQUIFY = 2 }
| Flags controlling the behavior of database searches. More...

## Functions
DEPRECATED lfDatabase * | lf_db_new (void)
| Create a new empty database object. More...
lfDatabase * | lf_db_create (void)
| Create a new empty database object. More...
void | lf_db_destroy (lfDatabase *db)
| Destroy the database object. More...
long int | lf_db_read_timestamp (lfDatabase *db, const char *dirname)
lfError | lf_db_load (lfDatabase *db)
DEPRECATED lfError | lf_db_load_file (lfDatabase *db, const char *filename)
DEPRECATED cbool | lf_db_load_directory (lfDatabase *db, const char *dirname)
lfError | lf_db_load_path (lfDatabase *db, const char *pathname)
lfError | lf_db_load_data (lfDatabase *db, const char *errcontext, const char *data, size_t data_size)
lfError | lf_db_save_all (const lfDatabase *db, const char *filename)
lfError | lf_db_save_file (const lfDatabase *db, const char *filename, const lfMount *const *mounts, const lfCamera *const *cameras, const lfLens *const *lenses)
char * | lf_db_save (const lfMount *const *mounts, const lfCamera *const *cameras, const lfLens *const *lenses)
const lfCamera ** | lf_db_find_cameras (const lfDatabase *db, const char *maker, const char *model)
const lfCamera ** | lf_db_find_cameras_ext (const lfDatabase *db, const char *maker, const char *model, int sflags)
const lfCamera *const * | lf_db_get_cameras (lfDatabase *db)
DEPRECATED const lfLens ** | lf_db_find_lenses_hd (const lfDatabase *db, const lfCamera *camera, const char *maker, const char *lens, int sflags)
const lfLens ** | lf_db_find_lenses (const lfDatabase *db, const lfCamera *camera, const char *maker, const char *lens, int sflags)
const lfLens *const * | lf_db_get_lenses (lfDatabase *db)
const lfMount * | lf_db_find_mount (const lfDatabase *db, const char *mount)
const char * | lf_db_mount_name (const lfDatabase *db, const char *mount)
const lfMount *const * | lf_db_get_mounts (lfDatabase *db)

## Variables
const char *const | lf_db_system_location
const char *const | lf_db_system_updates_location
const char *const | lf_db_user_location
const char *const | lf_db_user_updates_location

## Detailed Description

Create, destroy and search database for objects.

## Enumeration Type Documentation

## ◆ anonymous enum

anonymous enum

Flags controlling the behavior of database searches.

Enumerator
LF_SEARCH_LOOSE | This flag selects a looser search algorithm resulting in more results (still sorted by score). If it is not present, all results where at least one of the input words is missing will be discarded.
LF_SEARCH_SORT_AND_UNIQUIFY | This flag makes Lensfun to sort the results by focal length, and remove all double lens names. If a lens has entries for different crop factors/aspect ratios, the only best match is included into the result. This is meant to be used to create a list presented to the user to pick a lens. Or, to lookup a lens for which you know maker and model exactly, and to check whether the result list really contains only one element.

## Function Documentation

## ◆ lf_db_create()

lfDatabase * lf_db_create | ( | void |  | ) |

Create a new empty database object.

Usually the application will want to do this at startup, after which it would be a good idea to call lf_db_load().

Returns
  A new empty database object.

See also
  lfDatabase::lfDatabase

## ◆ lf_db_destroy()

void lf_db_destroy | ( | lfDatabase * | db | ) |

Destroy the database object.

This is the only way to correctly destroy the database object.

Parameters

  db | The database to destroy.

See also
  lfDatabase::~lfDatabase

Examples
  example.c.

## ◆ lf_db_find_cameras()

const lfCamera ** lf_db_find_cameras | ( | const lfDatabase * | db,
|  | const char * | maker,
|  | const char * | model
| ) |  |

See also
  lfDatabase::FindCameras

## ◆ lf_db_find_cameras_ext()

const lfCamera ** lf_db_find_cameras_ext | ( | const lfDatabase * | db,
|  | const char * | maker,
|  | const char * | model,
|  | int | sflags
| ) |  |

See also
  lfDatabase::FindCamerasExt

## ◆ lf_db_find_lenses()

const lfLens ** lf_db_find_lenses | ( | const lfDatabase * | db,
|  | const lfCamera * | camera,
|  | const char * | maker,
|  | const char * | lens,
|  | int | sflags
| ) |  |

See also
  lfDatabase::FindLenses(const lfCamera *, const char *, const char *)

## ◆ lf_db_find_lenses_hd()

DEPRECATED const lfLens ** lf_db_find_lenses_hd | ( | const lfDatabase * | db,
|  | const lfCamera * | camera,
|  | const char * | maker,
|  | const char * | lens,
|  | int | sflags
| ) |  |

See also
  lfDatabase::FindLenses(const lfCamera *, const char *, const char *)

## ◆ lf_db_find_mount()

const lfMount * lf_db_find_mount | ( | const lfDatabase * | db,
|  | const char * | mount
| ) |  |

See also
  lfDatabase::FindMount

## ◆ lf_db_get_cameras()

const lfCamera *const * lf_db_get_cameras | ( | lfDatabase * | db | ) |

See also
  lfDatabase::GetCameras

Examples
  example.c.

## ◆ lf_db_get_lenses()

const lfLens *const * lf_db_get_lenses | ( | lfDatabase * | db | ) |

See also
  lfDatabase::GetLenses

Examples
  example.c.

## ◆ lf_db_get_mounts()

const lfMount *const * lf_db_get_mounts | ( | lfDatabase * | db | ) |

See also
  lfDatabase::GetMounts

Examples
  example.c.

## ◆ lf_db_load()

lfError lf_db_load | ( | lfDatabase * | db | ) |

See also
  lfDatabase::Load()

Examples
  example.c.

## ◆ lf_db_load_data()

lfError lf_db_load_data | ( | lfDatabase * | db,
|  | const char * | errcontext,
|  | const char * | data,
|  | size_t | data_size
| ) |  |

See also
  lfDatabase::Load(const char *, const char *, size_t)

## ◆ lf_db_load_directory()

DEPRECATED cbool lf_db_load_directory | ( | lfDatabase * | db,
|  | const char * | dirname
| ) |  |

See also
  lfDatabase::LoadDirectory(const char *). Deprecated, use lf_db_load_path() instead.

## ◆ lf_db_load_file()

DEPRECATED lfError lf_db_load_file | ( | lfDatabase * | db,
|  | const char * | filename
| ) |  |

See also
  lfDatabase::Load(const char *). Deprecated, use lf_db_load_path() instead.

## ◆ lf_db_load_path()

lfError lf_db_load_path | ( | lfDatabase * | db,
|  | const char * | pathname
| ) |  |

See also
  lfDatabase::Load(const char *)

## ◆ lf_db_mount_name()

const char * lf_db_mount_name | ( | const lfDatabase * | db,
|  | const char * | mount
| ) |  |

See also
  lfDatabase::MountName

Examples
  example.c, and tfun.cpp.

## ◆ lf_db_new()

DEPRECATED lfDatabase * lf_db_new | ( | void |  | ) |

Create a new empty database object.

This function is deprecated, use lf_db_create () instead.

Returns
  A new empty database object.

See also
  lfDatabase::lfDatabase

Examples
  example.c, and tfun.cpp.

## ◆ lf_db_read_timestamp()

long int lf_db_read_timestamp | ( | lfDatabase * | db,
|  | const char * | dirname
| ) |  |

See also
  lfDatabase::ReadTimestamp()

## ◆ lf_db_save()

char * lf_db_save | ( | const lfMount *const * | mounts,
|  | const lfCamera *const * | cameras,
|  | const lfLens *const * | lenses
| ) |  |

See also
  lfDatabase::Save(const lfMount *const *, const lfCamera *const *, const lfLens *const *)

## ◆ lf_db_save_all()

lfError lf_db_save_all | ( | const lfDatabase * | db,
|  | const char * | filename
| ) |  |

See also
  lfDatabase::Save(const char *)

## ◆ lf_db_save_file()

lfError lf_db_save_file | ( | const lfDatabase * | db,
|  | const char * | filename,
|  | const lfMount *const * | mounts,
|  | const lfCamera *const * | cameras,
|  | const lfLens *const * | lenses
| ) |  |

See also
  lfDatabase::Save(const char *, const lfMount *const *, const lfCamera *const *, const lfLens *const *)

Examples
  example.c.

## Variable Documentation

## ◆ lf_db_system_location

const char* const lf_db_system_location
| extern

See also
  lfDatabase::SystemLocation()

## ◆ lf_db_system_updates_location

const char* const lf_db_system_updates_location
| extern

See also
  lfDatabase::SystemUpdatesLocation()

## ◆ lf_db_user_location

const char* const lf_db_user_location
| extern

See also
  lfDatabase::UserLocation()

## ◆ lf_db_user_updates_location

const char* const lf_db_user_updates_location
| extern

See also
  lfDatabase::UserUpdatesLocation()