"Fossies" - the Fresh Open Source Software Archive

Member "detox-1.4.5/src/table.h" (15 Aug 2021, 914 Bytes) of package /linux/privat/detox-1.4.5.tar.gz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) C and C++ source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file. For more information about "table.h" see the Fossies "Dox" file reference documentation.

    1 /**
    2  * This file is part of the Detox package.
    3  *
    4  * Copyright (c) Doug Harple <detox.dharple@gmail.com>
    5  *
    6  * For the full copyright and license information, please view the LICENSE
    7  * file that was distributed with this source code.
    8  */
    9 
   10 #ifndef __TABLE_H
   11 #define __TABLE_H
   12 
   13 struct translation_table_row {
   14     unsigned int key;
   15     char *data;
   16 };
   17 
   18 struct translation_table {
   19     int length;
   20     int used;
   21 
   22     int max_data_length;
   23 
   24     char *default_translation;
   25 
   26     struct translation_table_row *rows;
   27 
   28     int hits, misses, overwrites;
   29 };
   30 
   31 extern struct translation_table *table_init(int max_rows);
   32 extern struct translation_table *table_resize(struct translation_table *table, int rows);
   33 extern void table_free(struct translation_table *table);
   34 extern int table_put(struct translation_table *table, unsigned int key, char *data);
   35 extern char *table_get(struct translation_table *table, unsigned int key);
   36 
   37 #endif              /* __TABLE_H */