## hkl

hkl

## Functions

#define | HKL_DEPRECATED_FOR()
#define | HKL_ARG_NONNULL()
#define | HKL_GEOMETRY_LIST_FOREACH()
#define | HKL_SAMPLE_REFLECTIONS_FOREACH()

## Types and Values

#define | HKL_DEPRECATED
#define | HKL_TINY
#define | HKL_EPSILON
#define | HKL_DEGTORAD
#define | HKL_RADTODEG
#define | HKL_VERSION
#define | HKL_TAU
#define | HKLAPI
#define | HKL_WARN_UNUSED_RESULT
struct | HklVector
#define | HKL_VECTOR_X
#define | HKL_VECTOR_Y
#define | HKL_VECTOR_Z
struct | HklQuaternion
typedef | darray_string
struct | HklUnitDimension
#define | HklDPlaneAngle
#define | HklDLength
enum | HklUnitEnum
struct | HklUnit
extern const HklUnit | hkl_unit_angle_deg
extern const HklUnit | hkl_unit_angle_rad
extern const HklUnit | hkl_unit_length_nm
extern const HklUnit | hkl_unit_angle_mrad
extern const HklUnit | hkl_unit_length_mm
extern const HklUnit | hkl_unit_length_meter
enum | HklDetectorType
typedef | darray_engine
enum | HklEngineCapabilities
enum | HklEngineAxisNamesGet
enum | HklEngineDependencies
| HklDetector
| HklEngine
| HklEngineList
| HklFactory
| HklGeometry
| HklGeometryList
| HklGeometryListItem
| HklLattice
| HklMatrix
| HklParameter
| HklSample
| HklSampleReflection

## Description

## Functions

### HKL_DEPRECATED_FOR()

    # define HKL_DEPRECATED_FOR(f) __attribute__((__deprecated__("Use '" #f "' instead")))

### HKL_ARG_NONNULL()

    # define HKL_ARG_NONNULL(...) __attribute__ ((__nonnull__(__VA_ARGS__)))

### HKL_GEOMETRY_LIST_FOREACH()

    #define             HKL_GEOMETRY_LIST_FOREACH(item, list)

### HKL_SAMPLE_REFLECTIONS_FOREACH()

    #define             HKL_SAMPLE_REFLECTIONS_FOREACH(_item, _list)

## Types and Values

### HKL_DEPRECATED

    # define HKL_DEPRECATED __attribute__((__deprecated__))

### HKL_TINY

    #define HKL_TINY 1e-7

### HKL_EPSILON

    #define HKL_EPSILON 1e-6

### HKL_DEGTORAD

    #define HKL_DEGTORAD (M_PI/180.)

### HKL_RADTODEG

    #define HKL_RADTODEG (180./M_PI)

### HKL_VERSION

    #define HKL_VERSION "5.1.9"

### HKL_TAU

    #define HKL_TAU (2. * M_PI)

### HKLAPI

    #  define HKLAPI __attribute__ ((visibility("default")))

### HKL_WARN_UNUSED_RESULT

    #  define HKL_WARN_UNUSED_RESULT __attribute__ ((__warn_unused_result__))

### struct HklVector

    struct HklVector {
    	double data[3];
    };

### HKL_VECTOR_X

    #define HKL_VECTOR_X {{1, 0, 0}}

### HKL_VECTOR_Y

    #define HKL_VECTOR_Y {{0, 1, 0}}

### HKL_VECTOR_Z

    #define HKL_VECTOR_Z {{0, 0, 1}}

### struct HklQuaternion

    struct HklQuaternion {
    	double data[4];
    };

### darray_string

    typedef darray(const char *) darray_string;

### struct HklUnitDimension

    struct HklUnitDimension {
    	int l; /* Length */
    	int m; /* Mass */
    	int t; /* Time */
    	int i; /* Electric current */
    	int th; /* Thermodynamic temperature */
    	int n; /* Amount of substance */
    	int j; /* Luminous intensity */
    };

### HklDPlaneAngle

    #define HklDPlaneAngle {0, 0, 0, 0, 0, 0, 0}

### HklDLength

    #define HklDLength {1, 0, 0, 0, 0, 0, 0}

### enum HklUnitEnum

#### Members

HKL_UNIT_DEFAULT |  |
HKL_UNIT_USER |  |

### struct HklUnit

    struct HklUnit {
    	HklUnitDimension dimension;
    	double factor;
    	char const *name;
    	char const *repr;
    };

### hkl_unit_angle_deg

    extern const HklUnit hkl_unit_angle_deg;

