00001 /* 00002 * This work (Common Community Physics Package), identified by NOAA, NCAR, 00003 * CU/CIRES, is free of known copyright restrictions and is placed in the 00004 * public domain. 00005 * 00006 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 00007 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 00008 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 00009 * THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 00010 * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 00011 * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 00012 */ 00013 00023 #ifndef CCPP_FIELD_IDX_H 00024 #define CCPP_FIELD_IDX_H 00025 00026 #ifdef __cplusplus 00027 extern "C" 00028 { 00029 #endif 00030 00031 00032 #define CCPP_FIELD_IDX_MAX 75 00033 #define CCPP_FIELD_IDX_GROW 1.75 00034 00035 00036 struct ccpp_field { 00037 int n; 00038 char *name; 00039 }; 00040 00041 struct ccpp_field_idx { 00042 int sorted; 00043 int n; 00044 int max; 00045 struct ccpp_field **fields; 00046 }; 00047 00048 00050 int ccpp_field_idx_init(void **); 00051 00052 00054 int ccpp_field_idx_fini(void **); 00055 00057 int ccpp_field_idx_add(const char *, void **); 00058 00060 int ccpp_field_idx_find(const char *, void **); 00061 00063 int ccpp_field_idx_sort(void **); 00064 00066 int ccpp_field_idx_grow(void **); 00067 00069 int ccpp_field_idx_max(void **); 00070 00071 00072 #ifdef __cplusplus 00073 } /* extern "C" */ 00074 #endif 00075 00076 #endif /* CCPP_FIELD_IDX_H */ 00077 00078