1234567891011121314151617181920212223242526272829303132333435363738394041424344 |
- /* This file is part of nit.
- *
- * Nit is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * Nit 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
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with nit. If not, see <http://www.gnu.org/licenses/>.
- */
- #ifndef MAP_H
- #define MAP_H
- #include "set.h"
- #define map_foreach(...) set_foreach(__VA_ARGS__)
- typedef Set Map;
- #define map_init(...) set_init(__VA_ARGS__)
- void
- map_dispose(Map *map);
- Nit_error
- map_add(Map *map, uint32_t key_len, const void *key, void *val);
- Nit_error
- map_remove(Map *map, uint32_t key_len, const void *key, void **val);
- int
- map_get(const Map *map, uint32_t key_len, const void *key, void **val);
- void *
- map_val(void *dat, uint32_t key_len);
- #endif
|