Skip to content
This repository
Fetching contributors…

Octocat-spinner-32-eaf2f5

Cannot retrieve contributors at this time

file 36 lines (28 sloc) 1.007 kb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35
#pragma once

/*
quIRC - simple terminal-based IRC client
Copyright (C) 2010 Edward Cree

See quirc.c for license information
names: handling for name lists
*/

#include <stdio.h>
#include <stdlib.h>
#include <stdbool.h>
#include <string.h>
#include <sys/types.h>
#include <regex.h>

typedef struct _name
{
bool icase; // only used for ignore lists; true = case-insensitive
bool pms; // only used for ignore lists; true = affect private messages
char *data; // is a unique pointer (eg. from strdup()), and must be free()d
struct _name *next, *prev;
}
name;

#include "buffer.h"

name * n_add(name ** list, char *data); // returns pointer to the added name (which should also be the new value of *list). Calls n_cull() first
int n_cull(name ** list, char *data); // returns number of instances culled
void n_free(name * list);

int i_match(name * list, char *nm, bool pm); // returns number of matches
int i_cull(name ** list, char *nm); // returns number of instances culled
void i_list(int b);
Something went wrong with that request. Please try again.