Changeset 79ae36dd in mainline for uspace/srv/clip/clip.c


Ignore:
Timestamp:
2011-06-08T19:01:55Z (14 years ago)
Author:
Martin Decky <martin@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
0eff68e
Parents:
764d71e
Message:

new async framework with integrated exchange tracking

  • strict isolation between low-level IPC and high-level async framework with integrated exchange tracking
    • each IPC connection is represented by an async_sess_t structure
    • each IPC exchange is represented by an async_exch_t structure
    • exchange management is either based on atomic messages (EXCHANGE_ATOMIC), locking (EXCHANGE_SERIALIZE) or connection cloning (EXCHANGE_CLONE)
  • async_obsolete: temporary compatibility layer to keep old async clients working (several pieces of code are currently broken, but only non-essential functionality)
  • IPC_M_PHONE_HANGUP is now method no. 0 (for elegant boolean evaluation)
  • IPC_M_DEBUG_ALL has been renamed to IPC_M_DEBUG
  • IPC_M_PING has been removed (VFS protocol now has VFS_IN_PING)
  • console routines in libc have been rewritten for better abstraction
  • additional use for libc-private header files (FILE structure opaque to the client)
  • various cstyle changes (typos, indentation, missing externs in header files, improved comments, etc.)
File:
1 edited

Legend:

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

    r764d71e r79ae36dd  
    3030#include <bool.h>
    3131#include <async.h>
    32 #include <ipc/ns.h>
     32#include <ns.h>
    3333#include <ipc/services.h>
    3434#include <ipc/clipboard.h>
     
    153153        async_answer_0(iid, EOK);
    154154       
    155         bool cont = true;
    156         while (cont) {
     155        while (true) {
    157156                ipc_call_t call;
    158157                ipc_callid_t callid = async_get_call(&call);
    159158               
     159                if (!IPC_GET_IMETHOD(call))
     160                        break;
     161               
    160162                switch (IPC_GET_IMETHOD(call)) {
    161                 case IPC_M_PHONE_HUNGUP:
    162                         cont = false;
    163                         continue;
    164163                case CLIPBOARD_PUT_DATA:
    165164                        clip_put_data(callid, &call);
     
    179178int main(int argc, char *argv[])
    180179{
    181         printf(NAME ": HelenOS clipboard service\n");
     180        printf("%s: HelenOS clipboard service\n", NAME);
    182181       
    183182        async_set_client_connection(clip_connection);
     
    186185                return -1;
    187186       
    188         printf(NAME ": Accepting connections\n");
     187        printf("%s: Accepting connections\n", NAME);
     188        task_retval(0);
    189189        async_manager();
    190190       
Note: See TracChangeset for help on using the changeset viewer.