void *util_htget (hash_table_t *ht, const char *key);
void *util_htgeth(hash_table_t *ht, const char *key, size_t hash);
- /*===================================================================*/
- /*=========================== thread.c ==============================*/
- /*===================================================================*/
- GMQCC_INLINE uint32_t util_atomic_xadd32(volatile uint32_t *x, uint32_t v);
-
- /*===================================================================*/
- /*============================ file.c ===============================*/
- /*===================================================================*/
- /* file handling */
- void fs_file_close (FILE *);
- int fs_file_error (FILE *);
- int fs_file_getc (FILE *);
- int fs_file_printf (FILE *, const char *, ...);
- int fs_file_puts (FILE *, const char *);
- int fs_file_seek (FILE *, long int, int);
- long int fs_file_tell (FILE *);
-
- size_t fs_file_read (void *, size_t, size_t, FILE *);
- size_t fs_file_write (const void *, size_t, size_t, FILE *);
-
- FILE *fs_file_open (const char *, const char *);
- int fs_file_getline(char **, size_t *, FILE *);
-
- /* directory handling */
+ int util_snprintf(char *str, size_t, const char *fmt, ...);
+
+
++/* thread.c */
++uint32_t util_atomic_xadd32(volatile uint32_t *x, uint32_t v);
++
++
+ /* fs.c */
+ #define FS_FILE_SEEK_SET 0
+ #define FS_FILE_SEEK_CUR 1
+ #define FS_FILE_SEEK_END 2
+ #define FS_FILE_EOF -1
+
+ typedef struct fs_dir_s fs_dir_t;
+ /*typedef struct fs_file_s fs_file_t;*/
+ typedef struct dirent fs_dirent_t;
+
+ void fs_file_close (fs_file_t *);
+ int fs_file_error (fs_file_t *);
+ int fs_file_getc (fs_file_t *);
+ int fs_file_printf (fs_file_t *, const char *, ...);
+ int fs_file_puts (fs_file_t *, const char *);
+ int fs_file_seek (fs_file_t *, long int, int);
+ long fs_file_tell (fs_file_t *);
+ int fs_file_flush (fs_file_t *);
+
+ size_t fs_file_read (void *, size_t, size_t, fs_file_t *);
+ size_t fs_file_write (const void *, size_t, size_t, fs_file_t *);
+
+ fs_file_t *fs_file_open (const char *, const char *);
+ int fs_file_getline(char **, size_t *, fs_file_t *);
+
int fs_dir_make (const char *);
- DIR *fs_dir_open (const char *);
- int fs_dir_close (DIR *);
- struct dirent *fs_dir_read (DIR *);
+ fs_dir_t *fs_dir_open (const char *);
+ int fs_dir_close (fs_dir_t *);
+ fs_dirent_t *fs_dir_read (fs_dir_t *);
+
+ /* correct.c */
+ typedef struct correct_trie_s {
+ void *value;
+ struct correct_trie_s *entries;
+ } correct_trie_t;
+
+ correct_trie_t* correct_trie_new(void);
- /*===================================================================*/
- /*=========================== correct.c =============================*/
- /*===================================================================*/
typedef struct {
char ***edits;
size_t **lens;