示例#1
0
RunnerStatus DynamicResult::deduceStatus(oRunner &runner) const {
  if (getMethod(MDeduceRStatus))
    return toStatus(getMethod(MDeduceRStatus)->evaluate(parser));
  else if (getMethodSource(MDeduceRStatus).empty())
    return GeneralResult::deduceStatus(runner);
  else throw meosException("Syntax error");
}
示例#2
0
SyncQtOwnCloud* SyncWindow::addAccount(QString name)
{
    SyncQtOwnCloud *account = new SyncQtOwnCloud(name,
            mSharedFilters,mConfigDirectory);
    mAccounts.append(account);
    mAccountNames.append(name);

    // Connect the signals
    connect(account,SIGNAL(conflictExists(SyncQtOwnCloud*)),
            this,SLOT(slotConflictExists(SyncQtOwnCloud*)));
    connect(account,SIGNAL(conflictResolved(SyncQtOwnCloud*)),
            this,SLOT(slotConflictResolved(SyncQtOwnCloud*)));
    connect(account,SIGNAL(progressFile(qint64)),
            this,SLOT(slotProgressFile(qint64)));
    connect(account,SIGNAL(progressTotal(qint64)),
            this,SLOT(slotProgressTotal(qint64)));
    connect(account,SIGNAL(readyToSync(SyncQtOwnCloud*)),
            this,SLOT(slotReadyToSync(SyncQtOwnCloud*)));
    connect(account,SIGNAL(toLog(QString)),
            this,SLOT(slotToLog(QString)));
    connect(account,SIGNAL(toStatus(QString)),
            this,SLOT(slotToStatus(QString)));
    connect(account,SIGNAL(finishedSync(SyncQtOwnCloud*)),
            this,SLOT(slotFinishedSync(SyncQtOwnCloud*)));
    connect(account,SIGNAL(toMessage(QString,QString,
                                     QSystemTrayIcon::MessageIcon)),
            this,SLOT(slotToMessage(QString,QString,
                                    QSystemTrayIcon::MessageIcon)));
    return account;
}
示例#3
0
/*
 * Class:     jdk_net_SolarisSocketOptions
 * Method:    setFlowOption0
 * Signature: (IIJ)I
 */
JNIEXPORT jint JNICALL Java_jdk_net_SolarisSocketOptions_setFlowOption
  (JNIEnv *env, jobject unused, jint fd, jint priority, jlong bandwidth)
{
    int rv;
    sock_flow_props_t props;
    memset(&props, 0, sizeof(props));
    props.sfp_version = SOCK_FLOW_PROP_VERSION1;

    if (priority != jdk_net_SocketFlow_UNSET) {
        props.sfp_mask |= SFP_PRIORITY;
        props.sfp_priority = priority;
    }
    if (bandwidth > jdk_net_SocketFlow_UNSET)  {
        props.sfp_mask |= SFP_MAXBW;
        props.sfp_maxbw = (uint64_t) bandwidth;
    }

    rv = setsockopt(fd, SOL_SOCKET, SO_FLOW_SLA, &props, sizeof(props));

    if (rv < 0) {
        if (errno == ENOPROTOOPT) {
            JNU_ThrowByName(env, "java/lang/UnsupportedOperationException",
                            "unsupported socket option");
        } else if (errno == EACCES || errno == EPERM) {
            JNU_ThrowByName(env, "java/net/SocketException", "Permission denied");
        } else {
            throwByNameWithLastError(env, "java/net/SocketException",
                                     "set option SO_FLOW_SLA failed");
        }
        return 0;
    }
    return toStatus(props.sfp_status);
}
示例#4
0
/*
 * Class:     jdk_net_SolarisSocketOptions
 * Method:    getFlowOption0
 * Signature: (ILjdk/net/SocketFlow;)I
 */
JNIEXPORT jint JNICALL Java_jdk_net_SolarisSocketOptions_getFlowOption
  (JNIEnv *env, jobject unused, jint fd, jobject flow)
{
    sock_flow_props_t props;
    socklen_t sz = sizeof(props);

    int rv = getsockopt(fd, SOL_SOCKET, SO_FLOW_SLA, &props, &sz);

    if (rv < 0) {
        if (errno == ENOPROTOOPT) {
            JNU_ThrowByName(env, "java/lang/UnsupportedOperationException",
                            "unsupported socket option");
        } else if (errno == EACCES || errno == EPERM) {
            JNU_ThrowByName(env, "java/net/SocketException", "Permission denied");
        } else {
            throwByNameWithLastError(env, "java/net/SocketException",
                                     "get option SO_FLOW_SLA failed");
        }
        return -1;
    }
    /* first check status to see if flow exists */
    if (props.sfp_status == 0) { /* OK */
        /* can set the other fields now */
        if (props.sfp_mask & SFP_PRIORITY) {
            (*env)->SetIntField(env, flow, sf_priority, props.sfp_priority);
        }
        if (props.sfp_mask & SFP_MAXBW) {
            (*env)->SetLongField(env, flow, sf_bandwidth,
                                    (jlong)props.sfp_maxbw);
        }
    }
    return toStatus(props.sfp_status);
}
    Return<void> DrmFactory::createPlugin(const hidl_array<uint8_t, 16>& uuid,
            const hidl_string& /* appPackageName */, createPlugin_cb _hidl_cb) {

        for (size_t i = 0; i < loader.factoryCount(); i++) {
            if (loader.getFactory(i)->isCryptoSchemeSupported(uuid.data())) {
                android::DrmPlugin *legacyPlugin = NULL;
                status_t status = loader.getFactory(i)->createDrmPlugin(
                        uuid.data(), &legacyPlugin);
                DrmPlugin *newPlugin = NULL;
                if (legacyPlugin == NULL) {
                    ALOGE("Drm legacy HAL: failed to create drm plugin");
                } else {
                    newPlugin = new DrmPlugin(legacyPlugin);
                }
                _hidl_cb(toStatus(status), newPlugin);
                return Void();
            }
        }
        _hidl_cb(Status::ERROR_DRM_CANNOT_HANDLE, NULL);
        return Void();
    }
示例#6
0
OmxStore::OmxStore(
        const char* owner,
        const char* const* searchDirs,
        const char* mainXmlName,
        const char* performanceXmlName,
        const char* profilingResultsXmlPath) {
    MediaCodecsXmlParser parser(searchDirs,
            mainXmlName,
            performanceXmlName,
            profilingResultsXmlPath);
    mParsingStatus = toStatus(parser.getParsingStatus());

    const auto& serviceAttributeMap = parser.getServiceAttributeMap();
    mServiceAttributeList.resize(serviceAttributeMap.size());
    size_t i = 0;
    for (const auto& attributePair : serviceAttributeMap) {
        ServiceAttribute attribute;
        attribute.key = attributePair.first;
        attribute.value = attributePair.second;
        mServiceAttributeList[i] = std::move(attribute);
        ++i;
    }

    const auto& roleMap = parser.getRoleMap();
    mRoleList.resize(roleMap.size());
    i = 0;
    for (const auto& rolePair : roleMap) {
        RoleInfo role;
        role.role = rolePair.first;
        role.type = rolePair.second.type;
        role.isEncoder = rolePair.second.isEncoder;
        // TODO: Currently, preferPlatformNodes information is not available in
        // the xml file. Once we have a way to provide this information, it
        // should be parsed properly.
        role.preferPlatformNodes = rolePair.first.compare(0, 5, "audio") == 0;
        hidl_vec<NodeInfo>& nodeList = role.nodes;
        nodeList.resize(rolePair.second.nodeList.size());
        size_t j = 0;
        for (const auto& nodePair : rolePair.second.nodeList) {
            NodeInfo node;
            node.name = nodePair.second.name;
            node.owner = owner;
            hidl_vec<NodeAttribute>& attributeList = node.attributes;
            attributeList.resize(nodePair.second.attributeList.size());
            size_t k = 0;
            for (const auto& attributePair : nodePair.second.attributeList) {
                NodeAttribute attribute;
                attribute.key = attributePair.first;
                attribute.value = attributePair.second;
                attributeList[k] = std::move(attribute);
                ++k;
            }
            nodeList[j] = std::move(node);
            ++j;
        }
        mRoleList[i] = std::move(role);
        ++i;
    }

    mPrefix = parser.getCommonPrefix();
}
示例#7
0
文件: status.cpp 项目: i80and/mongo
void MongoStatusInfo::Functions::reason::call(JSContext* cx, JS::CallArgs args) {
    ValueReader(cx, args.rval()).fromStringData(toStatus(cx, args.thisv()).reason());
}
示例#8
0
文件: status.cpp 项目: i80and/mongo
void MongoStatusInfo::Functions::code::call(JSContext* cx, JS::CallArgs args) {
    args.rval().setInt32(toStatus(cx, args.thisv()).code());
}