FrontISTR  5.7.1
Large-scale structural analysis program with finit element method
hecmw_map_int.h
Go to the documentation of this file.
1 /*****************************************************************************
2  * Copyright (c) 2019 FrontISTR Commons
3  * This software is released under the MIT License, see LICENSE.txt
4  *****************************************************************************/
5 
6 #ifndef HECMW_MAP_INT_INCLUDED
7 #define HECMW_MAP_INT_INCLUDED
8 
9 struct hecmw_bit_array;
10 
12  int key;
13  void *val;
14 };
15 
17  int key;
18  int local;
19 };
20 
21 struct hecmw_map_int {
22  size_t n_val;
23  size_t max_val;
24 
27 
28  int checked;
29  int sorted;
30 
32 
33  int in_iter;
34  size_t iter;
35 
36  void (*free_fnc)(void *);
37 };
38 
39 extern int HECMW_map_int_init(struct hecmw_map_int *map,
40  void (*free_fnc)(void *));
41 
42 extern void HECMW_map_int_finalize(struct hecmw_map_int *map);
43 
44 extern size_t HECMW_map_int_nval(const struct hecmw_map_int *map);
45 
46 extern int HECMW_map_int_add(struct hecmw_map_int *map, int key, void *value);
47 
48 extern size_t HECMW_map_int_check_dup(struct hecmw_map_int *map);
49 
50 extern int HECMW_map_int_key2local(const struct hecmw_map_int *map, int key,
51  size_t *local);
52 
53 extern void *HECMW_map_int_get(const struct hecmw_map_int *map, int key);
54 
55 extern void HECMW_map_int_iter_init(struct hecmw_map_int *map);
56 
57 extern int HECMW_map_int_iter_next(struct hecmw_map_int *map, int *key,
58  void **value);
59 
60 extern int HECMW_map_int_mark_init(struct hecmw_map_int *map);
61 
62 extern int HECMW_map_int_mark(struct hecmw_map_int *map, int key);
63 
64 extern int HECMW_map_int_iter_next_unmarked(struct hecmw_map_int *map, int *key,
65  void **value);
66 
67 extern int HECMW_map_int_del_unmarked(struct hecmw_map_int *map);
68 
69 #endif /* HECMW_MAP_INT_INCLUDED */
size_t HECMW_map_int_nval(const struct hecmw_map_int *map)
Definition: hecmw_map_int.c:65
int HECMW_map_int_add(struct hecmw_map_int *map, int key, void *value)
int HECMW_map_int_iter_next(struct hecmw_map_int *map, int *key, void **value)
int HECMW_map_int_mark_init(struct hecmw_map_int *map)
int HECMW_map_int_mark(struct hecmw_map_int *map, int key)
int HECMW_map_int_iter_next_unmarked(struct hecmw_map_int *map, int *key, void **value)
int HECMW_map_int_del_unmarked(struct hecmw_map_int *map)
void * HECMW_map_int_get(const struct hecmw_map_int *map, int key)
size_t HECMW_map_int_check_dup(struct hecmw_map_int *map)
void HECMW_map_int_iter_init(struct hecmw_map_int *map)
void HECMW_map_int_finalize(struct hecmw_map_int *map)
Definition: hecmw_map_int.c:40
int HECMW_map_int_key2local(const struct hecmw_map_int *map, int key, size_t *local)
int HECMW_map_int_init(struct hecmw_map_int *map, void(*free_fnc)(void *))
Definition: hecmw_map_int.c:18
struct hecmw_map_int_value * vals
Definition: hecmw_map_int.h:25
struct hecmw_bit_array * mark
Definition: hecmw_map_int.h:31
struct hecmw_map_int_pair * pairs
Definition: hecmw_map_int.h:26
void(* free_fnc)(void *)
Definition: hecmw_map_int.h:36