Ignore:
Timestamp:
2011-07-12T13:41:26Z (13 years ago)
Author:
Petr Koupy <petr.koupy@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
50fc490
Parents:
11809eab (diff), 6817eba (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.
Message:

Merge libposix changes.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/c/generic/adt/measured_strings.c

    r11809eab r1916d1f  
    4242#include <errno.h>
    4343#include <async.h>
    44 #include <async_obsolete.h>
    4544
    4645/** Creates a new measured string bundled with a copy of the given string
     
    298297 * size has to be negotiated in advance.
    299298 *
    300  * @param[in] phone     The other module phone.
     299 * @param[in] exch      Exchange.
    301300 * @param[out] strings  The returned measured strings array.
    302301 * @param[out] data     The measured strings data. This memory block stores the
     
    305304 * @return              EOK on success.
    306305 * @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.
    308307 * @return              EINVAL if the sent array differs in size.
    309308 * @return              ENOMEM if there is not enough memory left.
     
    311310 *                      async_data_read_start() function.
    312311 */
    313 int
    314 measured_strings_return(int phone, measured_string_t **strings, uint8_t **data,
    315     size_t count)
     312int measured_strings_return(async_exch_t *exch, measured_string_t **strings,
     313    uint8_t **data, size_t count)
    316314{
    317315        size_t *lengths;
     
    320318        int rc;
    321319
    322         if ((phone < 0) || (!strings) || (!data) || (count <= 0))
     320        if ((exch == NULL) || (!strings) || (!data) || (count <= 0))
    323321                return EINVAL;
    324322
     
    327325                return ENOMEM;
    328326
    329         rc = async_obsolete_data_read_start(phone, lengths,
     327        rc = async_data_read_start(exch, lengths,
    330328            sizeof(size_t) * (count + 1));
    331329        if (rc != EOK) {
     
    352350                (*strings)[index].length = lengths[index];
    353351                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]);
    355353                        if (rc != EOK) {
    356354                                free(lengths);
     
    376374 * size has to be negotiated in advance.
    377375 *
    378  * @param[in] phone     The other module phone.
     376 * @param[in] exch      Exchange.
    379377 * @param[in] strings   The measured strings array to be transferred.
    380378 * @param[in] count     The measured strings array size.
    381379 * @return              EOK on success.
    382380 * @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.
    384382 * @return              Other error codes as defined for the
    385383 *                      async_data_write_start() function.
    386384 */
    387 int
    388 measured_strings_send(int phone, const measured_string_t *strings,
     385int measured_strings_send(async_exch_t *exch, const measured_string_t *strings,
    389386    size_t count)
    390387{
     
    393390        int rc;
    394391
    395         if ((phone < 0) || (!strings) || (count <= 0))
     392        if ((exch == NULL) || (!strings) || (count <= 0))
    396393                return EINVAL;
    397394
     
    400397                return ENOMEM;
    401398
    402         rc = async_obsolete_data_write_start(phone, lengths,
     399        rc = async_data_write_start(exch, lengths,
    403400            sizeof(size_t) * (count + 1));
    404401        if (rc != EOK) {
     
    411408        for (index = 0; index < count; index++) {
    412409                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,
    414411                            strings[index].length);
    415412                        if (rc != EOK)
     
    423420/** @}
    424421 */
    425 
Note: See TracChangeset for help on using the changeset viewer.