www.pudn.com > apdb2ndb.rar > atn_conv_to_iport.cc
#ifndef lint
static char copyright[] = "Copyright (C) FUJITSU LIMITED 2001" ;
static char id[] = "$Id: atn_conv_to_iport.cc,v 1.1 2001/02/13 10:34:26 JST rad1 Exp $" ;
#endif
/*
* $Log: atn_conv_to_iport.cc,v $
* Revision 1.1 2001/02/13 10:34:26 JST rad1
* $B:eK\(B(TSL)
* $B!&(Batn_conv_to_inst $B$+$iFHN)$5$;$k(B
* $B!&(BPortInfo$BG[Ns@8@.It$r4X?t2=(B
*
* $Com: 阪本(TSL)
* $Com: ・atn_conv_to_inst から独立させる
* $Com: ・PortInfo配列生成部を関数化
*/
// Convert Io Block and IO component to NDB-inst
//
//
#include "atn_inc.h"
ATN_FDEF int atn_conv_to_iport(atn_com &com,
AirBlockInfo &BlockInfo,
NDB_INSTID ndb_instid)
{
int rcode = 0;
int rc = 0;
AirPortInfo *PortInfo = NULL_PTR;
int num_cports;
rc = atn_get_port(com,BlockInfo, PortInfo,num_cports);
//
// 3rd fase : get ndb_instid (top)
//
NDB_IPORTID ndb_top_iportid =
ndb_get_iportid(com.part_cntl,com.mid,ndb_instid,NDB_TOP);
if(ndb_top_iportid <= 0 )
{
// Program error
rcode = -1;
goto exit_func;
}
if(ndb_top_iportid == 0)
{
/* this is not error */
goto exit_func;
}
//
// 4th fase : entry ndb_iportid and PortInfo to PortConvTable
//
for(int i=0;ientry_port
(NDB_IPORT_OBJ,ndb_top_iportid+i,&PortInfo[i]);
}
catch(...)
{
com.afm->message("nta0800",
AIR_MSG_CHR,"file",__FILE__,
AIR_MSG_INT,"line",__LINE__,AIR_MSG_END);
}
}
exit_func:
return rcode;
}