diff --git a/src/bitmap.c b/src/bitmap.c index d50e7d6..b9252b7 100644 --- a/src/bitmap.c +++ b/src/bitmap.c @@ -14,10 +14,16 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor Boston, MA 02110-1301, USA */ +/** + * @file + * @brief Functions for work with image bitmaps + */ + #include "common.h" #include "bitmap.h" -unsigned char dict[256] = { +/** bictionary for speedup bitmap comparing */ +static unsigned char dict[256] = { /* 0x00 _0 _1 _2 _3 _4 _5 _6 _7 _8 _9 _A _B _C _D _E _F */ /* ---------------------------------------------------- */ /* 0_ */ 0, 1, 1, 2, 1, 2, 2, 3, 1, 2, 2, 3, 2, 3, 3, 4, diff --git a/src/bitmap.h b/src/bitmap.h index b44ba06..e044083 100644 --- a/src/bitmap.h +++ b/src/bitmap.h @@ -53,7 +53,7 @@ simdb_bitmap_unpack(const unsigned char *map, /** * @brief Print bitmap to stdout as ascii-square * @param map Source bitmap - * @note Heigth of "square" is equals to BITMAP_SIDE, + * @note Height of "square" is equals to BITMAP_SIDE, * but width is BITMAP_SIDE x 2, for ease of reading */ void diff --git a/src/database.c b/src/database.c index 2501604..db11735 100644 --- a/src/database.c +++ b/src/database.c @@ -14,6 +14,11 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor Boston, MA 02110-1301, USA */ +/** + * @file + * Common routines to work with database + */ + #include "common.h" #include "bitmap.h" #include "simdb.h" @@ -24,17 +29,20 @@ struct _simdb_t { char path[PATH_MAX]; /**< path to database file */ }; +/** read some records from database file and checks for errors */ #define DB_READ(db, buf, len, off) \ errno = 0; \ memset((buf), 0x0, (len)); \ bytes = pread((db)->fd, (buf), (len), (off)); \ if (errno) { return SIMDB_ERR_SYSTEM; } +/** write some records from database file and checks for errors */ #define DB_WRITE(db, buf, len, off) \ errno = 0; \ bytes = pwrite((db)->fd, (buf), (len), (off)); \ if (errno) { return SIMDB_ERR_SYSTEM; } +/** database header format line */ const char *simdb_hdr_fmt = "IMDB v%02u, CAPS: %s;"; bool