1 /* 2 * 3 * Copyright (c) 1994 4 * Hewlett-Packard Company 5 * 6 * Permission to use, copy, modify, distribute and sell this software 7 * and its documentation for any purpose is hereby granted without fee, 8 * provided that the above copyright notice appear in all copies and 9 * that both that copyright notice and this permission notice appear 10 * in supporting documentation. Hewlett-Packard Company makes no 11 * representations about the suitability of this software for any 12 * purpose. It is provided "as is" without express or implied warranty. 13 * 14 * 15 * Copyright (c) 1996 16 * Silicon Graphics Computer Systems, Inc. 17 * 18 * Permission to use, copy, modify, distribute and sell this software 19 * and its documentation for any purpose is hereby granted without fee, 20 * provided that the above copyright notice appear in all copies and 21 * that both that copyright notice and this permission notice appear 22 * in supporting documentation. Silicon Graphics makes no 23 * representations about the suitability of this software for any 24 * purpose. It is provided "as is" without express or implied warranty. 25 */ 26 27 /* 28 Copyright (c) 2007 Lao wen bo 29 30 This software is provided 'as-is', without any express or implied 31 warranty. In no event will the authors be held liable for any damages 32 arising from the use of this software. 33 34 Permission is granted to anyone to use this software for any purpose, 35 including commercial applications, and to alter it and redistribute it 36 freely, subject to the following restrictions: 37 38 1. The origin of this software must not be misrepresented; you must not 39 claim that you wrote the original software. If you use this software 40 in a product, an acknowledgment in the product documentation would be 41 appreciated but is not required. 42 43 2. Altered source versions must be plainly marked as such, and must not be 44 misrepresented as being the original software. 45 46 3. This notice may not be removed or altered from any source 47 distribution. 48 49 Lao wen bo 50 viewpl(at)gmail.com 51 */ 52 53 /* 54 NOTE: This is an internal header file, You should not attempt to use it directly. 55 */ 56 57 #ifndef _C_PAIR_H 58 #define _C_PAIR_H 59 60 #include "c_iterator.h" 61 #include "c_memory.h" 62 63 #define c_pair _c_pair 64 #define c_ppair _c_ppair 65 #define c_iter_bool_pair _c_iter_bool_pair 66 #define c_piter_bool_pair _c_piter_bool_pair 67 #define c_iter_iter_pair _c_iter_iter_pair 68 #define c_piter_iter_pair _c_piter_iter_pair 69 #define c_make_pair _c_make_pair 70 #define c_make_iter_bool_pair _c_make_iter_bool_pair 71 #define c_make_iter_iter_pair _c_make_iter_iter_pair 72 73 typedef value_type first_type; 74 typedef value_type second_type; 75 76 typedef struct c_pair c_pair, * c_ppair; 77 typedef int (*PAIR_COMPARER)(c_ppair, c_ppair); 78 79 struct c_pair 80 { 81 first_type first; 82 second_type second; 83 }; 84 85 86 typedef struct c_iter_bool_pair c_iter_bool_pair, c_piter_bool_pair; 87 88 struct c_iter_bool_pair 89 { 90 c_iterator first; 91 c_bool second; 92 }; 93 94 95 typedef struct c_iter_iter_pair c_iter_iter_pair, c_piter_iter_pair; 96 97 struct c_iter_iter_pair 98 { 99 c_iterator first; 100 c_iterator second; 101 }; 102 103 104 c_pair c_make_pair(const value_type x, const value_type y); 105 c_iter_bool_pair c_make_iter_bool_pair(c_iterator x, c_bool y); 106 c_iter_iter_pair c_make_iter_iter_pair(c_iterator x, c_iterator y); 107 108 109 110 111 #endif /* _C_PAIR_H */ 112 113 114 115 116 117