1 /* 2 * Copyright (C) Internet Systems Consortium, Inc. ("ISC") 3 * 4 * This Source Code Form is subject to the terms of the Mozilla Public 5 * License, v. 2.0. If a copy of the MPL was not distributed with this 6 * file, you can obtain one at https://mozilla.org/MPL/2.0/. 7 * 8 * See the COPYRIGHT file distributed with this work for additional 9 * information regarding copyright ownership. 10 */ 11 12 #ifndef ISC_SERIAL_H 13 #define ISC_SERIAL_H 1 14 15 #include <inttypes.h> 16 #include <stdbool.h> 17 18 #include <isc/lang.h> 19 #include <isc/types.h> 20 21 /*! \file isc/serial.h 22 * \brief Implement 32 bit serial space arithmetic comparison functions. 23 * Note: Undefined results are returned as false. 24 */ 25 26 /*** 27 *** Functions 28 ***/ 29 30 ISC_LANG_BEGINDECLS 31 32 bool 33 isc_serial_lt(uint32_t a, uint32_t b); 34 /*%< 35 * Return true if 'a' < 'b' otherwise false. 36 */ 37 38 bool 39 isc_serial_gt(uint32_t a, uint32_t b); 40 /*%< 41 * Return true if 'a' > 'b' otherwise false. 42 */ 43 44 bool 45 isc_serial_le(uint32_t a, uint32_t b); 46 /*%< 47 * Return true if 'a' <= 'b' otherwise false. 48 */ 49 50 bool 51 isc_serial_ge(uint32_t a, uint32_t b); 52 /*%< 53 * Return true if 'a' >= 'b' otherwise false. 54 */ 55 56 bool 57 isc_serial_eq(uint32_t a, uint32_t b); 58 /*%< 59 * Return true if 'a' == 'b' otherwise false. 60 */ 61 62 bool 63 isc_serial_ne(uint32_t a, uint32_t b); 64 /*%< 65 * Return true if 'a' != 'b' otherwise false. 66 */ 67 68 ISC_LANG_ENDDECLS 69 70 #endif /* ISC_SERIAL_H */ 71