コード例 #1
0
ファイル: rexx.c プロジェクト: ErisBlastar/osfree
APIRET APIENTRY RexxResetTrace( LONG pid,
                                LONG tid)
{
   APIRET rc=RXARI_NOT_FOUND;

   if ( InterpreterIdx == -1 )
      LoadInterpreter();

   if (Trace)
   {
      TraceString( "%s: pid: %ld tid: %ld ",
         "RexxResetTrace()",
         pid,
         tid );

   }
   if (ORexxResetTrace)
   {
      rc = (*ORexxResetTrace)(
         (LONG)      pid,
         (LONG)      tid);
   }
   if (Trace)
   {
      TraceString( "<=> Result: %d\n", rc );
   }
   return rc;
}
コード例 #2
0
ファイル: TraceNdbApi.cpp プロジェクト: A-eolus/mysql
CTraceNdbIndexOperation* CTraceNdbConnection::getNdbIndexOperation(const char* anIndexName, const char* aTableName)
{
  NdbIndexOperation* pNdbIndexOperation = NdbConnection::getNdbIndexOperation(anIndexName, aTableName);
  TraceBegin();
  TraceNdbConnection(this);
  TraceMethod("getNdbIndexOperation");
  TraceString(anIndexName);
  TraceString(aTableName);
  TraceReturn();
  TraceNdbIndexOperation(pNdbIndexOperation);
  TraceEnd();
  return (CTraceNdbIndexOperation*)pNdbIndexOperation; 
}
コード例 #3
0
ファイル: rexx.c プロジェクト: ErisBlastar/osfree
/*
 * RexxStart
 */