### hkl_unit_angle_rad

    extern const HklUnit hkl_unit_angle_rad;

### hkl_unit_length_nm

    extern const HklUnit hkl_unit_length_nm;

### hkl_unit_angle_mrad

    extern const HklUnit hkl_unit_angle_mrad;

### hkl_unit_length_mm

    extern const HklUnit hkl_unit_length_mm;

### hkl_unit_length_meter

    extern const HklUnit hkl_unit_length_meter;

### enum HklDetectorType

#### Members

HKL_DETECTOR_TYPE_0D |  |

### darray_engine

    typedef darray(HklEngine *) darray_engine;

### enum HklEngineCapabilities

#### Members

HKL_ENGINE_CAPABILITIES_READABLE |  |
HKL_ENGINE_CAPABILITIES_WRITABLE |  |
HKL_ENGINE_CAPABILITIES_INITIALIZABLE |  |

### enum HklEngineAxisNamesGet

#### Members

HKL_ENGINE_AXIS_NAMES_GET_READ |  |
HKL_ENGINE_AXIS_NAMES_GET_WRITE |  |

### enum HklEngineDependencies

#### Members

HKL_ENGINE_DEPENDENCIES_AXES |  |
HKL_ENGINE_DEPENDENCIES_ENERGY |  |
HKL_ENGINE_DEPENDENCIES_SAMPLE |  |

### HklDetector

    typedef struct {
    	size_t idx;
    	HklHolder const *holder;
    } HklDetector;

### HklEngine

    typedef struct {
    	const HklEngineInfo *info;
    	const HklEngineOperations *ops;
    	HklGeometry *geometry;
    	HklDetector *detector;
    	HklSample *sample;
    	HklMode *mode; /* not owned */
    	HklEngineList *engines; /* not owned */
    	darray_parameter axes;
    	darray_parameter pseudo_axes;
    	darray_string pseudo_axis_names;
    	darray_mode modes;
    	darray_string mode_names;
    } HklEngine;

### HklEngineList

    typedef struct {
    	_darray(HklEngine *); /* must be the first memeber */
    	const HklEngineListInfo *info;
    	const HklEngineListOperations *ops;
    	HklGeometryList *geometries;
    	HklGeometry *geometry;
    	HklDetector *detector;
    	HklSample *sample;
    	darray_parameter pseudo_axes;
    	darray_parameter parameters;
    	darray_string parameters_names;
    } HklEngineList;

### HklFactory

    typedef struct {
    	const char *name;
    	const char *description;
    	const darray_string axes;
    	HklFactoryGeometryFunction create_new_geometry;
    	HklFactoryEngineListFunction create_new_engine_list;
    } HklFactory;

### HklGeometry

    typedef struct {
    	const HklFactory *factory;
    	HklSource source;
    	darray_parameter axes;
    	darray_holder holders;
    	const HklGeometryOperations *ops;
    } HklGeometry;

### HklGeometryList

    typedef struct {
    	HklGeometryListMultiplyFunction multiply;
    	struct list_head items;
    	size_t n_items;
    } HklGeometryList;

### HklGeometryListItem

    typedef struct {
    	struct list_node list;
    	HklGeometry *geometry;
    } HklGeometryListItem;

### HklLattice

    typedef struct {
    	HklParameter *a;
    	HklParameter *b;
    	HklParameter *c;
    	HklParameter *alpha;
    	HklParameter *beta;
    	HklParameter *gamma;
    	HklParameter *volume;
    } HklLattice;

### HklMatrix

    typedef struct {
    	double data[3][3];
    } HklMatrix;

### HklParameter

    typedef struct {
    	const char *name;
    	const char *description;
    	HklInterval range;
    	double _value;
    	const HklUnit *unit;
    	const HklUnit *punit;
    	int fit;
    	int changed;
    	const HklParameterOperations *ops;
            HklParameterType type;
    } HklParameter;

### HklSample

    typedef struct {
    	char *name;
    	HklLattice *lattice;
    	HklMatrix U;
    	HklMatrix UB;
    	HklParameter *ux;
    	HklParameter *uy;
    	HklParameter *uz;
    	struct list_head reflections;
    	size_t n_reflections;
    } HklSample;

### HklSampleReflection

    typedef struct {
    	HklGeometry *geometry;
    	HklDetector *detector;
    	HklSample *sample;
    	HklVector hkl;
    	HklVector _hkl;
    	int flag;
    	struct list_node list;
    } HklSampleReflection;