/****************************************************************************
**
** DCOP Skeleton generated by dcopidl2cpp from kinetd.kidl
**
** WARNING! All changes made in this file will be lost!
**
*****************************************************************************/

#include "/tmp/buildd/tde-packaging/arch/tde-extra/tde-tdenetwork/src/tdenetwork-trinity-14.1.6/krfb/kinetd/kinetd.h"

#include <kdatastream.h>
#include <tqasciidict.h>


static const int KInetD_fhash = 11;
static const char* const KInetD_ftable[10][3] = {
    { "TQStringList", "services()", "services()" },
    { "bool", "isEnabled(TQString)", "isEnabled(TQString service)" },
    { "void", "setEnabled(TQString,bool)", "setEnabled(TQString service,bool enable)" },
    { "void", "setEnabled(TQString,TQDateTime)", "setEnabled(TQString service,TQDateTime expiration)" },
    { "int", "port(TQString)", "port(TQString service)" },
    { "bool", "setPort(TQString,int,int)", "setPort(TQString service,int port,int autoPortRange)" },
    { "bool", "isInstalled(TQString)", "isInstalled(TQString service)" },
    { "void", "setServiceRegistrationEnabled(TQString,bool)", "setServiceRegistrationEnabled(TQString service,bool enabled)" },
    { "bool", "isServiceRegistrationEnabled(TQString)", "isServiceRegistrationEnabled(TQString service)" },
    { 0, 0, 0 }
};
static const int KInetD_ftable_hiddens[9] = {
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
};

bool KInetD::process(const TQCString &fun, const TQByteArray &data, TQCString& replyType, TQByteArray &replyData)
{
    static TQAsciiDict<int>* fdict = 0;
    if ( !fdict ) {
	fdict = new TQAsciiDict<int>( KInetD_fhash, true, false );
	for ( int i = 0; KInetD_ftable[i][1]; i++ )
	    fdict->insert( KInetD_ftable[i][1],  new int( i ) );
    }
    int* fp = fdict->find( fun );
    switch ( fp?*fp:-1) {
    case 0: { // TQStringList services()
	replyType = KInetD_ftable[0][0]; 
	TQDataStream _replyStream( replyData, IO_WriteOnly );
	_replyStream << services( );
    } break;
    case 1: { // bool isEnabled(TQString)
	TQString arg0;
	TQDataStream arg( data, IO_ReadOnly );
	if (arg.atEnd()) return false;
	arg >> arg0;
	replyType = KInetD_ftable[1][0]; 
	TQDataStream _replyStream( replyData, IO_WriteOnly );
	_replyStream << isEnabled(arg0 );
    } break;
    case 2: { // void setEnabled(TQString,bool)
	TQString arg0;
	bool arg1;
	TQDataStream arg( data, IO_ReadOnly );
	if (arg.atEnd()) return false;
	arg >> arg0;
	if (arg.atEnd()) return false;
	arg >> arg1;
	replyType = KInetD_ftable[2][0]; 
	setEnabled(arg0, arg1 );
    } break;
    case 3: { // void setEnabled(TQString,TQDateTime)
	TQString arg0;
	TQDateTime arg1;
	TQDataStream arg( data, IO_ReadOnly );
	if (arg.atEnd()) return false;
	arg >> arg0;
	if (arg.atEnd()) return false;
	arg >> arg1;
	replyType = KInetD_ftable[3][0]; 
	setEnabled(arg0, arg1 );
    } break;
    case 4: { // int port(TQString)
	TQString arg0;
	TQDataStream arg( data, IO_ReadOnly );
	if (arg.atEnd()) return false;
	arg >> arg0;
	replyType = KInetD_ftable[4][0]; 
	TQDataStream _replyStream( replyData, IO_WriteOnly );
	_replyStream << port(arg0 );
    } break;
    case 5: { // bool setPort(TQString,int,int)
	TQString arg0;
	int arg1;
	int arg2;
	TQDataStream arg( data, IO_ReadOnly );
	if (arg.atEnd()) return false;
	arg >> arg0;
	if (arg.atEnd()) return false;
	arg >> arg1;
	if (arg.atEnd()) return false;
	arg >> arg2;
	replyType = KInetD_ftable[5][0]; 
	TQDataStream _replyStream( replyData, IO_WriteOnly );
	_replyStream << setPort(arg0, arg1, arg2 );
    } break;
    case 6: { // bool isInstalled(TQString)
	TQString arg0;
	TQDataStream arg( data, IO_ReadOnly );
	if (arg.atEnd()) return false;
	arg >> arg0;
	replyType = KInetD_ftable[6][0]; 
	TQDataStream _replyStream( replyData, IO_WriteOnly );
	_replyStream << isInstalled(arg0 );
    } break;
    case 7: { // void setServiceRegistrationEnabled(TQString,bool)
	TQString arg0;
	bool arg1;
	TQDataStream arg( data, IO_ReadOnly );
	if (arg.atEnd()) return false;
	arg >> arg0;
	if (arg.atEnd()) return false;
	arg >> arg1;
	replyType = KInetD_ftable[7][0]; 
	setServiceRegistrationEnabled(arg0, arg1 );
    } break;
    case 8: { // bool isServiceRegistrationEnabled(TQString)
	TQString arg0;
	TQDataStream arg( data, IO_ReadOnly );
	if (arg.atEnd()) return false;
	arg >> arg0;
	replyType = KInetD_ftable[8][0]; 
	TQDataStream _replyStream( replyData, IO_WriteOnly );
	_replyStream << isServiceRegistrationEnabled(arg0 );
    } break;
    default: 
	return KDEDModule::process( fun, data, replyType, replyData );
    }
    return true;
}

QCStringList KInetD::interfaces()
{
    QCStringList ifaces = KDEDModule::interfaces();
    ifaces += "KInetD";
    return ifaces;
}

QCStringList KInetD::functions()
{
    QCStringList funcs = KDEDModule::functions();
    for ( int i = 0; KInetD_ftable[i][2]; i++ ) {
	if (KInetD_ftable_hiddens[i])
	    continue;
	TQCString func = KInetD_ftable[i][0];
	func += ' ';
	func += KInetD_ftable[i][2];
	funcs << func;
    }
    return funcs;
}


