diff options
author | Christian Grothoff <christian@grothoff.org> | 2018-04-10 13:02:28 +0200 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2018-04-10 13:02:51 +0200 |
commit | 0cd0e3a5287af73bb81219ebc9548395a8945ce8 (patch) | |
tree | b5bb24d78a4eed519b37e6fb8f9291a6282d06d4 /src/include | |
parent | 3eae3e43d6f94449cb89998a676e6696438cc604 (diff) | |
download | gnunet-0cd0e3a5287af73bb81219ebc9548395a8945ce8.tar.gz gnunet-0cd0e3a5287af73bb81219ebc9548395a8945ce8.zip |
more work on gnunet-zoneimport, some bugfix in flat namestore, misc. style fixes
Diffstat (limited to 'src/include')
-rw-r--r-- | src/include/gnunet_gnsrecord_plugin.h | 30 | ||||
-rw-r--r-- | src/include/gnunet_namestore_plugin.h | 55 | ||||
-rw-r--r-- | src/include/gnunet_program_lib.h | 4 |
3 files changed, 51 insertions, 38 deletions
diff --git a/src/include/gnunet_gnsrecord_plugin.h b/src/include/gnunet_gnsrecord_plugin.h index d212c3663..e3e1a98eb 100644 --- a/src/include/gnunet_gnsrecord_plugin.h +++ b/src/include/gnunet_gnsrecord_plugin.h | |||
@@ -53,10 +53,11 @@ extern "C" | |||
53 | * @param data_size number of bytes in @a data | 53 | * @param data_size number of bytes in @a data |
54 | * @return NULL on error, otherwise human-readable representation of the value | 54 | * @return NULL on error, otherwise human-readable representation of the value |
55 | */ | 55 | */ |
56 | typedef char * (*GNUNET_GNSRECORD_ValueToStringFunction) (void *cls, | 56 | typedef char * |
57 | uint32_t type, | 57 | (*GNUNET_GNSRECORD_ValueToStringFunction) (void *cls, |
58 | const void *data, | 58 | uint32_t type, |
59 | size_t data_size); | 59 | const void *data, |
60 | size_t data_size); | ||
60 | 61 | ||
61 | 62 | ||
62 | /** | 63 | /** |
@@ -71,11 +72,12 @@ typedef char * (*GNUNET_GNSRECORD_ValueToStringFunction) (void *cls, | |||
71 | * @param data_size set to number of bytes in @a data | 72 | * @param data_size set to number of bytes in @a data |
72 | * @return #GNUNET_OK on success | 73 | * @return #GNUNET_OK on success |
73 | */ | 74 | */ |
74 | typedef int (*GNUNET_GNSRECORD_StringToValueFunction) (void *cls, | 75 | typedef int |
75 | uint32_t type, | 76 | (*GNUNET_GNSRECORD_StringToValueFunction) (void *cls, |
76 | const char *s, | 77 | uint32_t type, |
77 | void **data, | 78 | const char *s, |
78 | size_t *data_size); | 79 | void **data, |
80 | size_t *data_size); | ||
79 | 81 | ||
80 | 82 | ||
81 | /** | 83 | /** |
@@ -86,8 +88,9 @@ typedef int (*GNUNET_GNSRECORD_StringToValueFunction) (void *cls, | |||
86 | * @param dns_typename name to convert | 88 | * @param dns_typename name to convert |
87 | * @return corresponding number, UINT32_MAX on error | 89 | * @return corresponding number, UINT32_MAX on error |
88 | */ | 90 | */ |
89 | typedef uint32_t (*GNUNET_GNSRECORD_TypenameToNumberFunction) (void *cls, | 91 | typedef uint32_t |
90 | const char *dns_typename); | 92 | (*GNUNET_GNSRECORD_TypenameToNumberFunction) (void *cls, |
93 | const char *dns_typename); | ||
91 | 94 | ||
92 | 95 | ||
93 | /** | 96 | /** |
@@ -98,8 +101,9 @@ typedef uint32_t (*GNUNET_GNSRECORD_TypenameToNumberFunction) (void *cls, | |||
98 | * @param type number of a type to convert | 101 | * @param type number of a type to convert |
99 | * @return corresponding typestring, NULL on error | 102 | * @return corresponding typestring, NULL on error |
100 | */ | 103 | */ |
101 | typedef const char * (*GNUNET_GNSRECORD_NumberToTypenameFunction) (void *cls, | 104 | typedef const char * |
102 | uint32_t type); | 105 | (*GNUNET_GNSRECORD_NumberToTypenameFunction) (void *cls, |
106 | uint32_t type); | ||
103 | 107 | ||
104 | 108 | ||
105 | /** | 109 | /** |
diff --git a/src/include/gnunet_namestore_plugin.h b/src/include/gnunet_namestore_plugin.h index 3ec0299ba..48965b3b6 100644 --- a/src/include/gnunet_namestore_plugin.h +++ b/src/include/gnunet_namestore_plugin.h | |||
@@ -52,11 +52,12 @@ extern "C" | |||
52 | * @param rd_count number of entries in @a rd array | 52 | * @param rd_count number of entries in @a rd array |
53 | * @param rd array of records with data to store | 53 | * @param rd array of records with data to store |
54 | */ | 54 | */ |
55 | typedef void (*GNUNET_NAMESTORE_RecordIterator) (void *cls, | 55 | typedef void |
56 | const struct GNUNET_CRYPTO_EcdsaPrivateKey *private_key, | 56 | (*GNUNET_NAMESTORE_RecordIterator) (void *cls, |
57 | const char *label, | 57 | const struct GNUNET_CRYPTO_EcdsaPrivateKey *private_key, |
58 | unsigned int rd_count, | 58 | const char *label, |
59 | const struct GNUNET_GNSRECORD_Data *rd); | 59 | unsigned int rd_count, |
60 | const struct GNUNET_GNSRECORD_Data *rd); | ||
60 | 61 | ||
61 | 62 | ||
62 | /** | 63 | /** |
@@ -81,12 +82,13 @@ struct GNUNET_NAMESTORE_PluginFunctions | |||
81 | * @param rd array of records with data to store | 82 | * @param rd array of records with data to store |
82 | * @return #GNUNET_OK on success, else #GNUNET_SYSERR | 83 | * @return #GNUNET_OK on success, else #GNUNET_SYSERR |
83 | */ | 84 | */ |
84 | int (*store_records) (void *cls, | 85 | int |
85 | const struct GNUNET_CRYPTO_EcdsaPrivateKey *zone, | 86 | (*store_records) (void *cls, |
86 | const char *label, | 87 | const struct GNUNET_CRYPTO_EcdsaPrivateKey *zone, |
87 | unsigned int rd_count, | 88 | const char *label, |
88 | const struct GNUNET_GNSRECORD_Data *rd); | 89 | unsigned int rd_count, |
89 | 90 | const struct GNUNET_GNSRECORD_Data *rd); | |
91 | |||
90 | /** | 92 | /** |
91 | * Lookup records in the datastore for which we are the authority. | 93 | * Lookup records in the datastore for which we are the authority. |
92 | * | 94 | * |
@@ -97,11 +99,12 @@ struct GNUNET_NAMESTORE_PluginFunctions | |||
97 | * @param iter_cls closure for @a iter | 99 | * @param iter_cls closure for @a iter |
98 | * @return #GNUNET_OK on success, else #GNUNET_SYSERR | 100 | * @return #GNUNET_OK on success, else #GNUNET_SYSERR |
99 | */ | 101 | */ |
100 | int (*lookup_records) (void *cls, | 102 | int |
101 | const struct GNUNET_CRYPTO_EcdsaPrivateKey *zone, | 103 | (*lookup_records) (void *cls, |
102 | const char *label, | 104 | const struct GNUNET_CRYPTO_EcdsaPrivateKey *zone, |
103 | GNUNET_NAMESTORE_RecordIterator iter, void *iter_cls); | 105 | const char *label, |
104 | 106 | GNUNET_NAMESTORE_RecordIterator iter, | |
107 | void *iter_cls); | ||
105 | 108 | ||
106 | 109 | ||
107 | /** | 110 | /** |
@@ -115,10 +118,12 @@ struct GNUNET_NAMESTORE_PluginFunctions | |||
115 | * @param iter_cls closure for @a iter | 118 | * @param iter_cls closure for @a iter |
116 | * @return #GNUNET_OK on success, #GNUNET_NO if there were no results, #GNUNET_SYSERR on error | 119 | * @return #GNUNET_OK on success, #GNUNET_NO if there were no results, #GNUNET_SYSERR on error |
117 | */ | 120 | */ |
118 | int (*iterate_records) (void *cls, | 121 | int |
119 | const struct GNUNET_CRYPTO_EcdsaPrivateKey *zone, | 122 | (*iterate_records) (void *cls, |
120 | uint64_t offset, | 123 | const struct GNUNET_CRYPTO_EcdsaPrivateKey *zone, |
121 | GNUNET_NAMESTORE_RecordIterator iter, void *iter_cls); | 124 | uint64_t offset, |
125 | GNUNET_NAMESTORE_RecordIterator iter, | ||
126 | void *iter_cls); | ||
122 | 127 | ||
123 | 128 | ||
124 | /** | 129 | /** |
@@ -132,10 +137,12 @@ struct GNUNET_NAMESTORE_PluginFunctions | |||
132 | * @param iter_cls closure for @a iter | 137 | * @param iter_cls closure for @a iter |
133 | * @return #GNUNET_OK on success, #GNUNET_NO if there were no results, #GNUNET_SYSERR on error | 138 | * @return #GNUNET_OK on success, #GNUNET_NO if there were no results, #GNUNET_SYSERR on error |
134 | */ | 139 | */ |
135 | int (*zone_to_name) (void *cls, | 140 | int |
136 | const struct GNUNET_CRYPTO_EcdsaPrivateKey *zone, | 141 | (*zone_to_name) (void *cls, |
137 | const struct GNUNET_CRYPTO_EcdsaPublicKey *value_zone, | 142 | const struct GNUNET_CRYPTO_EcdsaPrivateKey *zone, |
138 | GNUNET_NAMESTORE_RecordIterator iter, void *iter_cls); | 143 | const struct GNUNET_CRYPTO_EcdsaPublicKey *value_zone, |
144 | GNUNET_NAMESTORE_RecordIterator iter, | ||
145 | void *iter_cls); | ||
139 | 146 | ||
140 | 147 | ||
141 | }; | 148 | }; |
diff --git a/src/include/gnunet_program_lib.h b/src/include/gnunet_program_lib.h index 526760bdd..65be7ab3d 100644 --- a/src/include/gnunet_program_lib.h +++ b/src/include/gnunet_program_lib.h | |||
@@ -84,6 +84,7 @@ GNUNET_PROGRAM_run2 (int argc, | |||
84 | void *task_cls, | 84 | void *task_cls, |
85 | int run_without_scheduler); | 85 | int run_without_scheduler); |
86 | 86 | ||
87 | |||
87 | /** | 88 | /** |
88 | * Run a standard GNUnet command startup sequence (initialize loggers | 89 | * Run a standard GNUnet command startup sequence (initialize loggers |
89 | * and configuration, parse options). | 90 | * and configuration, parse options). |
@@ -103,7 +104,8 @@ GNUNET_PROGRAM_run (int argc, | |||
103 | const char *binaryName, | 104 | const char *binaryName, |
104 | const char *binaryHelp, | 105 | const char *binaryHelp, |
105 | const struct GNUNET_GETOPT_CommandLineOption *options, | 106 | const struct GNUNET_GETOPT_CommandLineOption *options, |
106 | GNUNET_PROGRAM_Main task, void *task_cls); | 107 | GNUNET_PROGRAM_Main task, |
108 | void *task_cls); | ||
107 | 109 | ||
108 | 110 | ||
109 | #if 0 /* keep Emacsens' auto-indent happy */ | 111 | #if 0 /* keep Emacsens' auto-indent happy */ |