2 Copyright (C) 2006 by Jonas Kramer
3 Published under the terms of the GNU General Public License (GPL).
18 int banned(const char * artist
) {
22 unsigned int size
= 0;
27 if(!(fd
= fopen(rcpath("autoban"), "r")))
30 while(!feof(fd
) && !match
) {
32 if(!getln(& line
, & size
, fd
))
35 if(strlen(line
) > 1) {
36 if((ptr
= strrchr(line
, 10)) != NULL
)
38 match
= !strncasecmp(line
, artist
, strlen(line
));
49 int autoban(const char * artist
) {
51 const char * file
= rcpath("autoban");
56 if(!(fd
= fopen(file
, "a"))) {
57 printf("Sorry, %s could not be written.\n", file
);
61 fprintf(fd
, "%s\n", artist
);