本文整理匯總了C++中DupStr函數的典型用法代碼示例。如果您正苦於以下問題:C++ DupStr函數的具體用法?C++ DupStr怎麽用?C++ DupStr使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。
在下文中一共展示了DupStr函數的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C++代碼示例。
示例1: RepInitEv
static void RepInitEv( event_record *ev )
{
DIPHDL( cue, ch );
if( ev->cue == NULL ) {
if( DeAliasAddrCue( NO_MOD, ev->ip, ch ) != SR_NONE ) {
ev->cue = CopySourceLine( ch );
}
if( ev->cue == NULL ) {
UnAsm( ev->ip, TxtBuff, TXT_LEN );
ev->cue = DupStr( TxtBuff );
}
}
if( ev->addr_string == NULL ) {
ev->addr_string = DupStr( GetEventAddress( ev ) );
}
}
示例2: BreakWrite
bool BreakWrite( address addr, mad_type_handle th, const char *comment )
{
brkp *bp;
mad_type_info mti;
bool ok_to_try = true;
if( IS_BP_EXECUTE( th ) )
return( false );
MADTypeInfo( th, &mti );
switch( mti.b.bits / BITS_PER_BYTE ) {
case 8:
if( !Is8ByteBreakpointsSupported() ) {
ok_to_try = false;
}
// fall down
case 1:
case 2:
case 4:
if( ok_to_try ) {
if( FindBreak( addr ) != NULL ) {
Error( ERR_NONE, LIT_ENG( ERR_POINT_EXISTS ) );
}
bp = AddPoint( addr, th, false );
if( bp == NULL )
return( true );
bp->source_line = DupStr( comment );
RecordBreakEvent( bp, B_SET );
return( true );
}
// fall down
default:
return( false );
}
}
示例3: ProcCmd
void ProcCmd( void )
{
char buff[TXT_LEN];
unsigned screen_mem;
size_t have_env;
int pass;
MemSize = MIN_MEM_SIZE;
TrapParms = NULL;
_SwitchOn( SW_LOAD_SYMS );
_SwitchOn( SW_USE_MOUSE );
ProcSysOptInit();
DUIScreenOptInit();
have_env = DUIEnvLkup( EXENAME, buff, sizeof( buff ) );
for( pass = 1; pass <= 2; ++pass ) {
if( have_env ) {
GetArg = &GetEnvArg;
CurrArgc = 0;
CurrArgp = buff;
ProcOptList( pass );
if( CurrChar != ARG_TERMINATE ) {
OptError( LIT_ENG( STARTUP_Expect_End_Env_Str ) );
}
}
GetArg = &GetCmdArg;
CurrArgc = 0;
CurrArgp = GetCmdArg( 0 );
if( CurrArgp != NULL ) {
ProcOptList( pass );
if( pass == 2 ) {
SetCmdArgStart( CurrArgc, CurrArgp );
}
}
if( pass == 1 ) {
screen_mem = DUIConfigScreen();
if( MemSize + screen_mem >= MemSize ) {
MemSize += screen_mem;
} else {
MemSize = ~0;
}
SysSetMemLimit();
TrapParms = DupStr( "std" );
InvokeFile = DupStr( "" );
}
}
}
示例4: WantEquals
/*
* GetFileName -- get filename from command line
*/
char *GetFileName( int pass )
{
char buff[CMD_LEN];
WantEquals();
GetItem( buff );
return( pass == 1 ? NULL : DupStr( buff ) );
}
示例5: _mm_fseek
CHAR *S69_LoadTitle(void)
{
CHAR s[36];
_mm_fseek(modreader,2,SEEK_SET);
if(!_mm_read_UBYTES(s,36,modreader)) return NULL;
return(DupStr(s,36,1));
}
示例6: _mm_fseek
static CHAR *STX_LoadTitle(void)
{
CHAR s[28];
_mm_fseek(modreader,0,SEEK_SET);
if(!_mm_read_UBYTES(s,20,modreader)) return NULL;
return(DupStr(s,28,1));
}
示例7: _mm_fseek
CHAR *DSM_LoadTitle(void)
{
CHAR s[28];
_mm_fseek(modfp,12,SEEK_SET);
if(!_mm_fread(s,28,1,modfp)) return NULL;
return(DupStr(s,28));
}
示例8: _mm_fseek
CHAR *DSM_LoadTitle(void)
{
CHAR s[28];
_mm_fseek(modreader,12,SEEK_SET);
if(!_mm_read_UBYTES(s,28,modreader)) return NULL;
return(DupStr(s,28,1));
}
示例9: ImgMenuItem
static void ImgMenuItem( a_window *wnd, gui_ctl_id id, int row, int piece )
{
image_entry *img;
char *new_name;
char *old_name;
piece=piece;
img = ImgGetImage( row );
switch( id ) {
case MENU_INITIALIZE:
WndMenuGrayAll( wnd );
if( img != NULL ) {
if( img->dip_handle == NO_MOD ) {
WndMenuEnable( wnd, MENU_IMAGE_ADD_SYMBOLS, TRUE );
} else {
WndMenuEnableAll( wnd );
}
}
break;
case MENU_IMAGE_ADD_SYMBOLS:
// nyi - change sym_file
if( img->deferred_symbols ) {
ReLoadSymInfo( img );
} else {
new_name = DupStr( ImgSymName( img, TRUE ) );
if( !SymBrowse( &new_name ) ) {
_Free( new_name );
} else {
UnLoadSymInfo( img, TRUE );
old_name = img->sym_name;
img->sym_name = new_name;
if( ReLoadSymInfo( img ) ) {
_Free( old_name );
} else {
img->sym_name = old_name;
_Free( new_name );
}
}
}
ImgInit( wnd );
break;
case MENU_IMAGE_DEL_SYMBOLS:
UnLoadSymInfo( img, TRUE );
ImgInit( wnd );
break;
case MENU_IMAGE_SHOW_FUNCTIONS:
WndGblFuncInspect( img->dip_handle );
break;
case MENU_IMAGE_SHOW_MODULES:
WndModListInspect( img->dip_handle );
break;
case MENU_IMAGE_SHOW_GLOBALS:
WndGblVarInspect( img->dip_handle );
break;
}
}
示例10: _mm_fseek
static CHAR *GT2_LoadTitle(void)
{
CHAR title[33];
_mm_fseek(modreader, 8, SEEK_SET);
if (!_mm_read_UBYTES(title, 32, modreader))
return NULL;
title[32] = 0;
return (DupStr(title, 32, 1));
}
示例11: DlgList
void DlgList( const char *title, void (*clear)(void), void (*add)(const char *,unsigned),
char_ring *(*next)(char_ring *), char *(*name)(char_ring *) )
{
dlg_list dlg;
dlg.clear = clear;
dlg.add = add;
dlg.next = next;
dlg.name = name;
dlg.title = DupStr( title );
ResDlgOpen( &SourceEvent, &dlg, GUI_MAKEINTRESOURCE( DIALOG_LIST ) );
}
示例12: SetBPCondition
void SetBPCondition( brkp *bp, const char *condition )
{
if( bp->condition != NULL ) {
_Free( bp->condition );
}
if( condition == NULL || condition[0] == '\0' ) {
bp->condition = NULL;
} else {
bp->condition = DupStr( condition );
}
bp->status.b.use_condition = ( bp->condition != NULL );
}
示例13: tmp
BaseRec::BaseRec(const DZStrW &base)
{
DZStrW tmp(base);
TCHAR lc = tmp.LastChar();
if (lc != _T(':') && lc != BSLASH)
tmp += BSLASH;
Base = DupStr(tmp);
Next = NULL;
}
示例14: OKT_doSAMP
/* Read sample information */
static BOOL OKT_doSAMP(int len)
{
int t;
SAMPLE *q;
OKTSAMPLE s;
of.numins = of.numsmp = (len / 0x20);
if (!AllocSamples())
return 0;
for (t = 0, q = of.samples; t < of.numins; t++, q++) {
_mm_read_UBYTES(s.sampname, 20, modreader);
s.len = _mm_read_M_ULONG(modreader);
s.loopbeg = _mm_read_M_UWORD(modreader);
s.looplen = _mm_read_M_UWORD(modreader);
_mm_read_UBYTE(modreader);
s.volume = _mm_read_UBYTE(modreader);
_mm_read_M_UWORD(modreader);
if (_mm_eof(modreader)) {
_mm_errno = MMERR_LOADING_SAMPLEINFO;
return 0;
}
if (!s.len)
q->seekpos = q->length = q->loopstart = q->loopend = q->flags = 0;
else {
s.len--;
/* sanity checks */
if (s.loopbeg > s.len)
s.loopbeg = s.len;
if (s.loopbeg + s.looplen > s.len)
s.looplen = s.len - s.loopbeg;
if (s.looplen < 2)
s.looplen = 0;
q->length = s.len;
q->loopstart = s.loopbeg;
q->loopend = s.looplen + q->loopstart;
q->volume = s.volume;
q->flags = SF_SIGNED;
if (s.looplen)
q->flags |= SF_LOOP;
}
q->samplename = DupStr(s.sampname, 20, 1);
q->speed = 8363;
}
return 1;
}
示例15: ULT_Load
static BOOL ULT_Load(BOOL curious)
{
int t,u,tracks=0;
SAMPLE *q;
ULTSAMPLE s;
ULTHEADER mh;
UBYTE nos,noc,nop;
/* try to read module header */
_mm_read_string(mh.id,15,modreader);
_mm_read_string(mh.songtitle,32,modreader);
mh.reserved=_mm_read_UBYTE(modreader);
if(_mm_eof(modreader)) {
_mm_errno = MMERR_LOADING_HEADER;
return 0;
}
ULT_Version[ULT_VERSION_LEN-1]='3'+(mh.id[14]-'1');
of.modtype = DupStr(ULT_Version,ULT_VERSION_LEN,1);
of.initspeed = 6;
of.inittempo = 125;
of.reppos = 0;
/* read songtext */
if ((mh.id[14]>'1')&&(mh.reserved))
if(!ReadLinedComment(mh.reserved * 32, 32)) return 0;
nos=_mm_read_UBYTE(modreader);
if(_mm_eof(modreader)) {
_mm_errno = MMERR_LOADING_HEADER;
return 0;
}
of.songname=DupStr(mh.songtitle,32,1);
of.numins=of.numsmp=nos;
if(!AllocSamples()) return 0;
q = of.samples;
for(t=0; t<nos; t++) {
/* try to read sample info */
_mm_read_string(s.samplename,32,modreader);
_mm_read_string(s.dosname,12,modreader);
s.loopstart =_mm_read_I_ULONG(modreader);
s.loopend =_mm_read_I_ULONG(modreader);
s.sizestart =_mm_read_I_ULONG(modreader);
s.sizeend =_mm_read_I_ULONG(modreader);
s.volume =_mm_read_UBYTE(modreader);
s.flags =_mm_read_UBYTE(modreader);
s.speed =(mh.id[14]>='4')?_mm_read_I_UWORD(modreader):8363;
s.finetune =_mm_read_I_SWORD(modreader);
if(_mm_eof(modreader)) {
_mm_errno = MMERR_LOADING_SAMPLEINFO;
return 0;
}
q->samplename=DupStr(s.samplename,32,1);
/* The correct formula for the coefficient would be
pow(2,(double)s.finetume/OCTAVE/32768), but to avoid floating point
here, we'll use a first order approximation here.
1/567290 == Ln(2)/OCTAVE/32768 */
q->speed=s.speed+s.speed*(((SLONG)s.speed*(SLONG)s.finetune)/567290);
q->length = s.sizeend-s.sizestart;
q->volume = s.volume>>2;
q->loopstart = s.loopstart;
q->loopend = s.loopend;
q->flags = SF_SIGNED;
if(s.flags&ULTS_LOOP) q->flags|=SF_LOOP;
if(s.flags&ULTS_16BITS) {
s.sizeend+=(s.sizeend-s.sizestart);
s.sizestart<<=1;
q->flags|=SF_16BITS;
q->loopstart>>=1;
q->loopend>>=1;
}
q++;
}