Changeset c028b22 in mainline for uspace/lib/c/generic/adt/measured_strings.c
- Timestamp:
- 2011-07-08T17:01:01Z (13 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- cc1a727
- Parents:
- 4e36219 (diff), 026793d (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
r4e36219 rc028b22 297 297 * size has to be negotiated in advance. 298 298 * 299 * @param[in] phone The other module phone.299 * @param[in] exch Exchange. 300 300 * @param[out] strings The returned measured strings array. 301 301 * @param[out] data The measured strings data. This memory block stores the … … 304 304 * @return EOK on success. 305 305 * @return EINVAL if the strings or data parameter is NULL. 306 * @return EINVAL if the phone or count parameter is not positive.306 * @return EINVAL if the exch or count parameter is invalid. 307 307 * @return EINVAL if the sent array differs in size. 308 308 * @return ENOMEM if there is not enough memory left. … … 310 310 * async_data_read_start() function. 311 311 */ 312 int 313 measured_strings_return(int phone, measured_string_t **strings, uint8_t **data, 314 size_t count) 312 int measured_strings_return(async_exch_t *exch, measured_string_t **strings, 313 uint8_t **data, size_t count) 315 314 { 316 315 size_t *lengths; … … 319 318 int rc; 320 319 321 if (( phone < 0) || (!strings) || (!data) || (count <= 0))320 if ((exch == NULL) || (!strings) || (!data) || (count <= 0)) 322 321 return EINVAL; 323 322 … … 326 325 return ENOMEM; 327 326 328 rc = async_data_read_start( phone, lengths,327 rc = async_data_read_start(exch, lengths, 329 328 sizeof(size_t) * (count + 1)); 330 329 if (rc != EOK) { … … 351 350 (*strings)[index].length = lengths[index]; 352 351 if (lengths[index] > 0) { 353 rc = async_data_read_start( phone, next, lengths[index]);352 rc = async_data_read_start(exch, next, lengths[index]); 354 353 if (rc != EOK) { 355 354 free(lengths); … … 375 374 * size has to be negotiated in advance. 376 375 * 377 * @param[in] phone The other module phone.376 * @param[in] exch Exchange. 378 377 * @param[in] strings The measured strings array to be transferred. 379 378 * @param[in] count The measured strings array size. 380 379 * @return EOK on success. 381 380 * @return EINVAL if the strings parameter is NULL. 382 * @return EINVAL if the phone or count parameter is not positive.381 * @return EINVAL if the exch or count parameter is invalid. 383 382 * @return Other error codes as defined for the 384 383 * async_data_write_start() function. 385 384 */ 386 int 387 measured_strings_send(int phone, const measured_string_t *strings, 385 int measured_strings_send(async_exch_t *exch, const measured_string_t *strings, 388 386 size_t count) 389 387 { … … 392 390 int rc; 393 391 394 if (( phone < 0) || (!strings) || (count <= 0))392 if ((exch == NULL) || (!strings) || (count <= 0)) 395 393 return EINVAL; 396 394 … … 399 397 return ENOMEM; 400 398 401 rc = async_data_write_start( phone, lengths,399 rc = async_data_write_start(exch, lengths, 402 400 sizeof(size_t) * (count + 1)); 403 401 if (rc != EOK) { … … 410 408 for (index = 0; index < count; index++) { 411 409 if (strings[index].length > 0) { 412 rc = async_data_write_start( phone, strings[index].value,410 rc = async_data_write_start(exch, strings[index].value, 413 411 strings[index].length); 414 412 if (rc != EOK) … … 422 420 /** @} 423 421 */ 424
Note:
See TracChangeset
for help on using the changeset viewer.