/* Copyright (C) 2015-2020, Dirk Krause SPDX-License-Identifier: BSD-3-Clause */ /* WARNING: This file was generated by the dkct program (see http://dktools.sourceforge.net/ for details). Changes you make here will be lost if dkct is run again! You should modify the original source and run dkct on it. Original source: dk4pref.ctr */ #ifndef DK4PREF_H_INCLUDED /** Avoid multiple inclusions. */ #define DK4PREF_H_INCLUDED 1 #line 10 "dk4pref.ctr" /** @file Preferences as key/value pairs; the module contains functions to create and destroy a preference structure and to compare preference structures by name or against a given name. Typically preferences are stored in a dk4_sto_t structure. CRT on Windows: Optional. */ #ifndef DK4CONF_H_INCLUDED #if DK4_BUILDING_DKTOOLS4 #include "dk4conf.h" #else #include #endif #endif #ifndef DK4TYPES_H_INCLUDED #if DK4_BUILDING_DKTOOLS4 #include "dk4types.h" #else #include #endif #endif #ifndef DK4ERROR_H_INCLUDED #if DK4_BUILDING_DKTOOLS4 #include "dk4error.h" #else #include #endif #endif #ifndef DK4STR8_H_INCLUDED #if DK4_BUILDING_DKTOOLS4 #include "dk4str8.h" #else #include #endif #endif #ifndef DK4STRW_H_INCLUDED #if DK4_BUILDING_DKTOOLS4 #include "dk4strw.h" #else #include #endif #endif #ifndef DK4STRD_H_INCLUDED #if DK4_BUILDING_DKTOOLS4 #include "dk4strd.h" #else #include #endif #endif /** Preferences storage. */ typedef struct { dkChar *name; /**< Preference name. */ dkChar *value; /**< Value. */ } dk4_pref_t; #ifdef __cplusplus extern "C" { #endif /** Create preferences structure, allocate memory. @param name Preference name. @param value Preference value. @param erp Error report, may be NULL. @return Pointer to new preferences object on success, NULL on error. */ dk4_pref_t * dk4pref_open(dkChar const *name, dkChar const *value, dk4_er_t *erp); /** Destroy preference structure, release memory. @param ptr Preference structure to destroy. */ void dk4pref_close(dk4_pref_t *ptr); /** Comparison function. @param l Left pointer. @param r Right pointer. @param cr Comparison criteria: 0=structure/structure, 1=structure/name. @return Comparison result. */ int dk4pref_compare(const void *l, const void *r, int cr); #ifdef __cplusplus } #endif #endif