Example #1
0
static void
addxmlchar( str *s, unsigned int ch )
{
	if ( minimalxmlchars( s, ch ) ) return;
	if ( ch > 127 ) addentity( s, ch );
	else str_addchar( s, ch );
}
Example #2
0
static void
addgb18030char( str *s, unsigned int ch, int xmlout )
{
	unsigned char code[4];
	int nc, i;
	if ( xmlout ) {
		if ( minimalxmlchars( s, ch ) ) return;
		if ( ch > 127 && xmlout == STR_CONV_XMLOUT_ENTITIES )
			{ addentity( s, ch ); return; }
	}
	nc = gb18030_encode( ch, code );
	for ( i=0; i<nc; ++i )
		str_addchar( s, code[i] );
}
Example #3
0
void LogicSystem::setupExtent(int uid, int type)
{
    logger::log(logger::DEBUG, "setupExtent: %d, %d", uid, type);
    INDENT_LOG(logger::DEBUG);

    extentity *e = new extentity;
    entities::getents().add(e);

    e->type = type;
    e->o = vec(0, 0, 0);
    int numattrs = getattrnum(type);
    for (int i = 0; i < numattrs; ++i) e->attr.add(0);

    extern void addentity(extentity* entity);
    addentity(e);
    attachentity(*e);

    LogicSystem::setUniqueId(e, uid);
    LogicSystem::registerLogicEntity(e);
}