H5HLprivate2.h

00001 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
00002  * Copyright by The HDF Group.                                               *
00003  * Copyright by the Board of Trustees of the University of Illinois.         *
00004  * All rights reserved.                                                      *
00005  *                                                                           *
00006  * This file is part of HDF5.  The full HDF5 copyright notice, including     *
00007  * terms governing use, modification, and redistribution, is contained in    *
00008  * the files COPYING and Copyright.html.  COPYING can be found at the root   *
00009  * of the source code distribution tree; Copyright.html can be found at the  *
00010  * root level of an installed copy of the electronic HDF5 document set and   *
00011  * is linked from the top-level documents page.  It can also be found at     *
00012  * http://hdfgroup.org/HDF5/doc/Copyright.html.  If you do not have          *
00013  * access to either file, you may request a copy from help@hdfgroup.org.     *
00014  * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
00015 
00016 #ifndef _H5HLprivate2_H
00017 #define _H5HLprivate2_H
00018 
00019 /* Public HDF5 header */
00020 #include "hdf5.h"
00021 
00022 /* Public High-Level header */
00023 #include "hdf5_hl.h"
00024 
00025 /* The following is copied from src/H5private.h */
00026 
00027 /*
00028  * Status return values for the `herr_t' type.
00029  * Since some unix/c routines use 0 and -1 (or more precisely, non-negative
00030  * vs. negative) as their return code, and some assumption had been made in
00031  * the code about that, it is important to keep these constants the same
00032  * values.  When checking the success or failure of an integer-valued
00033  * function, remember to compare against zero and not one of these two
00034  * values.
00035  */
00036 #define SUCCEED         0
00037 #define FAIL            (-1)
00038 #define UFAIL           (unsigned)(-1)
00039 
00040 /* minimum of two, three, or four values */
00041 #undef MIN
00042 #define MIN(a,b)                (((a)<(b)) ? (a) : (b))
00043 #define MIN2(a,b)               MIN(a,b)
00044 #define MIN3(a,b,c)             MIN(a,MIN(b,c))
00045 #define MIN4(a,b,c,d)           MIN(MIN(a,b),MIN(c,d))
00046 
00047 /* maximum of two, three, or four values */
00048 #undef MAX
00049 #define MAX(a,b)                (((a)>(b)) ? (a) : (b))
00050 #define MAX2(a,b)               MAX(a,b)
00051 #define MAX3(a,b,c)             MAX(a,MAX(b,c))
00052 #define MAX4(a,b,c,d)           MAX(MAX(a,b),MAX(c,d))
00053 
00054 /*
00055  * HDF Boolean type.
00056  */
00057 #ifndef FALSE
00058 #   define FALSE 0
00059 #endif
00060 #ifndef TRUE
00061 #   define TRUE 1
00062 #endif
00063 
00064 #endif /* _H5HLprivate2_H */
00065