1 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ 2 /* */ 3 /* File....: bound.h */ 4 /* Name....: Bound value */ 5 /* Author..: Thorsten Koch */ 6 /* Copyright by Author, All rights reserved */ 7 /* */ 8 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ 9 /* 10 * Copyright (C) 2001-2018 by Thorsten Koch <koch@zib.de> 11 * 12 * This program is free software; you can redistribute it and/or 13 * modify it under the terms of the GNU Lesser General Public License 14 * as published by the Free Software Foundation; either version 3 15 * of the License, or (at your option) any later version. 16 * 17 * This program is distributed in the hope that it will be useful, 18 * but WITHOUT ANY WARRANTY; without even the implied warranty of 19 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 20 * GNU Lesser General Public License for more details. 21 * 22 * You should have received a copy of the GNU Lesser General Public License 23 * along with this program; if not, write to the Free Software 24 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. 25 */ 26 #ifndef _BOUND_H_ 27 #define _BOUND_H_ 28 29 #ifndef _NUMB_H_ 30 #error "Need to include numb.h before bound.h" 31 #endif 32 33 #ifdef __cplusplus 34 extern "C" { 35 #endif 36 37 enum bound_type 38 { 39 BOUND_ERROR = 0, BOUND_VALUE, BOUND_INFTY, BOUND_MINUS_INFTY 40 }; 41 42 typedef enum bound_type BoundType; 43 typedef struct bound Bound; 44 45 /*lint -sem( bound_new, @P > malloc(1P)) */ 46 extern Bound* bound_new(BoundType type, const Numb* value); 47 /*lint -sem( bound_free, custodial(1), 1p == 1) */ 48 extern void bound_free(Bound* bound); 49 /*lint -sem( bound_is_valid, 1p == 1) */ 50 extern bool bound_is_valid(const Bound* bound); 51 /*lint -sem( bound_copy, 1p == 1, @P > malloc(1P)) */ 52 extern Bound* bound_copy(const Bound* source); 53 /*lint -sem( bound_get_type, 1p == 1) */ 54 extern BoundType bound_get_type(const Bound* bound); 55 /*lint -sem( bound_get_value, 1p == 1) */ 56 extern const Numb* bound_get_value(const Bound* bound); 57 /*lint -sem( bound_print, 1p == 1 && 2p == 1) */ 58 extern void bound_print(FILE* fp, const Bound* bound); 59 60 #ifdef __cplusplus 61 } 62 #endif 63 #endif /* _BOUND_H_ */ 64 65