muhstik

- irc flooding solution
git clone git://git.acid.vegas/muhstik.git
Log | Files | Refs | Archive | README

lists.h (2097B)

      1 /* Muhstik, Copyright (C) 2001-2002, Louis Bavoil <mulder@gmx.fr>       */
      2 /*                        2009-2011, Leon Kaiser <literalka@gnaa.eu>    */
      3 /*                                                                      */
      4 /* This program is free software; you can redistribute it and/or        */
      5 /* modify it under the terms of the GNU Library General Public License  */
      6 /* as published by the Free Software Foundation; either version 2       */
      7 /* of the License, or (at your option) any later version.               */
      8 /*                                                                      */
      9 /* This program is distributed in the hope that it will be useful,      */
     10 /* but WITHOUT ANY WARRANTY; without even the implied warranty of       */
     11 /* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        */
     12 /* GNU Library General Public License for more details.                 */
     13 
     14 #ifndef LISTS_H
     15 #define LISTS_H
     16 
     17 #include "init.h"
     18 
     19 /* Functions for handling files */
     20 
     21 int occur_file (char *s, char *list);
     22 void add_file (char *s, char *list);
     23 int file_length (FILE *f);
     24 int get_a_line (char *s, int z, FILE *f);
     25 
     26 /* Functions for handling tables */
     27 
     28 int add_table (char *toadd, char **list, int max);
     29 int remove_table (char *torm, char **list, int max);
     30 void update_table (char *from, char *to, char **list, int max);
     31 void update_pattern_table (char *from, char *to, char **list, int max);
     32 int occur_table (char *s, char **list, int max);
     33 void fill_table (char **list, int max, FILE *f);
     34 void clear_table (char **list, int max);
     35 int match_table (char *s, char **list, int max);
     36 
     37 /* Functions for handling single linked lists */
     38 
     39 typedef struct st_list *queue;
     40 struct st_list {
     41      char *data;
     42      queue next;
     43 };
     44 
     45 typedef int cmp_fun (char *s1, char *s2);
     46 int add_queue (char *s, queue *list);
     47 int uniq_add_queue (char *s, queue *list);
     48 int remove_queue (char *d, queue *list);
     49 void update_queue (char *old, char *new, queue *list);
     50 int occur_queue (char *s, queue *list);
     51 void free_cell (queue *list);
     52 void clear_queue (queue *list);
     53 void rotate_cell (queue *list);
     54 
     55 #endif