00001 /* 00002 * Copyright (c) 2005-2008 Nominet UK (www.nic.uk) 00003 * All rights reserved. 00004 * Contributors: Ben Laurie, Rachel Willmer. The Contributors have asserted 00005 * their moral rights under the UK Copyright Design and Patents Act 1988 to 00006 * be recorded as the authors of this copyright work. 00007 * 00008 * Licensed under the Apache License, Version 2.0 (the "License"); you may not 00009 * use this file except in compliance with the License. 00010 * 00011 * You may obtain a copy of the License at 00012 * http://www.apache.org/licenses/LICENSE-2.0 00013 * 00014 * Unless required by applicable law or agreed to in writing, software 00015 * distributed under the License is distributed on an "AS IS" BASIS, 00016 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 00017 * 00018 * See the License for the specific language governing permissions and 00019 * limitations under the License. 00020 */ 00021 00022 #ifndef __OPS_CALLBACK_H__ 00023 #define __OPS_CALLBACK_H__ 00024 00025 #define CB(cbinfo,t,pc) do { (pc)->tag=(t); if(ops_parse_cb((pc),(cbinfo)) == OPS_RELEASE_MEMORY) ops_parser_content_free(pc); } while(0) 00026 /*#define CB(cbinfo,t,pc) do { (pc)->tag=(t); if((cbinfo)->cb(pc,(cbinfo)) == OPS_RELEASE_MEMORY) ops_parser_content_free(pc); } while(0)*/ 00027 //#define CB(cbinfo,t,pc) do { (pc)->tag=(t); if((cbinfo)->cb(pc,(cbinfo)) == OPS_RELEASE_MEMORY) ops_parser_content_free(pc); } while(0) 00028 00029 #define CBP(info,t,pc) CB(&(info)->cbinfo,t,pc) 00030 00031 #define ERR(cbinfo,err,code) do { content.content.error.error=err; content.tag=OPS_PARSER_ERROR; ops_parse_cb(&content,(cbinfo)); OPS_ERROR(errors,code,err); return -1; } while(0) 00032 /*#define ERR(err) do { content.content.error.error=err; content.tag=OPS_PARSER_ERROR; ops_parse_cb(&content,cbinfo); return -1; } while(0)*/ 00033 00034 #define ERRP(info,err) do { C.error.error=err; CBP(info,OPS_PARSER_ERROR,&content); return ops_false; } while(0) 00035 00036 00037 #endif /*__OPS_CALLBACK_H__*/
1.4.6