sprint 1-alpha
|
00001 /****************************************************************************** 00002 * sprint::ipc 00003 * 00004 * Copyright (C) 2005-2011 Paolo Medici <www.pmx.it> 00005 * 00006 * This library is free software; you can redistribute it and/or 00007 * modify it under the terms of the GNU Lesser General Public 00008 * License as published by the Free Software Foundation; either 00009 * version 2.1 of the License, or (at your option) any later version. 00010 * 00011 * This library is distributed in the hope that it will be useful, 00012 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00013 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00014 * Lesser General Public License for more details. 00015 * 00016 * You should have received a copy of the GNU Lesser General Public 00017 * License along with this library; if not, write to the Free Software 00018 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 00019 * 00020 *******************************************************************************/ 00021 00022 #ifndef _SPRINT_RPC_H 00023 #define _SPRINT_RPC_H 00024 00028 #include "ipc.h" 00029 00030 namespace sprint { 00031 00032 namespace ipc { 00033 00034 struct rpc_request { 00036 int byte_order; 00038 int status; 00040 unsigned int in_size; 00042 char *in; 00044 unsigned int out_size; 00046 char *out; 00047 }; 00048 00049 typedef int (* rpc_fun)(rpc_request *req, void *param); 00050 00052 void declare_rpc(const char *name, rpc_fun fun, unsigned int byte_order, unsigned int in_size, unsigned int out_size, void *param); 00053 00054 class rpc { 00055 public: 00056 virtual ~rpc() {} 00058 virtual rpc_request & request() = 0; 00060 virtual int run() = 0; 00061 }; 00062 00064 rpc *open_rpc(const char *name); 00065 00066 } 00067 } 00068 00069 #endif