Ejemplo n.º 1
0
void readArgs(int* msg_type,int* msg_len,char buffer[],char* msg_to) {
	char type[10];
	memset(buffer,'\0',sizeof(buffer));
	do {
		printf("Please input the type of messge to %s(int):\n",msg_to);
		scanf("%s",type);
	}	
	while(checkType(type) == 0);
	getchar();
	*msg_type = transformType(type);
	printf("Please input message to %s. Press 'Enter' to send.(input \"q\" or \"Q\" to quit)\n",msg_to);
	fgets(buffer,BUF_SIZE,stdin);
	*msg_len = strlen(buffer)-1;
	buffer[*msg_len] = '\0';
}
Ejemplo n.º 2
0
TypeTraversalSynthesizedAttribute
TypeTraversal::evaluateSynthesizedAttribute (
     SgNode* astNode,
     TypeTraversalInheritedAttribute inheritedAttribute,
     SynthesizedAttributesList childAttributes )
   {
#if 0
     printf ("In TypeTraversal::evaluateSynthesizedAttribute(): astNode = %p = %s \n",astNode,astNode->class_name().c_str());
#endif
     
     SgType* type = isSgType(astNode);
     if (type != NULL)
        {
          transformType(type);
        }

     TypeTraversalSynthesizedAttribute localResult;

     return localResult;
   }
InterpolationValue SVGTransformListInterpolationType::maybeConvertSVGValue(const SVGPropertyBase& svgValue) const
{
    if (svgValue.type() != AnimatedTransformList)
        return nullptr;

    const SVGTransformList& svgList = toSVGTransformList(svgValue);
    OwnPtr<InterpolableList> result = InterpolableList::create(svgList.length());

    Vector<SVGTransformType> transformTypes;
    for (size_t i = 0; i < svgList.length(); i++) {
        const SVGTransform* transform = svgList.at(i);
        SVGTransformType transformType(transform->transformType());
        if (transformType == SVG_TRANSFORM_MATRIX) {
            // TODO(ericwilligers): Support matrix interpolation.
            return nullptr;
        }
        result->set(i, toInterpolableValue(transform->clone().get(), transformType));
        transformTypes.append(transformType);
    }
    return InterpolationValue(result.release(), SVGTransformNonInterpolableValue::create(transformTypes));
}