int Bchart:: headPosFromItems(Item* lhs, Items& rhs) { int ansPriority = 9999; ECString lhsString(lhs->term()->name()); if(lhsString == "") lhsString = "S1"; int pos = -1; int ans = -1; Items::iterator ii = rhs.begin(); Item *subi; for( ; ii != rhs.end() ; ii++ ) { subi = (*ii); pos++; const Term* trm = subi->term(); int nextPriority = 12; if(trm) { ECString rhsString(subi->term()->name()); if(subi->term() == Term::stopTerm) continue; nextPriority = headPriority(lhsString, rhsString, ansPriority); } if(nextPriority <= ansPriority) { ans = pos; ansPriority = nextPriority; } } return ans; }
int headPosFromTree(InputTree* tree) { int ansPriority = 10; ECString lhsString(tree->term()); if(lhsString == "") lhsString = "S1"; int pos = -1; int ans = -1; ConstInputTreesIter subTreeIter = tree->subTrees().begin(); InputTree *subTree; for( ; subTreeIter != tree->subTrees().end() ; subTreeIter++ ) { subTree = *subTreeIter; pos++; ECString rhsString(subTree->term()); int nextPriority = headPriority(lhsString, rhsString, ansPriority); if(nextPriority <= ansPriority) { ans = pos; ansPriority = nextPriority; } } return ans; }
/* * Class: com_yahoo_jmh_jmhtest_jni_JNIWrapper * Method: nativeParamStringsUTF8 * Signature: (Ljava/lang/String;Ljava/lang/String;)V */ JNIEXPORT void JNICALL Java_com_yahoo_jmh_jmhtest_jni_JNIWrapper_nativeParamStringsUTF8 (JNIEnv *jenv, jclass, jstring lhs, jstring rhs) { // we want to use this string. ScopedStringUTFChars lhsString(jenv, lhs); ScopedStringUTFChars rhsString(jenv, rhs); }
/* * Class: com_yahoo_jmh_jmhtest_jni_JNIWrapper * Method: nativeEquals * Signature: (Ljava/lang/String;Ljava/lang/String;)Z */ JNIEXPORT jboolean JNICALL Java_com_yahoo_jmh_jmhtest_jni_JNIWrapper_nativeEquals( JNIEnv *jenv, jclass, jstring lhsArg, jstring rhsArg) { // we want to use this string. ScopedStringUTFChars lhsString(jenv, lhsArg); ScopedStringUTFChars rhsString(jenv, rhsArg); return 0 == strcmp(lhsString.get(), rhsString.get()); }