pelib  2.0.0
include/pelib/pair.h
Go to the documentation of this file.
00001 /*
00002  * pair.h
00003  *
00004  *  Created on: 5 Sep 2011
00005  *  Copyright 2011 Nicolas Melot
00006  *
00007  * This file is part of pelib.
00008  * 
00009  *     pelib is free software: you can redistribute it and/or modify
00010  *     it under the terms of the GNU General Public License as published by
00011  *     the Free Software Foundation, either version 3 of the License, or
00012  *     (at your option) any later version.
00013  * 
00014  *     pelib is distributed in the hope that it will be useful,
00015  *     but WITHOUT ANY WARRANTY; without even the implied warranty of
00016  *     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00017  *     GNU General Public License for more details.
00018  * 
00019  *     You should have received a copy of the GNU General Public License
00020  *     along with pelib. If not, see <http://www.gnu.org/licenses/>.
00021  * 
00022  */
00023 
00024 #include <pelib/template.h>
00025 #if PELIB_CONCAT_4(DONE_pair_, PAIR_KEY_T, _, PAIR_VALUE_T) == 0
00026 
00027 #define pair(key, value) PELIB_CONCAT_4(pair_, key, _, value)
00028 #define pair_t(key, value) PELIB_CONCAT_2(pair(key, value), _t)
00029 
00031 struct pair(PAIR_KEY_T, PAIR_VALUE_T)
00032 {
00033         PAIR_KEY_T key;
00034         PAIR_VALUE_T value;
00035 };
00036 typedef struct pair(PAIR_KEY_T, PAIR_VALUE_T) pair_t(PAIR_KEY_T, PAIR_VALUE_T);
00037 
00038 #define STRUCT_T pair_t(PAIR_KEY_T, PAIR_VALUE_T)
00039 #include <pelib/structure.h>
00040 
00041 #endif /* PAIR_H_ */
00042 
00043 // Make sure the symbol does not propagate any further
00044 #undef PAIR_KEY_T
00045 #undef PAIR_VALUE_T