diff options
author | Christian Grothoff <christian@grothoff.org> | 2011-08-15 21:51:21 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2011-08-15 21:51:21 +0000 |
commit | 6fd3e715cae09fa6e657c96f1c6f9711ee51f42f (patch) | |
tree | edbc42f37889069033e57da201fef242939a6e0f /src/include/gnunet_bandwidth_lib.h | |
parent | 502af2167f7c218366666ca4944bd7cc54b5b19a (diff) | |
download | gnunet-6fd3e715cae09fa6e657c96f1c6f9711ee51f42f.tar.gz gnunet-6fd3e715cae09fa6e657c96f1c6f9711ee51f42f.zip |
indentation
Diffstat (limited to 'src/include/gnunet_bandwidth_lib.h')
-rw-r--r-- | src/include/gnunet_bandwidth_lib.h | 80 |
1 files changed, 35 insertions, 45 deletions
diff --git a/src/include/gnunet_bandwidth_lib.h b/src/include/gnunet_bandwidth_lib.h index 059a6696c..e78d16552 100644 --- a/src/include/gnunet_bandwidth_lib.h +++ b/src/include/gnunet_bandwidth_lib.h | |||
@@ -89,8 +89,8 @@ struct GNUNET_BANDWIDTH_Tracker | |||
89 | * @param bytes_per_second value to create | 89 | * @param bytes_per_second value to create |
90 | * @return the new bandwidth value | 90 | * @return the new bandwidth value |
91 | */ | 91 | */ |
92 | struct GNUNET_BANDWIDTH_Value32NBO | 92 | struct GNUNET_BANDWIDTH_Value32NBO GNUNET_BANDWIDTH_value_init (uint32_t |
93 | GNUNET_BANDWIDTH_value_init (uint32_t bytes_per_second); | 93 | bytes_per_second); |
94 | 94 | ||
95 | 95 | ||
96 | /** | 96 | /** |
@@ -107,20 +107,12 @@ GNUNET_BANDWIDTH_value_init (uint32_t bytes_per_second); | |||
107 | * @param deadline when is the deadline | 107 | * @param deadline when is the deadline |
108 | * @return number of bytes available at bps until deadline | 108 | * @return number of bytes available at bps until deadline |
109 | */ | 109 | */ |
110 | uint64_t | 110 | uint64_t GNUNET_BANDWIDTH_value_get_available_until (struct |
111 | 111 | GNUNET_BANDWIDTH_Value32NBO | |
112 | 112 | bps, | |
113 | 113 | struct | |
114 | 114 | GNUNET_TIME_Relative | |
115 | 115 | deadline); | |
116 | |||
117 | |||
118 | |||
119 | |||
120 | GNUNET_BANDWIDTH_value_get_available_until (struct GNUNET_BANDWIDTH_Value32NBO | ||
121 | bps, | ||
122 | struct GNUNET_TIME_Relative | ||
123 | deadline); | ||
124 | 116 | ||
125 | 117 | ||
126 | /** | 118 | /** |
@@ -131,9 +123,11 @@ uint64_t | |||
131 | * @param size number of bytes we want to have available | 123 | * @param size number of bytes we want to have available |
132 | * @return how long it would take | 124 | * @return how long it would take |
133 | */ | 125 | */ |
134 | struct GNUNET_TIME_Relative | 126 | struct GNUNET_TIME_Relative GNUNET_BANDWIDTH_value_get_delay_for (struct |
135 | GNUNET_BANDWIDTH_value_get_delay_for (struct GNUNET_BANDWIDTH_Value32NBO bps, | 127 | GNUNET_BANDWIDTH_Value32NBO |
136 | uint64_t size); | 128 | bps, |
129 | uint64_t | ||
130 | size); | ||
137 | 131 | ||
138 | 132 | ||
139 | 133 | ||
@@ -144,9 +138,12 @@ GNUNET_BANDWIDTH_value_get_delay_for (struct GNUNET_BANDWIDTH_Value32NBO bps, | |||
144 | * @param b2 second value | 138 | * @param b2 second value |
145 | * @return the min of b1 and b2 | 139 | * @return the min of b1 and b2 |
146 | */ | 140 | */ |
147 | struct GNUNET_BANDWIDTH_Value32NBO | 141 | struct GNUNET_BANDWIDTH_Value32NBO GNUNET_BANDWIDTH_value_min (struct |
148 | GNUNET_BANDWIDTH_value_min (struct GNUNET_BANDWIDTH_Value32NBO b1, | 142 | GNUNET_BANDWIDTH_Value32NBO |
149 | struct GNUNET_BANDWIDTH_Value32NBO b2); | 143 | b1, |
144 | struct | ||
145 | GNUNET_BANDWIDTH_Value32NBO | ||
146 | b2); | ||
150 | 147 | ||
151 | 148 | ||
152 | /** | 149 | /** |
@@ -163,10 +160,10 @@ GNUNET_BANDWIDTH_value_min (struct GNUNET_BANDWIDTH_Value32NBO b1, | |||
163 | * @param max_carry_s maximum number of seconds unused bandwidth | 160 | * @param max_carry_s maximum number of seconds unused bandwidth |
164 | * may accumulate before it expires | 161 | * may accumulate before it expires |
165 | */ | 162 | */ |
166 | void | 163 | void GNUNET_BANDWIDTH_tracker_init (struct GNUNET_BANDWIDTH_Tracker *av, |
167 | GNUNET_BANDWIDTH_tracker_init (struct GNUNET_BANDWIDTH_Tracker *av, | 164 | struct GNUNET_BANDWIDTH_Value32NBO |
168 | struct GNUNET_BANDWIDTH_Value32NBO | 165 | bytes_per_second_limit, |
169 | bytes_per_second_limit, uint32_t max_carry_s); | 166 | uint32_t max_carry_s); |
170 | 167 | ||
171 | 168 | ||
172 | /** | 169 | /** |
@@ -180,9 +177,8 @@ GNUNET_BANDWIDTH_tracker_init (struct GNUNET_BANDWIDTH_Tracker *av, | |||
180 | * @param size number of bytes consumed | 177 | * @param size number of bytes consumed |
181 | * @return GNUNET_YES if this consumption is above the limit | 178 | * @return GNUNET_YES if this consumption is above the limit |
182 | */ | 179 | */ |
183 | int | 180 | int GNUNET_BANDWIDTH_tracker_consume (struct GNUNET_BANDWIDTH_Tracker *av, |
184 | GNUNET_BANDWIDTH_tracker_consume (struct GNUNET_BANDWIDTH_Tracker *av, | 181 | ssize_t size); |
185 | ssize_t size); | ||
186 | 182 | ||
187 | 183 | ||
188 | /** | 184 | /** |
@@ -194,9 +190,10 @@ GNUNET_BANDWIDTH_tracker_consume (struct GNUNET_BANDWIDTH_Tracker *av, | |||
194 | * @param size number of bytes we would like to consume | 190 | * @param size number of bytes we would like to consume |
195 | * @return time to wait for consumption to be OK | 191 | * @return time to wait for consumption to be OK |
196 | */ | 192 | */ |
197 | struct GNUNET_TIME_Relative | 193 | struct GNUNET_TIME_Relative GNUNET_BANDWIDTH_tracker_get_delay (struct |
198 | GNUNET_BANDWIDTH_tracker_get_delay (struct GNUNET_BANDWIDTH_Tracker *av, | 194 | GNUNET_BANDWIDTH_Tracker |
199 | size_t size); | 195 | *av, |
196 | size_t size); | ||
200 | 197 | ||
201 | 198 | ||
202 | /** | 199 | /** |
@@ -206,15 +203,9 @@ GNUNET_BANDWIDTH_tracker_get_delay (struct GNUNET_BANDWIDTH_Tracker *av, | |||
206 | * @param av tracker to query | 203 | * @param av tracker to query |
207 | * @return number of bytes available for consumption right now | 204 | * @return number of bytes available for consumption right now |
208 | */ | 205 | */ |
209 | int64_t | 206 | int64_t GNUNET_BANDWIDTH_tracker_get_available (struct |
210 | 207 | GNUNET_BANDWIDTH_Tracker | |
211 | 208 | *av); | |
212 | |||
213 | |||
214 | |||
215 | |||
216 | |||
217 | GNUNET_BANDWIDTH_tracker_get_available (struct GNUNET_BANDWIDTH_Tracker *av); | ||
218 | 209 | ||
219 | 210 | ||
220 | /** | 211 | /** |
@@ -223,10 +214,9 @@ int64_t | |||
223 | * @param av tracker to initialize | 214 | * @param av tracker to initialize |
224 | * @param bytes_per_second_limit new limit to assume | 215 | * @param bytes_per_second_limit new limit to assume |
225 | */ | 216 | */ |
226 | void | 217 | void GNUNET_BANDWIDTH_tracker_update_quota (struct GNUNET_BANDWIDTH_Tracker *av, |
227 | GNUNET_BANDWIDTH_tracker_update_quota (struct GNUNET_BANDWIDTH_Tracker *av, | 218 | struct GNUNET_BANDWIDTH_Value32NBO |
228 | struct GNUNET_BANDWIDTH_Value32NBO | 219 | bytes_per_second_limit); |
229 | bytes_per_second_limit); | ||
230 | 220 | ||
231 | 221 | ||
232 | #if 0 /* keep Emacsens' auto-indent happy */ | 222 | #if 0 /* keep Emacsens' auto-indent happy */ |