Back to index

lightning-sunbird  0.9+nobinonly
morkEnv.cpp
Go to the documentation of this file.
00001 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-  */
00002 /* ***** BEGIN LICENSE BLOCK *****
00003  * Version: MPL 1.1/GPL 2.0/LGPL 2.1
00004  *
00005  * The contents of this file are subject to the Mozilla Public License Version
00006  * 1.1 (the "License"); you may not use this file except in compliance with
00007  * the License. You may obtain a copy of the License at
00008  * http://www.mozilla.org/MPL/
00009  *
00010  * Software distributed under the License is distributed on an "AS IS" basis,
00011  * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
00012  * for the specific language governing rights and limitations under the
00013  * License.
00014  *
00015  * The Original Code is mozilla.org code.
00016  *
00017  * The Initial Developer of the Original Code is
00018  * Netscape Communications Corporation.
00019  * Portions created by the Initial Developer are Copyright (C) 1999
00020  * the Initial Developer. All Rights Reserved.
00021  *
00022  * Contributor(s):
00023  *
00024  * Alternatively, the contents of this file may be used under the terms of
00025  * either of the GNU General Public License Version 2 or later (the "GPL"),
00026  * or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
00027  * in which case the provisions of the GPL or the LGPL are applicable instead
00028  * of those above. If you wish to allow use of your version of this file only
00029  * under the terms of either the GPL or the LGPL, and not to allow others to
00030  * use your version of this file under the terms of the MPL, indicate your
00031  * decision by deleting the provisions above and replace them with the notice
00032  * and other provisions required by the GPL or the LGPL. If you do not delete
00033  * the provisions above, a recipient may use your version of this file under
00034  * the terms of any one of the MPL, the GPL or the LGPL.
00035  *
00036  * ***** END LICENSE BLOCK ***** */
00037 
00038 #ifndef _MDB_
00039 #include "mdb.h"
00040 #endif
00041 
00042 #ifndef _MORK_
00043 #include "mork.h"
00044 #endif
00045 
00046 #ifndef _MORKNODE_
00047 #include "morkNode.h"
00048 #endif
00049 
00050 #ifndef _MORKCH_
00051 #include "morkCh.h"
00052 #endif
00053 
00054 #ifndef _MORKENV_
00055 #include "morkEnv.h"
00056 #endif
00057 
00058 #ifndef _MORKFACTORY_
00059 #include "morkFactory.h"
00060 #endif
00061 
00062 //3456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789
00063 
00064 // ````` ````` ````` ````` ````` 
00065 // { ===== begin morkNode interface =====
00066 
00067 /*public virtual*/ void
00068 morkEnv::CloseMorkNode(morkEnv* ev) /*i*/ // CloseEnv() only if open
00069 {
00070   if ( this->IsOpenNode() )
00071   {
00072     this->MarkClosing();
00073     this->CloseEnv(ev);
00074     this->MarkShut();
00075   }
00076 }
00077 
00078 /*public virtual*/
00079 morkEnv::~morkEnv() /*i*/ // assert CloseEnv() executed earlier
00080 {
00081   CloseMorkNode(mMorkEnv);
00082   if (mEnv_Heap)
00083   {
00084     mork_bool ownsHeap = mEnv_OwnsHeap;
00085     nsIMdbHeap*saveHeap = mEnv_Heap;
00086 
00087     if (ownsHeap)
00088     {
00089 #ifdef MORK_DEBUG_HEAP_STATS
00090       printf("%d blocks remaining \n", ((orkinHeap *) saveHeap)->HeapBlockCount());
00091       mork_u4* array = (mork_u4*) this;
00092       array -= 3;
00093       // null out heap ptr in mem block so we won't crash trying to use it to
00094       // delete the env.
00095       *array = nsnull;
00096 #endif // MORK_DEBUG_HEAP_STATS
00097       // whoops, this is our heap - hmm. Can't delete it, or not allocate env's from
00098       // an orkinHeap.
00099       delete saveHeap;
00100     }
00101 
00102   }
00103 //  MORK_ASSERT(mEnv_SelfAsMdbEnv==0);
00104   MORK_ASSERT(mEnv_ErrorHook==0);
00105 }
00106 
00107 /* choose morkBool_kTrue or morkBool_kFalse for kBeVerbose: */
00108 #define morkEnv_kBeVerbose morkBool_kFalse
00109 
00110 /*public non-poly*/
00111 morkEnv::morkEnv(const morkUsage& inUsage, nsIMdbHeap* ioHeap,
00112   morkFactory* ioFactory, nsIMdbHeap* ioSlotHeap)
00113 : morkObject(inUsage, ioHeap, morkColor_kNone)
00114 , mEnv_Factory( ioFactory )
00115 , mEnv_Heap( ioSlotHeap )
00116 
00117 , mEnv_SelfAsMdbEnv( 0 )
00118 , mEnv_ErrorHook( 0 )
00119 , mEnv_HandlePool( 0 )
00120   
00121 , mEnv_ErrorCount( 0 ) 
00122 , mEnv_WarningCount( 0 ) 
00123 
00124 , mEnv_ErrorCode( 0 )
00125   
00126 , mEnv_DoTrace( morkBool_kFalse )
00127 , mEnv_AutoClear( morkAble_kDisabled )
00128 , mEnv_ShouldAbort( morkBool_kFalse )
00129 , mEnv_BeVerbose( morkEnv_kBeVerbose )
00130 , mEnv_OwnsHeap ( morkBool_kFalse )
00131 {
00132   MORK_ASSERT(ioSlotHeap && ioFactory );
00133   if ( ioSlotHeap )
00134   {
00135     // mEnv_Heap is NOT refcounted:
00136     // nsIMdbHeap_SlotStrongHeap(ioSlotHeap, this, &mEnv_Heap);
00137     
00138     mEnv_HandlePool = new morkPool(morkUsage::kGlobal,
00139       (nsIMdbHeap*) 0, ioSlotHeap);
00140       
00141     MORK_ASSERT(mEnv_HandlePool);
00142     if ( mEnv_HandlePool && this->Good() )
00143     {
00144       mNode_Derived = morkDerived_kEnv;
00145       mNode_Refs += morkEnv_kWeakRefCountEnvBonus;
00146     }
00147   }
00148 }
00149 
00150 /*public non-poly*/
00151 morkEnv::morkEnv(morkEnv* ev, /*i*/
00152   const morkUsage& inUsage, nsIMdbHeap* ioHeap, nsIMdbEnv* inSelfAsMdbEnv,
00153   morkFactory* ioFactory, nsIMdbHeap* ioSlotHeap)
00154 : morkObject(ev, inUsage, ioHeap, morkColor_kNone, (morkHandle*) 0)
00155 , mEnv_Factory( ioFactory )
00156 , mEnv_Heap( ioSlotHeap )
00157 
00158 , mEnv_SelfAsMdbEnv( inSelfAsMdbEnv )
00159 , mEnv_ErrorHook( 0 )
00160 , mEnv_HandlePool( 0 )
00161   
00162 , mEnv_ErrorCount( 0 ) 
00163 , mEnv_WarningCount( 0 ) 
00164 
00165 , mEnv_ErrorCode( 0 )
00166   
00167 , mEnv_DoTrace( morkBool_kFalse )
00168 , mEnv_AutoClear( morkAble_kDisabled )
00169 , mEnv_ShouldAbort( morkBool_kFalse )
00170 , mEnv_BeVerbose( morkEnv_kBeVerbose )
00171 , mEnv_OwnsHeap ( morkBool_kFalse )
00172 {
00173   // $$$ do we need to refcount the inSelfAsMdbEnv nsIMdbEnv??
00174   
00175   if ( ioFactory && inSelfAsMdbEnv && ioSlotHeap)
00176   {
00177     // mEnv_Heap is NOT refcounted:
00178     // nsIMdbHeap_SlotStrongHeap(ioSlotHeap, ev, &mEnv_Heap);
00179 
00180     mEnv_HandlePool = new(*ioSlotHeap, ev) morkPool(ev, 
00181       morkUsage::kHeap, ioSlotHeap, ioSlotHeap);
00182       
00183     MORK_ASSERT(mEnv_HandlePool);
00184     if ( mEnv_HandlePool && ev->Good() )
00185     {
00186       mNode_Derived = morkDerived_kEnv;
00187       mNode_Refs += morkEnv_kWeakRefCountEnvBonus;
00188     }
00189   }
00190   else
00191     ev->NilPointerError();
00192 }
00193 
00194 NS_IMPL_ISUPPORTS_INHERITED1(morkEnv, morkObject, nsIMdbEnv)
00195 /*public non-poly*/ void
00196 morkEnv::CloseEnv(morkEnv* ev) /*i*/ // called by CloseMorkNode();
00197 {
00198   if ( this )
00199   {
00200     if ( this->IsNode() )
00201     {
00202       // $$$ release mEnv_SelfAsMdbEnv??
00203       // $$$ release mEnv_ErrorHook??
00204       
00205       mEnv_SelfAsMdbEnv = 0;
00206       mEnv_ErrorHook = 0;
00207       
00208       morkPool* savePool = mEnv_HandlePool;
00209       morkPool::SlotStrongPool((morkPool*) 0, ev, &mEnv_HandlePool);
00210       // free the pool
00211       if (mEnv_SelfAsMdbEnv)
00212       {
00213         if (savePool && mEnv_Heap)
00214           mEnv_Heap->Free(this->AsMdbEnv(), savePool);
00215       }
00216       else
00217       {
00218         if (savePool)
00219         {
00220           if (savePool->IsOpenNode())
00221             savePool->CloseMorkNode(ev);
00222           delete savePool;
00223         }
00224         // how do we free this? might need to get rid of asserts.
00225       }
00226       // mEnv_Factory is NOT refcounted
00227       
00228       this->MarkShut();
00229     }
00230     else
00231       this->NonNodeError(ev);
00232   }
00233   else
00234     ev->NilPointerError();
00235 }
00236 
00237 // } ===== end morkNode methods =====
00238 // ````` ````` ````` ````` ````` 
00239 
00240 mork_size
00241 morkEnv::OidAsHex(void* outBuf, const mdbOid& inOid)
00242 // sprintf(buf, "%lX:^%lX", (long) inOid.mOid_Id, (long) inOid.mOid_Scope);
00243 {
00244   mork_u1* p = (mork_u1*) outBuf;
00245   mork_size outSize = this->TokenAsHex(p, inOid.mOid_Id);
00246   p += outSize;
00247   *p++ = ':';
00248   
00249   mork_scope scope = inOid.mOid_Scope;
00250   if ( scope < 0x80 && morkCh_IsName((mork_ch) scope) )
00251   {
00252     *p++ = (mork_u1) scope;
00253     *p = 0; // null termination
00254     outSize += 2;
00255   }
00256   else
00257   {
00258     *p++ = '^';
00259     mork_size scopeSize = this->TokenAsHex(p, scope);
00260     outSize += scopeSize + 2;
00261   }
00262   return outSize;
00263 }
00264 
00265 
00266 mork_u1
00267 morkEnv::HexToByte(mork_ch inFirstHex, mork_ch inSecondHex)
00268 {
00269   mork_u1 hi = 0; // high four hex bits
00270   mork_flags f = morkCh_GetFlags(inFirstHex);
00271   if ( morkFlags_IsDigit(f) )
00272     hi = (mork_u1) (inFirstHex - (mork_ch) '0');
00273   else if ( morkFlags_IsUpper(f) )
00274     hi = (mork_u1) ((inFirstHex - (mork_ch) 'A') + 10);
00275   else if ( morkFlags_IsLower(f) )
00276     hi = (mork_u1) ((inFirstHex - (mork_ch) 'a') + 10);
00277   
00278   mork_u1 lo = 0; // low four hex bits
00279   f = morkCh_GetFlags(inSecondHex);
00280   if ( morkFlags_IsDigit(f) )
00281     lo = (mork_u1) (inSecondHex - (mork_ch) '0');
00282   else if ( morkFlags_IsUpper(f) )
00283     lo = (mork_u1) ((inSecondHex - (mork_ch) 'A') + 10);
00284   else if ( morkFlags_IsLower(f) )
00285     lo = (mork_u1) ((inSecondHex - (mork_ch) 'a') + 10);
00286     
00287   return (mork_u1) ((hi << 4) | lo);
00288 }
00289 
00290 mork_size
00291 morkEnv::TokenAsHex(void* outBuf, mork_token inToken)
00292   // TokenAsHex() is the same as sprintf(outBuf, "%lX", (long) inToken);
00293 {
00294   static const char morkEnv_kHexDigits[] = "0123456789ABCDEF";
00295   char* p = (char*) outBuf;
00296   char* end = p + 32; // write no more than 32 digits for safety
00297   if ( inToken )
00298   {
00299     // first write all the hex digits in backwards order:
00300     while ( p < end && inToken ) // more digits to write?
00301     {
00302       *p++ = morkEnv_kHexDigits[ inToken & 0x0F ]; // low four bits
00303       inToken >>= 4; // we fervently hope this does not sign extend
00304     }
00305     *p = 0; // end the string with a null byte
00306     char* s = (char*) outBuf; // first byte in string
00307     mork_size size = (mork_size) (p - s); // distance from start
00308 
00309     // now reverse the string in place:
00310     // note that p starts on the null byte, so we need predecrement:
00311     while ( --p > s ) // need to swap another byte in the string?
00312     {
00313       char c = *p; // temp for swap
00314       *p = *s;
00315       *s++ = c; // move s forward here, and p backward in the test
00316     }
00317     return size;
00318   }
00319   else // special case for zero integer
00320   {
00321     *p++ = '0'; // write a zero digit
00322     *p = 0; // end with a null byte
00323     return 1; // one digit in hex representation
00324   }
00325 }
00326 
00327 void
00328 morkEnv::StringToYarn(const char* inString, mdbYarn* outYarn)
00329 {
00330   if ( outYarn )
00331   {
00332     mdb_fill fill = ( inString )? (mdb_fill) MORK_STRLEN(inString) : 0; 
00333       
00334     if ( fill ) // have nonempty content?
00335     {
00336       mdb_size size = outYarn->mYarn_Size; // max dest size
00337       if ( fill > size ) // too much string content?
00338       {
00339         outYarn->mYarn_More = fill - size; // extra string bytes omitted
00340         fill = size; // copy no more bytes than size of yarn buffer
00341       }
00342       void* dest = outYarn->mYarn_Buf; // where bytes are going
00343       if ( !dest ) // nil destination address buffer?
00344         fill = 0; // we can't write any content at all
00345         
00346       if ( fill ) // anything to copy?
00347         MORK_MEMCPY(dest, inString, fill); // copy fill bytes to yarn
00348         
00349       outYarn->mYarn_Fill = fill; // tell yarn size of copied content
00350     }
00351     else // no content to put into the yarn
00352     {
00353       outYarn->mYarn_Fill = 0; // tell yarn that string has no bytes
00354     }
00355     outYarn->mYarn_Form = 0; // always update the form slot
00356   }
00357   else
00358     this->NilPointerError();
00359 }
00360 
00361 char*
00362 morkEnv::CopyString(nsIMdbHeap* ioHeap, const char* inString)
00363 {
00364   char* outString = 0;
00365   if ( ioHeap && inString )
00366   {
00367     mork_size size = MORK_STRLEN(inString) + 1;
00368     ioHeap->Alloc(this->AsMdbEnv(), size, (void**) &outString);
00369     if ( outString )
00370       MORK_STRCPY(outString, inString);
00371   }
00372   else
00373     this->NilPointerError();
00374   return outString;
00375 }
00376 
00377 void
00378 morkEnv::FreeString(nsIMdbHeap* ioHeap, char* ioString)
00379 {
00380   if ( ioHeap )
00381   {
00382     if ( ioString )
00383       ioHeap->Free(this->AsMdbEnv(), ioString);
00384   }
00385   else
00386     this->NilPointerError();
00387 }
00388 
00389 void
00390 morkEnv::NewErrorAndCode(const char* inString, mork_u2 inCode)
00391 {
00392   MORK_ASSERT(morkBool_kFalse); // get developer's attention
00393 
00394   ++mEnv_ErrorCount;
00395   mEnv_ErrorCode = (mork_u4) ((inCode)? inCode: morkEnv_kGenericError);
00396   
00397   if ( mEnv_ErrorHook )
00398     mEnv_ErrorHook->OnErrorString(this->AsMdbEnv(), inString);
00399 }
00400 
00401 void
00402 morkEnv::NewError(const char* inString)
00403 {
00404   MORK_ASSERT(morkBool_kFalse); // get developer's attention
00405 
00406   ++mEnv_ErrorCount;
00407   mEnv_ErrorCode = morkEnv_kGenericError;
00408   
00409   if ( mEnv_ErrorHook )
00410     mEnv_ErrorHook->OnErrorString(this->AsMdbEnv(), inString);
00411 }
00412 
00413 void
00414 morkEnv::NewWarning(const char* inString)
00415 {
00416   MORK_ASSERT(morkBool_kFalse); // get developer's attention
00417   
00418   ++mEnv_WarningCount;
00419   if ( mEnv_ErrorHook )
00420     mEnv_ErrorHook->OnWarningString(this->AsMdbEnv(), inString);
00421 }
00422 
00423 void
00424 morkEnv::StubMethodOnlyError()
00425 {
00426   this->NewError("method is stub only");
00427 }
00428 
00429 void
00430 morkEnv::OutOfMemoryError()
00431 {
00432   this->NewError("out of memory");
00433 }
00434 
00435 void
00436 morkEnv::CantMakeWhenBadError()
00437 {
00438   this->NewError("can't make an object when ev->Bad()");
00439 }
00440 
00441 static const char morkEnv_kNilPointer[] = "nil pointer";
00442 
00443 void
00444 morkEnv::NilPointerError()
00445 {
00446   this->NewError(morkEnv_kNilPointer);
00447 }
00448 
00449 void
00450 morkEnv::NilPointerWarning()
00451 {
00452   this->NewWarning(morkEnv_kNilPointer);
00453 }
00454 
00455 void
00456 morkEnv::NewNonEnvError()
00457 {
00458   this->NewError("non-env instance");
00459 }
00460 
00461 void
00462 morkEnv::NilEnvSlotError()
00463 {
00464   if ( !mEnv_HandlePool || !mEnv_Factory )
00465   {
00466     if ( !mEnv_HandlePool )
00467       this->NewError("nil mEnv_HandlePool");
00468     if ( !mEnv_Factory )
00469       this->NewError("nil mEnv_Factory");
00470   }
00471   else
00472     this->NewError("unknown nil env slot");
00473 }
00474 
00475 
00476 void morkEnv::NonEnvTypeError(morkEnv* ev)
00477 {
00478   ev->NewError("non morkEnv");
00479 }
00480 
00481 void
00482 morkEnv::ClearMorkErrorsAndWarnings()
00483 {
00484   mEnv_ErrorCount = 0;
00485   mEnv_WarningCount = 0;
00486   mEnv_ErrorCode = 0;
00487   mEnv_ShouldAbort = morkBool_kFalse;
00488 }
00489 
00490 void
00491 morkEnv::AutoClearMorkErrorsAndWarnings()
00492 {
00493   if ( this->DoAutoClear() )
00494   {
00495     mEnv_ErrorCount = 0;
00496     mEnv_WarningCount = 0;
00497     mEnv_ErrorCode = 0;
00498     mEnv_ShouldAbort = morkBool_kFalse;
00499   }
00500 }
00501 
00502 /*static*/ morkEnv*
00503 morkEnv::FromMdbEnv(nsIMdbEnv* ioEnv) // dynamic type checking
00504 {
00505   morkEnv* outEnv = 0;
00506   if ( ioEnv )
00507   {
00508     // Note this cast is expected to perform some address adjustment of the
00509     // pointer, so oenv likely does not equal ioEnv.  Do not cast to void*
00510     // first to force an exactly equal pointer (we tried it and it's wrong).
00511     morkEnv* ev = (morkEnv*) ioEnv;
00512     if ( ev && ev->IsEnv() )
00513     {
00514       if ( ev->DoAutoClear() )
00515       {
00516         ev->mEnv_ErrorCount = 0;
00517         ev->mEnv_WarningCount = 0;
00518         ev->mEnv_ErrorCode = 0;
00519       }
00520       outEnv = ev;
00521     }
00522     else
00523       MORK_ASSERT(outEnv);
00524   }
00525   else
00526     MORK_ASSERT(outEnv);
00527   return outEnv;
00528 }
00529 
00530 
00531 NS_IMETHODIMP
00532 morkEnv::GetErrorCount(mdb_count* outCount,
00533   mdb_bool* outShouldAbort)
00534 {
00535   if ( outCount )
00536     *outCount = mEnv_ErrorCount;
00537   if ( outShouldAbort )
00538     *outShouldAbort = mEnv_ShouldAbort;
00539   return NS_OK;
00540 }
00541 
00542 NS_IMETHODIMP
00543 morkEnv::GetWarningCount(mdb_count* outCount,
00544   mdb_bool* outShouldAbort)
00545 {
00546   if ( outCount )
00547     *outCount = mEnv_WarningCount;
00548   if ( outShouldAbort )
00549     *outShouldAbort = mEnv_ShouldAbort;
00550   return NS_OK;
00551 }
00552 
00553 NS_IMETHODIMP
00554 morkEnv::GetEnvBeVerbose(mdb_bool* outBeVerbose)
00555 {
00556   NS_ENSURE_ARG_POINTER(outBeVerbose);
00557   *outBeVerbose = mEnv_BeVerbose;
00558   return NS_OK;
00559 }
00560 
00561 NS_IMETHODIMP
00562 morkEnv::SetEnvBeVerbose(mdb_bool inBeVerbose)
00563 {
00564   mEnv_BeVerbose = inBeVerbose;
00565   return NS_OK;
00566 }
00567 
00568 NS_IMETHODIMP
00569 morkEnv::GetDoTrace(mdb_bool* outDoTrace)
00570 {
00571   NS_ENSURE_ARG_POINTER(outDoTrace);
00572   *outDoTrace = mEnv_DoTrace;
00573   return NS_OK;
00574 }
00575 
00576 NS_IMETHODIMP
00577 morkEnv::SetDoTrace(mdb_bool inDoTrace)
00578 {
00579   mEnv_DoTrace = inDoTrace;
00580   return NS_OK;
00581 }
00582 
00583 NS_IMETHODIMP
00584 morkEnv::GetAutoClear(mdb_bool* outAutoClear)
00585 {
00586   NS_ENSURE_ARG_POINTER(outAutoClear);
00587   *outAutoClear = DoAutoClear();
00588   return NS_OK;
00589 }
00590 
00591 NS_IMETHODIMP
00592 morkEnv::SetAutoClear(mdb_bool inAutoClear)
00593 {
00594   if ( inAutoClear )
00595     EnableAutoClear();
00596   else
00597     DisableAutoClear();
00598   return NS_OK;
00599 }
00600 
00601 NS_IMETHODIMP
00602 morkEnv::GetErrorHook(nsIMdbErrorHook** acqErrorHook)
00603 {
00604   NS_ENSURE_ARG_POINTER(acqErrorHook);
00605   *acqErrorHook = mEnv_ErrorHook;
00606   NS_IF_ADDREF(mEnv_ErrorHook);
00607   return NS_OK;
00608 }
00609 
00610 NS_IMETHODIMP
00611 morkEnv::SetErrorHook(
00612   nsIMdbErrorHook* ioErrorHook) // becomes referenced
00613 {
00614   mEnv_ErrorHook = ioErrorHook;
00615   return NS_OK;
00616 }
00617 
00618 NS_IMETHODIMP
00619 morkEnv::GetHeap(nsIMdbHeap** acqHeap)
00620 {
00621   NS_ENSURE_ARG_POINTER(acqHeap);
00622   nsIMdbHeap* outHeap = 0;
00623   nsIMdbHeap* heap = mEnv_Heap;
00624   if ( heap && heap->HeapAddStrongRef(this) == 0 )
00625     outHeap = heap;
00626 
00627   if ( acqHeap )
00628     *acqHeap = outHeap;
00629   return NS_OK;
00630 }
00631 
00632 NS_IMETHODIMP
00633 morkEnv::SetHeap(
00634   nsIMdbHeap* ioHeap) // becomes referenced
00635 {
00636   nsIMdbHeap_SlotStrongHeap(ioHeap, this, &mEnv_Heap);
00637   return NS_OK;
00638 }
00639 // } ----- end attribute methods -----
00640 
00641 NS_IMETHODIMP
00642 morkEnv::ClearErrors() // clear errors beore re-entering db API
00643 {
00644   mEnv_ErrorCount = 0;
00645   mEnv_ErrorCode = 0;
00646   mEnv_ShouldAbort = morkBool_kFalse;
00647 
00648   return NS_OK;
00649 }
00650 
00651 NS_IMETHODIMP
00652 morkEnv::ClearWarnings() // clear warning
00653 {
00654   mEnv_WarningCount = 0;
00655   return NS_OK;
00656 }
00657 
00658 NS_IMETHODIMP
00659 morkEnv::ClearErrorsAndWarnings() // clear both errors & warnings
00660 {
00661   ClearMorkErrorsAndWarnings();
00662   return NS_OK;
00663 }
00664 // } ===== end nsIMdbEnv methods =====
00665 
00666 
00667 //3456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789