📄 mmsaocs.c
字号:
/************************************************************************//* SISCO SOFTWARE MODULE HEADER *****************************************//************************************************************************//* (c) Copyright Systems Integration Specialists Company, Inc., *//* 1986 - 1997, All Rights Reserved. *//* *//* MODULE NAME : mmsaocs.c *//* PRODUCT(S) : MMSEASE *//* *//* MODULE DESCRIPTION : *//* This module contains functions to initiate the MMS operator *//* communication services. These functions are called from the *//* mainloop (check_key). *//* *//* 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"#if (SYSTEM_SEL & (MSOFT | OS2))#include <conio.h>#endif#include "mms_usr.h"#include "mms_pocs.h"#include "mmsop_en.h"#include "userdefs.h"#include "fkeydefs.h"#include "gvaldefs.h"/************************************************************************//* For debug version, use a static pointer to avoid duplication of *//* __FILE__ strings. *//************************************************************************/#ifdef DEBUG_SISCOstatic ST_CHAR *thisFileName = __FILE__;#endif/************************************************************************//* do_output *//* create and send an output operation request *//************************************************************************/ST_VOID do_output (ST_VOID) {#if MMS_OUTPUT_EN & REQ_ENOUTPUT_REQ_INFO *req_info;ST_CHAR **od_ptr;ST_INT chan;ST_BOOLEAN done;ST_INT tot_len;ST_BOOLEAN data_entered;ST_CHAR temp [256];ST_CHAR *od_str; if (!get_chan (&chan)) { (*menu_set_fun) (); return; } /* use first 2K of user 'dest_buffer' for request structure */ req_info = (OUTPUT_REQ_INFO *) (dest_buffer); od_ptr = (ST_CHAR **) (req_info + 1); /* use 3 - 10K for the output data strings */ od_str = (dest_buffer + 2048); printf (" Enter Operator Station Name : (R) "); if (data_entered = strget (temp)) { temp[MAX_IDENT_LEN] = '\x00'; strcpy (req_info->station_name,temp); } if (data_entered) { tot_len = 0; req_info->data_count = 0; done = SD_FALSE; while (!done) { printf (" Enter Output Data : (O) "); if (strget (temp)) { if ((tot_len += strlen (temp) + 1) < 8192) { req_info->data_count++; /* increment # of output data */ strcpy (od_str, temp); *od_ptr = od_str; od_ptr++; od_str += strlen (od_str) + 1; } else { done = SD_TRUE; wait_msg ("\n Output Data too long, last string was lost "); } } else done = SD_TRUE; /* set exit condition */ } } if (data_entered) { if (!mp_output (chan,req_info)) print_req_error (); if (num_reps) /* if this an auto repeat - */ { if (start_cont ()) /* wait for 1st to complete */ return; num_outstanding = 1; while (rep_count < num_reps) /* if enough done - */ { if (! mp_output (chan, req_info)) break; num_outstanding++; if (cont_serve ()) /* if user hit a key */ return; } cont_done (); /* display results */ } } else wait_msg ("\n Must enter all required information "); (*menu_set_fun) ();#endif }/************************************************************************//* do_input *//* create and send an input operation request *//************************************************************************/ST_VOID do_input (ST_VOID) {#if MMS_INPUT_EN & REQ_ENINPUT_REQ_INFO *req_info;ST_CHAR **pd_ptr;ST_INT chan;ST_BOOLEAN done;ST_LONG num;ST_INT tot_len;ST_BOOLEAN data_entered;ST_CHAR temp[256];ST_CHAR *pd_str; if (!get_chan (&chan)) { (*menu_set_fun) (); return; } /* use first 2K of user 'dest_buffer' for request structure */ req_info = (INPUT_REQ_INFO *) (dest_buffer); pd_ptr = (ST_CHAR **) (req_info + 1); /* use 3 - 10K for the prompt data strings */ pd_str = (dest_buffer + 2048); printf (" Enter Operator Station Name : (R) "); if (data_entered = strget (temp)) { temp[MAX_IDENT_LEN] = '\x00'; strcpy (req_info->station_name,temp); } if (data_entered) { req_info->echo = SD_TRUE; printf (" Enter Echo (y/n) : (default = TRUE) "); if (strget (temp)) { if ((temp[0] == 'n') || (temp[0] == 'N')) req_info->echo = SD_FALSE; } } if (data_entered) { printf (" Enter Input Timeout : (O) "); if (longget (&num)) { req_info->timeout_pres = SD_TRUE; req_info->timeout = (ST_UINT32) num; } else req_info->timeout_pres = SD_FALSE; } if (data_entered) { tot_len = 0; req_info->prompt_count = 0; done = SD_FALSE; req_info->prompt_pres= SD_FALSE; while (!done) { printf (" Enter Prompt Data : (O) "); if (strget (temp)) { if ((tot_len += strlen (temp) + 1) < 8192) { req_info->prompt_count++; /* increment # of prompt data */ req_info->prompt_pres = SD_TRUE; strcpy (pd_str, temp); *pd_ptr = pd_str; pd_ptr++; pd_str += strlen (pd_str) + 1; } else { done = SD_TRUE; wait_msg ("\n Prompt Data too long, last string was lost "); } } else done = SD_TRUE; /* set exit condition */ } } if (data_entered) { if (!mp_input (chan, req_info)) print_req_error (); if (num_reps) /* if this an auto repeat - */ { if (start_cont ()) /* wait for 1st to complete */ return; num_outstanding = 1; while (rep_count < num_reps) /* if enough done - */ { if (! mp_input (chan, req_info)) break; num_outstanding++; if (cont_serve ()) /* if user hit a key */ return; } cont_done (); /* display results */ } } else wait_msg ("\n Must enter all required information "); (*menu_set_fun) ();#endif }
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -