1 /* Copyright (C) 2000, Luca Padovani <luca.padovani@cs.unibo.it>.
3 * This file is part of mlminidom, the Ocaml binding for minidom.
5 * mlminidom is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU General Public License
7 * as published by the Free Software Foundation; either version 2
8 * of the License, or (at your option) any later version.
10 * mlminidom is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
15 * You should have received a copy of the GNU General Public License
16 * along with mlminidom; if not, write to the Free Software
17 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
19 * For details, send a mail to the author.
25 #define Val_ptr(p) ((value) (p))
27 #define Val_option(p,f) ((p != NULL) ? ml_some(f(p)) : Val_unit)
28 #endif /* Val_option */
29 #define mDOMString_val(v) ((mDOMStringRef) String_val(v))
30 #define mDOMNode_val(v) ((mDOMNodeRef) v)
32 #define mDOMNode_option_mDOMNodeRef(p) (((p) != NULL) ? ml_some((value) (p)) : Val_unit)
33 #define mDOMNodeRef_mDOMNode_option(v) ((v == Val_unit) ? NULL : (mDOMNodeRef)Field((v),0))
34 #define Val_mDOMNodeRef(p) (mDOMNode_option_mDOMNodeRef(p))
35 #define mDOMNodeRef_val(v) (mDOMNodeRef_mDOMNode_option(v))
36 #define mDOMDocRef_val(r) (*((mDOMDocRef *)Data_custom_val(r)))
38 #endif /* ml_minidom_h */