Changeset fe1776c2 in mainline for uspace/srv/clip/clip.c


Ignore:
Timestamp:
2011-02-11T12:41:11Z (13 years ago)
Author:
Matus Dekanek <smekideki@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
d81ef61c
Parents:
78d1525 (diff), 5d4193c (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 from usb/development

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/srv/clip/clip.c

    r78d1525 rfe1776c2  
    2929#include <stdio.h>
    3030#include <bool.h>
    31 #include <ipc/ipc.h>
    3231#include <async.h>
     32#include <ipc/ns.h>
    3333#include <ipc/services.h>
    3434#include <ipc/clipboard.h>
     
    6262               
    6363                fibril_mutex_unlock(&clip_mtx);
    64                 ipc_answer_0(rid, EOK);
     64                async_answer_0(rid, EOK);
    6565                break;
    6666        case CLIPBOARD_TAG_DATA:
    6767                rc = async_data_write_accept((void **) &data, false, 0, 0, 0, &size);
    6868                if (rc != EOK) {
    69                         ipc_answer_0(rid, rc);
     69                        async_answer_0(rid, rc);
    7070                        break;
    7171                }
     
    8181               
    8282                fibril_mutex_unlock(&clip_mtx);
    83                 ipc_answer_0(rid, EOK);
     83                async_answer_0(rid, EOK);
    8484                break;
    8585        default:
    86                 ipc_answer_0(rid, EINVAL);
     86                async_answer_0(rid, EINVAL);
    8787        }
    8888}
     
    9999        case CLIPBOARD_TAG_DATA:
    100100                if (!async_data_read_receive(&callid, &size)) {
    101                         ipc_answer_0(callid, EINVAL);
    102                         ipc_answer_0(rid, EINVAL);
     101                        async_answer_0(callid, EINVAL);
     102                        async_answer_0(rid, EINVAL);
    103103                        break;
    104104                }
     
    106106                if (clip_tag != CLIPBOARD_TAG_DATA) {
    107107                        /* So far we only understand binary data */
    108                         ipc_answer_0(callid, EOVERFLOW);
    109                         ipc_answer_0(rid, EOVERFLOW);
     108                        async_answer_0(callid, EOVERFLOW);
     109                        async_answer_0(rid, EOVERFLOW);
    110110                        break;
    111111                }
     
    113113                if (clip_size != size) {
    114114                        /* The client expects different size of data */
    115                         ipc_answer_0(callid, EOVERFLOW);
    116                         ipc_answer_0(rid, EOVERFLOW);
     115                        async_answer_0(callid, EOVERFLOW);
     116                        async_answer_0(rid, EOVERFLOW);
    117117                        break;
    118118                }
     
    120120                sysarg_t retval = async_data_read_finalize(callid, clip_data, size);
    121121                if (retval != EOK) {
    122                         ipc_answer_0(rid, retval);
     122                        async_answer_0(rid, retval);
    123123                        break;
    124124                }
    125125               
    126                 ipc_answer_0(rid, EOK);
     126                async_answer_0(rid, EOK);
    127127        default:
    128128                /*
     
    130130                 * data from the clipbard
    131131                 */
    132                 ipc_answer_0(rid, EINVAL);
     132                async_answer_0(rid, EINVAL);
    133133                break;
    134134        }
     
    145145       
    146146        fibril_mutex_unlock(&clip_mtx);
    147         ipc_answer_2(rid, EOK, (sysarg_t) size, (sysarg_t) tag);
     147        async_answer_2(rid, EOK, (sysarg_t) size, (sysarg_t) tag);
    148148}
    149149
     
    151151{
    152152        /* Accept connection */
    153         ipc_answer_0(iid, EOK);
     153        async_answer_0(iid, EOK);
    154154       
    155155        bool cont = true;
     
    172172                        break;
    173173                default:
    174                         ipc_answer_0(callid, ENOENT);
     174                        async_answer_0(callid, ENOENT);
    175175                }
    176176        }
     
    183183        async_set_client_connection(clip_connection);
    184184       
    185         if (ipc_connect_to_me(PHONE_NS, SERVICE_CLIPBOARD, 0, 0, NULL, NULL))
     185        if (service_register(SERVICE_CLIPBOARD) != EOK)
    186186                return -1;
    187187       
Note: See TracChangeset for help on using the changeset viewer.