Ejemplo n.º 1
0
bool
matches_arg(Smoke *smoke, Smoke::Index meth, Smoke::Index argidx, const char *argtype)
{
	Smoke::Index *arg = smoke->argumentList + smoke->methods[meth].args + argidx;
	SmokeType type = SmokeType(smoke, *arg);
	if (type.name() && qstrcmp(type.name(), argtype) == 0) {
		return true;
	}
	return false;
}
Ejemplo n.º 2
0
Marshall::HandlerFn getMarshallFn(const SmokeType &type) {
	if(type.elem())
		return marshall_basetype;
	if(!type.name())
		return marshall_void;

	TypeHandler *h = type_handlers[type.name()];

	if(h == 0 && type.isConst() && strlen(type.name()) > strlen("const ")) {
			h = type_handlers[type.name() + strlen("const ")];
	}

	if(h != 0) {
		return h->fn;
	}

	return marshall_unknown;
}
Ejemplo n.º 3
0
Marshall::HandlerFn Marshall::getMarshallFn(const SmokeType &type) {
    if (type.element() != 0) {
        return marshall_basetype;
    }
    
    if (type.name() == 0) {
        return marshall_void;
    }
    
    TypeHandler * handler = TypeHandlers[type.name()];
    if (handler == 0 && type.isConst() && qstrlen(type.name()) > qstrlen("const ")) {
        handler = TypeHandlers[type.name() + qstrlen("const ")];
    }
    
    if (handler != 0) {
        return handler->fn;
    }

    return marshall_unknown;
}
Ejemplo n.º 4
0
int scoreArg_unknown(SEXP /*arg*/, const SmokeType &type) {
  error("unable to score argument of type '%s'", type.name());
  return 0;
}