当前位置: 首页>>代码示例>>C++>>正文


C++ KPrintF函数代码示例

本文整理汇总了C++中KPrintF函数的典型用法代码示例。如果您正苦于以下问题:C++ KPrintF函数的具体用法?C++ KPrintF怎么用?C++ KPrintF使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了KPrintF函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: DevClose

BPTR ASMCALL
DevClose ( REG(a1, struct AHIRequest *ioreq),
           REG(a6, struct AHIBase *AHIBase) )
{
  struct AHIDevUnit *iounit;
  BPTR  seglist=0;

  if(AHIBase->ahib_DebugLevel >= AHI_DEBUG_LOW)
  {
    KPrintF("CloseDevice(0x%08lx)\n", ioreq);
  }

  ObtainSemaphore(&AHIBase->ahib_Lock);

  iounit= (struct AHIDevUnit *) ioreq->ahir_Std.io_Unit;
  ioreq->ahir_Std.io_Device = (struct Device *) -1;
  ioreq->ahir_Std.io_Unit = (struct Unit *) -1;

  if(iounit)
  {
    iounit->Unit.unit_OpenCnt--;
    if(!iounit->Unit.unit_OpenCnt)
      ExpungeUnit(iounit,AHIBase);
  }

  AHIBase->ahib_Library.lib_OpenCnt--;

  ReleaseSemaphore(&AHIBase->ahib_Lock);

  if(!AHIBase->ahib_Library.lib_OpenCnt)
  {
    if(AHIBase->ahib_Library.lib_Flags & LIBF_DELEXP)
      seglist=DevExpunge(AHIBase);
  }
  return seglist;
}
开发者ID:BackupTheBerlios,项目名称:arp2-svn,代码行数:36,代码来源:device.c

示例2: RemoveAudioMode

ULONG
RemoveAudioMode( ULONG           id,
                 struct AHIBase* AHIBase )
{
  struct AHI_AudioMode *node;
  struct AHI_AudioDatabase *audiodb;
  ULONG rc=FALSE;

  if(AHIBase->ahib_DebugLevel >= AHI_DEBUG_HIGH)
  {
    Debug_RemoveAudioMode(id);
  }


  /* Why ?? */

  audiodb = LockDatabaseWrite();

  if(audiodb != NULL)
  {
    UnlockDatabase(audiodb);
  }

  audiodb = LockDatabaseWrite();

  if(audiodb != NULL)
  {
    if(id != AHI_INVALID_ID)
    {
      for(node=(struct AHI_AudioMode *)audiodb->ahidb_AudioModes.mlh_Head;
          node->ahidbn_MinNode.mln_Succ;
          node=(struct AHI_AudioMode *)node->ahidbn_MinNode.mln_Succ)
      {
        if(id == GetTagData(AHIDB_AudioID, AHI_INVALID_ID, node->ahidbn_Tags))
        {
          Remove((struct Node *) node);
          FreeVec(node);
          rc = TRUE;
          break;
        }
      }

      // Remove the entire database if it's empty

      Forbid();

      if(audiodb->ahidb_AudioModes.mlh_Head->mln_Succ == NULL)
      {
        UnlockDatabase(audiodb);

        audiodb = (struct AHI_AudioDatabase *) FindSemaphore(ADB_NAME);

        if(audiodb != NULL)
        {
          RemSemaphore((struct SignalSemaphore *) audiodb);
          FreeVec(audiodb);
        }

        audiodb = NULL;

      }

      Permit();

    }
    UnlockDatabase(audiodb);
  }

  if(AHIBase->ahib_DebugLevel >= AHI_DEBUG_HIGH)
  {
    KPrintF("=>%ld\n",rc);
  }

  return rc;
}
开发者ID:BackupTheBerlios,项目名称:arp2-svn,代码行数:75,代码来源:database.c

示例3: BestAudioIDA

ULONG
BestAudioIDA( struct TagItem* tags,
              struct AHIBase* AHIBase )
{
  ULONG id = AHI_INVALID_ID, bestid = 0;
  Fixed score, bestscore = 0;
  struct TagItem *dizzytags;
  static const struct TagItem defdizzy[] =
  {
    // Default is off for performance reasons..
    { AHIDB_Volume,     FALSE },
    { AHIDB_Stereo,     FALSE },
    { AHIDB_Panning,    FALSE },
    { AHIDB_HiFi,       FALSE },
    { AHIDB_PingPong,   FALSE },
    // Default is on, 'cause they won't hurt performance (?)
    { AHIDB_Record,     TRUE  },
    { AHIDB_Realtime,   TRUE  },
    { AHIDB_FullDuplex, TRUE  },
    // And we don't care about the rest...
    { TAG_DONE,         0     }
  };

  if(AHIBase->ahib_DebugLevel >= AHI_DEBUG_LOW)
  {
    Debug_BestAudioIDA(tags);
  }

  dizzytags = (struct TagItem *) GetTagData(AHIB_Dizzy, (ULONG) defdizzy,tags);

  while(AHI_INVALID_ID != (id=AHI_NextAudioID(id)))
  {
    if(!TestAudioID(id, tags))
    {
      continue;
    }

    // Check if this id the better than the last one
    score = DizzyTestAudioID(id, dizzytags);
    if(score > bestscore)
    {
      bestscore = score;
      bestid = id;
    }
    else if(score == bestscore)
    {
      if(id > bestid)
      {
        bestid = id;    // Return the highest suitable audio id.
      }
    }
  }

  if(bestid == 0)
  {
    bestid = AHI_INVALID_ID;
  }

  if(AHIBase->ahib_DebugLevel >= AHI_DEBUG_LOW)
  {
    KPrintF("=>0x%08lx\n",bestid);
  }

  return bestid;
}
开发者ID:BackupTheBerlios,项目名称:arp2-svn,代码行数:65,代码来源:modeinfo.c

示例4: Debug_LoadModeFile

void
Debug_LoadModeFile( STRPTR name)
{
  KPrintF("AHI_LoadModeFile(%s)",name);
}
开发者ID:BackupTheBerlios,项目名称:arp2-svn,代码行数:5,代码来源:debug.c

示例5: Debug_AddAudioMode

void
Debug_AddAudioMode(struct TagItem *tags )
{
  KPrintF("AHI_AddAudioMode(");
  PrintTagList(tags);
}
开发者ID:BackupTheBerlios,项目名称:arp2-svn,代码行数:6,代码来源:debug.c

示例6: Debug_FreeAudioRequest

void
Debug_FreeAudioRequest( struct AHIAudioModeRequester *req )
{
  KPrintF("AHI_FreeAudioRequest(0x%08lx)\n",req);
}
开发者ID:BackupTheBerlios,项目名称:arp2-svn,代码行数:5,代码来源:debug.c

示例7: Debug_AllocAudioRequestA

void
Debug_AllocAudioRequestA( struct TagItem *tags )
{
  KPrintF("AHI_AllocAudioRequestA(");
  PrintTagList(tags);
}
开发者ID:BackupTheBerlios,项目名称:arp2-svn,代码行数:6,代码来源:debug.c

示例8: Debug_GetAudioAttrsA

void
Debug_GetAudioAttrsA( ULONG id, struct AHIAudioCtrlDrv *audioctrl, struct TagItem *tags )
{
  KPrintF("AHI_GetAudioAttrsA(0x%08lx, 0x%08lx,",id,audioctrl);
  PrintTagList(tags);
}
开发者ID:BackupTheBerlios,项目名称:arp2-svn,代码行数:6,代码来源:debug.c

示例9: UnlockResource

static void
UnlockResource( struct ResourceIterator* iter,
                struct ResourceContext*  ctx )
{
  if( ! iter->m_HasLock )
  {
    return;
  }

  switch( iter->m_Resource->isapnpr_Type )
  {
    case ISAPNP_NT_IRQ_RESOURCE:
    {
#ifdef DEBUG_ITERATORS
KPrintF( "U IRQ %ld\n", iter->m_IRQBit );
#endif
      ctx->m_IRQ[ iter->m_IRQBit ] = NULL;

      break;
    }


    case ISAPNP_NT_DMA_RESOURCE:
    {
#ifdef DEBUG_ITERATORS
KPrintF( "U DMA %ld\n", iter->m_ChannelBit );
#endif
      ctx->m_DMA[ iter->m_ChannelBit ] = NULL;

      break;
    }


    case ISAPNP_NT_IO_RESOURCE:
    {
      struct ResourceIteratorRef* io;

#ifdef DEBUG_ITERATORS
KPrintF( "U IO %lx-%lx\n", iter->m_Base, 
         iter->m_Base + iter->m_Length );
#endif

      for( io = (struct ResourceIteratorRef*) ctx->m_IO.mlh_Head;
           io->m_MinNode.mln_Succ != NULL;
           io = (struct ResourceIteratorRef*) io->m_MinNode.mln_Succ )
      {
        if( io->m_Iterator->m_Base == iter->m_Base )
        {
          Remove( (struct Node*) io );
          FreeVec( io );
          break;
        }
      }

      break;
    }

    case ISAPNP_NT_MEMORY_RESOURCE:
    default:
      break;
  }

  iter->m_HasLock = FALSE;
}
开发者ID:BackupTheBerlios,项目名称:arp2-svn,代码行数:64,代码来源:pnp_iterators.c

示例10: LockResource

static BOOL
LockResource( struct ResourceIterator* iter,
              struct ResourceContext*  ctx )
{
  struct ResourceIterator* conflict = NULL;

  switch( iter->m_Resource->isapnpr_Type )
  {
    case ISAPNP_NT_IRQ_RESOURCE:
    {
#ifdef DEBUG_ITERATORS
KPrintF( "L IRQ %ld", iter->m_IRQBit );
#endif
      if( ctx->m_IRQ[ iter->m_IRQBit ] == NULL )
      {
        ctx->m_IRQ[ iter->m_IRQBit ] = iter;
      }
      else
      {
        conflict = ctx->m_IRQ[ iter->m_IRQBit ];
      }
      
      break;
    }


    case ISAPNP_NT_DMA_RESOURCE:
    {
#ifdef DEBUG_ITERATORS
KPrintF( "L DMA %ld", iter->m_ChannelBit );
#endif
      if( ctx->m_DMA[ iter->m_ChannelBit ] == NULL )
      {
        ctx->m_DMA[ iter->m_ChannelBit ] = iter;
      }
      else
      {
        conflict = ctx->m_DMA[ iter->m_ChannelBit ];
      }

      break;
    }


    case ISAPNP_NT_IO_RESOURCE:
    {
      struct ResourceIteratorRef* io;
      struct ResourceIteratorRef* new_io;
      struct Node*                position = NULL;

      UWORD base   = iter->m_Base;
      UWORD length = iter->m_Length;

#ifdef DEBUG_ITERATORS
KPrintF( "L IO %lx-%lx", base, base + length );
#endif

      for( io = (struct ResourceIteratorRef*) ctx->m_IO.mlh_Head;
           io->m_MinNode.mln_Succ != NULL;
           io = (struct ResourceIteratorRef*) io->m_MinNode.mln_Succ )
      {
        UWORD io_base   = io->m_Iterator->m_Base;
        UWORD io_length = io->m_Iterator->m_Length;

        if( ( base <= io_base && ( base + length ) > io_base )    ||
            ( base >= io_base && base < ( io_base + io_length ) ) )
        {
          // Collision!

          conflict = io->m_Iterator;
          break;
        }

        if( base + length <= io_base )
        {
          // No more collisions possible; insert before this one
    
          position = (struct Node*) io->m_MinNode.mln_Pred;

          break;
        }
      }

      if( conflict == NULL )
      {
        // Insert the node
    
        new_io = AllocVec( sizeof( *new_io ), MEMF_PUBLIC );

        if( new_io == NULL )
        {
          return FALSE;
        }
        else
        {
          new_io->m_Iterator = iter;

          if( position == NULL )
          {
            AddTail( (struct List*) &ctx->m_IO, (struct Node*) new_io );
//.........这里部分代码省略.........
开发者ID:BackupTheBerlios,项目名称:arp2-svn,代码行数:101,代码来源:pnp_iterators.c

示例11: L_Test

void __asm __saveds L_Test(void)
{
	KPrintF("test\n");
}
开发者ID:MrZammler,项目名称:opus_magellan,代码行数:4,代码来源:config_test.c

示例12: Slave


//.........这里部分代码省略.........
	    bytes   = samples * 2; // one 16 bit sample is 2 bytes

	    switch( AudioCtrl->ahiac_BuffType )
	    {
	      case AHIST_M16S:
		skip = 1;
		offset = 0;
		break;
	    
	      case AHIST_M32S:
		skip = 2;
		offset = 1;
		break;

	      case AHIST_S16S:
		skip = 1;
		offset = 0;
		samples *= 2;
		bytes *= 2;
		break;

	      case AHIST_S32S:
		skip = 2;
		offset = 1;
		samples *= 2;
		bytes *= 2;
		break;
	    }

	    bytes_in_buffer  = bytes;
	    offset_in_buffer = 0;

	    if( ! skip_mix )
	    {
	      CallHookPkt( AudioCtrl->ahiac_MixerFunc, AudioCtrl,
			   dd->mixbuffer );
	    }

	    src = ((WORD*) dd->mixbuffer) + offset;
	    dst = dd->mixbuffer;

	    for( i = 0; i < samples; ++i )
	    {
	      *dst++ = *src;
	      src += skip;
	    }

//	    KPrintF( "Mixed %ld/%ld new bytes/samples\n", bytes, samples );
	  }

	  while( bytes_in_buffer > 0 &&
		 bytes_avail > 0 )
	  {
	    int written;
    	    int counter = 0;
    	    do
	    {
	    	written = OSS_Write( dd->mixbuffer + offset_in_buffer,
				    min( bytes_in_buffer, bytes_avail ) );
	    	if (counter > 10)
		{
		    if (written < 0) written = 0;
		    break;
		}
		
		if (written < 0) KPrintF("OSS_Write returned %ld. counter %ld  bytes_in_buffer %ld  bytes_avail %ld\n",
		    	    	written, counter, bytes_in_buffer, bytes_avail);
		
		counter++;
		
    	    } while (written < 0);
	    
	    bytes_in_buffer  -= written;
	    offset_in_buffer += written;
	    bytes_avail      -= written;
	    
//	    KPrintF( "Wrote %ld bytes (%ld bytes in buffer, offset=%ld, %ld bytes available in OSS buffers\n",
//		     written, bytes_in_buffer, offset_in_buffer, bytes_avail );
	  }
	}

	CallHookA( AudioCtrl->ahiac_PostTimerFunc, (Object*) AudioCtrl, 0 );
      }
    }
  }

  FreeSignal( dd->slavesignal );
  dd->slavesignal = -1;

  Forbid();

  // Tell the Master we're dying

  Signal( (struct Task*) dd->mastertask,
          1L << dd->mastersignal );

  dd->slavetask = NULL;

  // Multitaking will resume when we are dead.
}
开发者ID:BackupTheBerlios,项目名称:arp2-svn,代码行数:101,代码来源:aros-playslave.c

示例13: _DevOpen

ULONG
_DevOpen ( struct AHIRequest* ioreq,
           ULONG              unit,
           ULONG              flags,
           struct AHIBase*    AHIBase )
{
    ULONG rc = 0;
    BOOL  error = FALSE;
    struct AHIDevUnit *iounit=NULL;

    if(AHIBase->ahib_DebugLevel >= AHI_DEBUG_LOW)
    {
        KPrintF("OpenDevice(%ld, 0x%08lx, %ld)", unit, (ULONG) ioreq, flags);
    }

// Check if size includes the ahir_Version field

    if(ioreq->ahir_Std.io_Message.mn_Length < (sizeof(struct IOStdReq) + 2))
    {
        Req( "Bad parameters to OpenDevice()." );
        ioreq->ahir_Std.io_Error=IOERR_OPENFAIL;
        return IOERR_OPENFAIL;
    }

// One more check...

    if((unit != AHI_NO_UNIT) && (ioreq->ahir_Version >= 4))
    {
        if(ioreq->ahir_Std.io_Message.mn_Length < sizeof(struct AHIRequest))
        {
            Req( "Bad parameters to OpenDevice()." );
            ioreq->ahir_Std.io_Error=IOERR_OPENFAIL;
            return IOERR_OPENFAIL;
        }
        else
        {
            /*       KPrintF( "Tagging %08lx on task %08lx\n", ioreq, FindTask(0)); */
            ioreq->ahir_Private[1] = (ULONG) ioreq;
        }
    }

    AHIBase->ahib_Library.lib_OpenCnt++;

    ObtainSemaphore(&AHIBase->ahib_Lock);

    if( ! (flags & AHIDF_NOMODESCAN))
    {
        // Load database if not already loaded

        if(AHI_NextAudioID(AHI_INVALID_ID) == (ULONG) AHI_INVALID_ID)
        {
            AHI_LoadModeFile("DEVS:AudioModes");

            // Be quiet here. - Piru
            if (IS_MORPHOS)
            {
                APTR *windowptr = &((struct Process *) FindTask(NULL))->pr_WindowPtr;
                APTR oldwindowptr = *windowptr;
                *windowptr = (APTR) -1;

                AHI_LoadModeFile("MOSSYS:DEVS/AudioModes");

                *windowptr = oldwindowptr;
            }
        }
    }

    if( ioreq->ahir_Version > AHIBase->ahib_Library.lib_Version)
        error=TRUE;
    else
    {
        if(unit < AHI_UNITS)
        {
            iounit=InitUnit(unit,AHIBase);
            if(!iounit)
                error=TRUE;
        }
        else if(unit == AHI_NO_UNIT)
            InitUnit(unit,AHIBase);
    }

    if(!error)
    {
        ioreq->ahir_Std.io_Unit=(struct Unit *) iounit;
        if(iounit)    // Is NULL for AHI_NO_UNIT
            iounit->Unit.unit_OpenCnt++;
        AHIBase->ahib_Library.lib_OpenCnt++;
        AHIBase->ahib_Library.lib_Flags &=~LIBF_DELEXP;
    }
    else
    {
        rc=IOERR_OPENFAIL;
        ioreq->ahir_Std.io_Error=IOERR_OPENFAIL;
        ioreq->ahir_Std.io_Device=(struct Device *) -1;
        ioreq->ahir_Std.io_Unit=(struct Unit *) -1;
    }

    ReleaseSemaphore(&AHIBase->ahib_Lock);

    AHIBase->ahib_Library.lib_OpenCnt--;
//.........这里部分代码省略.........
开发者ID:BackupTheBerlios,项目名称:arp2-svn,代码行数:101,代码来源:device.c

示例14: LoadModeFile

ULONG
LoadModeFile( UBYTE*          name,
              struct AHIBase* AHIBase )
{
  ULONG rc=FALSE;
  struct FileInfoBlock  *fib;
  BPTR  lock,thisdir;

  if(AHIBase->ahib_DebugLevel >= AHI_DEBUG_HIGH)
  {
    Debug_LoadModeFile(name);
  }

  SetIoErr(NULL);

  fib = AllocDosObject(DOS_FIB, TAG_DONE);

  if(fib != NULL)
  {
    lock = Lock(name, ACCESS_READ);

    if(lock != NULL)
    {
      if(Examine(lock,fib))
      {
        if(fib->fib_DirEntryType>0) // Directory?
        {
          thisdir = CurrentDir(lock);

          while(ExNext(lock, fib))
          {
            if(fib->fib_DirEntryType>0)
            {
              continue;     // AHI_LoadModeFile(fib->fib_FileName); for recursion
            }
            else
            {
              rc = AddModeFile(fib->fib_FileName);

              if(!rc)
              {
                break;
              }
            }
          }
          if(IoErr() == ERROR_NO_MORE_ENTRIES)
          {
            SetIoErr(NULL);
          }

          CurrentDir(thisdir);
        }
        else  // Plain file
        {
          rc = AddModeFile(name);
        }
      }

      UnLock(lock);
    }

    FreeDosObject(DOS_FIB,fib);
  }

  if(AHIBase->ahib_DebugLevel >= AHI_DEBUG_HIGH)
  {
    KPrintF("=>%ld\n",rc);
  }

  return rc;
}
开发者ID:BackupTheBerlios,项目名称:arp2-svn,代码行数:71,代码来源:database.c

示例15: Debug_UnloadSound

void
Debug_UnloadSound( UWORD sound, struct AHIPrivAudioCtrl *audioctrl )
{
  KPrintF("AHI_UnloadSound(%ld, 0x%08lx)\n", sound, audioctrl);
}
开发者ID:BackupTheBerlios,项目名称:arp2-svn,代码行数:5,代码来源:debug.c


注:本文中的KPrintF函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。