static __bool defineVariable(struct blk_var_t * v, __uint context)
{
	FILE * of = (FILE*)context;
	char buf[1024];
	char path[F8_MAX_PATH];
	const char *tp = _type_name(v->type);
	IBlk_path_by_blk(v->blk, path, sizeof(path));
	sprintf(buf, "set type=%s name=\"%s\" comment=\"%s\" scope=\"%s\"", tp, v->name, v->comment, path);
	if (of==stdout)
		utils_trace("%s\n", buf);
	else
		fprintf(of, "%s\n", buf);
	return __true;
}
const std::string& RestListAvailReply::_typeName() const {
	return _type_name();
}
const std::string& Checkin::_typeName() const {
	return _type_name();
}
Exemple #4
0
void Value::fprint(FILE* os) const
{
    fprintf(os, "Value\n");
    fprintf(os, "{\n");

    fprintf(os, "    type=%s\n", _type_name(_type));
    fprintf(os, "    null=%s\n", _null ? "true" : "false");
    // Don't display values when null set.  Info unreliable at least
    // for strings.
    if (_null)
    {
        fprintf(os, "    value= NONE\n");
        return;
    }
    fprintf(os, "    value=");

    switch (_type)
    {
        case NONE:
            fputc('\n', os);
            break;

        case BOOLEAN:
            __print_scalar(os, _type, &_boolean);
            fputc('\n', os);
            break;

        case UINT8:
            __print_scalar(os, _type, &_uint8);
            fputc('\n', os);
            break;

        case SINT8:
            __print_scalar(os, _type, &_sint8);
            fputc('\n', os);
            break;

        case UINT16:
            __print_scalar(os, _type, &_uint16);
            fputc('\n', os);
            break;

        case SINT16:
            __print_scalar(os, _type, &_sint16);
            fputc('\n', os);
            break;

        case UINT32:
            __print_scalar(os, _type, &_uint32);
            fputc('\n', os);
            break;

        case SINT32:
            __print_scalar(os, _type, &_sint32);
            fputc('\n', os);
            break;

        case UINT64:
            __print_scalar(os, _type, &_uint64);
            fputc('\n', os);
            break;

        case SINT64:
            __print_scalar(os, _type, &_sint64);
            fputc('\n', os);
            break;

        case REAL32:
            __print_scalar(os, _type, &_real32);
            fputc('\n', os);
            break;

        case REAL64:
            __print_scalar(os, _type, &_real64);
            fputc('\n', os);
            break;

        case CHAR16:
            __print_scalar(os, _type, &_char16);
            fputc('\n', os);
            break;

        case STRING:
            __print_scalar(os, _type, &_string);
            fputc('\n', os);
            break;

        case DATETIME:
            __print_scalar(os, _type, &_datetime);
            fputc('\n', os);
            break;

        case INSTANCE:
            cimple::fprint(os,_instance);
            break;

        case BOOLEAN_ARRAY:
            __print_array(os, _type & 0x7F, &_boolean, 1);
            fputc('\n', os);
            break;

        case UINT8_ARRAY:
            __print_array(os, _type & 0x7F, &_uint8, 1);
            fputc('\n', os);
            break;

        case SINT8_ARRAY:
            __print_array(os, _type & 0x7F, &_sint8, 1);
            fputc('\n', os);
            break;

        case UINT16_ARRAY:
            __print_array(os, _type & 0x7F, &_uint16, 1);
            fputc('\n', os);
            break;

        case SINT16_ARRAY:
            __print_array(os, _type & 0x7F, &_sint16, 1);
            fputc('\n', os);
            break;

        case UINT32_ARRAY:
            __print_array(os, _type & 0x7F, &_uint32, 1);
            fputc('\n', os);
            break;

        case SINT32_ARRAY:
            __print_array(os, _type & 0x7F, &_sint32, 1);
            fputc('\n', os);
            break;

        case UINT64_ARRAY:
            __print_array(os, _type & 0x7F, &_uint64, 1);
            fputc('\n', os);
            break;

        case SINT64_ARRAY:
            __print_array(os, _type & 0x7F, &_sint64, 1);
            fputc('\n', os);
            break;

        case REAL32_ARRAY:
            __print_array(os, _type & 0x7F, &_real32, 1);
            fputc('\n', os);
            break;

        case REAL64_ARRAY:
            __print_array(os, _type & 0x7F, &_real64, 1);
            fputc('\n', os);
            break;

        case CHAR16_ARRAY:
            __print_array(os, _type & 0x7F, &_char16, 1);
            fputc('\n', os);
            break;

        case STRING_ARRAY:
            __print_array(os, _type & 0x7F, &_string, 1);
            fputc('\n', os);
            break;

        case DATETIME_ARRAY:
            __print_array(os, _type & 0x7F, &_datetime, 1);
            fputc('\n', os);
            break;

        case INSTANCE_ARRAY:
        {
            fprintf(os, "\n    {\n");

            const Array_Instance& arr = *((Array_Instance*)_array);

            for (size_t i = 0; i < arr.size(); i++)
                __print_aux(os, arr[i], 0, 2, false);

            fprintf(os, "    }\n");
            break;
        }

        default:
            break;
    }

    fprintf(os, "}\n");
}
const std::string& GoMessage::_typeName() const {
	return _type_name();
}
const std::string& Player::_typeName() const {
	return _type_name();
}
const std::string& GameState::_typeName() const {
	return _type_name();
}
const std::string& GameOver::_typeName() const {
	return _type_name();
}
const std::string& ShipPlacementReply::_typeName() const {
	return _type_name();
}
const std::string& Segment::_typeName() const {
	return _type_name();
}
const std::string& MoveResult::_typeName() const {
	return _type_name();
}