mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-10-23 23:57:31 +09:00
parent
73047ccc74
commit
ac612ee4b5
7 changed files with 44 additions and 44 deletions
|
|
@ -29,40 +29,35 @@
|
||||||
|
|
||||||
//3456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789
|
//3456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789
|
||||||
|
|
||||||
mork_bool
|
/* static */
|
||||||
morkAtom::GetYarn(mdbYarn* outYarn) const
|
mork_bool morkAtom::GetYarn(const morkAtom* atom, mdbYarn* outYarn)
|
||||||
{
|
{
|
||||||
const void* source = 0;
|
const void* source = 0;
|
||||||
mdb_fill fill = 0;
|
mdb_fill fill = 0;
|
||||||
mdb_cscode form = 0;
|
mdb_cscode form = 0;
|
||||||
outYarn->mYarn_More = 0;
|
outYarn->mYarn_More = 0;
|
||||||
|
|
||||||
if ( this->IsWeeBook() )
|
if (atom) {
|
||||||
{
|
if (atom->IsWeeBook()) {
|
||||||
morkWeeBookAtom* weeBook = (morkWeeBookAtom*) this;
|
morkWeeBookAtom* weeBook = (morkWeeBookAtom*)atom;
|
||||||
source = weeBook->mWeeBookAtom_Body;
|
source = weeBook->mWeeBookAtom_Body;
|
||||||
fill = weeBook->mAtom_Size;
|
fill = weeBook->mAtom_Size;
|
||||||
}
|
} else if (atom->IsBigBook()) {
|
||||||
else if ( this->IsBigBook() )
|
morkBigBookAtom* bigBook = (morkBigBookAtom*)atom;
|
||||||
{
|
|
||||||
morkBigBookAtom* bigBook = (morkBigBookAtom*) this;
|
|
||||||
source = bigBook->mBigBookAtom_Body;
|
source = bigBook->mBigBookAtom_Body;
|
||||||
fill = bigBook->mBigBookAtom_Size;
|
fill = bigBook->mBigBookAtom_Size;
|
||||||
form = bigBook->mBigBookAtom_Form;
|
form = bigBook->mBigBookAtom_Form;
|
||||||
}
|
} else if (atom->IsWeeAnon()) {
|
||||||
else if ( this->IsWeeAnon() )
|
morkWeeAnonAtom* weeAnon = (morkWeeAnonAtom*)atom;
|
||||||
{
|
|
||||||
morkWeeAnonAtom* weeAnon = (morkWeeAnonAtom*) this;
|
|
||||||
source = weeAnon->mWeeAnonAtom_Body;
|
source = weeAnon->mWeeAnonAtom_Body;
|
||||||
fill = weeAnon->mAtom_Size;
|
fill = weeAnon->mAtom_Size;
|
||||||
}
|
} else if (atom->IsBigAnon()) {
|
||||||
else if ( this->IsBigAnon() )
|
morkBigAnonAtom* bigAnon = (morkBigAnonAtom*)atom;
|
||||||
{
|
|
||||||
morkBigAnonAtom* bigAnon = (morkBigAnonAtom*) this;
|
|
||||||
source = bigAnon->mBigAnonAtom_Body;
|
source = bigAnon->mBigAnonAtom_Body;
|
||||||
fill = bigAnon->mBigAnonAtom_Size;
|
fill = bigAnon->mBigAnonAtom_Size;
|
||||||
form = bigAnon->mBigAnonAtom_Form;
|
form = bigAnon->mBigAnonAtom_Form;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if ( source && fill ) // have an atom with nonempty content?
|
if ( source && fill ) // have an atom with nonempty content?
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -89,7 +89,7 @@ public: // errors
|
||||||
public: // yarns
|
public: // yarns
|
||||||
|
|
||||||
static mork_bool AliasYarn(const morkAtom* atom, mdbYarn* outYarn);
|
static mork_bool AliasYarn(const morkAtom* atom, mdbYarn* outYarn);
|
||||||
mork_bool GetYarn(mdbYarn* outYarn) const;
|
static mork_bool GetYarn(const morkAtom* atom, mdbYarn* outYarn);
|
||||||
|
|
||||||
private: // copying is not allowed
|
private: // copying is not allowed
|
||||||
morkAtom(const morkAtom& other);
|
morkAtom(const morkAtom& other);
|
||||||
|
|
|
||||||
|
|
@ -45,7 +45,7 @@ void
|
||||||
morkCell::GetYarn(morkEnv* ev, mdbYarn* outYarn) const
|
morkCell::GetYarn(morkEnv* ev, mdbYarn* outYarn) const
|
||||||
{
|
{
|
||||||
MORK_USED_1(ev);
|
MORK_USED_1(ev);
|
||||||
mCell_Atom->GetYarn(outYarn);
|
morkAtom::GetYarn(mCell_Atom, outYarn);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
|
|
||||||
|
|
@ -332,7 +332,7 @@ NS_IMETHODIMP morkCellObject::GetYarn(nsIMdbEnv* mev,
|
||||||
if ( ev )
|
if ( ev )
|
||||||
{
|
{
|
||||||
morkAtom* atom = cell->GetAtom();
|
morkAtom* atom = cell->GetAtom();
|
||||||
atom->GetYarn(outYarn);
|
morkAtom::GetYarn(atom, outYarn);
|
||||||
outErr = ev->AsErr();
|
outErr = ev->AsErr();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -447,17 +447,21 @@ void morkRow::SeekColumn(morkEnv* ev, mdb_pos inPos,
|
||||||
if ( cells && inPos < mRow_Length && inPos >= 0 )
|
if ( cells && inPos < mRow_Length && inPos >= 0 )
|
||||||
{
|
{
|
||||||
morkCell* c = cells + inPos;
|
morkCell* c = cells + inPos;
|
||||||
if ( outColumn )
|
if ( outColumn ) {
|
||||||
*outColumn = c->GetColumn();
|
*outColumn = c->GetColumn();
|
||||||
if ( outYarn )
|
}
|
||||||
c->mCell_Atom->GetYarn(outYarn); // nil atom works okay here
|
if ( outYarn ) {
|
||||||
|
morkAtom::GetYarn(c->mCell_Atom, outYarn);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if ( outColumn )
|
if ( outColumn ) {
|
||||||
*outColumn = 0;
|
*outColumn = 0;
|
||||||
if ( outYarn )
|
}
|
||||||
((morkAtom*) 0)->GetYarn(outYarn); // yes this will work
|
if ( outYarn ) {
|
||||||
|
morkAtom::GetYarn((morkAtom*)0, outYarn);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -467,28 +471,30 @@ morkRow::NextColumn(morkEnv* ev, mdb_column* ioColumn, mdbYarn* outYarn)
|
||||||
morkCell* cells = mRow_Cells;
|
morkCell* cells = mRow_Cells;
|
||||||
if ( cells )
|
if ( cells )
|
||||||
{
|
{
|
||||||
mork_column last = 0;
|
mork_column last = 0;
|
||||||
mork_column inCol = *ioColumn;
|
mork_column inCol = *ioColumn;
|
||||||
morkCell* end = cells + mRow_Length;
|
morkCell* end = cells + mRow_Length;
|
||||||
while ( cells < end )
|
while ( cells < end )
|
||||||
{
|
{
|
||||||
if ( inCol == last ) // found column?
|
if ( inCol == last ) // found column?
|
||||||
{
|
{
|
||||||
if ( outYarn )
|
if ( outYarn ) {
|
||||||
cells->mCell_Atom->GetYarn(outYarn); // nil atom works okay here
|
if (outYarn) {
|
||||||
|
morkAtom::GetYarn(cells->mCell_Atom, outYarn);
|
||||||
|
}
|
||||||
*ioColumn = cells->GetColumn();
|
*ioColumn = cells->GetColumn();
|
||||||
return; // stop, we are done
|
return; // stop, we are done
|
||||||
}
|
}
|
||||||
else
|
} else {
|
||||||
{
|
|
||||||
last = cells->GetColumn();
|
last = cells->GetColumn();
|
||||||
++cells;
|
++cells;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
*ioColumn = 0;
|
*ioColumn = 0;
|
||||||
if ( outYarn )
|
if ( outYarn ) {
|
||||||
((morkAtom*) 0)->GetYarn(outYarn); // yes this will work
|
morkAtom::GetYarn((morkAtom*)0, outYarn);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
morkCell*
|
morkCell*
|
||||||
|
|
|
||||||
|
|
@ -467,8 +467,7 @@ morkRowObject::GetCellYarn(
|
||||||
if ( mRowObject_Store && mRowObject_Row)
|
if ( mRowObject_Store && mRowObject_Row)
|
||||||
{
|
{
|
||||||
morkAtom* atom = mRowObject_Row->GetColumnAtom(ev, inColumn);
|
morkAtom* atom = mRowObject_Row->GetColumnAtom(ev, inColumn);
|
||||||
atom->GetYarn(outYarn);
|
morkAtom::GetYarn(atom, outYarn);
|
||||||
// note nil atom works and sets yarn correctly
|
|
||||||
}
|
}
|
||||||
|
|
||||||
outErr = ev->AsErr();
|
outErr = ev->AsErr();
|
||||||
|
|
|
||||||
|
|
@ -775,7 +775,7 @@ morkStore::OidToYarn(morkEnv* ev, const mdbOid& inOid, mdbYarn* outYarn)
|
||||||
morkAtomAidMap* map = &atomSpace->mAtomSpace_AtomAids;
|
morkAtomAidMap* map = &atomSpace->mAtomSpace_AtomAids;
|
||||||
atom = map->GetAid(ev, (mork_aid) inOid.mOid_Id);
|
atom = map->GetAid(ev, (mork_aid) inOid.mOid_Id);
|
||||||
}
|
}
|
||||||
atom->GetYarn(outYarn); // note this is safe even when atom==nil
|
morkAtom::GetYarn(atom, outYarn);
|
||||||
|
|
||||||
return ev->Good();
|
return ev->Good();
|
||||||
}
|
}
|
||||||
|
|
@ -823,10 +823,10 @@ morkStore::TokenToString(morkEnv* ev, mdb_token inToken, mdbYarn* outTokenName)
|
||||||
{
|
{
|
||||||
morkBookAtom* atom = 0;
|
morkBookAtom* atom = 0;
|
||||||
morkAtomSpace* space = mStore_GroundColumnSpace;
|
morkAtomSpace* space = mStore_GroundColumnSpace;
|
||||||
if ( space )
|
if ( space ) {
|
||||||
atom = space->mAtomSpace_AtomAids.GetAid(ev, (mork_aid) inToken);
|
atom = space->mAtomSpace_AtomAids.GetAid(ev, (mork_aid) inToken);
|
||||||
|
}
|
||||||
atom->GetYarn(outTokenName); // note this is safe even when atom==nil
|
morkAtom::GetYarn(atom, outTokenName);
|
||||||
}
|
}
|
||||||
else // token is an "immediate" single byte string representation?
|
else // token is an "immediate" single byte string representation?
|
||||||
this->SmallTokenToOneByteYarn(ev, inToken, outTokenName);
|
this->SmallTokenToOneByteYarn(ev, inToken, outTokenName);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue