"Fossies" - the Fresh Open Source Software Archive

Member "glusterfs-8.2/libglusterfs/src/glusterfs/trie.h" (16 Sep 2020, 1022 Bytes) of package /linux/misc/glusterfs-8.2.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 "trie.h" see the Fossies "Dox" file reference documentation.

    1 /*
    2   Copyright (c) 2008-2012 Red Hat, Inc. <http://www.redhat.com>
    3   This file is part of GlusterFS.
    4 
    5   This file is licensed to you under your choice of the GNU Lesser
    6   General Public License, version 3 or any later version (LGPLv3 or
    7   later), or the GNU General Public License, version 2 (GPLv2), in all
    8   cases as published by the Free Software Foundation.
    9 */
   10 
   11 #ifndef _TRIE_H_
   12 #define _TRIE_H_
   13 
   14 struct trienode;
   15 typedef struct trienode trienode_t;
   16 
   17 struct trie;
   18 typedef struct trie trie_t;
   19 
   20 struct trienodevec {
   21     trienode_t **nodes;
   22     unsigned cnt;
   23 };
   24 
   25 trie_t *
   26 trie_new();
   27 
   28 int
   29 trie_add(trie_t *trie, const char *word);
   30 
   31 void
   32 trie_destroy(trie_t *trie);
   33 
   34 void
   35 trie_destroy_bynode(trienode_t *node);
   36 
   37 int
   38 trie_measure(trie_t *trie, const char *word, trienode_t **nodes, int nodecnt);
   39 
   40 int
   41 trie_measure_vec(trie_t *trie, const char *word, struct trienodevec *nodevec);
   42 
   43 void
   44 trie_reset_search(trie_t *trie);
   45 
   46 int
   47 trienode_get_dist(trienode_t *node);
   48 
   49 int
   50 trienode_get_word(trienode_t *node, char **buf);
   51 
   52 #endif