Exemple #1
0
char *RemoteLink( char *name, char server )
{
    int     i;
    int     rc;

    server = server;
    if( name == NULL || *name == '\0' ) name = DefLinkName;
    i = 0;
    for( ;; ) {
        if( i >= sizeof( LinkName ) ) break;
        if( *name == '\0' ) break;
        LinkName[i++] = *name++;
    }
    LinkName[i] = '\0';
#ifdef SERVER
    rc = RegisterName( LinkName );
    if( rc < 0 ) {
        UnregisterName( LinkName );
        rc = RegisterName( LinkName );
        if( rc < 0 ) {
            return( TRP_ERR_CANT_REGISTER_SERVER );
        }
    }
#else
    rc = AccessName( LinkName, &_id );
    if( rc < 0 ) return( TRP_ERR_CANT_FIND_SERVER );
#endif
    return( NULL );
}
bool ClassHeaderGenerator::ProcessObjectEx( const TiXmlElement* field )
{
	const char* name = field->Attribute( "name" );
	if( name == NULL )
    {
		_log( COMMON__ERROR, "field at line %d is missing the name attribute, skipping.", field->Row() );
		return false;
	}
	const char* type = field->Attribute( "type" );
	if( type == NULL )
	{
		_log( COMMON__ERROR, "field at line %d is missing the type attribute.", field->Row() );
		return false;
	}

    if( !RegisterName( name, field->Row() ) )
        return false;

	fprintf( mOutputFile,
		"    %s*\t%s;\n",
		type, name
	);

    return true;
}
Exemple #3
0
void ArgumentList::add(const std::string& ArgumentName, const MyMatrix& value)
{
	ArgumentType thisOne = matrix;
	std::pair<std::string, ArgumentType> thisPair(ArgumentName,thisOne);
	ArgumentNames.push_back(thisPair);
	MatrixArguments.insert(std::make_pair(ArgumentName,value));
	
	RegisterName(ArgumentName, thisOne);
}
Exemple #4
0
void ArgumentList::addList(const std::string& ArgumentName, const CellMatrix& values)
{
	ArgumentType thisOne = list;
	std::pair<std::string, ArgumentType> thisPair(ArgumentName,thisOne);
	ArgumentNames.push_back(thisPair);
	ListArguments.insert(std::make_pair(ArgumentName,values));

	
	RegisterName(ArgumentName, thisOne);
}
Exemple #5
0
void ArgumentList::add(const std::string& ArgumentName, bool value)
{
	ArgumentType thisOne = boolean;
	std::pair<std::string, ArgumentType> thisPair(ArgumentName,thisOne);
	ArgumentNames.push_back(thisPair);
	BoolArguments.insert(std::make_pair(ArgumentName,value));
	
	RegisterName(ArgumentName, thisOne);

}
Exemple #6
0
void ArgumentList::add(const std::string& ArgumentName, const std::string& value)
{
	ArgumentType thisOne = string;
	std::pair<std::string, ArgumentType> thisPair(ArgumentName,thisOne);
	ArgumentNames.push_back(thisPair);

	std::pair<std::string,std::string> valuePair(ArgumentName,value);
	StringArguments.insert(valuePair);

	RegisterName(ArgumentName, thisOne);
}
Exemple #7
0
void ArgumentList::add(const std::string& ArgumentName, double value)
{
	ArgumentType thisOne = number;
	std::pair<std::string, ArgumentType> thisPair(ArgumentName,thisOne);
	ArgumentNames.push_back(thisPair);

	std::pair<std::string,double> valuePair(ArgumentName,value);
	DoubleArguments.insert(valuePair);
	
	RegisterName(ArgumentName, thisOne);
				
}
bool ClassHeaderGenerator::ProcessDictRaw( const TiXmlElement* field )
{
	const char* name = field->Attribute( "name" );
	if( name == NULL )
    {
		_log( COMMON__ERROR, "field at line %d is missing the name attribute, skipping.", field->Row() );
		return false;
	}

	const char* key = field->Attribute( "key" );
	if( key == NULL )
    {
		_log( COMMON__ERROR, "field at line %d is missing the key attribute, skipping.", field->Row() );
		return false;
	}
	const char* pykey = field->Attribute( "pykey" );
	if( pykey == NULL )
    {
		_log( COMMON__ERROR, "field at line %d is missing the pykey attribute, skipping.", field->Row() );
		return false;
	}
	const char* value = field->Attribute( "value" );
	if( value == NULL )
    {
		_log( COMMON__ERROR, "field at line %d is missing the value attribute, skipping.", field->Row() );
		return false;
	}
	const char* pyvalue = field->Attribute( "pyvalue" );
	if( pyvalue == NULL )
    {
		_log( COMMON__ERROR, "field at line %d is missing the pyvalue attribute, skipping.", field->Row() );
		return false;
	}

    if( !RegisterName( name, field->Row() ) )
        return false;

    fprintf( mOutputFile,
		"    std::map<%s, %s>\t%s;\n",
		key, value, name
	);

    return true;
}
bool ClassHeaderGenerator::ProcessDictStr( const TiXmlElement* field )
{
	const char* name = field->Attribute( "name" );
	if( name == NULL )
    {
		_log( COMMON__ERROR, "field at line %d is missing the name attribute, skipping.", field->Row() );
		return false;
	}

    if( !RegisterName( name, field->Row() ) )
        return false;

    fprintf( mOutputFile,
		"    std::map<std::string, PyRep*>\t%s;\n",
		name
	);

    return true;
}
Exemple #10
0
/*
 * VxDLink - start a lnk
 */
const char * __pascal VxDLink( const char __far *name )
{
    int rc;

    _farstrcpy( linkName, name );
#ifdef SERVER
    rc = RegisterName( linkName );
    if( rc < 0 ) {
        return( "Could not register server!" );
    }
#else
    rc = AccessName( linkName, &__ConvId );
    if( rc < 0 ) {
        return( "Could not find server!" );
    }
#endif
    return( NULL );

} /* VxDLink */