Return TypeFunction nameArguments
hzEcodehdbADP::DeltaOriginateObj(hdbObjRepos*,hzChain&,)

Declared in file: hzDatabase.h
Defined in file : hdbADP.cpp

Function Logic:

0:START 1:unknown 2:Return E_OK 3:nSend nSend nSend items items items items items 4:unknown 5:nSent 6:unknown 7:rc 8:Return E_OK

Function body:

hzEcode hdbADP::DeltaOriginateObj (hdbObjRepos* pObjRepos)hzChain& Zd, 
{
   _hzfunc("hdbADP::DeltaOriginateObj") ;
   hzChain::BlkIter    bi ;    //  Chain block iterator
   hzChain             X ;     //  Chain to send to DS
   int32_t     nSend ;         //  Bytes to send
   int32_t     nSent ;         //  Bytes sent
   uint32_t    nSIL ;          //  Serial integer len
   hzEcode     rc = E_OK ;     //  Return code
   char        outBuf[64]; //  Used to state repos id etc
   if (m_eDeltaMode == DELTA_MODE_NULL)
       return E_OK ;
   //  Compile delta header
   nSend = sprintf(outBuf, "a=%s;r=%s;", *m_appName, pObjRepos->txtName()) ;
   nSend += 2;
   nSend += Zd.Size() ;
   //  Write command
   X.AddByte(DELTA_ORIG_OBJECT) ;
   //  Write nLen
   WriteSerialUINT32(X, nSIL, nSend) ;
   //  Write delta header
   X << outBuf ;
   //  Write delta
   X << Zd ;
   threadLog(X) ;
   //  Write to socket
   for (bi = X ; rc == E_OK && bi.Data() ; bi.Advance())
   {
       nSent = write(m_unixSock, bi.Data(), bi.Size()) ;
       if (nSent < 0)
           rc = hzerr(E_SENDFAIL, "Send error (errno=%d)\n", errno) ;
   }
   return E_OK ;
}