/*
BOIL (Brunni's Own Interpreter Language)
(c) 1998 netEstate (http://www.netestate.de/, info@netestate.de),
Michael Brunnbauer & Markus Hendel, Gesellschaft fuer Netzwerkkommunikation bR
Am Bluetenanger 8, 80995 Muenchen, Germany

This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
*/

#ifdef RPC_HDR
%#include "general.h"
#endif

enum rpc_data {
	RPC_LONG = 1,
	RPC_DOUBLE = 2,
	RPC_STRING = 3,
	RPC_VOID = 4,
	RPC_ULONG = 5
};

struct rpc_string {
	bool defined;
	string stringval<>;
};

union rpc_value switch (rpc_data type) {
	case RPC_LONG:
		int longval;
	case RPC_DOUBLE:
		double doubleval;
	case RPC_STRING:
		rpc_string stringval;
	case RPC_ULONG:
		unsigned int ulongval;
	default:
		void;
};

struct rpc_error {
	string error<>;
	unsigned int line;
};

struct rpc_accounting_element {
	unsigned int count_normal;
	unsigned int count_akt;
	unsigned int count_time_sec;
	unsigned int count_time_usec;
};

struct rpc_accounting {
	rpc_accounting_element accounting[ACCOUNTING_ANZ];
};

struct rpc_flowctrl {
	unsigned int ctrl;
	rpc_value returnval;
	rpc_error *error;
	rpc_accounting *accounting;
};

struct rpc_function_args {
	rpc_value args<MAX_RPC_ARGS>;
};

struct rpc_callargs {
	string function<>;
	string password<>;
	rpc_function_args args;
};

program BOILRPC {
	version BOILRPC_VERSION {
		rpc_flowctrl
		BOILRPC_CALL(rpc_callargs) = 1;
	} = 1;
} = 0x20000000;
