aboutsummaryrefslogtreecommitdiff
path: root/src/gnsrecord/gnsrecord_misc.c
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2013-10-16 20:21:27 +0000
committerChristian Grothoff <christian@grothoff.org>2013-10-16 20:21:27 +0000
commitaccfd6bd85274da2f19e7230c8da6b273cfb2ece (patch)
tree60966194963795ff07b4da94f4efb6c46d6a23cf /src/gnsrecord/gnsrecord_misc.c
parent3d670727232e79b7e49a1df7ba9260db4e5798a0 (diff)
downloadgnunet-accfd6bd85274da2f19e7230c8da6b273cfb2ece.tar.gz
gnunet-accfd6bd85274da2f19e7230c8da6b273cfb2ece.zip
-another renaming fest for GNUNET_NAMESTORE_ to GNUNET_GNSRECORD_ symbols that were moved
Diffstat (limited to 'src/gnsrecord/gnsrecord_misc.c')
-rw-r--r--src/gnsrecord/gnsrecord_misc.c32
1 files changed, 16 insertions, 16 deletions
diff --git a/src/gnsrecord/gnsrecord_misc.c b/src/gnsrecord/gnsrecord_misc.c
index 7d73af376..aee1f9fd2 100644
--- a/src/gnsrecord/gnsrecord_misc.c
+++ b/src/gnsrecord/gnsrecord_misc.c
@@ -43,7 +43,7 @@
43 * @return converted result 43 * @return converted result
44 */ 44 */
45char * 45char *
46GNUNET_NAMESTORE_normalize_string (const char *src) 46GNUNET_GNSRECORD_string_to_lowercase (const char *src)
47{ 47{
48 GNUNET_assert (NULL != src); 48 GNUNET_assert (NULL != src);
49 char *res = strdup (src); 49 char *res = strdup (src);
@@ -59,10 +59,10 @@ GNUNET_NAMESTORE_normalize_string (const char *src)
59 * NOT reentrant! 59 * NOT reentrant!
60 * 60 *
61 * @param z the zone key 61 * @param z the zone key
62 * @return string form; will be overwritten by next call to #GNUNET_NAMESTORE_z2s 62 * @return string form; will be overwritten by next call to #GNUNET_GNSRECORD_z2s
63 */ 63 */
64const char * 64const char *
65GNUNET_NAMESTORE_z2s (const struct GNUNET_CRYPTO_EcdsaPublicKey *z) 65GNUNET_GNSRECORD_z2s (const struct GNUNET_CRYPTO_EcdsaPublicKey *z)
66{ 66{
67 static char buf[sizeof (struct GNUNET_CRYPTO_EcdsaPublicKey) * 8]; 67 static char buf[sizeof (struct GNUNET_CRYPTO_EcdsaPublicKey) * 8];
68 char *end; 68 char *end;
@@ -90,8 +90,8 @@ GNUNET_NAMESTORE_z2s (const struct GNUNET_CRYPTO_EcdsaPublicKey *z)
90 * @return #GNUNET_YES if the records are equal or #GNUNET_NO if they are not 90 * @return #GNUNET_YES if the records are equal or #GNUNET_NO if they are not
91 */ 91 */
92int 92int
93GNUNET_NAMESTORE_records_cmp (const struct GNUNET_NAMESTORE_RecordData *a, 93GNUNET_GNSRECORD_records_cmp (const struct GNUNET_GNSRECORD_Data *a,
94 const struct GNUNET_NAMESTORE_RecordData *b) 94 const struct GNUNET_GNSRECORD_Data *b)
95{ 95{
96 LOG (GNUNET_ERROR_TYPE_DEBUG, 96 LOG (GNUNET_ERROR_TYPE_DEBUG,
97 "Comparing records\n"); 97 "Comparing records\n");
@@ -110,13 +110,13 @@ GNUNET_NAMESTORE_records_cmp (const struct GNUNET_NAMESTORE_RecordData *a,
110 b->expiration_time); 110 b->expiration_time);
111 return GNUNET_NO; 111 return GNUNET_NO;
112 } 112 }
113 if ((a->flags & GNUNET_NAMESTORE_RF_RCMP_FLAGS) 113 if ((a->flags & GNUNET_GNSRECORD_RF_RCMP_FLAGS)
114 != (b->flags & GNUNET_NAMESTORE_RF_RCMP_FLAGS)) 114 != (b->flags & GNUNET_GNSRECORD_RF_RCMP_FLAGS))
115 { 115 {
116 LOG (GNUNET_ERROR_TYPE_DEBUG, 116 LOG (GNUNET_ERROR_TYPE_DEBUG,
117 "Flags %lu (%lu) != %lu (%lu)\n", a->flags, 117 "Flags %lu (%lu) != %lu (%lu)\n", a->flags,
118 a->flags & GNUNET_NAMESTORE_RF_RCMP_FLAGS, b->flags, 118 a->flags & GNUNET_GNSRECORD_RF_RCMP_FLAGS, b->flags,
119 b->flags & GNUNET_NAMESTORE_RF_RCMP_FLAGS); 119 b->flags & GNUNET_GNSRECORD_RF_RCMP_FLAGS);
120 return GNUNET_NO; 120 return GNUNET_NO;
121 } 121 }
122 if (a->data_size != b->data_size) 122 if (a->data_size != b->data_size)
@@ -149,8 +149,8 @@ GNUNET_NAMESTORE_records_cmp (const struct GNUNET_NAMESTORE_RecordData *a,
149 * @return absolute expiration time 149 * @return absolute expiration time
150 */ 150 */
151struct GNUNET_TIME_Absolute 151struct GNUNET_TIME_Absolute
152GNUNET_NAMESTORE_record_get_expiration_time (unsigned int rd_count, 152GNUNET_GNSRECORD_record_get_expiration_time (unsigned int rd_count,
153 const struct GNUNET_NAMESTORE_RecordData *rd) 153 const struct GNUNET_GNSRECORD_Data *rd)
154{ 154{
155 unsigned int c; 155 unsigned int c;
156 struct GNUNET_TIME_Absolute expire; 156 struct GNUNET_TIME_Absolute expire;
@@ -162,7 +162,7 @@ GNUNET_NAMESTORE_record_get_expiration_time (unsigned int rd_count,
162 expire = GNUNET_TIME_UNIT_FOREVER_ABS; 162 expire = GNUNET_TIME_UNIT_FOREVER_ABS;
163 for (c = 0; c < rd_count; c++) 163 for (c = 0; c < rd_count; c++)
164 { 164 {
165 if (0 != (rd[c].flags & GNUNET_NAMESTORE_RF_RELATIVE_EXPIRATION)) 165 if (0 != (rd[c].flags & GNUNET_GNSRECORD_RF_RELATIVE_EXPIRATION))
166 { 166 {
167 rt.rel_value_us = rd[c].expiration_time; 167 rt.rel_value_us = rd[c].expiration_time;
168 at = GNUNET_TIME_relative_to_absolute (rt); 168 at = GNUNET_TIME_relative_to_absolute (rt);
@@ -188,11 +188,11 @@ GNUNET_NAMESTORE_record_get_expiration_time (unsigned int rd_count,
188 * #GNUNET_NO if not 188 * #GNUNET_NO if not
189 */ 189 */
190int 190int
191GNUNET_NAMESTORE_is_expired (const struct GNUNET_NAMESTORE_RecordData *rd) 191GNUNET_GNSRECORD_is_expired (const struct GNUNET_GNSRECORD_Data *rd)
192{ 192{
193 struct GNUNET_TIME_Absolute at; 193 struct GNUNET_TIME_Absolute at;
194 194
195 if (0 != (rd->flags & GNUNET_NAMESTORE_RF_RELATIVE_EXPIRATION)) 195 if (0 != (rd->flags & GNUNET_GNSRECORD_RF_RELATIVE_EXPIRATION))
196 return GNUNET_NO; 196 return GNUNET_NO;
197 at.abs_value_us = rd->expiration_time; 197 at.abs_value_us = rd->expiration_time;
198 return (0 == GNUNET_TIME_absolute_get_remaining (at).rel_value_us) ? GNUNET_YES : GNUNET_NO; 198 return (0 == GNUNET_TIME_absolute_get_remaining (at).rel_value_us) ? GNUNET_YES : GNUNET_NO;
@@ -210,7 +210,7 @@ GNUNET_NAMESTORE_is_expired (const struct GNUNET_NAMESTORE_RecordData *rd)
210 * key in an encoding suitable for DNS labels. 210 * key in an encoding suitable for DNS labels.
211 */ 211 */
212const char * 212const char *
213GNUNET_NAMESTORE_pkey_to_zkey (const struct GNUNET_CRYPTO_EcdsaPublicKey *pkey) 213GNUNET_GNSRECORD_pkey_to_zkey (const struct GNUNET_CRYPTO_EcdsaPublicKey *pkey)
214{ 214{
215 static char ret[128]; 215 static char ret[128];
216 char *pkeys; 216 char *pkeys;
@@ -235,7 +235,7 @@ GNUNET_NAMESTORE_pkey_to_zkey (const struct GNUNET_CRYPTO_EcdsaPublicKey *pkey)
235 * @return #GNUNET_SYSERR if @a zkey has the wrong syntax 235 * @return #GNUNET_SYSERR if @a zkey has the wrong syntax
236 */ 236 */
237int 237int
238GNUNET_NAMESTORE_zkey_to_pkey (const char *zkey, 238GNUNET_GNSRECORD_zkey_to_pkey (const char *zkey,
239 struct GNUNET_CRYPTO_EcdsaPublicKey *pkey) 239 struct GNUNET_CRYPTO_EcdsaPublicKey *pkey)
240{ 240{
241 char *cpy; 241 char *cpy;