Changeset 26e7d6d in mainline for uspace/lib/c/generic/adt/measured_strings.c
- Timestamp:
- 2011-09-19T16:31:00Z (13 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- a347a11
- Parents:
- 3842a955 (diff), 086290d (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)
links above to see all the changes relative to each parent. - File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/c/generic/adt/measured_strings.c
r3842a955 r26e7d6d 42 42 #include <errno.h> 43 43 #include <async.h> 44 #include <async_obsolete.h>45 44 46 45 /** Creates a new measured string bundled with a copy of the given string … … 298 297 * size has to be negotiated in advance. 299 298 * 300 * @param[in] phone The other module phone.299 * @param[in] exch Exchange. 301 300 * @param[out] strings The returned measured strings array. 302 301 * @param[out] data The measured strings data. This memory block stores the … … 305 304 * @return EOK on success. 306 305 * @return EINVAL if the strings or data parameter is NULL. 307 * @return EINVAL if the phone or count parameter is not positive.306 * @return EINVAL if the exch or count parameter is invalid. 308 307 * @return EINVAL if the sent array differs in size. 309 308 * @return ENOMEM if there is not enough memory left. … … 311 310 * async_data_read_start() function. 312 311 */ 313 int 314 measured_strings_return(int phone, measured_string_t **strings, uint8_t **data, 315 size_t count) 312 int measured_strings_return(async_exch_t *exch, measured_string_t **strings, 313 uint8_t **data, size_t count) 316 314 { 317 315 size_t *lengths; … … 320 318 int rc; 321 319 322 if (( phone < 0) || (!strings) || (!data) || (count <= 0))320 if ((exch == NULL) || (!strings) || (!data) || (count <= 0)) 323 321 return EINVAL; 324 322 … … 327 325 return ENOMEM; 328 326 329 rc = async_ obsolete_data_read_start(phone, lengths,327 rc = async_data_read_start(exch, lengths, 330 328 sizeof(size_t) * (count + 1)); 331 329 if (rc != EOK) { … … 352 350 (*strings)[index].length = lengths[index]; 353 351 if (lengths[index] > 0) { 354 rc = async_ obsolete_data_read_start(phone, next, lengths[index]);352 rc = async_data_read_start(exch, next, lengths[index]); 355 353 if (rc != EOK) { 356 354 free(lengths); … … 376 374 * size has to be negotiated in advance. 377 375 * 378 * @param[in] phone The other module phone.376 * @param[in] exch Exchange. 379 377 * @param[in] strings The measured strings array to be transferred. 380 378 * @param[in] count The measured strings array size. 381 379 * @return EOK on success. 382 380 * @return EINVAL if the strings parameter is NULL. 383 * @return EINVAL if the phone or count parameter is not positive.381 * @return EINVAL if the exch or count parameter is invalid. 384 382 * @return Other error codes as defined for the 385 383 * async_data_write_start() function. 386 384 */ 387 int 388 measured_strings_send(int phone, const measured_string_t *strings, 385 int measured_strings_send(async_exch_t *exch, const measured_string_t *strings, 389 386 size_t count) 390 387 { … … 393 390 int rc; 394 391 395 if (( phone < 0) || (!strings) || (count <= 0))392 if ((exch == NULL) || (!strings) || (count <= 0)) 396 393 return EINVAL; 397 394 … … 400 397 return ENOMEM; 401 398 402 rc = async_ obsolete_data_write_start(phone, lengths,399 rc = async_data_write_start(exch, lengths, 403 400 sizeof(size_t) * (count + 1)); 404 401 if (rc != EOK) { … … 411 408 for (index = 0; index < count; index++) { 412 409 if (strings[index].length > 0) { 413 rc = async_ obsolete_data_write_start(phone, strings[index].value,410 rc = async_data_write_start(exch, strings[index].value, 414 411 strings[index].length); 415 412 if (rc != EOK) … … 423 420 /** @} 424 421 */ 425
Note:
See TracChangeset
for help on using the changeset viewer.