/ * *调试功能 *使用va_args表示args数量 * *用法addlog(number_of_arguments,arg1,arg2,arg3,arg4 ...) * / void addlog(int num_args,...){ va_list ap; 如果(LOGFILE == NULL)返回; va_start(ap,num_args); while(num_args--)fprintf(LOGFILE," %s",va_arg(ap,char *)); va_end(ap); fprintf(LOGFILE," \ n"); 返回; } SPF_result_t spfcheck_s(SPF_request_t * ecm_spf_request,char * ip, char * helo,char * sender ){ SPF_response_t * spf_response = NULL; SPF_result_t t; SPF_request_set_ipv4_str(ecm_spf_request,ip); SPF_request_set_helo_dom(ecm_spf_request,helo); SPF_request_set_env_from(ecm_spf_request,sender); SPF_request_query_mailfrom(ecm_spf_request,& spf_response); t = SPF_response_result( spf_response); SPF_response_free(spf_response); 返回t; }The file is here----#include "mdef.h"FILE* LOGFILE;/** Opens file ( /var/log/milter.log ) for debug log* any milter code can print to log file using addlog function*/void opendbglog(void){LOGFILE=NULL;LOGFILE=fopen(LOGFILENAME,"a");if(LOGFILE==NULL){fprintf(stderr,"Couldnot open logfile\n");exit(1);}fprintf(LOGFILE,"opened logfile\n");setvbuf(LOGFILE, (char *)NULL, _IONBF, 0);}/** Debug function* using va_args for number of args** usage addlog(number_of_arguments,arg1,arg2,arg3,arg4...)*/void addlog(int num_args, ... ) {va_list ap;if(LOGFILE == NULL ) return;va_start(ap,num_args);while(num_args--) fprintf(LOGFILE," %s ", va_arg(ap,char*));va_end(ap);fprintf(LOGFILE,"\n");return;}SPF_result_t spfcheck_s(SPF_request_t *ecm_spf_request, char* ip,char* helo, char* sender) {SPF_response_t*spf_response = NULL;SPF_result_t t;SPF_request_set_ipv4_str( ecm_spf_request, ip );SPF_request_set_helo_dom( ecm_spf_request, helo );SPF_request_set_env_from( ecm_spf_request, sender );SPF_request_query_mailfrom(ecm_spf_request, &spf_response);t = SPF_response_result(spf_response);SPF_response_free(spf_response);return t;} 文件在这里 ----The file is here---- * snip * 我加载到一个语法hilited编辑器中,并没有看到明显的语法错误 - 尽管快速扫描我无法手动看到任何内容,我猜猜在mdef.h中可能会有麻烦吗?我假设你包括< stdio.hamongst 其他东西。没有它,一个人真的不能告诉。 尝试注释掉块然后恢复它们以查明 错误。*snip*I loaded into a syntax hilited editor and saw no obvious syntax errors -I cant see anything manually despite a quick scan, I guess there mightbe troubles in mdef.h where I assume you are including <stdio.hamongstother things. Without it one cant really tell.Try commenting blocks out and then reinstating them to pinpoint theerror. 这篇关于错误:预期')'在'*'之前'令牌 - 这是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持! 上岸,阿里云!
07-12 15:18