summaryrefslogtreecommitdiffabout
path: root/include
authorSergey Poznyakoff <gray@gnu.org.ua>2016-01-22 10:58:16 (GMT)
committer Sergey Poznyakoff <gray@gnu.org.ua>2016-07-04 12:43:12 (GMT)
commit1705e5d927dba731c135e1192bfdee421829786a (patch) (unidiff)
tree4f51b9209198208cfbe2f3b6fc7b68561ba73bde /include
parent8e541ddaffcab6eaa36faf86304b51a0bc6a92a1 (diff)
downloadgrecs-1705e5d927dba731c135e1192bfdee421829786a.tar.gz
grecs-1705e5d927dba731c135e1192bfdee421829786a.tar.bz2
Unify some typedefs.
Use _ptr_t suffix for typedefs that define pointers.
Diffstat (limited to 'include') (more/less context) (ignore whitespace changes)
-rw-r--r--include/grecs/list.h31
-rw-r--r--include/grecs/node.h2
-rw-r--r--include/grecs/symtab.h21
-rw-r--r--include/grecs/value.h2
4 files changed, 28 insertions, 28 deletions
diff --git a/include/grecs/list.h b/include/grecs/list.h
index efccd56..a5840db 100644
--- a/include/grecs/list.h
+++ b/include/grecs/list.h
@@ -17,8 +17,8 @@
17#ifndef _GRECS_LIST_H 17#ifndef _GRECS_LIST_H
18#define _GRECS_LIST_H 18#define _GRECS_LIST_H
19 19
20typedef struct grecs_list_entry *grecs_list_entry_t; 20typedef struct grecs_list_entry *grecs_list_entry_ptr_t;
21typedef struct grecs_list *grecs_list_t; 21typedef struct grecs_list *grecs_list_ptr_t;
22 22
23struct grecs_list_entry { 23struct grecs_list_entry {
24 struct grecs_list_entry *next, *prev; 24 struct grecs_list_entry *next, *prev;
@@ -32,24 +32,23 @@ struct grecs_list {
32 void (*free_entry)(void *); 32 void (*free_entry)(void *);
33}; 33};
34 34
35grecs_list_t grecs_list_create(void); 35grecs_list_ptr_t grecs_list_create(void);
36size_t grecs_list_size(grecs_list_t); 36size_t grecs_list_size(grecs_list_ptr_t);
37void grecs_list_append(grecs_list_t, void *); 37void grecs_list_append(grecs_list_ptr_t, void *);
38void grecs_list_push(grecs_list_t, void *); 38void grecs_list_push(grecs_list_ptr_t, void *);
39void *grecs_list_pop(grecs_list_t); 39void *grecs_list_pop(grecs_list_ptr_t);
40void *grecs_list_locate(grecs_list_t, void *); 40void *grecs_list_locate(grecs_list_ptr_t, void *);
41void *grecs_list_index(grecs_list_t, size_t); 41void *grecs_list_index(grecs_list_ptr_t, size_t);
42void *grecs_list_remove_tail(grecs_list_t); 42void *grecs_list_remove_tail(grecs_list_ptr_t);
43void grecs_list_remove_entry(grecs_list_t, grecs_list_entry_t); 43void grecs_list_remove_entry(grecs_list_ptr_t, grecs_list_entry_ptr_t);
44void grecs_list_clear(grecs_list_t); 44void grecs_list_clear(grecs_list_ptr_t);
45void grecs_list_free(grecs_list_t); 45void grecs_list_free(grecs_list_ptr_t);
46void grecs_list_add(grecs_list_t, grecs_list_t); 46void grecs_list_add(grecs_list_ptr_t, grecs_list_ptr_t);
47int grecs_list_compare(grecs_list_ptr_t, grecs_list_ptr_t);
47 48
48/* FIXME */ 49/* FIXME */
49struct grecs_list *_grecs_simple_list_create(int dispose); 50struct grecs_list *_grecs_simple_list_create(int dispose);
50struct grecs_list *grecs_value_list_create(void); 51struct grecs_list *grecs_value_list_create(void);
51 52
52 53
53
54
55#endif 54#endif
diff --git a/include/grecs/node.h b/include/grecs/node.h
index 5bbe9dc..2d879ad 100644
--- a/include/grecs/node.h
+++ b/include/grecs/node.h
@@ -38,7 +38,7 @@ typedef struct grecs_node {
38 grecs_locus_t idloc; 38 grecs_locus_t idloc;
39 union { 39 union {
40 grecs_value_t *value; 40 grecs_value_t *value;
41 grecs_symtab_t texttab; 41 grecs_symtab_ptr_t texttab;
42 } v; 42 } v;
43} grecs_node_t; 43} grecs_node_t;
44 44
diff --git a/include/grecs/symtab.h b/include/grecs/symtab.h
index a4a7106..3008b17 100644
--- a/include/grecs/symtab.h
+++ b/include/grecs/symtab.h
@@ -17,7 +17,8 @@
17#ifndef _GRECS_SYMTAB_H 17#ifndef _GRECS_SYMTAB_H
18#define _GRECS_SYMTAB_H 18#define _GRECS_SYMTAB_H
19 19
20typedef struct grecs_symtab *grecs_symtab_t; 20typedef struct grecs_symtab *grecs_symtab_ptr_t;
21typedef struct grecs_syment *grecs_syment_ptr_t;
21 22
22struct grecs_syment { 23struct grecs_syment {
23 char *name; 24 char *name;
@@ -27,24 +28,24 @@ typedef int (*grecs_symtab_enumerator_t)(void *sym, void *data);
27 28
28const char *grecs_symtab_strerror(int rc); 29const char *grecs_symtab_strerror(int rc);
29 30
30void *grecs_symtab_lookup_or_install(grecs_symtab_t st, 31void *grecs_symtab_lookup_or_install(grecs_symtab_ptr_t st,
31 void *key, int *install); 32 void *key, int *install);
32void grecs_symtab_clear(grecs_symtab_t st); 33void grecs_symtab_clear(grecs_symtab_ptr_t st);
33grecs_symtab_t grecs_symtab_create(size_t elsize, 34grecs_symtab_ptr_t grecs_symtab_create(size_t elsize,
34 unsigned (*hash_fun)(void *, unsigned long), 35 unsigned (*hash_fun)(void *, unsigned long),
35 int (*cmp_fun)(const void *, const void *), 36 int (*cmp_fun)(const void *, const void *),
36 int (*copy_fun)(void *, void *), 37 int (*copy_fun)(void *, void *),
37 void *(*alloc_fun)(size_t), 38 void *(*alloc_fun)(size_t),
38 void (*free_fun)(void *)); 39 void (*free_fun)(void *));
39grecs_symtab_t grecs_symtab_create_default(size_t elsize); 40grecs_symtab_ptr_t grecs_symtab_create_default(size_t elsize);
40 41
41void grecs_symtab_free(grecs_symtab_t pst); 42void grecs_symtab_free(grecs_symtab_ptr_t pst);
42int grecs_symtab_remove(grecs_symtab_t st, void *elt); 43int grecs_symtab_remove(grecs_symtab_ptr_t st, void *elt);
43int grecs_symtab_replace(grecs_symtab_t st, void *ent, void **old_ent); 44int grecs_symtab_replace(grecs_symtab_ptr_t st, void *ent, void **old_ent);
44int grecs_symtab_enumerate(grecs_symtab_t st, 45int grecs_symtab_enumerate(grecs_symtab_ptr_t st,
45 grecs_symtab_enumerator_t fun, void *data); 46 grecs_symtab_enumerator_t fun, void *data);
46 47
47size_t grecs_symtab_count_entries(grecs_symtab_t st); 48size_t grecs_symtab_count_entries(grecs_symtab_ptr_t st);
48 49
49unsigned grecs_hash_string(const char *name, unsigned long hashsize); 50unsigned grecs_hash_string(const char *name, unsigned long hashsize);
50unsigned grecs_hash_string_ci(const char *name, unsigned long hashsize); 51unsigned grecs_hash_string_ci(const char *name, unsigned long hashsize);
diff --git a/include/grecs/value.h b/include/grecs/value.h
index 73f979c..8cd2800 100644
--- a/include/grecs/value.h
+++ b/include/grecs/value.h
@@ -28,7 +28,7 @@ typedef struct grecs_value {
28 int type; 28 int type;
29 grecs_locus_t locus; 29 grecs_locus_t locus;
30 union { 30 union {
31 grecs_list_t list; 31 grecs_list_ptr_t list;
32 char *string; 32 char *string;
33 struct { 33 struct {
34 size_t c; 34 size_t c;

Return to:

Send suggestions and report system problems to the System administrator.