static ValueStruct * _DBOPEN( DBG_Struct *dbg, DBCOMM_CTRL *ctrl) { ENTER_FUNC; OpenDB_RedirectPort(dbg); dbg->process[PROCESS_UPDATE].conn = (void *)NewLBS(); dbg->process[PROCESS_UPDATE].dbstatus = DB_STATUS_CONNECT; dbg->process[PROCESS_READONLY].dbstatus = DB_STATUS_NOCONNECT; if ( ctrl != NULL ) { ctrl->rc = MCP_OK; } LEAVE_FUNC; return (NULL); }
extern ValueStruct *SYSDATA_DBOPEN(DBG_Struct *dbg, DBCOMM_CTRL *ctrl) { int fh, rc; NETFILE *fp; fp = NULL; rc = MCP_BAD_OTHER; if (ThisEnv->sysdata != NULL && ThisEnv->sysdata->port != NULL && (fh = ConnectSocket(ThisEnv->sysdata->port, SOCK_STREAM)) >= 0) { fp = SocketToNet(fh); } OpenDB_RedirectPort(dbg); dbg->conn = (void *)fp; if (fp != NULL) { dbg->dbstatus = DB_STATUS_CONNECT; rc = MCP_OK; } if (ctrl != NULL) { ctrl->rc = rc; } return (NULL); }