diff options
author | Christian Grothoff <christian@grothoff.org> | 2015-10-08 11:30:19 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2015-10-08 11:30:19 +0000 |
commit | ae53a8d1d043cbd5967fb01316a32685c7a8af9b (patch) | |
tree | a8d791aed993ac8691f68ee6152a6ffb14a88ee3 /src/set/gnunet-service-set_union_strata_estimator.h | |
parent | e105a542a8ddb22184712bfe565aa734f1d0349d (diff) | |
download | gnunet-ae53a8d1d043cbd5967fb01316a32685c7a8af9b.tar.gz gnunet-ae53a8d1d043cbd5967fb01316a32685c7a8af9b.zip |
add logic for strata compression
Diffstat (limited to 'src/set/gnunet-service-set_union_strata_estimator.h')
-rw-r--r-- | src/set/gnunet-service-set_union_strata_estimator.h | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/src/set/gnunet-service-set_union_strata_estimator.h b/src/set/gnunet-service-set_union_strata_estimator.h index 2b59e8ed3..8c50e2c9f 100644 --- a/src/set/gnunet-service-set_union_strata_estimator.h +++ b/src/set/gnunet-service-set_union_strata_estimator.h | |||
@@ -66,9 +66,10 @@ struct StrataEstimator | |||
66 | * Write the given strata estimator to the buffer. | 66 | * Write the given strata estimator to the buffer. |
67 | * | 67 | * |
68 | * @param se strata estimator to serialize | 68 | * @param se strata estimator to serialize |
69 | * @param buf buffer to write to, must be of appropriate size | 69 | * @param[out] buf buffer to write to, must be of appropriate size |
70 | * @return number of bytes written to @a buf | ||
70 | */ | 71 | */ |
71 | void | 72 | size_t |
72 | strata_estimator_write (const struct StrataEstimator *se, | 73 | strata_estimator_write (const struct StrataEstimator *se, |
73 | void *buf); | 74 | void *buf); |
74 | 75 | ||
@@ -78,10 +79,15 @@ strata_estimator_write (const struct StrataEstimator *se, | |||
78 | * estimator. The strata estimator must already be allocated. | 79 | * estimator. The strata estimator must already be allocated. |
79 | * | 80 | * |
80 | * @param buf buffer to read from | 81 | * @param buf buffer to read from |
81 | * @param se strata estimator to write to | 82 | * @param buf_len number of bytes in @a buf |
83 | * @param is_compressed is the data compressed? | ||
84 | * @param[out] se strata estimator to write to | ||
85 | * @return #GNUNET_OK on success | ||
82 | */ | 86 | */ |
83 | void | 87 | int |
84 | strata_estimator_read (const void *buf, | 88 | strata_estimator_read (const void *buf, |
89 | size_t buf_len, | ||
90 | int is_compressed, | ||
85 | struct StrataEstimator *se); | 91 | struct StrataEstimator *se); |
86 | 92 | ||
87 | 93 | ||
@@ -91,7 +97,7 @@ strata_estimator_read (const void *buf, | |||
91 | * @param strata_count number of stratas, that is, number of ibfs in the estimator | 97 | * @param strata_count number of stratas, that is, number of ibfs in the estimator |
92 | * @param ibf_size size of each ibf stratum | 98 | * @param ibf_size size of each ibf stratum |
93 | * @param ibf_hashnum hashnum parameter of each ibf | 99 | * @param ibf_hashnum hashnum parameter of each ibf |
94 | * @return a freshly allocated, empty strata estimator | 100 | * @return a freshly allocated, empty strata estimator, NULL on error |
95 | */ | 101 | */ |
96 | struct StrataEstimator * | 102 | struct StrataEstimator * |
97 | strata_estimator_create (unsigned int strata_count, | 103 | strata_estimator_create (unsigned int strata_count, |
@@ -161,4 +167,3 @@ strata_estimator_dup (struct StrataEstimator *se); | |||
161 | #endif | 167 | #endif |
162 | 168 | ||
163 | #endif | 169 | #endif |
164 | |||