Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 47 lines (38 sloc) 1.178 kb
29252b6 More refactoring; chopping up quirc.c. '#pragma once'-ing headers
Sound and Fury authored
1 #pragma once
2
a886cb2 Moved name-list handling out to new files 'names.*'
Sound and Fury authored
3 /*
3fcb080 Enable many warnings & fix them
ec429 authored
4 quIRC - simple terminal-based IRC client
4e3364b @ec429 Nudge copyright year to 2013
authored
5 Copyright (C) 2010-13 Edward Cree
3fcb080 Enable many warnings & fix them
ec429 authored
6
a886cb2 Moved name-list handling out to new files 'names.*'
Sound and Fury authored
7 See quirc.c for license information
8 names: handling for name lists
9 */
10
a808728 Started /ignore handling
Sound and Fury authored
11 #include <stdio.h>
a886cb2 Moved name-list handling out to new files 'names.*'
Sound and Fury authored
12 #include <stdlib.h>
a808728 Started /ignore handling
Sound and Fury authored
13 #include <stdbool.h>
a886cb2 Moved name-list handling out to new files 'names.*'
Sound and Fury authored
14 #include <string.h>
a808728 Started /ignore handling
Sound and Fury authored
15 #include <sys/types.h>
16 #include <regex.h>
a886cb2 Moved name-list handling out to new files 'names.*'
Sound and Fury authored
17
f998834 Parse the prefixes in RPL_NAMREPLY
ec429 authored
18 typedef struct
19 {
20 char letter;
21 char pfx;
22 }
23 prefix;
24
a886cb2 Moved name-list handling out to new files 'names.*'
Sound and Fury authored
25 typedef struct _name
26 {
a808728 Started /ignore handling
Sound and Fury authored
27 bool icase; // only used for ignore lists; true = case-insensitive
a3c5734 /ignore command
Sound and Fury authored
28 bool pms; // only used for ignore lists; true = affect private messages
f998834 Parse the prefixes in RPL_NAMREPLY
ec429 authored
29 unsigned int npfx;
30 prefix *prefixes;
a886cb2 Moved name-list handling out to new files 'names.*'
Sound and Fury authored
31 char *data; // is a unique pointer (eg. from strdup()), and must be free()d
32 struct _name *next, *prev;
33 }
34 name;
35
5ed2685 /ignore -l: lists ignores
Sound and Fury authored
36 #include "buffer.h"
17ee225 Case-insensitive regex-match (/ignore tests)
Sound and Fury authored
37 #include "irc.h"
5ed2685 /ignore -l: lists ignores
Sound and Fury authored
38
c114bc8 Fix various memory access violations and double frees
ec429 authored
39 name *n_dup(const name *list);
3be945d Refactoring from irc.c:ctcp() to new buffer.c:makeptab()
ec429 authored
40 name * n_add(name ** list, const char *data, cmap casemapping); // returns pointer to the added name. Calls n_cull() first
41 int n_cull(name ** list, const char *data, cmap casemapping); // returns number of instances culled
a886cb2 Moved name-list handling out to new files 'names.*'
Sound and Fury authored
42 void n_free(name * list);
a808728 Started /ignore handling
Sound and Fury authored
43
3be945d Refactoring from irc.c:ctcp() to new buffer.c:makeptab()
ec429 authored
44 int i_match(name * list, const char *nm, bool pm, cmap casemapping); // returns number of matches
45 int i_cull(name ** list, const char *nm); // returns number of instances culled
3fcb080 Enable many warnings & fix them
ec429 authored
46 void i_list(void);
Something went wrong with that request. Please try again.