APIRET APIENTRY RexxStart(
   LONG ArgCount,
   PRXSTRING ArgList,
   PCSZ ProgramName,
   PRXSTRING Instore,
   PCSZ EnvName,
   LONG CallType,
   PRXSYSEXIT Exits,
   PSHORT ReturnCode,
   PRXSTRING Result )
{
   APIRET rc=RXFUNC_NOTREG;

   if ( InterpreterIdx == -1 )
      LoadInterpreter();

   if (Trace)
   {
      TraceString( "%s: ArgCount: %d ArgList: %x ProgramName: \"%s\" Instore: %x EnvName: \"%s\" Calltype: %d Exits: %x ReturnCode: %x Result: %x",
         "RexxStart()",
         ArgCount,
         ArgList,
         ProgramName,
         Instore,
         EnvName,
         CallType,
         Exits,
         ReturnCode,
         Result );
   }
   if (ORexxStart)
      rc = (*ORexxStart)(
         (LONG)      ArgCount,
         (PRXSTRING) ArgList,
         (PSZ)       ProgramName,
         (PRXSTRING) Instore,
         (PSZ)       EnvName,
         (LONG)      CallType,
         (PRXSYSEXIT)Exits,
         (PSHORT)    ReturnCode,
         (PRXSTRING) Result ) ;
   if (Trace)
   {
      TraceString( "<=> ReturnCode %d ResultString \"%s\" Result: %d\n",
                   (Result && Result->strptr) ? Result->strptr : "",
                   ReturnCode,
                   rc );
   }
   return rc;
}
コード例 #4
0
ファイル: rexx.c プロジェクト: ErisBlastar/osfree
static void LoadInterpreter( void )
{
   handle_type handle=(handle_type)NULL ;
   char *ptr;

   if ( DosScanEnv( "REXX_TRACEFILE", (PSZ *)&ptr ) )
      ptr = NULL;
   if ( ptr != NULL )
   {
      Trace = 1;
      strcpy( TraceFileName, ptr );
   }

   handle = (handle_type)FindInterpreter( "REGINA" );
   if ( handle == (handle_type)NULL )
   {
      fprintf( stderr, "Could not find Regina DLL. Cannot continue.\n" );
      exit( 11 );
   }
   if ( Trace )
   {
      TraceString( "----------- Initialisation Complete - Program Execution Begins -----------\n" );
   }
   InterpreterIdx = 0;
   return;
}
コード例 #5
0
HRESULT CHWMFT::GetOutputStatus(
    DWORD*  pdwFlags)
{
    /*****************************************
    ** See http://msdn.microsoft.com/en-us/library/ms696269(v=VS.85).aspx
    *****************************************/

    HRESULT hr = S_OK;

    TraceString(CHMFTTracing::TRACE_INFORMATION, L"%S(): Enter",  __FUNCTION__);

    do
    {
        if(IsLocked() != FALSE)
        {
            hr = MF_E_TRANSFORM_ASYNC_LOCKED;
            break;
        }

        if(pdwFlags == NULL)
        {
            hr = E_POINTER;
            break;
        }

        (*pdwFlags) = 0;

        {
            CAutoLock lock(&m_csLock);

            if((m_dwStatus & MYMFT_STATUS_OUTPUT_SAMPLE_READY) != 0)
            {
                *pdwFlags = MFT_OUTPUT_STATUS_SAMPLE_READY;
            }
        }

        TraceString(CHMFTTracing::TRACE_INFORMATION, L"%S(): Output Status Flags: 0x%x",  __FUNCTION__, (*pdwFlags));
    }while(false);

    TraceString(CHMFTTracing::TRACE_INFORMATION, L"%S(): Exit (hr=0x%x)",  __FUNCTION__, hr);

    return hr;
}
コード例 #6
0
ファイル: TraceNdbApi.cpp プロジェクト: A-eolus/mysql
CTraceNdb::CTraceNdb(const char* aDataBase)
: Ndb(aDataBase) 
{
  TraceBegin();
  TraceNdb(this);
  TraceMethod("Ndb");
  TraceString(aDataBase);
  TraceReturn();
  TraceVoid();
  TraceEnd();
}
コード例 #7
0
ファイル: TraceNdbApi.cpp プロジェクト: A-eolus/mysql
CTraceNdbRecAttr* CTraceNdbIndexOperation::getValue(const char* anAttrName)
{
  NdbRecAttr* pNdbRecAttr = NdbIndexOperation::getValue(anAttrName);
  TraceBegin();
  TraceNdbIndexOperation(this);
  TraceMethod("getValue");
  TraceString(anAttrName);
  TraceReturn();
  TraceNdbRecAttr(pNdbRecAttr);
  TraceEnd();
  return (CTraceNdbRecAttr*)pNdbRecAttr;
}
コード例 #8
0
ファイル: TraceNdbApi.cpp プロジェクト: A-eolus/mysql
int CTraceNdbSchemaOp::createTable(const char* aTableName)
{
  int i = NdbSchemaOp::createTable(aTableName);
  TraceBegin();
  TraceNdbSchemaOp(this);
  TraceMethod("createTable");
  TraceString(aTableName);
  TraceReturn();
  TraceInt(i);
  TraceEnd();
  return i;
}
コード例 #9
0
ファイル: rexx.c プロジェクト: ErisBlastar/osfree
APIRET APIENTRY RexxSAA(
                VOID              )
{
   APIRET rc=0;

   if ( InterpreterIdx == -1 )
      LoadInterpreter();

   if (Trace)
   {
      TraceString( "%s: ",
         "RexxSAA()" );

   }
   if (Trace)
   {
      TraceString( "<=> Result: %d\n",
                   rc );
   }
   return rc;
}
コード例 #10
0
ファイル: TraceNdbApi.cpp プロジェクト: A-eolus/mysql
int CTraceNdbIndexOperation::incValue(const char* anAttrName, Uint32 aValue)
{
  int i = NdbIndexOperation::incValue(anAttrName, aValue);
  TraceBegin();
  TraceNdbIndexOperation(this);
  TraceMethod("incValue");
  TraceString(anAttrName);
  TraceUint32(aValue);
  TraceReturn();
  TraceInt(i);
  TraceEnd();
  return i;
}
コード例 #11
0
ファイル: TraceNdbApi.cpp プロジェクト: A-eolus/mysql
int CTraceNdbOperation::equal(const char* anAttrName, Uint32 aValue)
{
  int i = NdbOperation::equal(anAttrName, aValue);
  TraceBegin();
  TraceNdbOperation(this);
  TraceMethod("equal");
  TraceString(anAttrName);
  TraceUint32(aValue);
  TraceReturn();
  TraceInt(i);
  TraceEnd();
  return i;
}
コード例 #12
0
ファイル: TraceNdbApi.cpp プロジェクト: A-eolus/mysql
int CTraceNdbSchemaOp::createAttribute(const char* aAttrName, KeyType aTupleyKey)
{
  int i = NdbSchemaOp::createAttribute(aAttrName, aTupleyKey);
  TraceBegin();
  TraceNdbSchemaOp(this);
  TraceMethod("createAttribute");
  TraceString(aAttrName);
  TraceKeyType(aTupleyKey);
  TraceReturn();
  TraceInt(i);
  TraceEnd();
  return i;
}
コード例 #13
0
HRESULT CHWMFT::ProcessOutput(
    DWORD                   dwFlags,
    DWORD                   dwOutputBufferCount,
    MFT_OUTPUT_DATA_BUFFER* pOutputSamples,
    DWORD*                  pdwStatus)
{
    /*****************************************
    ** See http://msdn.microsoft.com/en-us/library/ms704014(v=VS.85).aspx
    *****************************************/

    HRESULT     hr      = S_OK;
    IMFSample*  pSample = NULL;

    TraceString(CHMFTTracing::TRACE_INFORMATION, L"%S(): Enter",  __FUNCTION__);

    do
    {
        if(IsLocked() != FALSE)
        {
            hr = MF_E_TRANSFORM_ASYNC_LOCKED;
            break;
        }

        {
            CAutoLock lock(&m_csLock);

            TraceString(CHMFTTracing::TRACE_INFORMATION, L"%S(): HaveOutputCount: %u",  __FUNCTION__, m_dwHaveOutputCount);

            if(m_dwHaveOutputCount == 0)
            {
                // This call does not correspond to a have output call

                hr = E_UNEXPECTED;
                break;
            }
            else
            {
                m_dwHaveOutputCount--;
            }
        }

        /*****************************************
        ** Todo: If your MFT supports more than one
        ** stream, make sure you modify
        ** MFT_MAX_STREAMS and adjust this function
        ** accordingly
        *****************************************/
        if(dwOutputBufferCount < MFT_MAX_STREAMS)
        {
            hr = E_INVALIDARG;
            break;
        }

        if(IsMFTReady() == FALSE)
        {
            hr = MF_E_TRANSFORM_TYPE_NOT_SET;
            break;
        }

        /***************************************
        ** Since this in an internal function
        ** we know m_pOutputSampleQueue can never be
        ** NULL due to InitializeTransform()
        ***************************************/
        hr = m_pOutputSampleQueue->GetNextSample(&pSample);
        if(FAILED(hr))
        {
            break;
        }

        if(pSample == NULL)
        {
            hr = MF_E_TRANSFORM_NEED_MORE_INPUT;
            break;
        }

        /*******************************
        ** Todo: This MFT only has one
        ** input stream, so the output
        ** samples array and stream ID
        ** will only use the first
        ** member
        *******************************/
        pOutputSamples[0].dwStreamID    = 0;
        
        if((pOutputSamples[0].pSample) == NULL)
        {
            // The MFT is providing it's own samples
            (pOutputSamples[0].pSample)   = pSample;
            (pOutputSamples[0].pSample)->AddRef();
        }
        else
        {
            // The pipeline has allocated the samples
            IMFMediaBuffer* pBuffer = NULL;

            do
            {
                hr = pSample->ConvertToContiguousBuffer(&pBuffer);
                if(FAILED(hr))
                {
                    break;
                }

                hr = (pOutputSamples[0].pSample)->AddBuffer(pBuffer);
                if(FAILED(hr))
                {
                    break;
                }
            }while(false);

            SAFERELEASE(pBuffer);

            if(FAILED(hr))
            {
                break;
            }
        }

        /***************************************
        ** Since this in an internal function
        ** we know m_pOutputSampleQueue can never be
        ** NULL due to InitializeTransform()
        ***************************************/
        if(m_pOutputSampleQueue->IsQueueEmpty() != FALSE)
        {
            // We're out of samples in the output queue
            CAutoLock lock(&m_csLock);

            if((m_dwStatus & MYMFT_STATUS_DRAINING) != 0)
            {
                // We're done draining, time to send the event
                IMFMediaEvent*  pDrainCompleteEvent  = NULL;

                do
                {
                    hr = MFCreateMediaEvent(METransformDrainComplete , GUID_NULL, S_OK, NULL, &pDrainCompleteEvent);
                    if(FAILED(hr))
                    {
                        break;
                    }

                    /*******************************
                    ** Todo: This MFT only has one
                    ** input stream, so the drain
                    ** is always on stream zero.
                    ** Update this is your MFT
                    ** has more than one stream
                    *******************************/
                    hr = pDrainCompleteEvent->SetUINT32(MF_EVENT_MFT_INPUT_STREAM_ID, 0);
                    if(FAILED(hr))
                    {
                        break;
                    }

                    /***************************************
                    ** Since this in an internal function
                    ** we know m_pEventQueue can never be
                    ** NULL due to InitializeTransform()
                    ***************************************/
                    hr = m_pEventQueue->QueueEvent(pDrainCompleteEvent);
                    if(FAILED(hr))
                    {
                        break;
                    }
                }while(false);

                SAFERELEASE(pDrainCompleteEvent);

                if(FAILED(hr))
                {
                    break;
                }

                m_dwStatus &= (~MYMFT_STATUS_DRAINING);
            }
        }
    }while(false);

    SAFERELEASE(pSample);

    TraceString(CHMFTTracing::TRACE_INFORMATION, L"%S(): Exit (hr=0x%x)",  __FUNCTION__, hr);

    return hr;
}
コード例 #14
0
HRESULT CHWMFT::ProcessInput(
    DWORD       dwInputStreamID,
    IMFSample*  pSample,
    DWORD       dwFlags)
{
    /*****************************************
    ** See http://msdn.microsoft.com/en-us/library/ms703131(v=VS.85).aspx
    *****************************************/

    HRESULT hr = S_OK;

    TraceString(CHMFTTracing::TRACE_INFORMATION, L"%S(): Enter",  __FUNCTION__);

    do
    {
        if(IsLocked() != FALSE)
        {
            hr = MF_E_TRANSFORM_ASYNC_LOCKED;
            break;
        }

        {
            CAutoLock lock(&m_csLock);

            TraceString(CHMFTTracing::TRACE_INFORMATION, L"%S(): NeedInputCount: %u",  __FUNCTION__, m_dwNeedInputCount);

            if(m_dwNeedInputCount == 0)
            {
                // This call does not correspond to a need input call
                hr = MF_E_NOTACCEPTING;
                break;
            }
            else
            {
                m_dwNeedInputCount--;
            }
        }

        if(pSample == NULL)
        {
            hr = E_POINTER;
            break;
        }

        /*****************************************
        ** Todo: If your MFT supports more than one
        ** stream, make sure you modify
        ** MFT_MAX_STREAMS and adjust this function
        ** accordingly
        *****************************************/
        if(dwInputStreamID >= MFT_MAX_STREAMS)
        {
            hr = MF_E_INVALIDSTREAMNUMBER;
            break;
        }

        // First, put sample into the input Queue

        /***************************************
        ** Since this in an internal function
        ** we know m_pInputSampleQueue can never be
        ** NULL due to InitializeTransform()
        ***************************************/
        hr = m_pInputSampleQueue->AddSample(pSample);
        if(FAILED(hr))
        {
            break;
        }

        // Now schedule the work to decode the sample
        hr = ScheduleFrameDecode();
        if(FAILED(hr))
        {
            break;
        }
    }while(false);

    TraceString(CHMFTTracing::TRACE_INFORMATION, L"%S(): Exit (hr=0x%x)",  __FUNCTION__, hr);

    return hr;
}
コード例 #15
0
ファイル: rexx.c プロジェクト: ErisBlastar/osfree
/*
 * Variable pool
 */
APIRET APIENTRY RexxVariablePool(
   PSHVBLOCK RequestBlockList )
{
   APIRET rc=RXSHV_NOAVL;

   if ( InterpreterIdx == -1 )
      LoadInterpreter();

   if (Trace)
   {
      PSHVBLOCK tmp=RequestBlockList;
      TraceString( "%s: RequestBlockList %x\n",
         "RexxVariablePool()",
         RequestBlockList );
      while(tmp)
      {
         switch( tmp->shvcode )
         {
            case RXSHV_SET:
               TraceString("in    RXSHV_SET: shvname: \"%s\" shvnamelen: %d shvvalue: \"%s\" shvvaluelen: %d\n",
                  tmp->shvname.strptr, tmp->shvnamelen, tmp->shvvalue.strptr, tmp->shvvaluelen );
               break;
            case RXSHV_SYSET:
               TraceString("in  RXSHV_SYSET: shvname: \"%s\" shvnamelen: %d shvvalue: \"%s\" shvvaluelen: %d\n",
                  tmp->shvname.strptr, tmp->shvnamelen, tmp->shvvalue.strptr, tmp->shvvaluelen );
               break;
            case RXSHV_FETCH:
               TraceString("in  RXSHV_FETCH: shvname: \"%s\" shvnamelen: %d\n",
                  tmp->shvname.strptr, tmp->shvnamelen );
               break;
            case RXSHV_DROPV:
               TraceString("in  RXSHV_DROPV: shvname: \"%s\" shvnamelen: %d\n",
                  tmp->shvname.strptr, tmp->shvnamelen );
               break;
            case RXSHV_SYDRO:
               TraceString("in  RXSHV_SYDRO: shvname: \"%s\" shvnamelen: %d\n",
                  tmp->shvname.strptr, tmp->shvnamelen );
               break;
            case RXSHV_NEXTV:
               TraceString("in  RXSHV_NEXTV: shvname: \"%s\" shvnamelen: %d\n",
                  tmp->shvname.strptr, tmp->shvnamelen );
               break;
            case RXSHV_PRIV:
               TraceString("in   RXSHV_PRIV\n" );
               break;
            case RXSHV_EXIT:
               TraceString("in   RXSHV_EXIT\n" );
               break;
            default:
               break;
         }
         tmp = tmp->shvnext;
      }
   }
   if (ORexxVariablePool)
      rc = (*ORexxVariablePool)(
         (PSHVBLOCK) RequestBlockList);
   if (Trace)
   {
      PSHVBLOCK tmp=RequestBlockList;
      while(tmp)
      {
         switch( tmp->shvcode )
         {
            case RXSHV_SET:
               TraceString("out   RXSHV_SET: shvret: %x\n",
                  tmp->shvret );
               break;
            case RXSHV_SYSET:
               TraceString("out RXSHV_SYSET: shvret: %x\n",
                  tmp->shvret );
               break;
            case RXSHV_FETCH:
               TraceString("out RXSHV_FETCH: shvret: %x shvvalue: \"%s\" shvvaluelen: %d\n",
                  tmp->shvret, tmp->shvvalue.strptr, tmp->shvvaluelen );
               break;
            case RXSHV_DROPV:
               TraceString("out RXSHV_DROPV: shvret: %x\n",
                  tmp->shvret );
               break;
            case RXSHV_SYDRO:
               TraceString("out RXSHV_SYDRO: shvret: %x\n",
                  tmp->shvret );
               break;
            case RXSHV_NEXTV:
               TraceString("out RXSHV_NEXTV: shvret: %x\n",
                  tmp->shvret );
               break;
            case RXSHV_PRIV:
               TraceString("out  RXSHV_PRIV: shvret: %x\n",
                  tmp->shvret );
               break;
            case RXSHV_EXIT:
               TraceString("out  RXSHV_EXIT: shvret: %x\n",
                  tmp->shvret );
               break;
            default:
               break;
         }
         tmp = tmp->shvnext;
      }
      TraceString( "<=> Result: %d\n", rc );
   }
   return rc;
}
コード例 #16
0
ファイル: rexx.c プロジェクト: ErisBlastar/osfree
static handle_type FindInterpreter( char *library )
{
   handle_type handle=(handle_type)NULL ;
   CHAR LoadError[256];
   PFN addr;
   register int j=0;

   if ( Trace )
   {
      TraceString( "%s: Attempting to load \"%s\" using DosLoadModule()...",
                   "FindInterpreter()",
                   "REGINA");
   }
   if ( DosLoadModule( LoadError, sizeof(LoadError), library, &handle ) )
   {
      handle = (handle_type)NULL;
   }
   if ( handle != (handle_type)NULL )
   {
      if ( Trace )
      {
         TraceString( "found REGINA\n" );
      }
      for ( j = 0; j < NUM_REXX_FUNCTIONS; j++ )
      {
         if ( DosQueryProcAddr( handle, 0L, MyFunctionName[j], &addr) )
         {
            addr = NULL;
         }
         /*
          * Log the function and address. This is useful if the module
          * doesn't have an address for this procedure.
          */
         if (Trace)
         {
            TraceString( "%s: Address %x\n",
               MyFunctionName[j],
               (addr == NULL) ? 0 : addr );
         }
         /*
          * Even if the function being processed is not in the module, its
          * address is still stored.  In this case it will simply be set
          * again to NULL.
          */
         switch ( j )
         {
            case FUNCTION_REXXSTART:                ORexxStart =                 (OREXXSTART                *)addr; break;
            case FUNCTION_REXXVARIABLEPOOL:         ORexxVariablePool =          (OREXXVARIABLEPOOL         *)addr; break;
            case FUNCTION_REXXSETHALT:              ORexxSetHalt=                (OREXXSETHALT              *)addr; break;
            case FUNCTION_REXXSETTRACE:             ORexxSetTrace =              (OREXXSETTRACE             *)addr; break;
            case FUNCTION_REXXRESETTRACE:           ORexxResetTrace =            (OREXXRESETTRACE           *)addr; break;
         }
      }
   }
   else
   {
      if ( Trace )
      {
         TraceString( "not found: %s\n", LoadError );
      }
   }
   return handle;
}