⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 u_cfil.c

📁 ICCP Toolkit 是在 Tru64下开发Tase.2通信协议的开发包
💻 C
字号:
/************************************************************************//* SISCO SOFTWARE MODULE HEADER *****************************************//************************************************************************//*   (c) Copyright Systems Integration Specialists Company, Inc.,	*//*      	  1986 - 1997, All Rights Reserved.		        *//*									*//* MODULE NAME : u_cfil.c						*//* PRODUCT(S)  : MMSEASE						*//*									*//* MODULE DESCRIPTION : 						*//*	This module contains user confirm functions. These functions	*//*	are invoked from 'mms_req_serve' when the response to an        *//*	outstanding request is received. These functions should check	*//*	the resp_err member of the request control structure before	*//*	assuming returned data. 					*//*									*//* NOTES ON REQUEST INFORMATION :					*//*	In the user application, request information structures may be	*//*	committed when the request is made (e.g. for error recovery).	*//*	If so, these information buffers could be freed in the confirm	*//*	functions.  In the sample application, all request information	*//*	structures are automatic or handled when the request is issued. *//*									*//* GLOBAL FUNCTIONS DEFINED IN THIS MODULE :				*//*									*//* MODIFICATION LOG :							*//*  Date     Who   Rev			Comments			*//* --------  ---  ------   -------------------------------------------	*//* 04/15/97  DSF   7.00    MMSEASE 7.0 release. See MODL70.DOC for	*//*			   history.					*//************************************************************************/#include "glbtypes.h"#include "sysincs.h"#include "mms_usr.h"#include "userdefs.h"#include "mmsop_en.h"#include "gvaldefs.h"#include "scrndefs.h"#include "fkeydefs.h"#include "mms_pfil.h"#include "mms_vfil.h"/************************************************************************//* For debug version, use a static pointer to avoid duplication of 	*//* __FILE__ strings.							*//************************************************************************/#ifdef DEBUG_SISCOstatic ST_CHAR *thisFileName = __FILE__;#endif/************************************************************************//************************************************************************//*			FILE MANAGEMENT 				*//************************************************************************//************************************************************************//* MV FCOPY								*//************************************************************************/#if (MMS_MV_FCOPY_EN & REQ_EN)ST_VOID u_mv_fcopy_conf (MMSREQ_PEND *req_ptr)  {OBTFILE_REQ_INFO *req_info;FILE_NAME *fname_idx;ST_INT i;  if (mms_debug_sel & MMS_LOG_USR_CONF)    {    conf_info_print (req_ptr,"Remote File Copy ");    if (req_ptr->resp_err)      list_err_info (req_ptr);    else      {      req_info = (OBTFILE_REQ_INFO *) req_ptr->req_info_ptr;      printf ("\n Application Reference Title : ");      if (req_info->ar_title_pres)	printf ("%s", req_info->ar_title);      else	printf ("Not Present");      fname_idx = (FILE_NAME *)(req_info + 1);      printf ("\n Number of Source FileNames  : %d ", req_info->num_of_src_fname);      for (i = 0; i < req_info->num_of_src_fname; i++, fname_idx++)        {        printf ("\n   %d) ", i+1);        list_bytes ((ST_UCHAR *)fname_idx->fname, fname_idx->fn_len);        }       printf ("\n Number of Destination FileNames  : %d ",                 req_info->num_of_dest_fname);       for (i = 0; i < req_info->num_of_dest_fname; i++, fname_idx++)         {         printf ("\n   %d) ", i+1);         list_bytes ((ST_UCHAR *)fname_idx->fname, fname_idx->fn_len);         }      }     conf_info_wait ();     }   				/* take care of continuous send var	*/   resp_rcvd = 1;		/* set response received flag		*/   rep_count++;			/* increment number of reps counter	*/   ms_clr_mvreq (req_ptr);		/* clear the VM command info	*/  }  #endif/************************************************************************//* MP OBTFILE								*//************************************************************************/  #if MMS_OBTAINFILE_EN & REQ_ENST_VOID u_mp_obtfile_conf (MMSREQ_PEND *req_ptr)  {  if (mms_debug_sel & MMS_LOG_USR_CONF)    {    conf_info_print (req_ptr,"Obtain File ");    if (req_ptr->resp_err)      list_err_info (req_ptr);    conf_info_wait ();    }				/* take care of continuous send var	*/  resp_rcvd = 1;		/* set response received flag		*/  rep_count++;			/* increment number of reps counter	*/  }#endif/************************************************************************//* MV MVE_FOPEN								*//************************************************************************/#if MMS_MV_FOPEN_EN & REQ_ENST_VOID u_mv_fopen_conf (MMSREQ_PEND *req_ptr)  {#if MMS_FOPEN_EN & REQ_EN  u_mp_fopen_conf (req_ptr);#endif  ms_clr_mvreq (req_ptr);		/* clear the VM command info	*/				/* take care of continuous send var	*/  resp_rcvd = 1;		/* set response received flag		*/  rep_count++;			/* increment number of reps counter	*/  }#endif/************************************************************************//* MP MVE_FOPEN								*//************************************************************************/#if MMS_FOPEN_EN & REQ_ENST_VOID u_mp_fopen_conf (MMSREQ_PEND *req_ptr)  {FOPEN_RESP_INFO *info_ptr;FCTRL_INFO      *finfo;  if (mms_debug_sel & MMS_LOG_USR_CONF)    {    conf_info_print (req_ptr,"File open ");    if (req_ptr->resp_err)      list_err_info (req_ptr);    else      {      info_ptr = (FOPEN_RESP_INFO *) req_ptr->resp_info_ptr;      finfo =  (FCTRL_INFO *) req_ptr->req_info_ptr;      printf ("\n File Read State Machine ID = %ld", info_ptr->frsmid);      printf ("\n Remote File Reference Number = %d", finfo->refnum);      printf ("\n File Size = %lu", info_ptr->ent.fsize);      printf ("\n Time modified ");      if (info_ptr->ent.mtimpres)	printf ("= %s",ctime (&info_ptr->ent.mtime));      else	printf ("not present");      }    conf_info_wait ();    }  }#endif/************************************************************************//* MV FREAD								*//************************************************************************/#if MMS_MV_FREAD_EN & REQ_ENST_VOID u_mv_fread_conf (MMSREQ_PEND *req_ptr)  {FCTRL_INFO	*finfo;FREAD_RESP_INFO *ptr;ST_CHAR junk[100];  if (mms_debug_sel & MMS_LOG_USR_CONF)    {    conf_info_print (req_ptr,"Remote File read ");    if (req_ptr->resp_err)      list_err_info (req_ptr);    else      {      finfo = (FCTRL_INFO *) req_ptr->req_info_ptr;      ptr = (FREAD_RESP_INFO *) req_ptr->resp_info_ptr;      printf ("\n More Follows     : ");      if (ptr->more_follows)	printf ("YES");      else	printf ("NO");      printf ("\n File Data Length : %d", ptr->fd_len);      printf ("\n Enter H for HEX display, just ENTER for ASCII : ");      if (strget (junk) && (junk[0] == 'H' || junk[0] == 'h'))	{	CLEARSCR;	list_bytes (finfo->buffer, (ST_INT) finfo->bytes_read);	}      else	{	CLEARSCR;	list_ascii ((ST_CHAR *)finfo->buffer, (ST_INT) finfo->bytes_read);	}      }    conf_info_wait ();    }				/* take care of continuous send var	*/  resp_rcvd = 1;		/* set response received flag		*/  rep_count++;			/* increment number of reps counter	*/  ms_clr_mvreq (req_ptr);		/* clear the VM command info	*/  }#endif/************************************************************************//* MP FREAD								*//************************************************************************/#if MMS_FREAD_EN & REQ_ENST_VOID u_mp_fread_conf (MMSREQ_PEND *req_ptr)  {FREAD_RESP_INFO *ptr;ST_CHAR junk[100];  if (mms_debug_sel & MMS_LOG_USR_CONF)    {    conf_info_print (req_ptr,"File read ");    if (req_ptr->resp_err)      list_err_info (req_ptr);    else      {      ptr = (FREAD_RESP_INFO *) req_ptr->resp_info_ptr;      printf ("\n More Follows     : ");      if (ptr->more_follows)	printf ("YES");      else	printf ("NO");      printf ("\n File Data Length : %d", ptr->fd_len);      printf ("\n Enter H for HEX display, just ENTER for ASCII : ");      if (strget (junk) && (junk[0] == 'H' || junk[0] == 'h'))	{	CLEARSCR;	list_bytes (ptr->filedata, ptr->fd_len);	}      else	{	CLEARSCR;	list_ascii ((ST_CHAR *)ptr->filedata, ptr->fd_len);	}      }    conf_info_wait ();    }  }#endif/************************************************************************//* MV FCLOSE								*//************************************************************************/     #if MMS_MV_FCLOSE_EN & REQ_ENST_VOID u_mv_fclose_conf (MMSREQ_PEND *req_ptr)  {#if MMS_FCLOSE_EN & REQ_EN  u_mp_fclose_conf (req_ptr);#endif  ms_clr_mvreq (req_ptr);		/* clear the VM command info	*/				/* take care of continuous send var	*/  resp_rcvd = 1;		/* set response received flag		*/  rep_count++;			/* increment number of reps counter	*/  }#endif/************************************************************************//* MP FCLOSE								*//************************************************************************/#if MMS_FCLOSE_EN & REQ_ENST_VOID u_mp_fclose_conf (MMSREQ_PEND *req_ptr)  {  if (mms_debug_sel & MMS_LOG_USR_CONF)    {    conf_info_print (req_ptr,"File close ");    if (req_ptr->resp_err)      list_err_info (req_ptr);    conf_info_wait ();    }  }#endif/************************************************************************//* MP MVE_FRENAME								*//************************************************************************/#if MMS_FRENAME_EN & REQ_ENST_VOID u_mp_frename_conf (MMSREQ_PEND *req_ptr)  {  if (mms_debug_sel & MMS_LOG_USR_CONF)    {    conf_info_print (req_ptr,"File rename ");    if (req_ptr->resp_err)      list_err_info (req_ptr);    conf_info_wait ();    }  }#endif/************************************************************************//* MP MVE_FDELETE								*//************************************************************************/#if MMS_FDELETE_EN & REQ_ENST_VOID u_mp_fdelete_conf (MMSREQ_PEND *req_ptr)  {  if (mms_debug_sel & MMS_LOG_USR_CONF)    {    conf_info_print (req_ptr,"File delete ");    if (req_ptr->resp_err)      list_err_info (req_ptr);    conf_info_wait ();    }  }#endif/************************************************************************//* MP FDIRECTORY							*//************************************************************************/#if MMS_FDIR_EN & REQ_ENST_VOID u_mp_fdir_conf (MMSREQ_PEND *req_ptr)  {ST_INT i;ST_INT j;ST_INT ch;FDIR_RESP_INFO  *rsp_ptr;FDIR_DIR_ENT    *dir_ptr;FILE_NAME       *fname_idx;ST_INT fname_count = 0;ST_CHAR	last_name[30];  if (mms_debug_sel & MMS_LOG_USR_CONF)    {    conf_info_print (req_ptr,"File directory ");    if (req_ptr->resp_err)      list_err_info (req_ptr);    else      {      last_name[0] = '\x00';      rsp_ptr = (FDIR_RESP_INFO *) req_ptr->resp_info_ptr;      dir_ptr = (FDIR_DIR_ENT *) (rsp_ptr + 1);      printf ("\n  Number of Directory Entries Returned : %d", 	      rsp_ptr->num_dir_ent);      for (i = 0; i < rsp_ptr->num_dir_ent; i++)	{        CLEARLINE (17);	printf ("  Directory Entry : %d", i+1);        CLEARLINE (18);	printf ("    File Name       : ");	fname_idx = (FILE_NAME *)(dir_ptr + 1);	fname_count = 0;	for (j=0; j < dir_ptr -> num_of_fname; j++, fname_idx++)	  { 	  list_ascii (fname_idx->fname, fname_idx->fn_len);	  strncpy (last_name, fname_idx->fname, fname_idx->fn_len);	  last_name[fname_idx->fn_len] = '\x00';	  fname_count++;	  }        CLEARLINE (19);	printf ("    File Size       : %lu", dir_ptr->fsize);        CLEARLINE (20);	if (dir_ptr->mtimpres)	  printf ("    Time Modified   : %s", ctime (&dir_ptr->mtime));	else	  printf ("    Time Modified   : not present");	if ((i + 1) < rsp_ptr->num_dir_ent)	  {          CLEARLINE (22);	  printf ("  Press return to continue, x to exit");	  ch = get_a_char ();	  if (ch == 'x' || ch == 'X')	    {			/* exit selected, find last dir entry	*/	    for (; i < (rsp_ptr->num_dir_ent-1); i++, dir_ptr++)	      ;	    }	  }	dir_ptr = (FDIR_DIR_ENT *)(((FILE_NAME *)                  (dir_ptr + 1)) + fname_count);	}      CLEARLINE (22);      if (rsp_ptr->more_follows)	printf ("  More Follows After :%s ", last_name);      else	printf ("  No More Follows ");    }    conf_info_wait ();    }				/* take care of continuous send var	*/  resp_rcvd = 1;		/* set response received flag		*/  rep_count++;			/* increment number of reps counter	*/  }#endif

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -