parsing.c
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011 #include <string.h>
00012 #ifdef EBUG
00013 #include <stdio.h>
00014 #endif
00015 #include "libspopc.h"
00016
00017 int dotline(char* buf){
00018
00019 char* ptr;
00020
00021 if(!buf){
00022 #ifdef EBUG
00023 fprintf(stderr,"<dotline>\nempty buf ?\n");
00024 #endif
00025 return(0);
00026 }
00027 ptr=buf;
00028 while((ptr=strchr(ptr,'.'))){
00029 if(
00030 ((*(ptr - 1) == '\n') || (*(ptr - 1) == '\r'))
00031 &&
00032 ((*(ptr + 1) == '\n') || (*(ptr + 1) == '\0') ||
00033 (*(ptr + 1) == '\r'))
00034 ){
00035 return(1);
00036 }
00037 ptr++;
00038 }
00039 return(0);
00040 }
00041
00042 int pop3_error(char* string){
00043
00044 return(string?(!strncmp(string,"-ERR",(size_t)4)):1);
00045 }