tests/tools/scu.cc
// Returns usable presentation context ID for a given abstract syntax UID and
// transfer syntax UID. 0 if none matches.
Returns usable presentation context ID for a given abstract syntax UID and
transfer syntax UID. 0 if none matches.
Returns usable presentation context ID for a given abstract syntax UID and transfer syntax UID . 0 if none matches .
T_ASC_PresentationContextID DcmSCU::findPresentationContextID(const OFString &abstractSyntax,
                                                              const OFString &transferSyntax)
{
  if (!isConnected())
    return 0;
  DUL_PRESENTATIONCONTEXT *pc;
  LST_HEAD **l;
  OFBool found = OFFalse;
  if (abstractSyntax.empty()) return 0;
  l = &m_assoc->params->DULparams.acceptedPresentationContext;
  pc = (DUL_PRESENTATIONCONTEXT*) LST_Head(l);
  (void)LST_Position(l, (LST_NODE*)pc);
  while (pc && !found)
  {
    found = (strcmp(pc->abstractSyntax, abstractSyntax.c_str()) == 0);
    found &= (pc->result == ASC_P_ACCEPTANCE);
    if (!transferSyntax.empty())  
      found &= (strcmp(pc->acceptedTransferSyntax, transferSyntax.c_str()) == 0);
    if (!found) pc = (DUL_PRESENTATIONCONTEXT*) LST_Next(l);
  }
  if (found)
    return pc->presentationContextID;
  return 0;   
}
T_ASC_PresentationContextID DcmSCU :: findPresentationContextID ( const OFString & abstractSyntax , const OFString & transferSyntax ) { if ( ! isConnected ( ) ) return 0 ; DUL_PRESENTATIONCONTEXT * pc ; LST_HEAD * * l ; OFBool found = OFFalse ; if ( abstractSyntax . empty ( ) ) return 0 ; l = & m_assoc -> params -> DULparams . acceptedPresentationContext ; pc = ( DUL_PRESENTATIONCONTEXT * ) LST_Head ( l ) ; ( void ) LST_Position ( l , ( LST_NODE * ) pc ) ; while ( pc && ! found ) { found = ( strcmp ( pc -> abstractSyntax , abstractSyntax . c_str ( ) ) == 0 ) ; found &= ( pc -> result == ASC_P_ACCEPTANCE ) ; if ( ! transferSyntax . empty ( ) ) found &= ( strcmp ( pc -> acceptedTransferSyntax , transferSyntax . c_str ( ) ) == 0 ) ; if ( ! found ) pc = ( DUL_PRESENTATIONCONTEXT * ) LST_Next ( l ) ; } if ( found ) return pc -> presentationContextID ; return 0 ; }
Returns usable presentation context ID for a given abstract syntax UID and
transfer syntax UID.
Returns usable presentation context ID for a given abstract syntax UID and transfer syntax UID .
/* first of all we look for a presentation context
   * matching both abstract and transfer syntax
   */ // ignore transfer syntax if not specified /* not found */