"Fossies" - the Fresh Open Source Software Archive

Member "fusesmb-0.8.7/stringlist.h" (4 May 2006, 1807 Bytes) of package /linux/privat/old/fusesmb-0.8.7.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 "stringlist.h" see the Fossies "Dox" file reference documentation.

    1 /*
    2  * The MIT License
    3  *
    4  * Copyright (c) 2006 Vincent Wagelaar
    5  *
    6  * Permission is hereby granted, free of charge, to any person obtaining a
    7  * copy of this software and associated documentation files (the
    8  * "Software"), to deal in the Software without restriction, including
    9  * without limitation the rights to use, copy, modify, merge, publish,
   10  * distribute, sublicense, and/or sell copies of the Software, and to
   11  * permit persons to whom the Software is furnished to do so, subject to
   12  * the following conditions:
   13  *
   14  * The above copyright notice and this permission notice shall be included
   15  * in all copies or substantial portions of the Software.
   16  *
   17  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
   18  * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
   19  * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
   20  * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
   21  * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
   22  * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
   23  * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
   24  */
   25 
   26 #ifndef STRINGLIST_H
   27 #define STRINGLIST_H
   28 
   29 #include <string.h>
   30 #include <stdlib.h>
   31 
   32 typedef struct stringlist {
   33     char **lines;
   34     size_t numlines;
   35     size_t maxlines;
   36     char sorted;
   37 } stringlist_t;
   38 
   39 stringlist_t *sl_init(void);
   40 void sl_free(stringlist_t *sl);
   41 
   42 inline int sl_add(stringlist_t *sl, char *str, int do_malloc);
   43 inline size_t sl_count(stringlist_t *sl);
   44 void sl_clear(stringlist_t *sl);
   45 char *sl_find(stringlist_t *sl, const char *str);
   46 char *sl_casefind(stringlist_t *sl, const char *str);
   47 inline char *sl_item(stringlist_t *sl, size_t index);
   48 
   49 void sl_sort(stringlist_t *sl);
   50 void sl_casesort(stringlist_t *sl);
   51 
   52 #endif /* STRINGLIST_H */