示例#1
0
static
void
ndbPrintCompatibleTable(struct NdbUpGradeCompatible table[])
{
    int i;
    printf("ownVersion, matchType, otherVersion\n");
    for (i = 0; table[i].ownVersion != 0 && table[i].otherVersion != 0; i++) {

        printf("%u.%u.%u, ",
               getMajor(table[i].ownVersion),
               getMinor(table[i].ownVersion),
               getBuild(table[i].ownVersion));
        switch (table[i].matchType) {
        case UG_Range:
            printf("Range");
            break;
        case UG_Exact:
            printf("Exact");
            break;
        default:
            break;
        }
        printf(", %u.%u.%u\n",
               getMajor(table[i].otherVersion),
               getMinor(table[i].otherVersion),
               getBuild(table[i].otherVersion));

    }
    printf("\n");
}
示例#2
0
const char * ndbGetVersionString(Uint32 version, Uint32 mysql_version,
                                 const char * status,
                                 char *buf, unsigned sz)
{
    char tmp[NDB_VERSION_STRING_BUF_SZ];
    if (status && status[0] != 0)
        basestring_snprintf(tmp, sizeof(tmp), "%s", status);
    else
        tmp[0] = 0;

    if (mysql_version)
    {
        basestring_snprintf(buf, sz, "mysql-%d.%d.%d ndb-%d.%d.%d%s",
                            getMajor(mysql_version),
                            getMinor(mysql_version),
                            getBuild(mysql_version),
                            getMajor(version),
                            getMinor(version),
                            getBuild(version),
                            tmp);
    }
    else
    {
        basestring_snprintf(buf, sz, "ndb-%d.%d.%d%s",
                            getMajor(version),
                            getMinor(version),
                            getBuild(version),
                            tmp);
    }
    return buf;
}
示例#3
0
文件: version.c 项目: Coco-wan/git-1
void ndbPrintVersion()
{
  printf("Version: %u.%u.%u\n",
	 getMajor(ndbGetOwnVersion()),
	 getMinor(ndbGetOwnVersion()),
	 getBuild(ndbGetOwnVersion()));
}
示例#4
0
QString Address::toCsv() const
{
    QString res;
    if(!isEmpty())
    {
        res += "\""+ QString::number(getStreetId()) + "\";\"";
        res += QString::number(getBuildId()) + "\";\"";
        res += getRawAddress().join(';') + "\";\"";
        res += getTypeOfFSubjInString() + "\";\"";
        res += getFsubj() + "\";\"";
        res += getDistrict() + "\";\"";
        res += getTypeOfCity1() + "\";\"";
        res += getCity1() + "\";\"";
        res += getTypeOfCity2() + "\";\"";
        res += getCity2() + "\";\"";
        res += getTypeOfStreet() + "\";\"";
        res += getStreet() + "\";\"";
        res += getAdditional() + "\";\"";
        res += getBuild() + "\";\"";
        res += getKorp() + "\";\"";
        res += getLitera() + "\";\"";
        res += QString(isCorrect()?"1":"0") + "\"";
    }
    else
    {
        res += "Is empty\n";
    }
    return res;
}
示例#5
0
QString Address::toInsertSqlQuery() const
{
    QString strF =
          "INSERT INTO  %1 (BUILD_ID, BUILD, STREET_ID, STREET, "
          "TYPE_OF_STREET, KORP, LITERA, CORRECT, CITY1, "
          "TYPE_OF_CITY1, TYPE_OF_CITY2, CITY2, FSUBJ, DISTRICT, "
          "ADDITIONAL, RAW, TYPE_OF_FSUBJ) "
          "VALUES('%2', '%3', '%4', '%5', '%6', "
          "'%7', '%8', '%9', '%10', '%11', '%12', '%13', "
          "'%14', '%15', '%16', '%17', '%18'); ";

    QString str =
            strF
            .arg(TableName)
            .arg(QString::number(getBuildId()))
            .arg(getBuild())
            .arg(QString::number(getStreetId()))
            .arg(getStreet())
            .arg(getTypeOfStreet())
            .arg(getKorp())
            .arg(getLitera())
            .arg(QString(isCorrect()?"1":"0"))
            .arg(getCity1())
            .arg(getTypeOfCity1())
            .arg(getTypeOfCity2())
            .arg(getCity2())
            .arg(getFsubj())
            .arg(getDistrict())
            .arg(getAdditional())
            .arg(getRawAddress().join("\";\"").insert(0,'\"').append('\"'))
            .arg(getTypeOfFSubjInString());
    return str;
}
示例#6
0
float CTown::getResCostFor(int build, eResType typ)
{
	float cost = 0;
	if (typ == RES_TIME)
		cost = 60 * ONE_HOUR + 15 * getBuild(build);
	else
		if (typ == RES_GOLD)
			cost = 30 * getBuild(build);
		else
			if (typ == RES_PP)
				cost = 0.55 + getBuild(build)*0.02;
			else
				if (typ == RES_TIMBER)
					cost = 35 + getBuild(build) * 8;

	return cost;
}
void getTextConnectedApiVersion(QQQQ) {
  BaseString::snprintf(m_text, m_text_len, 
		       "Node %u: API version %d.%d.%d",
		       theData[1],
		       getMajor(theData[2]),
		       getMinor(theData[2]),
		       getBuild(theData[2]));
}
示例#8
0
文件: version.c 项目: Coco-wan/git-1
const char * ndbGetVersionString(Uint32 version, const char * status,
                                 char *buf, unsigned sz)
{
  if (status && status[0] != 0)
	  basestring_snprintf(buf, sz,
	     "Version %d.%d.%d (%s)",
	     getMajor(version),
	     getMinor(version),
	     getBuild(version),
	     status);
  else
    basestring_snprintf(buf, sz,
	     "Version %d.%d.%d",
	     getMajor(version),
	     getMinor(version),
	     getBuild(version));
  return buf;
}
void getTextNDBStartStarted(QQQQ) {
  //-----------------------------------------------------------------------
  // Start of NDB has been initiated.
  //-----------------------------------------------------------------------
  BaseString::snprintf(m_text, m_text_len, 
		       "Start initiated (version %d.%d.%d)", 
		       getMajor(theData[1]),
		       getMinor(theData[1]),
		       getBuild(theData[1]));
}
示例#10
0
bool Address::isEmpty() const
{
    return (getRawAddress().isEmpty() &&
            getStreet().isEmpty() &&
            getBuild().isEmpty() &&
            getKorp().isEmpty() &&
            getAdditional().isEmpty() &&
            getCity1().isEmpty() &&
            getDistrict().isEmpty() &&
            getLitera().isEmpty() &&
            getTypeOfCity1().isEmpty() &&
            getTypeOfCity2().isEmpty() &&
            getTypeOfStreet().isEmpty() &&
            getFsubj().isEmpty());
}
示例#11
0
QString Address::toDebug() const
{
    QString res;
    res +="*** Address: ***\n";
    res += "StreetID: " + QString::number(getStreetId()) + "\n";
    res += "BuildID: " + QString::number(getBuildId()) + "\n";
    res += "Type of Federal Subj: " + getTypeOfFSubjInString() + "\n";
    res += "Federal subj: " + getFsubj() + "\n";
    res += "District: " + getDistrict() + "\n";
    res += "Type of City1: " + getTypeOfCity1() + "\n";
    res += "City1: " + getCity1() + "\n";
    res += "Type of City2: " + getTypeOfCity2() + "\n";
    res += "City2: " + getCity2() + "\n";
    res += "Type of Street: " + getTypeOfStreet() + "\n";
    res += "Street: " + getStreet() + "\n";
    res += "Additional: " + getAdditional() + "\n";
    res += "Build: " + getBuild() + "\n";
    res += "Korpus: " + getKorp() + "\n";
    res += "Litera: " + getLitera() + "\n";
    res += "Correct: " + QString(isCorrect()?"1":"0") + "\n";
    return res;
}
示例#12
0
QList<QVariant> Version::toArray()
{
   return {getMajor(), getMinor(), getPatch(), getBuild(), getRelease()};
}