From a135a26ed5e9fba32cb5c4a1a347e8d83d14010e Mon Sep 17 00:00:00 2001 From: Alex 'AdUser' Z Date: Sun, 5 Feb 2017 19:18:27 +1000 Subject: [PATCH] * fix doxygen comments --- src/database.c | 12 +++++++++++- src/record.h | 4 ++-- src/simdb.h | 8 ++++---- 3 files changed, 17 insertions(+), 7 deletions(-) diff --git a/src/database.c b/src/database.c index 81dcfd8..01d8c36 100644 --- a/src/database.c +++ b/src/database.c @@ -375,7 +375,17 @@ simdb_search_free(simdb_search_t *search) { search->found = 0; } -int +/** + * @brief Generic search routine + * @param db Database handle + * @param search Search struct, initialized with @ref simdb_search_init + * @param sample Source sample + * @param skip Skep this record number from search (if ge take source from same database) + * @retval <0 error + * @retval 0 nothing found + * @retval >0 matches count + */ +static int simdb_search(simdb_t *db, simdb_search_t *search, simdb_urec_t *sample, int skip) { simdb_match_t *matches; simdb_match_t match; diff --git a/src/record.h b/src/record.h index ab9bd36..445c058 100644 --- a/src/record.h +++ b/src/record.h @@ -10,7 +10,7 @@ */ /** struct for packed record usage */ -typedef struct __attribute__((__packed__)) { +typedef struct simdb_urec_t { uint8_t used; /**< record is used */ uint8_t clevel_r; /**< color level: red */ uint8_t clevel_g; /**< color level: green */ @@ -19,7 +19,7 @@ typedef struct __attribute__((__packed__)) { uint16_t image_h; /**< image height */ unsigned char _unused[8]; /**< padding */ unsigned char bitmap[SIMDB_BITMAP_SIZE]; /**< image luma bitmap */ -} simdb_urec_t; +} __attribute__((__packed__)) simdb_urec_t; /** compile-time check for packed struct length */ typedef char size_mismatch_for__simdb_urec_t[(sizeof(simdb_urec_t) == SIMDB_REC_LEN) * 2 - 1]; diff --git a/src/simdb.h b/src/simdb.h index 1458633..c396112 100644 --- a/src/simdb.h +++ b/src/simdb.h @@ -12,7 +12,7 @@ /** * @defgroup SIMDBFlags Database runtime flags * @{ */ -#define SIMDB_FLAGS_MASK 0xFF +#define SIMDB_FLAGS_MASK 0xFF /**< get all flags */ #define SIMDB_FLAG_WRITE 1 << (0 + 0) /**< database has write access */ #define SIMDB_FLAG_LOCK 1 << (0 + 1) /**< use locks for file with write access (only with @ref SIMDB_FLAG_WRITE) */ #define SIMDB_FLAG_LOCKNB 1 << (0 + 2) /**< same as above, but not wait for lock (only with @ref SIMDB_FLAG_WRITE) */ @@ -55,7 +55,7 @@ typedef struct _simdb_t simdb_t; /** * search matches */ -typedef struct { +typedef struct simdb_match_t { int num; /**< record id */ float d_ratio; /**< difference of ratio */ float d_bitmap; /**< difference of bitmap */ @@ -70,7 +70,7 @@ typedef struct { float d_ratio; /**< max difference of ratios, default - 7% */ int limit; /**< max results */ int found; /**< count of found results */ - simdb_match_t *matches; + simdb_match_t *matches; /**< search results */ } simdb_search_t; /** @@ -176,7 +176,7 @@ int simdb_record_del(simdb_t *db, int num); * @brief Get record bitmap * @param db Database handle * @param num Number of record to get bitmap - * @param bitmap Pointer to storage for bitmap (allocated) + * @param map Pointer to storage for bitmap (allocated) * @param side Pointer to storage for bitmap side length * @retval <0 on error * @retval 0 if record not exists