view src/subscriberfuncs.c @ 1:762570b02394

*** empty log message ***
author mmj
date Thu, 22 Apr 2004 05:08:53 +1000
parents 21ce01de8109
children 035484b0da60
line wrap: on
line source

/* Copyright (C) 2003 Mads Martin Joergensen <mmj at mmj.dk>
 *
 * $Id$
 *
 * This file is redistributable under version 2 of the GNU General
 * Public License as described at http://www.gnu.org/licenses/gpl.txt
 */

#include <stdio.h>
#include <string.h>
#include <ctype.h>

#include "mlmmj.h"
#include "subscriberfuncs.h"
#include "readln.h"

int find_subscriber(int subfilefd, const char *address)
{
	char buf[READ_BUFSIZE];

	while (readln(subfilefd, buf, sizeof(buf))) {
		while (buf[0] && isspace(buf[strlen(buf)-1]))
			buf[strlen(buf)-1] = '\0';
		if (strcasecmp(buf, address) == 0)
			return 0;
	}
	return 1;
}