map.h 1.38 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34
/* 
 * Copyright (c) 2012 Christoph Mueller <ruunhb@googlemail.com>
 * 
 * Crystal is free software: you can redistribute it and/or modify
 * it under the terms of the Lesser GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * Crystal is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * Lesser GNU General Public License for more details.
 *
 * You should have received a copy of the Lesser GNU General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 *
 */

#ifndef CRYSTAL_STRUCTURES_MAP_H
#define CRYSTAL_STRUCTURES_MAP_H


#include "structures.h"

struct CryMap;


struct CryMap*  cry_map_new(cry_ordering_funptr compare);
void            cry_map_free(struct CryMap* map, cry_free_funptr key_free, cry_free_funptr value_free);

size_t          cry_map_size(struct CryMap* map);

pointer         cry_map_lookup(struct CryMap* map, const_pointer key);
return_code     cry_map_insert(struct CryMap* map, const_pointer key, pointer value);
35
pointer         cry_map_remove(struct CryMap* map, const_pointer key, cry_free_funptr key_free);
36 37 38 39 40 41


void            cry_map_dump_debug(struct CryMap* map);


#endif // CRYSTAL_STRUCTURES_MAP_H