Browse Source

* fix doxygen comments

master
Alex 'AdUser' Z 7 years ago
parent
commit
a135a26ed5
  1. 12
      src/database.c
  2. 4
      src/record.h
  3. 8
      src/simdb.h

12
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;

4
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];

8
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

Loading…
Cancel
Save