1/*************************************************** 2 * Header name: dict.h 3 * 4 * Copyright (C) 2015, Broadcom Corporation. All Rights Reserved. 5 * 6 * Permission to use, copy, modify, and/or distribute this software for any 7 * purpose with or without fee is hereby granted, provided that the above 8 * copyright notice and this permission notice appear in all copies. 9 * 10 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 11 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 12 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY 13 * SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 14 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION 15 * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN 16 * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 17 * 18 * First written on 03/08/2010 by Toni Homedes i Saun. 19 * 20 ***************************************************/ 21/** \file dict.h 22 * 23 * \ingroup dict 24 * 25 * \brief Header file for dict.c 26 * 27 * $Id: dict.h 298543 2011-11-24 01:30:47Z $ 28 **************************************************/ 29 30#ifndef _DICT_H_ 31#define _DICT_H_ 32 33/* FILE-CSTYLED */ 34 35/*************************************************** 36 * Public Defines Section 37 ***************************************************/ 38 39/*************************************************** 40 * Public Constants Section 41 ***************************************************/ 42 43/*************************************************** 44 * Public Typedefs Section 45 ***************************************************/ 46 47/*************************************************** 48 * Public Function Prototypes Section 49 ***************************************************/ 50typedef const struct dict_hdl_s { int foo; } *dict_hdl_t; 51typedef const struct dict_iterator_s { int foo; } *dict_iterator_t; 52 53dict_hdl_t DictNew(void); 54void DictFree(dict_hdl_t dict); 55void DictSet(dict_hdl_t dict, const char * const key, const char * const value); 56const char *DictGet(dict_hdl_t dict, const char * const key); 57void DictDelete(dict_hdl_t dict, const char * const key); 58int DictIsEmpty(dict_hdl_t dict); 59void DictDoEmpty(dict_hdl_t dict); 60void DictMap(dict_hdl_t dict, void (*fn)(const char *key, const char *value)); 61 62dict_iterator_t DictIteratorNew(dict_hdl_t dict); 63void DictIteratorFree(dict_iterator_t iterator); 64const char *DictIteratorKey(dict_iterator_t iterator); 65int DictIteratorAdvance(dict_iterator_t iterator); 66 67#else 68#error "Header file __FILE__ has already been included!" 69#endif 70