📄 mmsavmd.c
字号:
temp[MAX_IDENT_LEN] = '\x00'; strcpy (info.continue_after, temp); info.cont_after_pres = SD_TRUE; } else info.cont_after_pres = SD_FALSE; if (!mp_namelist (chan,&info)) { print_req_error (); (*menu_set_fun) (); return; } if (num_reps) /* if this an auto repeat - */ { if (start_cont ()) /* wait for 1st to complete */ return; num_outstanding = 1; /* we just put one in the pipe */ while (rep_count < num_reps) /* if enough done - */ { if (!mp_namelist (chan,&info)) /* send the next one */ break; num_outstanding++; if (cont_serve ()) /* if user hit a key */ return; } cont_done (); /* display results */ } else (*menu_set_fun) ();#endif }/************************************************************************//* do_getcl *//* create and send a get capability list request *//************************************************************************/ST_VOID do_getcl (ST_VOID) {#if MMS_GETCL_EN & REQ_ENGETCL_REQ_INFO req_info;ST_INT chan;ST_CHAR temp [256]; if (!get_chan (&chan)) { (*menu_set_fun) (); return; } printf (" Enter Continue After Capability : (O) "); if (strget (temp)) { req_info.cont_after_pres = SD_TRUE; req_info.continue_after = temp; } else req_info.cont_after_pres = SD_FALSE; if (!mp_getcl (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_getcl (chan, &req_info)) break; num_outstanding++; if (cont_serve ()) /* if user hit a key */ return; } cont_done (); /* display results */ } (*menu_set_fun) ();#endif }/************************************************************************//* do_add_vmd *//* add a local VMD *//************************************************************************/ST_VOID do_add_vmd (ST_VOID) {#if MMS_VMD_ENST_INT chan_count = 0;ST_INT chan = 0;ST_BOOLEAN data_entered = 0;ST_INT *chan_array;ST_CHAR temp[100];ST_CHAR *user_info = NULL;VMD_CTRL *new_vmd; printf ("\n Enter User Info String for new VMD : (O) "); if (data_entered = strget (temp)) { user_info = chk_malloc (strlen (temp)); strcpy (user_info, temp); } data_entered = SD_TRUE; chan_array = (ST_INT *)dest_buffer; while ((data_entered) && (chan_count < max_mms_chan)) { printf (" Enter Channel # for new VMD : (O) "); if (data_entered = intget (&chan)) { if (chan < max_mms_chan) { chan_array[chan_count] = chan; chan_count++; } else data_entered = SD_FALSE; } } new_vmd = ms_create_vmd (chan_count, chan_array); new_vmd -> user_info = user_info; printf ("\n Current VMD has been set to the new node."); printf ("\n User Info for current VMD : "); if (m_vmd_select->user_info) printf ("%s", m_vmd_select->user_info); else printf ("Not Present"); wait_msg (""); (*menu_set_fun) ();#endif }/************************************************************************//* do_list_vmd *//* list all the local VMD's *//************************************************************************/ST_VOID do_list_vmd (ST_VOID) {#if MMS_VMD_ENST_INT count=0;struct vmd_ctrl *vmd_ptr;struct vmd_ctrl *idx_ptr;ST_INT i; if (ask ("\nDo you want to see mapping from channels to VMDs (y,n) (default = n) : ",0)) { CLEARSCR; printf ("\n\n"); for (i=0; i < max_mms_chan; i++) { if (mms_chan_info[i].objs.vmd) { printf ("\nUser Info for VMD on channel %d : ", i); if (mms_chan_info[i].objs.vmd->user_info) printf ("%s",mms_chan_info[i].objs.vmd->user_info); else printf ("No User Info available for this VMD."); } else printf ("\nThere is no VMD associated with channel %d.", i); } wait_msg ("\nPress any key to see the individual VMDs."); } CLEARSCR; if (m_vmd_ctrl_list == NULL) { printf ("\n\nThere are no VMDs in the database. "); wait_msg ("\n\nPress any key to continue."); } else { vmd_ptr = m_vmd_ctrl_list; idx_ptr = NULL; while (idx_ptr != m_vmd_ctrl_list) { count++; printf ("\nVMD node #%d", count); printf ("\n\nUser Info: "); if (vmd_ptr->user_info) printf ("%s", vmd_ptr->user_info); else printf ("Not Present"); printf ("\nNamed Variables: "); if (vmd_ptr->vmd_wide.var_list) printf ("Are Present"); else printf ("Not Present"); printf ("\nVariable List: "); if (vmd_ptr->vmd_wide.var_list_list) printf ("Is Present"); else printf ("Not Present"); printf ("\nNamed Type List: "); if (vmd_ptr->vmd_wide.type_list) printf ("Is Present"); else printf ("Not Present"); printf ("\nScattered Access List: "); if (vmd_ptr->vmd_wide.scat_acc_list) printf ("Is Present"); else printf ("Not Present"); printf ("\nSemaphore List: "); if (vmd_ptr->vmd_wide.sem_list) printf ("Is Present"); else printf ("Not Present"); printf ("\nEvent Condition List: "); if (vmd_ptr->vmd_wide.ev_cond_list) printf ("Is Present"); else printf ("Not Present"); printf ("\nEvent Action List: "); if (vmd_ptr->vmd_wide.ev_act_list) printf ("Is Present"); else printf ("Not Present"); printf ("\nJournal List: "); if (vmd_ptr->vmd_wide.jour_list) printf ("Is Present"); else printf ("Not Present"); printf ("\nNamed Domains: "); if (vmd_ptr->dom_list) printf ("Are Present"); else printf ("Not Present"); printf ("\nProgram Invocations: "); if (vmd_ptr->prog_inv_list) printf ("Are Present"); else printf ("Not Present"); printf ("\nOperator Stations: "); if (vmd_ptr->op_stat_list) printf ("Are Present"); else printf ("Not Present"); wait_msg (""); CLEARSCR; idx_ptr = (VMD_CTRL *)vmd_ptr->link.next; vmd_ptr = (VMD_CTRL *)vmd_ptr->link.next; } } (*menu_set_fun) ();#endif }/************************************************************************//* do_select_vmd *//* select the current working VMD *//************************************************************************/ST_VOID do_select_vmd (ST_VOID) {#if MMS_VMD_ENST_INT vmd_num = 0;ST_INT count = 0;ST_INT i;VMD_CTRL *vmd_ptr; printf ("\n Enter node # for new default VMD : "); if (intget (&vmd_num)) { count = count_vmd (); if ((vmd_num > 0) && (vmd_num <= count)) { vmd_ptr = m_vmd_ctrl_list; for (i=1; i < vmd_num; i++) vmd_ptr = (VMD_CTRL *)vmd_ptr->link.next; m_vmd_select = vmd_ptr; printf ("\nCurrent VMD has been set to node # : %d", vmd_num); printf ("\nLabel for current VMD : "); if (m_vmd_select->user_info) printf ("%s", m_vmd_select->user_info); else printf ("Not Present"); wait_msg (""); } } (*menu_set_fun) ();#endif } /************************************************************************//* do_dismantle_vmd *//* dismantle a VMD node that the user selects *//************************************************************************/ST_VOID do_dismantle_vmd (ST_VOID) {#if MMS_VMD_ENST_INT vmd_num = 0;ST_INT count = 0;struct vmd_ctrl *vmd_ptr;ST_INT i; printf ("\nEnter node # to be dismantled : "); if (intget (&vmd_num)) { count = count_vmd (); if ((vmd_num > 0) && (vmd_num <= count)) { vmd_ptr = m_vmd_ctrl_list; for (i=1; i < vmd_num; i++) vmd_ptr = (VMD_CTRL *)vmd_ptr->link.next; ms_dismantle_vmd (vmd_ptr); printf ("\nVMD node %d has successfully been dismantled.", vmd_num); wait_msg (""); } else { printf ("\n'%d'is an Invalid node #. Try again.", vmd_num); wait_msg (""); } } (*menu_set_fun) ();#endif }/************************************************************************//* do_delete_vmd *//* delete a VMD node that the user selects *//************************************************************************/ST_VOID do_delete_vmd (ST_VOID) {#if MMS_VMD_ENST_INT vmd_num = 0;ST_INT count = 0;VMD_CTRL *vmd_ptr;ST_INT i; printf ("\n Enter node # to be deleted : "); if (intget (&vmd_num)) { count = count_vmd (); if ((vmd_num > 0) && (vmd_num <= count)) { vmd_ptr = m_vmd_ctrl_list; for (i=1; i < vmd_num; i++) vmd_ptr = (VMD_CTRL *)vmd_ptr->link.next; if (ms_delete_vmd (vmd_ptr)) printf ("\n VMD node %d was not deleted.", vmd_num); else printf ("\n VMD node %d has successfully been deleted.", vmd_num); wait_msg (""); } } (*menu_set_fun) ();#endif }/************************************************************************//* count_vmd *//* count the number of nodes in the VMD list *//************************************************************************/#if MMS_VMD_ENST_INT count_vmd (ST_VOID) {ST_INT count = 0;VMD_CTRL *vmd_ptr;VMD_CTRL *idx_ptr = NULL; vmd_ptr = m_vmd_ctrl_list; while (idx_ptr != m_vmd_ctrl_list) { count++; idx_ptr = (VMD_CTRL *)vmd_ptr->link.next; vmd_ptr = (VMD_CTRL *)vmd_ptr->link.next; } return (count); }#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -