Jack2 1.9.6

JackMacLibClientRPC.cpp

00001 /*
00002 Copyright (C) 2004-2008 Grame
00003 
00004 This program is free software; you can redistribute it and/or modify
00005   it under the terms of the GNU General Public License as published by
00006   the Free Software Foundation; either version 2 of the License, or
00007   (at your option) any later version.
00008 
00009   This program is distributed in the hope that it will be useful,
00010   but WITHOUT ANY WARRANTY; without even the implied warranty of
00011   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00012   GNU General Public License for more details.
00013 
00014   You should have received a copy of the GNU General Public License
00015   along with this program; if not, write to the Free Software
00016   Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
00017 
00018 */
00019 
00020 #include "JackLibClient.h"
00021 #include "JackMachClientChannel.h"
00022 #include "JackRPCEngine.h"
00023 #include "JackLibGlobals.h"
00024 #include <assert.h>
00025 
00026 using namespace Jack;
00027 
00028 #define rpc_type kern_return_t  // for astyle
00029 
00030 rpc_type rpc_jack_client_sync_notify(mach_port_t client_port, int refnum, client_name_t name, int notify, message_t message, int value1, int value2, int* result)
00031 {
00032     jack_log("rpc_jack_client_sync_notify ref = %ld name = %s notify = %ld message %s val1 = %ld val2 = %ld", refnum, name, notify, message, value1, value2);
00033     JackClient* client = gClientTable[client_port];
00034     assert(client);
00035     *result = client->ClientNotify(refnum, name, notify, true, message, value1, value2);
00036     return KERN_SUCCESS;
00037 }
00038 
00039 rpc_type rpc_jack_client_async_notify(mach_port_t client_port, int refnum, client_name_t name, int notify, message_t message,  int value1, int value2)
00040 {
00041     jack_log("rpc_jack_client_async_notify ref = %ld name = %s notify = %ld message %s val1 = %ld val2 = %ld", refnum, name, notify, message, value1, value2);
00042     JackClient* client = gClientTable[client_port];
00043     assert(client);
00044     client->ClientNotify(refnum, name, notify, false, message, value1, value2);
00045     return KERN_SUCCESS;
00046 }
00047