/** * name: IconKey * class: CPsTreeItem * desc: merge the treeitem's unique name with a prefix to form a setting string * param: pszProperty - the prefix to add * return: pointer to the setting string **/ LPCSTR CPsTreeItem::IconKey() { LPCSTR pszIconName = GlobalName(); if (pszIconName) { static CHAR pszSetting[MAXSETTING]; mir_snprintf(pszSetting, MODNAME"_{%s}", pszIconName); return pszSetting; } return NULL; }
/* ============ idVarDef::PrintInfo ============ */ void idVarDef::PrintInfo( idFile *file, int instructionPointer ) const { statement_t *jumpst; int jumpto; etype_t etype; int i; int len; const char *ch; if( initialized == initializedConstant ) { file->Printf( "const " ); } etype = typeDef->Type(); switch( etype ) { case ev_jumpoffset : jumpto = instructionPointer + value.jumpOffset; jumpst = &gameLocal.program.GetStatement( jumpto ); file->Printf( "address %d [%s(%d)]", jumpto, gameLocal.program.GetFilename( jumpst->file ), jumpst->linenumber ); break; case ev_function : if( value.functionPtr->eventdef ) { file->Printf( "event %s", GlobalName() ); } else { file->Printf( "function %s", GlobalName() ); } break; case ev_field : file->Printf( "field %d", value.ptrOffset ); break; case ev_argsize: file->Printf( "args %d", value.argSize ); break; default: file->Printf( "%s ", typeDef->Name() ); if( initialized == initializedConstant ) { switch( etype ) { case ev_string : file->Printf( "\"" ); len = strlen( value.stringPtr ); ch = value.stringPtr; for( i = 0; i < len; i++, ch++ ) { if( idStr::CharIsPrintable( *ch ) ) { file->Printf( "%c", *ch ); } else if( *ch == '\n' ) { file->Printf( "\\n" ); } else { file->Printf( "\\x%.2x", static_cast<int>( *ch ) ); } } file->Printf( "\"" ); break; case ev_vector : file->Printf( "'%s'", value.vectorPtr->ToString() ); break; case ev_float : file->Printf( "%f", *value.floatPtr ); break; case ev_virtualfunction : file->Printf( "vtable[ %d ]", value.virtualFunction ); break; default : file->Printf( "%d", *value.intPtr ); break; } } else if( initialized == stackVariable ) { file->Printf( "stack[%d]", value.stackOffset ); } else { file->Printf( "global[%d]", num ); } break; } }
//-------------------------------------------------------------------------------- CGlobalSemaphore::CGlobalSemaphore( const TCHAR* lpName, SECURITY_ATTRIBUTES* pSemaphoreAttributes, long lInitialCount, long lMaximumCount, unsigned long dwDesiredAccess ) : CSemaphore( pSemaphoreAttributes, lInitialCount, lMaximumCount, GlobalName( lpName ), 0, dwDesiredAccess ) { _WINQ_FCONTEXT( "CGlobalSemaphore::CGlobalSemaphore" ); }
/** * name: GlobalPropertyKey * class: CPsTreeItem * desc: merge the treeitem's unique name with a prefix to form a setting string * param: pszProperty - the prefix to add * return: pointer to the setting string **/ LPCSTR CPsTreeItem::GlobalPropertyKey(LPCSTR pszProperty) { static CHAR pszSetting[MAXSETTING]; mir_snprintf(pszSetting, "{Global\\%s}_%s", GlobalName(), pszProperty); return pszSetting; }