PNOTICE_xforum.alm 10/27/88 1532.0r w 10/27/88 1532.0 2448 dec 1 "version 1 structure dec 1 "no. of pnotices dec 3 "no. of STIs dec 56 "lgth of all pnotices + no. of pnotices acc "Copyright, (C) Honeywell Information Systems Inc., 1988" aci "C1EFSM0E0000" aci "C2EFSM0E0000" aci "C3EFSM0E0000" end  xforum.pl1 09/13/88 1325.8rew 09/13/88 1257.6 397413 /****^ *********************************************************** * * * Copyright, (C) Honeywell Bull Inc., 1987 * * * * Copyright, (C) Honeywell Information Systems Inc., 1983 * * * *********************************************************** */ /****^ HISTORY COMMENTS: 1) change(85-01-08,Davids), approve(86-02-04,MCR7350), audit(86-04-24,Gilcrease), install(86-04-24,MR12.0-1048): Changed calling sequence of xforum_multics_mode to remove the handle_interactive_messages_flag. Also changed the calling sequence of xforum_help_$get_help to remove the handle_interactive_messages_flag and the function_key_data_ptr. Changed calling sequence of xforum_window_mgr$menu_get_choice to remove the arguments function_key_data_ptr and handle_interactive_messages. Changed test to call xforum_multics_mode to use xforum_user_profile$get_multics_mode instead of args.multics_mode. Note that the value of the flag returned by get_multics_mode can be changed within the loop that the test is being made in. 2) change(85-01-10,Davids), approve(86-02-04,MCR7350), audit(86-04-24,Gilcrease), install(86-04-24,MR12.0-1048): Changed call to xforum_process_args_ so that the args structure is no longer passed in. Instead just a pointer to the arg_list is input. Removed all the calls to xforum_user_profile$set that were based on the values in the args structure (this is now done by the xforum_process_args_ routine). Now setting values in the local_xforum_info structure by calling the appropriate xforum_user_profile$get routine. Took the arg_list_ptr and the ptrs elements out of the xforum_args structure and made them independent. Removed the reference to xforum_args.incl.pl1. 85-01-14 Davids: replaced calls to accept_messages, print_messages, and defer_messages with calls to xforum_im_mgr$init, defer_messages, and restore_messages. 85-01-18 Davids: Changed version to 1.1c 85-01-23 Davids: Changed version to 1.1d 85-01-24 Davids: Increased the hbound of ptrs from 2 to 3 to accommodate the segment used to hold the set_array. 3) change(85-02-01,Davids), approve(86-02-04,MCR7350), audit(86-04-24,Gilcrease), install(86-04-24,MR12.0-1048): Changed to version 1.1e. 85-02-06 Davids: Replaced call to xforum_main_options$getting_started with call to xforum_getting_started. 85-02-13 Davids: Replaced calls to xforum_getting_started and xforum_personalize to xforum_getting_started_menu and xforum_personalize_menu 85-02-13 Davids: Changed calling sequence of xforum_help_line_$change to include the new F3_message argument. 85-02-14 Davids: Changed the call to xforum_getting_started_menu to xforum_help_menus$getting_started. Added the call to xforum_help_line_$init; 85-02-18 Davids; Changed to version 1.1f 85-03-06 Davids: Moved the code that nulls xforum_meeting_list_ptr, xforum_menu_ptr, and spy_ptr so that it is after the check for a recursive call. Nulling xforum_meeting_list_ptr before the call ment that after the failure and a return to the first invocation of xforum a null pointer fault would happen almost immediately. 4) change(85-03-07,Davids), approve(86-02-04,MCR7350), audit(86-04-24,Gilcrease), install(86-04-24,MR12.0-1048): Changed version to 1.1g 85-04-04 Davids: Changed version to 1.1h 85-04-15 Davids: Changed version to 1.1i 85-04-22 Davids: Added xt_cleanup_flag paramater to the call of the xforum_im_mgr$restor_origial entry. 85-05-08 Davids: Added comments to all variable declarations and removed some declared but not used variables. 85-05-21 Davids: Removed reference to xforum_menu_info.incl.pl1 it was not being used. 5) change(86-02-21,LJAdams), approve(86-02-21,MCR7350), audit(86-04-24,Gilcrease), install(86-04-24,MR12.0-1048): Repositioned call to xforum_help_$init to avoid abort with invalid sci_ptr when terminating because of an error in xforum profile. 6) change(86-05-01,LJAdams), approve(86-05-01,MCR7350), audit(86-05-01,Gilcrease), install(86-05-06,MR12.0-1053): Changed version number to 2.0. 7) change(87-04-10,LJAdams), approve(87-04-22,MCR7684), audit(87-07-30,Blair), install(87-08-06,MR12.1-1065): Changed to allow command_processor_ escapes. Changed version to 2.1. 8) change(88-08-09,LJAdams), approve(88-08-09,MCR7766), audit(88-08-14,GDixon), install(88-09-13,MR12.2-1109): Moved the setting of Shelp switch prior to the call to xforum_help_$init. END HISTORY COMMENTS */ executive_forum: xforum: proc; /* BEGIN DESCRIPTION function: This is the main module of the xforum package. It coordinates the calls to lower level routines which perform the initialization of the system and the termination of the system. It also creates and displays the main menu and processes the user's menu selection. description of entry points: executive_forum, xforum: input: output: Main entry point. reconnect_test: input: output: returns bit (1) aligned, "1"b implies that the current condition frame on the stack is a quit and that the reconnect_quit switch is set to indicate that the quit was caused as a result of a reconnection. The reconnect_test entry point is used by the emacs extension to determine if a quit is the result of the user hitting the BREAK key or a reconnection. It returns a true if the quit was caused by a reconnection. It returns false if the quit was caused by some other reason. description of internal procedures: xforum_terminate: coordinates the termination of the facility. It is called during both normal termination and during a cleanup. The cleanup_flag is used to distinguish the two. Note that the only menu that needs to be destroyed is the main menu. The other menus are destroyed in the lower level routines that created them. collect_spy_data: records the users choice in a special spy structure. The record includes an index which counts the users responses, an identifier which indicates what the user is responding to, i.e. main menu, help prompt, and the users response. record_spy_data: moves the data collected in the spy structure from the segment in the users process dir to a segment in >udd>m>cp>Davids>xforum>spy directory. No error is reported if some reason the data cannot be moved i.e. the directory does not exist. fatal_error: is called in response to the xforum_fatal_error condition being signaled. It locates the information structure associated with the condition and calls xforum_error with the code and message from the structure. xforum_error: shuts down xforum and reports an error to the user. Xforum must first be shut down so that the user can see the error message. If the message is displayed and the system then shut down the message will be cleared off the screen to fast to read. check_for_reconnect: calls find_condition_info_ to get the info pointer for the quit condition. It then checks the reconnection_quit switch in the quit_info structure. known bugs: notes: history: 83-11-?? Deryk Barker: Originally coded 84-03-27 Davids: Modified to check the value of forum_version before adding the .control suffix to the meeting path. If the value of forum_version is 2 the suffix .forum is added instead. Modified the call to xforum_find_path_ to include the forum_version parameter. The call is first made with the version set to 1 and if an error occurs it is tried again with the version = 2. If that fails an error is reported to the user 84-03-28 Davids: Added forum_version parameter to display_trans, next_trans, and next_ref so that the correct forum_ entry for setting the "seen" value could be called. Changed the order of the calls to close_meeting and forum_$set_switch_index when the user selected to resign from a meeting in the attend_meeting proc so that the call to set_switch_indx is made before the call to close. This fixes the problem of not have a resignation recorded by forum. Modified so that the changed flag is updated when the user attends a meeting. The flag for participation/remove was already updated. This is needed if the user was previously not a participant. Added code to send a silent message to a special mailbox to record the fact that someone used xforum. 84-05-02 Davids: Modified the text of QUERY_USAGE to include "To return to top menu press BREAK". Also modified the usage_msg to include "To quit, press ESC, then ""q""" and "To quit, press F4". Added a "To return to top menu press BREAK" message when a dynamic menu is displayed, there used to be no message displayed. Moved code that starts up the video system so that its the first thing so that it can write out a "Executive Forum is setting up - be patient" message immediately. Also added code in xforum_terminate to clear user_io after it restores it to its original size. Also removed code appearing after the exit_xforum label and the call to xforum_terminate code that cleared the window - this only worked if the process was in the video system to start with. 84-05-03 Davids: Modified the help line when in the editor so that it indicates that BREAK is used to abort the transaction being entered. Changed the condition on length of meeting names from 20 to 26 characters - version 2 forums can have longer names than version 1 forums. Changed the length of the varaibles that will hold those names from 20 to 26. Changed the length of the headers from 38 to 44 to be able to handle the extra length. Changed Version to 1.6. 84-05-22 Davids: Moved the call to menu_$destroy to the xforum_terminate procedure instead of leaving it as the next thing after the call to xforum_terminate at the exit_xforum_label. Also added a call to window_$sync after the call to clear the user_io window in xforum_terminate so that the ready message is not lost when you exit xforum. Reformated the text on the help line so that F3 could be added. Added code to leave the cursor positioned two lines down from the getting set up message and in column 1 so that error messages start off at the left margin. Changed the last occurance of Use to Press (at least I hope its the last). Removed the call to clear the menu window right before the call to display the attending meeting menu. This means that the attending menu meeting will no longer be redrawn ever time you enter a new meeting. 84-05-24 Davids: Added code to the internal proc get_to_cl to create a special multics_mode status window and resize user_io to use most of the screen. Also changed the pi handler to destroy the status window and resize user_io. This code doesn't work. It clears the user_io window which it is not suppose to do and dies badly with the attending meeting menu. 84-05-30 Davids: Added code to the pi handler in the attend_meeting internal proc and changed the handler in the main xforum proc to correctly handle the return from multics mode. The status window is destroyed and the user_io window is correctly shrunk, the status info and menu are redisplayed. The text in the user_io window that does not overlap the menu window is left on the screen. Note that there are still circumstances when the user_io window will be cleared when it is increased as the user gets into Multics mode. No idea why. Also modified the xforum_terminate internal proc to destroy the xforum status window (as opposed to the multics mode status window) It has not been doing this. 84-06-01 Davids: Removed the call to window_$sync in xforum_terminate it was doing no good. The probelm with the lost screens was that my message handler was not clearing the status flag. Why this did not effect xmail I have no idea. 84-06-05 Davids: Modified xforum_terminate to call two new internal procs. output_shut_down_msg is used to restore the original user_io window and then output a Executive Forum is shutting down - be paitent message. It takes a while to shut down and the user was not given any feedback that his F4 was accepted. The record_spy_data routine looks for the directory >udd>m>cp>Davids>xforum>spy. If it finds it, it creates a segment in the dir and places in it a copy of the spy structure. Also changed the version to 1.7 and removed the call to send_message_silent. That form of usage recording is not needed with the spy code. 84-06-06 Davids: Added calls to collect_spy_data after all calls to menu_$get_choice, xforum_dyn_menu_$get_choice, xforum_help_$get_choice and iox_$get_line, and in the quit handlers. This will record the current state and the users input. 84-06-07 Davids: Added copy of reconnect_test and associated internal procs so that emacs extension can determine that a reconnect has occured. Code was copied from xmail_window_manger_. 84-06-12 Davids: Added calls to check_window_status as first thing done in all quit handlers. This allows reconnections to work right. Added an any_other hander to get_to_cl. This prevents the xforum quit handlers to be invoked when quit is signaled in multics mode. Modified xforum_error to goto error_exit_xforum instead of just exit_xforum. exit_xforum calls xforum_terminate which xforum_error has already done. This second call clears the error message from the screen. The error_exit_xforum label was added after the exit_xforum label - right after the call to xforum_terminate and before return. 84-06-14 Davids: Modified so that xforum_menu_ptr is set to null as one of the first things done and in xforum_terminate before the call to menu_$destroy the pointer is checked and the call made only if its non-null. Changed the start up message to "Executive Forum is setting up - Menu will be displayed shortly." and the shut down message to "Executive Forum is shutting down - Screen will clear shortly." Changed the version to 1.8 84-06-19 Davids: Modified so that all window recreation or changes are done via calls to xforum_window_mgr. The invocation and termination of the video system and the output of the starting up and shutting down messages are also done via the xforum_window_mgr module. The condition xforum_error was added to handle fatal errors. Changed the version to 1.9. 84-06-21 Davids: Removed window management take took place before and after multics mode and replaced with calls to xforum_window_mgr. 84-06-28 Davids: Removed the internal procedures display_trans, enter_trans, next_trans, prev_trans, list_trans, select_trans, next_ref, prev_ref, and first_ref and replaced them with calls to the corresponding xforum_attend_mtg_options entries. Also changed the version to 2.0. 84-07-05 Davids: replaced calls to menu_$display and menu_$get_choice with xforum_window_mgr$menu_display and xforum_window_mgr$menu_get_choice. Changed version to 2.1. 84-07-06 Davids: added calls to xforum_status_$update_title to output what used to be the menu header. Removed the header parameter from the calls to xforum_create_menu_ 84-07-10 Davids: Removed internal procedures goto_meeting, resign_from_meeting, next_meeting, list_meetings, get_choice_from_menu, find_meeting, and prompt_help and replaced then with calls to the corresponding xforum_main_option entries. 84-07-25 Davids: Extensively changed Multics mode. Now instead of just pushing a new command level what happens is that a prompt is issued and the user enters the command. When the command fishes executing a prompt is issued again. To return to xforum the user enters a null command, i.e. just presses the return key. The help line displays the command being executed or if the user is at the prompt a longer version of the prompt. Currently the prompts are just filler text because I cannot think of really good prompts yet. 84-07-26 Davids: Modified so that the xforum_meeting_info_ptr is obtained from args.ptrs (1) instead of arg.ptrs (2). ptrs (1) used to be the xforum_meeting_list_ptr ptr. Modified the xforum_terminate so that it just always frees ptrs (1) instead of testing args.meeting_list first. The xforum_meeting_list segment is used for the life of the process. Modified the get_to_cl routine so that it traps certain conditions and prints the error message that the system would. This prevents a new stack frame from being pushed. Certain conditions have to be let though. Its probably best if get_to_cl is an external routine. It will more than likely have to be modified several times before the list of what conditions trap and what to let though is correct. 84-07-27 Davids: Replaced calls to internal proc get_to_cl with calls to external proc xforum_multics_mode. Removed from the program_interrupt handler the code dealing with a return from multics mode and placed the code after the call to xforum_multics_mode. Deleted the multics_mode_flag. 84-07-30 Davids: Changed version to 3.0 84-07-31 Davids: Modified so that the help messages conform with the MTB and so that title is separated from the pad character by a space. 84-08-13 Davids: Changed version to 3.1. Changed Meetings to Eligible in the banner. Added code to handle interactive messages. If the handle_interactive_messages flag is set then messages will be defered during startup and accepted again during termination. Also the flag is passed to xforum_multics_mode and xforum_window_mgr_$menu_get_choice. 84-08-14 Davids: Changed the main menu to conform to the MTB. This deleted the "Resign from Meeting", "Next Attended Meeting", "List Meetings", "List Changed Meetings", and "List Attended Meetings" options. Added a call to xforum_user_profile$get to set up the profile (currently not used) and set the first time flag. 84-08-15 Davids: Replaced the long argument lists of xforum_main_options by a ptr to a structure which is loaded with the information. Also cleaned up the dcls. Deleted the internal procs get_help and general_help. Replaced get_help with xforum_get_help. 84-08-16 Davids: Replaced calls to xforum_get_help with calls to xforum_help_$get_help. Updated the attending meeting menu to reflect the MTB and changed the code handling the users choice accordingly. 84-08-29 Davids: Removed the attend_meeting internal proc (moved it to xforum_main_options). Added the exit_executive_forum condition handler and setting of xforum_info.main_options.use_alternate_fkeys, multics_mode, and handle_interactive_messages. These were needed to make the move work correctly. Also added the code for correctly handling the getting started menu. 84-08-30 Davids: Finally added an xforum_fatal_error handler. Added the parameter xt_clean_up flag to xforum_terminate. This value is passed to the window_mgr routines call by terminate to control terminal i/o. 84-09-04 Davids Changed version to 4.0 84-09-17 Davids: Added code for processing upper case escapse sequences. This include declaring XXX2 constants and using them where ever the XXX constants are used. 84-09-25 Davids: Removed references to xforum_trans_array. The array is being deleted because it enforces an upper limit on the number of transaction that xforum can handle. 84-09-28 Davids: Removed all references to usage messages and xforum_status_$update_usage and redisplay_usage. Replaced them with a reference to xforum_help_line. 84-10-01 Davids: Removed the determination of whether function keys or escapse sequences can be used. Replaced it with calls to xforum_user_profile. Still make a call to set the value of the function_key_data_ptr. This should be removed and calls to xforum_user_profile$get_function_key_data_ptr used where the ptr is actually needed. However I do not have the time do do that now. 84-10-02 Davids: Added a call to xforum_user_profile$set_use_function_keys with the new arggs element escape_sequences. Added the spy_ptr parameter to the xforum_list_meetings$process_args_ call and removed the code that created the xforum_spy segment in the pdir. 84-10-03 Davids: Changed a call from get_temp_segment_ to get_temp_segments_ the extra segment is for the seen_map. Change release_temp_segment_ to segments_ as well. 84-10-16 Davids: Updated version to 5.0 84-10-17 Davids: Changed versions to 5.1 84-10-22 Davids: Changed message handling so that it is the same as Xmail's, except for the -brief control arg for print_messages. Xforum will not start using the MR11 message system control args until after a controlled release tape is cut. 84-10-22 Davids: A new version (including todays changes) was installed in EXL so the development version's version has been changed to 5.2. 84-10-25 Davids: Added the xforum_already_active variable. This is internal static, inited to "0"b. The first thing xforum does is to see if this variable is true. if it is an error message is output. The value is set to true immediately after the cleanup routine is established. The cleanup routine re-sets it to false. 84-10-25 Davids: A new version (including todays changes) was installed in EXL so the development version's version has been changed to 5.3. 84-10-29 Davids: A new version (including todays changes) was installed in EXL so the development version's version has been changed to 5.4. 84-11-06 Davids: Changed references to xforum_list_meetings to xforum_list_meetings_. Also all references to xforum_help_line to xforum_help_line_ 84-11-13 Davids: Version changed to 5.5 84-11-15 Davids: Auditing changes: 1) Corrected messages to start with an upper case letter and end with some puncuation. 2) replaced calls to hcs_$make_seg with calls to initiate_file_$create. 3) Cleaned up dcls so that unrefered variables are deleted and undcled builtins are declared. Other changes: 1) Reorganized dcls into the standard format. 84-11-16 Davids: Added the "-brief" argument to the call to print_messages This is needed so that the call does not result in a "You have no messages" message being output. print_message was incompatibly changed. 84-11-19 Davids: Changed version to 5.6 84-12-06 Davids: Modified so that xforum_help_$init is called before xforum_main_options$getting_started. If the help structure is not initiated very strange things will happen when in getting started menu - not to friendly. Also changed versions to 1.1a. 84-12-14 Davids: Changed version to 1.1b END DESCRIPTION */ /* PARAMETERS */ /* EXTERNAL STATIC */ /* ENTRIES */ dcl com_err_ entry () options (variable); dcl cu_$arg_list_ptr entry (ptr); dcl find_condition_frame_ entry (ptr) returns (ptr); dcl find_condition_info_ entry (ptr, ptr, fixed bin (35)); dcl get_system_free_area_ entry () returns (ptr); dcl get_temp_segments_ entry (char (*), (*) ptr, fixed bin (35)); dcl hcs_$status_minf entry (char (*), char (*), fixed bin (1), fixed bin (2), fixed bin (24), fixed bin (35)); dcl initiate_file_$create entry (char (*), char (*), bit (*), ptr, bit (1) aligned, fixed bin (24), fixed bin (35)); dcl ioa_ entry () options (variable); dcl ioa_$rsnnl entry () options (variable); dcl release_temp_segments_ entry (char (*), (*) ptr, fixed bin (35)); dcl unique_chars_ entry (bit (*)) returns (char (15)); dcl xforum_create_menu_ entry ((*) char (*) var, ptr, ptr, fixed bin (35)); dcl xforum_get_str_ entry (char(*) var, ptr, char(*), char(*), char(*) var, fixed bin(35)); dcl xforum_get_str_$init entry options(variable); dcl xforum_help_$get_help entry (ptr, char (*), (*) char (*) var, ptr, ptr); dcl xforum_help_$init entry options(variable); dcl xforum_help_$term entry options (variable); dcl xforum_help_line_$change entry (bit (8), char (*), char (*), char (*)); dcl xforum_help_line_$init entry; dcl xforum_help_menus$getting_started entry (ptr, ptr); dcl xforum_im_mgr$defer_messages entry (); dcl xforum_im_mgr$init entry (); dcl xforum_im_mgr$restore_original entry (bit (1) aligned); dcl xforum_main_options$goto_meeting entry (ptr); dcl xforum_main_options$modify_meeting_list entry (ptr); dcl xforum_main_options$next_meeting entry (ptr); dcl xforum_multics_mode entry (fixed bin); dcl xforum_personalize_menu entry (ptr, ptr); dcl xforum_list_meetings_$xforum_process_args_ entry (ptr, char (*), ptr, fixed bin (35)); dcl xforum_redisplay_ entry options (variable); dcl xforum_status_$initialize entry options (variable); dcl xforum_status_$redisplay entry (fixed bin (35)); dcl xforum_status_$update_total entry (char (*)); dcl xforum_status_$update_title entry (char (*)); dcl xforum_status_$update_new entry (char (*)); dcl xforum_status_$update_banner entry (char (*)); dcl xforum_user_profile$get entry (bit (1) aligned); dcl xforum_user_profile$get_function_key_data_ptr entry () returns (ptr); dcl xforum_user_profile$get_menu_always entry () returns (bit (1)); dcl xforum_user_profile$get_multics_mode entry () returns (bit (1)); dcl xforum_user_profile$get_handle_interactive_messages entry () returns (bit (1)); dcl xforum_window_mgr$check_window_status entry options (variable); dcl xforum_window_mgr$menu_display entry (ptr); dcl xforum_window_mgr$menu_get_choice entry (ptr, bit (1) aligned, fixed bin); dcl xforum_window_mgr$prepare_to_shut_down entry (bit (1)); dcl xforum_window_mgr$shut_down_xforum_windows entry (bit (1)); dcl xforum_window_mgr$resynch_windows entry (fixed bin, bit (1)); dcl xforum_window_mgr$set_up_xforum_windows entry options (variable); /* CONDITIONS */ dcl ( cleanup, exit_executive_forum, program_interrupt, quit, xforum_fatal_error, xforum_redisplay_menu ) condition; /* INTERNAL AUTOMATIC */ dcl x_arg_list_ptr ptr; /* points to list of args that xforum was invoked with */ dcl x_choice fixed bin; /* user's choice from the menu or function key */ dcl x_code fixed bin (35); /* standard error code */ dcl x_first_time_user bit (1) aligned; /* "1"b if this is the very first time the user has used xforum */ dcl x_fkey bit (1) aligned; /* "1"b if choice stands for which function key was presswed */ dcl x_menu_window_height fixed bin; /* number of lines used by the menu */ dcl x_ptrs (3) ptr; /* used to get pointers to temp segments */ dcl x_xforum_banner char (40); /* second line of status window for main menu */ dcl x_xforum_menu_ptr ptr; /* pointer to the main menu */ dcl 1 x_xforum_info like xforum_info; /* structure used to give data to xforum_main_options entries */ dcl 1 x_xforum_menu_requirements like menu_requirements; /* used to tell menu_ what the menu looks like */ dcl Shelp bit(1); /* indicates if help has been initialized */ dcl Serror bit(1); /* INTERNAL STATIC */ dcl x_xforum_already_active bit (1) init ("0"b) internal static; /* "1"b imples that xforum is already on the stack */ /* CONSTANTS */ dcl ( ANSWER_LENGTH fixed bin init (256), /* maximum length for response */ x_FIRST_MENU fixed bin init (2),/* fkey choice for F2 or ESCf */ x_FIRST_MENU2 fixed bin init (9),/* fkey choice for ESCF */ x_HELP fixed bin init (1),/* fkey choice for F1 or ESC? */ x_ME char (6) init ("xforum"), /* name used in messages */ x_MULTICS fixed bin init (8),/* fkey choice for F8 or ESCe */ x_MULTICS2 fixed bin init (15), /* fkey choice for ESCE */ x_PREV_MENU fixed bin init (3),/* fkey choice for F3 or ESCp */ x_PREV_MENU2 fixed bin init (10), /* fkey choice for ESCP */ x_QUIT fixed bin init (4),/* fkey choice for F4 or ESCq */ x_QUIT2 fixed bin init (11), /* fkey choice for ESCQ */ x_REDISPLAY fixed bin init (5),/* fkey choice for F5 or ESCr */ x_REDISPLAY2 fixed bin init (12), /* fkey choice for ESCR */ x_CHOICES (7) char (38) varying init ( "Go To Changed Meeting", "Go To Attended Meeting", "Go To Eligible Meeting", "Go To Next Changed Meeting", "Modify Meeting List", "Personalize Exec Forum", "Getting Started"),/* options in main menu */ x_HEADERS (1) char (33) varying init ("Executive Forum (Version 2.1)") /* first line of main menu status window */ ) internal static options (constant); /* BUILTINS */ dcl ( addr, char, ltrim, null, rtrim ) builtin; /* BASED */ /* INCLUDE FILES */ %include access_mode_values; %page; %include condition_info; %page; %include condition_info_header; %page; %include forum_dcls; %page; %include forum_flags; %page; %include forum_info; %page; %include forum_user_trans; %page; %include function_key_data; %page; %include iox_dcls; %page; %include menu_dcls; %page; %include quit_info; %page; %include terminal_info; %page; %include window_dcls; %page; %include xforum_data_; %page; %include xforum_error_info; %page; %include xforum_info; %page; %include xforum_meeting_info; %page; %include xforum_meeting_list; %page; %include xforum_ptr_struct_; %page; %include xforum_spy; %page; %include xforum_windows; %page; %include xforum_prompts; %include xforum_answers; answer_array.N = 0; answer_array.max_length = ANSWER_LENGTH; if x_xforum_already_active then do; call ioa_ ("Executive Forum may not be called recursively.^/To re-enter Executive Forum logout and log back in."); goto error_exit_xforum; end; else do; Shelp = "0"b; /* help has not yet been initialized */ Serror = "0"b; end; on xforum_fatal_error begin; if Serror then do; /* because of new block activation revert */ /* will not work */ call ioa_ ("^/^10x A fatal error has occured. Please restart xforum^/"); call xforum_get_str_ ((RETURN_PROMPT), addr(answer_array), "", "", "", x_code); goto error_exit_xforum; end; Serror = "1"b; call fatal_error; end; xforum_meeting_list_ptr = null (); x_xforum_menu_ptr = null (); spy_ptr = null (); call cu_$arg_list_ptr (x_arg_list_ptr); on cleanup begin; call xforum_terminate ("1"b); call ioa_ ("^/^10x A fatal error has occured. Please restart xforum^/"); call xforum_get_str_ ((RETURN_PROMPT), addr(answer_array), "", "", "", x_code); end; x_xforum_already_active = "1"b; call xforum_window_mgr$set_up_xforum_windows; /* set up xforum windows (and video if necessary) */ Shelp = "1"b; call xforum_help_$init; /* initialize help_ system */ call xforum_user_profile$get (x_first_time_user); call xforum_list_meetings_$xforum_process_args_ (x_arg_list_ptr, x_ME, spy_ptr, x_code); if x_code ^= 0 then do; call xforum_terminate ("0"b); return; end; call xforum_help_line_$init; call xforum_im_mgr$init; call xforum_get_str_$init; if xforum_user_profile$get_handle_interactive_messages () then call xforum_im_mgr$defer_messages; if xforum_meeting_list.no_selected = 0 then call xforum_error (0, "No meetings were selected."); call get_temp_segments_ (x_ME, x_ptrs, x_code); if x_code ^= 0 then do; call com_err_ (x_code, x_ME, "Trying to get temp segments for forum list."); return; end; xforum_meeting_info_ptr = x_ptrs (1); xforum_meeting_info.seen_map_ptr = x_ptrs (2); xforum_meeting_info.set_array_ptr = x_ptrs (3); xforum_system_area_ptr = get_system_free_area_ (); call xforum_status_$initialize; function_key_data_ptr = xforum_user_profile$get_function_key_data_ptr (); on exit_executive_forum goto exit_xforum; x_xforum_info.main_options.xforum_mtg_list_ptr = xforum_meeting_list_ptr; x_xforum_info.main_options.xforum_sys_area_ptr = xforum_system_area_ptr; x_xforum_info.main_options.function_key_data_ptr = function_key_data_ptr; x_xforum_info.main_options.spy_ptr = spy_ptr; x_xforum_info.main_options.menu_always_flag = xforum_user_profile$get_menu_always (); x_xforum_info.main_options.use_alternate_fkeys = "1"b; x_xforum_info.main_options.multics_mode = xforum_user_profile$get_multics_mode (); x_xforum_info.main_options.handle_interactive_messages = xforum_user_profile$get_handle_interactive_messages (); if x_first_time_user then call xforum_help_menus$getting_started (spy_ptr, xforum_system_area_ptr); call ioa_$rsnnl ("Eligible ^d, Attended ^d, Changed ^d", x_xforum_banner, (0), no_selected, no_participant, no_changed); call xforum_status_$update_banner (x_xforum_banner); call xforum_status_$update_title ((x_HEADERS (1))); call xforum_help_line_$change ("10010000"b, "", "", ""); call xforum_status_$redisplay (x_code); if x_code ^= 0 then call xforum_error (x_code, "Unable to display in status window."); /* create the xforum menu */ x_xforum_menu_requirements.version = menu_requirements_version_1; call xforum_create_menu_ (x_CHOICES, addr (x_xforum_menu_requirements), x_xforum_menu_ptr, x_code); if x_code ^= 0 then call xforum_error (x_code, "Unable to create menu."); call xforum_window_mgr$resynch_windows (x_xforum_menu_requirements.lines_needed, "1"b); /* display xforum menu */ call xforum_window_mgr$menu_display (x_xforum_menu_ptr); on xforum_redisplay_menu call xforum_window_mgr$menu_display (x_xforum_menu_ptr);/* for redisplay function */ on quit begin; call xforum_window_mgr$check_window_status; call window_$bell (xforum_windows.menu.iocb, (0)); call xforum_help_line_$change ("10010000"b, "", "", ""); call xforum_status_$redisplay ((0)); call collect_spy_data (SPY_AT_1, "QUIT"); goto xforum_get_choice; end; on program_interrupt begin; call xforum_help_line_$change ("10010000"b, "", "", ""); call xforum_status_$redisplay ((0)); call window_$clear_window (xforum_windows.bottom.iocb, (0)); goto xforum_get_choice; end; /* get choice from xforum menu */ xforum_get_choice: do while ("1"b); call xforum_window_mgr$menu_get_choice (x_xforum_menu_ptr, x_fkey, x_choice); x_xforum_info.main_options.choice = x_choice; if x_fkey then call collect_spy_data (SPY_AT_1, "F" || rtrim (ltrim (char (x_choice)))); else call collect_spy_data (SPY_AT_1, rtrim (ltrim (char (x_choice)))); if x_fkey then do; if x_choice = x_HELP then do; call xforum_help_$get_help (x_xforum_menu_ptr, "Executive Forum", x_CHOICES, spy_ptr, xforum_system_area_ptr); call xforum_help_line_$change ("10010000"b, "", "", ""); end; else if x_choice = x_FIRST_MENU | x_choice = x_FIRST_MENU2 then goto xforum_get_next_choice; else if x_choice = x_PREV_MENU | x_choice = x_PREV_MENU2 then goto xforum_get_next_choice; else if x_choice = x_QUIT | x_choice = x_QUIT2 then goto exit_xforum; else if x_choice = x_REDISPLAY | x_choice = x_REDISPLAY2 then call xforum_redisplay_; else if (x_choice = x_MULTICS | x_choice = x_MULTICS2) & xforum_user_profile$get_multics_mode () then do; call xforum_multics_mode (x_menu_window_height); call xforum_window_mgr$resynch_windows (x_menu_window_height, "0"b); call xforum_help_line_$change ("10010000"b, "", "", ""); call xforum_status_$redisplay ((0)); call xforum_window_mgr$menu_display (x_xforum_menu_ptr); end; else call window_$bell (xforum_windows.menu.iocb, (0)); end; else do; if x_choice = CHANGED_MTG then do; call xforum_main_options$goto_meeting (addr (x_xforum_info)); end; else if x_choice = ATTENDED_MTG then do; call xforum_main_options$goto_meeting (addr (x_xforum_info)); end; else if x_choice = ELIGIBLE_MTG then do; call xforum_main_options$goto_meeting (addr (x_xforum_info)); end; else if x_choice = NEXT_MTG then do; call xforum_main_options$next_meeting (addr (x_xforum_info)); end; else if x_choice = MODIFY_MTG_LIST then call xforum_main_options$modify_meeting_list (addr (x_xforum_info)); else if x_choice = PERSONALIZE then call xforum_personalize_menu (spy_ptr, xforum_system_area_ptr); else if x_choice = GET_STARTED then call xforum_help_menus$getting_started (spy_ptr, xforum_system_area_ptr); end; call iox_$control (xforum_windows.bottom.iocb, "reset_more", null, (0)); /* get back in step */ xforum_get_next_choice: call xforum_status_$update_total (""); call xforum_status_$update_new (""); call xforum_help_line_$change ("10010000"b, "", "", ""); call ioa_$rsnnl ("Eligible ^d, Attended ^d, Changed ^d", x_xforum_banner, (0), no_selected, no_participant, no_changed); call xforum_status_$update_banner (x_xforum_banner); call xforum_status_$update_title ((x_HEADERS (1))); call xforum_status_$redisplay ((0)); call xforum_window_mgr$resynch_windows (x_xforum_menu_requirements.lines_needed, "0"b); call xforum_window_mgr$menu_display (x_xforum_menu_ptr); end; exit_xforum: call xforum_terminate ("0"b); error_exit_xforum: return; xforum_terminate: proc (xt_cleanup_flag); /* PARAMETERS */ dcl xt_cleanup_flag bit (1); /* (input) "1"b implies called because of a cleanup condition */ /* INTERNAL AUTOMATIC */ dcl xt_code fixed bin (35); /* standard error code */ call xforum_window_mgr$prepare_to_shut_down (xt_cleanup_flag); call record_spy_data; call release_temp_segments_ (x_ME, x_ptrs, xt_code); if x_xforum_menu_ptr ^= null then call menu_$destroy (x_xforum_menu_ptr, xt_code); if Shelp then do; call xforum_help_$term; Shelp = "0"b; /* help has been terminated */ end; call xforum_window_mgr$shut_down_xforum_windows (xt_cleanup_flag); x_xforum_already_active = "0"b; if xforum_user_profile$get_handle_interactive_messages () then call xforum_im_mgr$restore_original ((xt_cleanup_flag)); end xforum_terminate; collect_spy_data: proc (csd_where, csd_response); /* PARAMETERS */ dcl csd_where fixed bin; /* (input) location response was collected */ dcl csd_response char (*); /* (input) user's response */ spy.count = spy.count + 1; spy.choices (count).at = csd_where; spy.choices (count).choice = csd_response; return; end collect_spy_data; record_spy_data: proc; /* INTERNAL AUTOMATIC */ dcl rsd_code fixed bin (35); /* standard error code */ dcl rsd_spy_ptr ptr; /* pointer to segment spy data will be recorded in */ dcl rsd_unusedb1 bit (1) aligned; /* unused output from initiate_file_$create */ dcl rsd_unusedfb24 fixed bin (24); /* unused output from system routines */ if spy_ptr = null () then goto exit_record_spy_data; call hcs_$status_minf (">udd>m>cp>Davids>xforum", "spy", 0, 2, rsd_unusedfb24, rsd_code); if rsd_code ^= 0 then goto exit_record_spy_data; rsd_spy_ptr = null (); call initiate_file_$create (">udd>m>cp>Davids>xforum>spy", unique_chars_ ("0"b), RW_ACCESS, rsd_spy_ptr, rsd_unusedb1, rsd_unusedfb24, rsd_code); if rsd_spy_ptr = null () then goto exit_record_spy_data; rsd_spy_ptr -> spy = spy_ptr -> spy; exit_record_spy_data: return; end record_spy_data; fatal_error: proc; /* INTERNAL AUTOMATIC */ dcl fe_code fixed bin (35); /* standard system error code */ dcl fe_xforum_error_info_ptr ptr; /* ptr to structure containing info about the error */ dcl 1 fe_condition_info like condition_info; /* structure containing info about condition being signaled */ call find_condition_info_ (null (), addr (fe_condition_info), fe_code); if fe_code ^= 0 then call xforum_error (fe_code, "A fatal error has occured - no information is available."); if fe_condition_info.condition_name ^= "xforum_fatal_error" then call xforum_error (0, "A fatal error has occured - no information is available."); fe_xforum_error_info_ptr = fe_condition_info.info_ptr; call xforum_error (fe_xforum_error_info_ptr -> xforum_error_info.code, "^/A fatal error has occured while in the " || rtrim (fe_xforum_error_info_ptr -> xforum_error_info.name) || " module.^/" || fe_xforum_error_info_ptr -> xforum_error_info.reason); end fatal_error; xforum_error: proc (xe_code, xe_explanation); /* PARTAMETERS */ dcl xe_code fixed bin (35); /* (input) standard error code */ dcl xe_explanation char (*); /* (input) message to send to the user */ call xforum_terminate ("0"b); call com_err_ (xe_code, "xforum", xe_explanation); goto error_exit_xforum; end xforum_error; reconnect_test: entry returns (bit (1) aligned); /* PARAMETERS */ dcl rt_reconnect_sw bit (1) aligned; /* (output) "1"b if quit signaled because of reconnection */ call xforum_window_mgr$check_window_status; call check_for_reconnect (rt_reconnect_sw); return (rt_reconnect_sw); /* reconnect_test entry */ check_for_reconnect: proc (cfr_reconnect_quit); /* PARAMETERS */ dcl cfr_reconnect_quit bit (1) aligned parameter; /* (output) "1"b if quit signaled because of reconnection */ /* AUTOMATIC */ dcl cfr_stack_ptr ptr; /* pointer to the stack frame */ dcl 01 cfr_cond_info like condition_info; /* info about the condition */ cfr_reconnect_quit = "0"b; cfr_cond_info.version = condition_info_version_1; cfr_cond_info.info_ptr = null (); cfr_cond_info.flags.pad1 = "0"b; cfr_cond_info.pad2 = "0"b; cfr_cond_info.pad3 = "0"b; cfr_stack_ptr = find_condition_frame_ (null ()); if cfr_stack_ptr ^= null () then do; call find_condition_info_ (cfr_stack_ptr, addr (cfr_cond_info), (0)); if cfr_cond_info.info_ptr ^= null () then do; quit_info_ptr = cfr_cond_info.info_ptr; cfr_reconnect_quit = quit_info.switches.reconnection_quit; end; end; end check_for_reconnect; end executive_forum;  xforum_attend_mtg_utilities.pl1 08/06/87 1025.1rew 08/06/87 1014.9 448677 /****^ *********************************************************** * * * Copyright, (C) Honeywell Bull Inc., 1987 * * * * Copyright, (C) Honeywell Information Systems Inc., 1986 * * * *********************************************************** */ /****^ HISTORY COMMENTS: 1) change(85-02-21,Davids), approve(86-02-04,MCR7350), audit(86-04-24,Gilcrease), install(86-04-24,MR12.0-1048): Written by extracting things out of the xforum_ent_attend_mtg_menu and xforum_sub_attend_mtg_menus modules. 85-03-25 Davids: Added calls to timer_manager_$sleep after calls to com_err_ so that the user will have time to read the message. The timer calls were not placed after some calls to com_err_ in copy_to_name because the screen is not cleared after those calls. 85-03-26 Davids: Added the set_up_meeting entry point. 85-03-28 Davids: Added code to set_up_meeting so that the old xforum_meeting_info structure is not zeroed if it already contains information about the meeting. This will happen if the user leaves a meeting and then reenters it without going to another meeting. The forum meeting is still opened, the seen map updated and other meeting statistics are still updated. The current comment information is the oinly thing that is really saved. 2) change(85-04-17,Davids), approve(86-02-04,MCR7350), audit(86-04-24,Gilcrease), install(86-04-24,MR12.0-1048): Modified the next_unread_comment entry so that it saves the original current comment and flags and so that it has a quit handler that will restore the current comment and flags and get a pointer to the first current comment which is returned. This solves the problem of having a meeting with lots of deleted or expunged comments, asking for the next unread, hitting BREAk and being left with a current comment that has been deleted or expunged. Error list entry #8. 85-05-01 Davids: Modified next_unread_comment so that if the error code returned from xforum_trans_$read is non 0 and neither deleted or reaped it will find the next unread comment. It was just telling the user that the next one would be found but the code to find it was missing so the user would be in a loop. 85-05-20 Davids: Added header comments and cleaned up some dcls. 85-06-20 Davids: Changed calling sequence of xforum_format_$append so that the bit_count parameter which is input/output comes after all the input parameters (i.e. the bit (1) switch). 3) change(87-04-13,LJAdams), approve(87-04-22,MCR7684), audit(87-07-30,Blair), install(87-08-06,MR12.1-1065): Changed to allow command_processor_ escapes. END HISTORY COMMENTS */ xforum_attend_mtg_utilities: proc; /* BEGIN DESCRIPTION function: This module contains functions that are used by both the xforum_ent_attend_mtg_menu and the xforum_sub_attend_mtg_menu modules. description of entry points: xforum_attend_mtg_utilities: input: output: It is an error to call the main entry point. The xforum_fatal_error condition will be signaled with an "internal programming error" error message. set_up_meeting: input: ptr pointer to meeting_list structure ptr pointer to meeting_info structure fixed bin index of meeting in meeting_list bit (1) aligned "1"b => subject oriented attending menu in use output: fixed bin meeting index used by forum, 0 => meeting not opened char (256) subject of current comment chain char (256) chairs msg. "" => no message or no need to print message This entry calls forum to open a forum meeting and sets up information that xforum needs to know about. The meeting path is obtained from the meeting list. The new meeting name and index are compared to the previously opened name and index. If they are the same it is assumed that it is the same meeting and the old info is reused. This old info includes the current set of selected comments. Both name and index are used because it was felt that either one by itself might not be enough, i.e. two meeting with the same name or a resorted meeting list so that the same index refers to a different meeting. If the call to forum fails it is assumed that the meeting list has been invalidated by someone changing the name or access on the meeting and a message to that effect is output to the user. The participation and changed flags are also turned off (and the counts decremented) for that meeting. Given that the meeting is opened ok. Then if the participant flag is off it is turned on. For a version 2 forum the transaction map is obtained, a pseudo transaction map is obtained for version 1 forums by assuming that all comments prior to the last one the user has seen have all been seen. If the previous information is still to be used the current comment information must be checked to be sure that it can still be used. For the case of changing from entry oriented to subject oriented there are sets of current comments that cannot be used, i.e. ranges and sets. For these cases the last current comment is set to the last comment in the range or set. The chairman message is obtained and returned only if the current comment has been set to 1 which means that the user has never atteneded the meeting before. The current comment is also read, if the comment cannot be read the first comment in the meeting is read and the current comment set to that. If that cannot be read a programming error message is output to the user, copy_to_name: input: ptr pointer to the spy structure output: char (32) name of segment ptr pointer to segment fixed bin (24) bit count of segment This entry prompts the user for the name of a segment and returns the name, pointer and bit count of the segment. The user can input either an absolute or relative pathname. Null names are handled by printing an error message and the prompt again. "?" is handled by a call to xforum_help_$display with the parameters of "xforum_prompt" and "file_name" and then reissusing the prompt. "??" is handled by printing an error message and the prompt. The user's response is recorded in the spy segment as either "name" or "pathname". Pathname is used if the user's response has either a > or a < in it. If the segment indicated by the user cannot be initiated an error message is printed and the returned name, ptr and bit count values set to "", null and 0. A quit handler also sets the returned values to "", null, and 0. next_unread_comment: input: ptr pointer to meeting_info structure fixed bin index forum uses to ID meeting fixed bin version of forum meeting output: ptr pointer to next unread comment or null This entry returns a pointer to the forum_user_trans structure of the next unread comment, or a null if there are no more unread comments. It uses the next_unread element in the xforum_meeting_info structure to identify that comment. It then calls xforum_trans_$read to get a pointer to it. If the call to read fails because the comment has been deleted or expunged then the seen map is marked so that it shows its has been seen and the unread_count in xforum_meeting_info is decremented. In addition for version 2 meetings the seen switch for the comment is set. The next unread comment is then located by looping through the seen map - starting with the deleted/expunged comment. This new comment is then read and the cycle repeats itself. If some other error was returned by the read operation. An error message is output and a new unread comment is found. The cycle then repeats. update_status: input: ptr pointer to meeting_info structure fixed bin index of current comment, 0 implies no current comment char (*) subject of current comment, used for subject oriented menu fixed bin version of forum meeting fixed bin index forum uses to ID meeting output: This entry updates the contents of the status window, sets seen flags, and finds the next unread comment. If the index of the current comment is non-zero it will set the forum seen flag or the last_seen_idx depending on forum version. It will also set the xforum comment seen map to record that the comment has been seen and find the next unseen comment based on the xforum seen map. It always makes a call to forum to get the current status of the meeting, including the last transaction in the meeting. If the meeting has had comments added to it since the xforum_seen_map was last updated then the map is extended and the comments marked as unseen. The unread count is updated and if there currently were no unread comments next_unread is set to the first new comment. The xforum status line is then rebuilt using the lastest values of total, and new. The help line changed to show F1, F3, and F4. close_meeting: input: ptr pointer to meeting_info structure ptr pointer to meeting_list structure fixed bin index of meeting in the meeting list fixed bin index forum uses to ID meeting ptr pointer to the attend meeting menu output: This entry closes a meeting and destroys the associated attend meeting menu. The meeting is closed by calls forum_$close. After its closed then if the meeting was flaged as having been changed and there are no new comments the changed flag is turned off and the changed count decremented. enter_trans: input: ptr pointer to meeting_info structure fixed bin index forum uses to ID meeting bit (1) aligned "1"b implies reply mode, "0"b is talk mode ptr pointer to spy structure bit (1) aligned "1"b implies subject oriented meeting attendance, "0"b implies entry order attendance output: This entry sets up and calls the lisp extension for replying to and creating comments. There are two modes, reply mode and talk mode. In reply mode the current comments are written to a specially created file caled xforum_view_seg in the pdir. The segment will eventually be read into the top window of emacs. The segment xforum_trans which is also created in the pdir is used to house the new comment. The emacs extension IS NOT FOUND BY SEARCH RULES. It is found by determining the current referencing dir and creating the absolute path to the extension by using the referencing dir and the name of the extension. Note that the pointers to xforum_trans, xforum_view_seg and the extension are stored in internal static so once the extension is used you cannot use a new one. When the user exits the extension the new comment is in the xforum_trans segment. The first 9 characters of segment must be "Subject: " or an error will be reported. The subject is extracted and placed in its own variable of 500 characters. Embeded new-lines are allowed by terminating the subject with an ESC character. forum_$enter_trans is used to enter the comment and itr returns the comment number so it can be reported to the user. If the new comment number is greater than 1 + the last known comment number i.e. last_trans stored in xforum_meeting_info it means that there are new comments. The transaction number returned is used as a new last and the seen map, unread_count, and next_unread index are all updated. description of internal procedures: collect_spy_data: Similar to all the other collect_spy_data procedures. See the xforum module. Note that this procedure is duplicated so as to save the expense of an external call for a commonly executed, very short program, whose output is used only durning development or special site exposure. error: Similar to all the other error procedures. It records in an internal static structure the details of an error and then signals the xforum_fatal_error condition. known bugs: notes: 85-05-20 Davids: collect_spy_data could be placed in an include file. END DESCRIPTION */ /* PARAMETERS */ /* EXTERNAL STATIC */ dcl forum_error_table_$invalid_trans_idx fixed bin (35) ext static; dcl forum_error_table_$trans_deleted fixed bin (35) ext static; dcl forum_error_table_$trans_reaped fixed bin (35) ext static; /* ENTRIES */ dcl com_err_$suppress_name entry () options (variable); dcl emacs_ entry (ptr, char (*), char (*), ptr, fixed bin (35)); dcl expand_pathname_ entry (char (*), char (*), char (*), fixed bin (35)); dcl get_pdir_ entry () returns (char (168)); dcl hcs_$fs_get_path_name entry (ptr, char (*), fixed bin, char (*), fixed bin (35)); dcl hcs_$make_ptr entry (ptr, char (*), char (*), ptr, fixed bin (35)); dcl hcs_$set_bc_seg entry (ptr, fixed bin (24), fixed bin (35)); dcl initiate_file_ entry (char (*), char (*), bit (*), ptr, fixed bin (24), fixed bin (35)); dcl initiate_file_$create entry (char (*), char (*), bit (*), ptr, bit (1) aligned, fixed bin (24), fixed bin (35)); dcl xforum_get_str_ entry (char(*) var, ptr, char(*), char(*), char(*) var, fixed bin(35)); dcl ioa_ entry () options (variable); dcl ioa_$rsnnl entry () options (variable); dcl menu_$destroy entry (ptr, fixed bin (35)); dcl signal_ entry () options (variable); dcl timer_manager_$sleep entry (fixed bin (71), bit (2)); dcl window_$clear_window entry (ptr, fixed bin (35)); dcl xforum_format_$append entry (ptr, ptr, bit (1) aligned, fixed bin (24), fixed bin (35)); dcl xforum_format_$write entry (ptr, ptr, fixed bin (35)); dcl xforum_get_selected_trans$first entry (ptr, ptr, fixed bin (35)); dcl xforum_get_selected_trans$next entry (ptr, ptr, fixed bin (35)); dcl xforum_help_line_$change entry (bit (8) aligned, char (*), char (*), char (*)); dcl xforum_help_line_$pop entry options (variable); dcl xforum_help_line_$push entry (bit (8) aligned, char (*), char (*), char (*)); dcl xforum_status_$redisplay entry (fixed bin (35)); dcl xforum_status_$update_current entry (char (*)); dcl xforum_status_$update_new entry (char (*)); dcl xforum_status_$update_title entry (char (*)); dcl xforum_status_$update_total entry (char (*)); dcl xforum_trans_$first_trans entry (ptr, fixed bin (35)); dcl xforum_trans_$read entry (fixed bin, ptr, fixed bin (35)); dcl xforum_user_profile$get_remove_menu_while_editing entry () returns (bit (1)); dcl xforum_window_mgr$check_window_status entry options (variable); dcl xforum_window_mgr$resynch_windows entry (fixed bin, bit (1)); /* CONDITIONS */ dcl quit condition; /* INTERNAL AUTOMATIC */ dcl xforum_meeting_info_ptr ptr; /* pointer to meeting_info structure */ dcl xforum_meeting_list_ptr ptr; /* pointer to meeting_list structure */ /* INTERNAL STATIC */ dcl 01 xamu_xforum_error_info like xforum_error_info internal static; /* used to record error info to be output to the user */ /* CONSTANTS */ dcl ( xamu_QUERY_USAGE char (69) init ("Press ? and RETURN:help BREAK:Do not copy comments"), xamu_ME char (27) init ("xforum_attend_mtg_utilities"), xamu_OFF bit (1) aligned init ("0"b), xamu_ON bit (1) aligned init ("1"b), xamu_REPLY bit (1) aligned init ("1"b), xamu_SUBJECT bit (1) aligned init ("1"b) ) internal static options (constant); /* BUILTINS */ dcl ( addr, after, before, divide, index, length, null, rtrim, string, substr, unspec ) builtin; /* BASED */ /* INCLUDE FILES */ %include access_mode_values; %page; %include forum_dcls; %page; %include forum_flags; %page; %include forum_user_trans; %page; %include xforum_error_info; %page; %include xforum_meeting_info; %page; %include xforum_meeting_list; %page; %include xforum_spy; %page; %include xforum_windows; %page; %include xforum_prompts; %include xforum_answers; %include xforum_help_infos; call error (0, "Internal programming error - xforum_attend_mtg_utilities$xforum_attend_mtg_utilities called."); set_up_meeting: entry (sum_xforum_meeting_list_ptr, sum_xforum_meeting_info_ptr, sum_midx, sum_subject_oriented, sum_fidx, sum_subject, sum_chairman_msg); /* PARAMETERS */ dcl sum_xforum_meeting_list_ptr ptr; /* (input) pointer to meeting_list structure */ dcl sum_xforum_meeting_info_ptr ptr; /* (input) pointer to meeting_info structure */ dcl sum_midx fixed bin; /* (input) index of meeting in meeting_list */ dcl sum_subject_oriented bit (1) aligned; /* (input) "1"b => subject oriented attending menu in use */ dcl sum_fidx fixed bin; /* (output) meeting index used by forum, 0 => meeting not opened */ dcl sum_subject char (256); /* (output) subject of current comment chain */ dcl sum_chairman_msg char (256); /* (output) chairs msg. "" => no message or no need to print message */ /* INTERNAL AUTOMATIC */ dcl sum_code fixed bin (35); /* standard error code */ dcl sum_i fixed bin; /* loop index */ dcl sum_old_info_still_good bit (1) aligned; /* "1"b implies that data in meeting_info structure still valid */ dcl sum_seen_map_ptr ptr; /* pointer to the seen_map string */ dcl sum_set_array_ptr ptr; /* pointer to the set_array structure */ xforum_meeting_list_ptr = sum_xforum_meeting_list_ptr; xforum_meeting_info_ptr = sum_xforum_meeting_info_ptr; sum_fidx = 0; sum_subject = ""; sum_chairman_msg = ""; if xforum_meeting_info.lidx = sum_midx & xforum_meeting_info.name = forums (sum_midx).long_name then sum_old_info_still_good = "1"b; else sum_old_info_still_good = "0"b; if ^sum_old_info_still_good then do; sum_seen_map_ptr = xforum_meeting_info.seen_map_ptr; /* zero everything */ sum_set_array_ptr = xforum_meeting_info.set_array_ptr; /* but the seen_map_ptr */ unspec (xforum_meeting_info) = "0"b; /* and the set_array_ptr */ xforum_meeting_info.seen_map_ptr = sum_seen_map_ptr; xforum_meeting_info.set_array_ptr = sum_set_array_ptr; xforum_meeting_info.name = forums (sum_midx).long_name; end; if forums (sum_midx).forum_version = 1 then call forum_$open_forum (forums (sum_midx).directory, rtrim (forums (sum_midx).long_name) || ".control", sum_fidx, sum_code); else call forum_$open_forum (forums (sum_midx).directory, rtrim (forums (sum_midx).long_name) || ".forum", sum_fidx, sum_code); if sum_code ^= 0 then do; call ioa_ ("The ^a meeting^/has been deleted or renamed since your meeting list was created.", xforum_meeting_list.forums (sum_midx).long_name); call ioa_ ("To update your meeting list exit Executive Forum^/and reinvoke it with the -force control argument."); if xforum_meeting_list.forums (sum_midx).participant then do; xforum_meeting_list.forums (sum_midx).participant = "0"b; no_participant = no_participant - 1; end; if xforum_meeting_list.forums (sum_midx).changed then do; xforum_meeting_list.forums (sum_midx).changed = "0"b; no_changed = no_changed - 1; end; call timer_manager_$sleep (4, "11"b); goto exit_set_up_meeting; end; forums (sum_midx).been_to = xamu_ON; /* remember where you've been */ call forum_$forum_limits (sum_fidx, ONLY_UNDELETED, xforum_meeting_info.last_seen, xforum_meeting_info.first_trans, xforum_meeting_info.last_trans, xforum_meeting_info.new_trans, forum_flags_word, sum_code); if sum_code ^= 0 then do; call com_err_$suppress_name (sum_code, xamu_ME, "Getting forum_limits for ^a.", xforum_meeting_info.name); goto exit_set_up_meeting; end; if ^forums (sum_midx).participant /* keep tables up to date */ then do; forums (sum_midx).participant = xamu_ON; forums (sum_midx).removed = xamu_OFF; no_participant = no_participant + 1; if xforum_meeting_info.last_seen < xforum_meeting_info.last_trans then do; forums (sum_midx).changed = xamu_ON; no_changed = no_changed + 1; end; end; if forums (sum_midx).forum_version = 2 then do; call forum_$get_transaction_map_idx (sum_fidx, "", xforum_meeting_info.seen_map_ptr -> seen_map_string, sum_code); if sum_code ^= 0 then do; call com_err_$suppress_name (sum_code, "", "Could not get seen transaction map."); return; end; xforum_meeting_info.next_unread = -1; xforum_meeting_info.unread_count = 0; do sum_i = 1 to xforum_meeting_info.last_trans; if ^xforum_meeting_info.seen_map_ptr -> seen_map (sum_i) then do; xforum_meeting_info.unread_count = xforum_meeting_info.unread_count + 1; if xforum_meeting_info.next_unread = -1 then xforum_meeting_info.next_unread = sum_i; end; end; end; else do; do sum_i = 1 to xforum_meeting_info.last_seen; xforum_meeting_info.seen_map_ptr -> seen_map (sum_i) = "1"b; end; do sum_i = xforum_meeting_info.last_seen + 1 to xforum_meeting_info.last_trans; xforum_meeting_info.seen_map_ptr -> seen_map (sum_i) = "0"b; end; xforum_meeting_info.next_unread = xforum_meeting_info.last_seen + 1; xforum_meeting_info.unread_count = xforum_meeting_info.last_trans - xforum_meeting_info.last_seen; end; xforum_meeting_info.lidx = sum_midx; /* note which one we are */ xforum_meeting_info.idx = sum_fidx; if sum_old_info_still_good then do; if sum_subject_oriented & string (xforum_meeting_info.flags) ^= "0"b then do; if xforum_meeting_info.flags.all | xforum_meeting_info.flags.new then xforum_meeting_info.current = xforum_meeting_info.last_seen; else if xforum_meeting_info.flags.range then xforum_meeting_info.current = xforum_meeting_info.high; else if xforum_meeting_info.flags.set then do; sum_i = xforum_meeting_info.set_array_ptr -> set_array.number; xforum_meeting_info.current = xforum_meeting_info.set_array_ptr -> set_array.index (sum_i); end; else if xforum_meeting_info.flags.allref then xforum_meeting_info.current = xforum_meeting_info.current_ref; unspec (xforum_meeting_info.flags) = "0"b; end; end; else xforum_meeting_info.current = xforum_meeting_info.last_seen; if xforum_meeting_info.current = 0 then do; xforum_meeting_info.current = 1; call forum_$get_message (sum_fidx, sum_chairman_msg, sum_code); if sum_code ^= 0 then sum_chairman_msg = ""; end; if xforum_meeting_info.current ^= 0 then do; call xforum_trans_$read (xforum_meeting_info.current, forum_user_trans_ptr, sum_code); if sum_code ^= 0 then do; call xforum_trans_$first_trans (forum_user_trans_ptr, sum_code); xforum_meeting_info.current = forum_user_trans.trans_no; end; if sum_code = 0 then do; if forum_user_trans.subject_length <= length(sum_subject) then sum_subject = forum_user_trans.subject; else sum_subject = substr (forum_user_trans.subject, 1, length(sum_subject)); free forum_user_trans; end; else do; call ioa_ ("A programming error has occured.^/ The comments in this meeting cannot be read."); call timer_manager_$sleep (4, "11"b); goto exit_set_up_meeting; end; end; exit_set_up_meeting: return; copy_to_name: entry (ctn_spy_ptr, ctn_name, ctn_seg_ptr, ctn_bc); /* PARAMETERS */ dcl ctn_spy_ptr ptr; /* (input) pointer to the spy structure */ dcl ctn_name char (32); /* (output) name of segment */ dcl ctn_seg_ptr ptr; /* (output) pointer to segment */ dcl ctn_bc fixed bin (24); /* (output) bit count of segment */ /* INTERNAL AUTOMATIC */ dcl ctn_code fixed bin (35); /* standard error code */ dcl ctn_dir_name char (168); /* path of the dir containing the requested seg */ dcl ctn_entry_name char (32); /* name of the segment */ dcl ctn_reply char (200); /* buffer for user to enter reply */ /* extra long because we don't know what he will type */ dcl ctn_unused_b1 bit (1) aligned; /* unused output from called entry */ dcl reply char (200) var; /* EXTERNAL ENTRY */ dcl error_table_$long_record fixed bin(35) ext static; answer_array.N = 0; /* all answers acceptable */ answer_array.max_length = length(ctn_dir_name); /* max length of file name is 168 */ spy_ptr = ctn_spy_ptr; ctn_name = ""; ctn_seg_ptr = null (); ctn_bc = 0; call window_$clear_window (xforum_windows.bottom.iocb, (0)); call xforum_help_line_$push ("0"b, "", "", xamu_QUERY_USAGE); on quit begin; call xforum_window_mgr$check_window_status; call window_$clear_window (xforum_windows.bottom.iocb, (0)); call collect_spy_data (SPY_AT_15, "QUIT"); ctn_name = ""; ctn_seg_ptr = null (); ctn_bc = 0; goto exit_copy_to_name; end; ctn_code = 1; do while (ctn_code ^= 0); ctn_code = 0; call xforum_get_str_ ((FILE_PROMPT), addr(answer_array), PROMPT_HELP, "file_name", reply, ctn_code); if ctn_code = error_table_$long_record then do; call ioa_ ("File name must be less than ^i characters.^/", answer_array.max_length); ctn_code = 1; end; ctn_reply = substr (reply, 1, length(reply)); /* strip off new line char */ if rtrim (ctn_reply) = "" then do; call com_err_$suppress_name (0, "", "^/A file name must be entered. To return to the menu press BREAK.^/"); ctn_code = 1; end; else if ctn_reply = "??" then do; call collect_spy_data (SPY_AT_15, "??"); call ioa_ ("A menu of all possible file names cannot be constructed.^/"); ctn_code = 1; end; else do; call expand_pathname_ (ctn_reply, ctn_dir_name, ctn_entry_name, ctn_code); if ctn_code = 0 then ctn_name = ctn_entry_name; else do; call collect_spy_data (SPY_AT_15, "invalid"); call com_err_$suppress_name (ctn_code, "", "^a is not a valid file name.", ctn_reply); end; end; end; if (index (ctn_reply, ">") > 0) | (index (ctn_reply, "<") > 0) then call collect_spy_data (SPY_AT_15, "pathname"); else call collect_spy_data (SPY_AT_15, "name"); call initiate_file_$create (ctn_dir_name, ctn_entry_name, RW_ACCESS, ctn_seg_ptr, ctn_unused_b1, ctn_bc, ctn_code); if ctn_code ^= 0 then do; call com_err_$suppress_name (ctn_code, xamu_ME, "Could not find or create the file ^a>^a.", ctn_dir_name, ctn_entry_name); call timer_manager_$sleep (3, "11"b); ctn_name = ""; ctn_seg_ptr = null (); ctn_bc = 0; end; exit_copy_to_name: call xforum_help_line_$pop; return; next_unread_comment: entry (nuc_xforum_meeting_info_ptr, nuc_fidx, nuc_version, nuc_forum_user_trans_ptr); /* PARAMETERS */ dcl nuc_xforum_meeting_info_ptr ptr; /* (input) pointer to meeting_info structure */ dcl nuc_fidx fixed bin; /* (input) index forum uses to ID meeting */ dcl nuc_version fixed bin; /* (input) version of forum meeting */ dcl nuc_forum_user_trans_ptr ptr; /* (output) pointer to next unread comment or null */ /* INTERNAL AUTOMATIC */ dcl nuc_code fixed bin (35); /* standard error code */ dcl nuc_found bit (1); /* "1" imples that an unread comment was found */ dcl nuc_i fixed bin; /* loop index */ dcl nuc_old_current fixed bin; /* IDs the current comment before the search begins */ dcl nuc_old_flags bit (6) unaligned; /* IDs the current comment before the search begins */ xforum_meeting_info_ptr = nuc_xforum_meeting_info_ptr; nuc_forum_user_trans_ptr = null (); nuc_found = "0"b; nuc_old_current = xforum_meeting_info.current; nuc_old_flags = string (xforum_meeting_info.flags); on quit begin; xforum_meeting_info.current = nuc_old_current; unspec (xforum_meeting_info.flags) = nuc_old_flags; call xforum_get_selected_trans$first (xforum_meeting_info_ptr, forum_user_trans_ptr, nuc_code); if nuc_code = 0 then nuc_forum_user_trans_ptr = forum_user_trans_ptr; else nuc_forum_user_trans_ptr = null (); goto exit_next_unread_comment; end; do while (xforum_meeting_info.next_unread ^= -1 & ^nuc_found); xforum_meeting_info.current = xforum_meeting_info.next_unread; call xforum_trans_$read (xforum_meeting_info.current, forum_user_trans_ptr, nuc_code); if nuc_code = forum_error_table_$trans_deleted | nuc_code = forum_error_table_$trans_reaped then do; xforum_meeting_info.seen_map_ptr -> seen_map (xforum_meeting_info.current) = "1"b; xforum_meeting_info.unread_count = xforum_meeting_info.unread_count - 1; if nuc_version = 2 then call forum_$set_seen_switch (nuc_fidx, "", xforum_meeting_info.current, xamu_ON, nuc_code); xforum_meeting_info.next_unread = -1; do nuc_i = xforum_meeting_info.current + 1 to xforum_meeting_info.last_trans while (xforum_meeting_info.next_unread = -1); if ^xforum_meeting_info.seen_map_ptr -> seen_map (nuc_i) then xforum_meeting_info.next_unread = nuc_i; end; end; else if nuc_code ^= 0 then do; call ioa_ ("Comment #^i has not yet been read but cannot be obtained,", xforum_meeting_info.current); call ioa_ ("will find the next unread comment."); call timer_manager_$sleep (3, "11"b); xforum_meeting_info.next_unread = -1; do nuc_i = xforum_meeting_info.current + 1 to xforum_meeting_info.last_trans while (xforum_meeting_info.next_unread = -1); if ^xforum_meeting_info.seen_map_ptr -> seen_map (nuc_i) then xforum_meeting_info.next_unread = nuc_i; end; end; else nuc_found = "1"b; /* get out of the loop */ end; if nuc_found then nuc_forum_user_trans_ptr = forum_user_trans_ptr; exit_next_unread_comment: return; update_status: entry (us_xforum_meeting_info_ptr, us_trans_no, us_subject, us_version, us_fidx); /* PARAMETERS */ dcl us_xforum_meeting_info_ptr ptr; /* (input) pointer to meeting_info structure */ dcl us_trans_no fixed bin; /* (input) index of current comment, 0 implies no current comment */ dcl us_subject char (*); /* (input) subject of current comment, used for subject oriented menu */ dcl us_version fixed bin; /* (input) version of forum meeting */ dcl us_fidx fixed bin; /* (input) index forum uses to ID meeting */ /* INTERNAL AUTOMATIC */ dcl us_code fixed bin (35); /* standard error code */ dcl us_current_text char (80); /* middle part of second line of status window for attending menu */ dcl us_i fixed bin; /* loop index */ dcl us_last_trans fixed bin; /* index of last comment in meeting */ dcl us_new_text char (12); /* last part of second line of status window for attending menu */ dcl us_total_text char (11); /* first part of second line of status window for attending menu */ dcl us_unused_b36 bit (36) aligned; /* unused output from system call */ xforum_meeting_info_ptr = us_xforum_meeting_info_ptr; if us_trans_no ^= 0 then do; if us_version = 2 then call forum_$set_seen_switch (us_fidx, "", us_trans_no, xamu_ON, us_code); if (us_version = 1) & (us_trans_no > xforum_meeting_info.last_seen) then call forum_$set_last_seen_idx (us_fidx, us_trans_no, xamu_ON, us_code); if ^xforum_meeting_info.seen_map_ptr -> seen_map (us_trans_no) then do; xforum_meeting_info.seen_map_ptr -> seen_map (us_trans_no) = "1"b; xforum_meeting_info.unread_count = xforum_meeting_info.unread_count - 1; if xforum_meeting_info.next_unread = us_trans_no then do; xforum_meeting_info.next_unread = -1; do us_i = us_trans_no + 1 to xforum_meeting_info.last_trans while (xforum_meeting_info.next_unread = -1); if ^xforum_meeting_info.seen_map_ptr -> seen_map (us_i) then xforum_meeting_info.next_unread = us_i; end; end; end; end; call forum_$forum_limits (us_fidx, ONLY_UNDELETED, xforum_meeting_info.last_seen, xforum_meeting_info.first_trans, us_last_trans, xforum_meeting_info.new_trans, us_unused_b36, us_code); if us_last_trans > xforum_meeting_info.last_trans then do; do us_i = xforum_meeting_info.last_trans + 1 to us_last_trans; xforum_meeting_info.seen_map_ptr -> seen_map (us_i) = "0"b; xforum_meeting_info.unread_count = xforum_meeting_info.unread_count + 1; end; if xforum_meeting_info.next_unread = -1 then xforum_meeting_info.next_unread = xforum_meeting_info.last_trans + 1; xforum_meeting_info.last_trans = us_last_trans; end; call ioa_$rsnnl ("Total: ^d", us_total_text, (0), xforum_meeting_info.last_trans); call ioa_$rsnnl ("Unread: ^d", us_new_text, (0), xforum_meeting_info.unread_count); if us_subject ^= "" then do; if index (us_subject, "Re: ") ^= 1 then call ioa_$rsnnl ("Current Subject: ^a", us_current_text, (0), us_subject); else call ioa_$rsnnl ("Current Subject: ^a", us_current_text, (0), substr (us_subject, 5)); end; else do; if xforum_meeting_info.flags.set then us_current_text = "Current comment(s): " || set_array.spec; else call ioa_$rsnnl ( "Current comment(s): ^[^[all^]^[aref^]^[new^]^[^d:^d^s^]^;^s^s^s^s^s^s^d^]", us_current_text, (0), unspec (xforum_meeting_info.flags ^= "0"b), xforum_meeting_info.flags.all, xforum_meeting_info.flags.allref, xforum_meeting_info.flags.new, xforum_meeting_info.flags.range, xforum_meeting_info.low, xforum_meeting_info.high, xforum_meeting_info.current); end; call xforum_help_line_$change ("10110000"b, "Leave Meeting", "", ""); call xforum_status_$update_total (us_total_text); call xforum_status_$update_new (us_new_text); call xforum_status_$update_current (us_current_text); call xforum_status_$redisplay ((0)); return; close_meeting: entry (cm_xforum_meeting_info_ptr, cm_xforum_meeting_list_ptr, cm_midx, cm_fidx, cm_menu_ptr); /* PARAMETERS */ dcl cm_xforum_meeting_info_ptr ptr; /* (input) pointer to meeting_info structure */ dcl cm_xforum_meeting_list_ptr ptr; /* (input) pointer to meeting_list structure */ dcl cm_midx fixed bin; /* (index) index of meeting in the meeting list */ dcl cm_fidx fixed bin; /* (index) index forum uses to ID meeting */ dcl cm_menu_ptr ptr; /* (input) pointer to the attend meeting menu */ xforum_meeting_info_ptr = cm_xforum_meeting_info_ptr; xforum_meeting_list_ptr = cm_xforum_meeting_list_ptr; call forum_$close_forum (cm_fidx, (0)); if forums (cm_midx).changed then if xforum_meeting_info.new_trans = 0 then do; forums (cm_midx).changed = xamu_OFF; no_changed = no_changed - 1; end; if cm_menu_ptr ^= null then call menu_$destroy (cm_menu_ptr, (0)); cm_fidx = -1; cm_menu_ptr = null (); return; enter_trans: entry (et_xforum_meeting_info_ptr, et_fidx, et_spy_ptr, et_flavour, et_attend_mtg_type); /* PARAMETERS */ dcl et_xforum_meeting_info_ptr ptr; /* (input) pointer to meeting_info structure */ dcl et_fidx fixed bin; /* (index) index forum uses to ID meeting */ dcl et_flavour bit (1) aligned; /* (input) "1"b impl;ies reply mode, "0"b is talk mode */ dcl et_spy_ptr ptr; /* (input) /* (input) pointer to spy structure */ dcl et_attend_mtg_type bit (1) aligned; /* (input) "1"b implies subject oriented meeting attendance, */ /* "0"b implies entry order attendance */ /* INTERNAL AUTOMATIC */ dcl et_bc fixed bin (24); /* bit count of segment containing the just entered comment */ dcl et_chairman_msg char (256); /* chairman msg for the mtg */ dcl et_chars fixed bin (24); /* number of chars in just entered comments */ dcl et_code fixed bin (35); /* standard error code */ dcl et_emacs_flavour char (40); /* tells emacs extension what to do either */ /* talk, reply, if subject oriented includes current comment index */ dcl et_i fixed bin; /* loop index */ dcl et_my_label label; /* needed to determine referencing dir for emacs extension */ dcl et_prefix_len fixed bin; /* length of text string preceeding the subject in the just entered comment */ dcl et_reply_no fixed bin; /* index of comment being replied to */ dcl et_temp_line char (80); /* first line of status window when editing a reply */ dcl et_seg char (et_chars) based (et_trans.trans_seg_ptr); /* just entered comment */ dcl et_sj char (500) varying;/* subject of just enetered comment */ dcl et_str char (510) varying;/* subject of just enetered comment */ /* plus the "Subject: " string and a terminating ESC character */ dcl et_subj_len fixed bin; /* length of the subject */ dcl et_trans_num fixed bin; /* index of just eneterd comment */ dcl et_txt_len fixed bin; /* length of actual comment, i.e. no subject, prefix or ESC */ dcl et_unusedb1 bit (1) aligned; /* unused output from system call */ dcl et_unusedfb24 fixed bin (24); /* unused output from system call */ dcl et_view_seg_bc fixed bin (24); /* bit count of segment containing comment(s) being replied to */ dcl 1 et_my_overlay based (addr (et_my_label)), /* used too get referencing dir for emacs extension */ 2 my_addr ptr, /* segment i'm part of */ 2 my_stack ptr; /* my stack frame */ dcl 1 et_trans_seg based (et_trans.trans_seg_ptr), /* structure of segment containing just entered comment */ 2 prefix char (et_prefix_len) unal, /* the string "Subject:" */ 2 subj char (et_subj_len) unal, /* the text of the subject */ 2 esc_char char (1) unal, /* ESC char terminates subject text */ 2 new_line char (1) unal, /* new line char */ 2 txt char (et_txt_len) unal; /* text of comment */ /* INTERNAL STATIC */ dcl 01 et_trans internal static, /* need to get these only once per process */ 02 process_dir char (168), /* process dir path */ 02 ext_dir char (168), /* dir containing emacs extension */ 02 ext_seg char (32), /* name of emacs extebsion */ 02 ext_ptr ptr, /* pointer to emacs extension */ 02 have_trans_seg bit (1) unaligned init ("0"b), /* "1"b implies we have a segment to put new comments in */ 02 have_view_seg bit (1) unaligned init ("0"b), /* "1"b implies we have a segment to copy comment(s) being replied intgo */ 02 trans_seg_ptr ptr, /* pointer to seg to put just created comment into */ 02 view_seg_ptr ptr; /* pointer to put comment(s) being replied into */ /* CONSTANTS */ dcl et_ESC char (1) init ("") internal static options (constant); /* escape character 33 octal used to terminate subject */ dcl MAX_SUBJECT_LENGTH fixed bin internal static options (constant) init (256); spy_ptr = et_spy_ptr; xforum_meeting_info_ptr = et_xforum_meeting_info_ptr; on quit begin; call xforum_window_mgr$check_window_status; call window_$clear_window (xforum_windows.bottom.iocb, (0)); call ioa_ ("Comment not entered."); call timer_manager_$sleep (3, "11"b); goto exit_enter_trans; end; if et_flavour = xamu_REPLY then do; call xforum_trans_$read (xforum_meeting_info.current, forum_user_trans_ptr, et_code); if et_code ^= 0 then do; call com_err_$suppress_name (et_code, xamu_ME, "Could not read the comment you want to reply to."); call timer_manager_$sleep (3, "11"b); goto exit_enter_trans; end; if et_attend_mtg_type = xamu_SUBJECT then call ioa_$rsnnl ("Replying on subject ^a in the ^a meeting", et_temp_line, (0), forum_user_trans.subject, xforum_meeting_info.name); else call ioa_$rsnnl ("Replying to comment no. ^d in the ^a meeting", et_temp_line, (0), forum_user_trans.trans_no, xforum_meeting_info.name); call xforum_status_$update_title (et_temp_line); call xforum_status_$redisplay ((0)); call xforum_window_mgr$resynch_windows (-1, "1"b); if et_attend_mtg_type = xamu_SUBJECT then et_temp_line = " ESCl:previous page of comments ESCh:next page of comments"; else call ioa_$rsnnl (" ESCl:previous page of comment ^d ESCh:next page of comment ^d", et_temp_line, (0), forum_user_trans.trans_no, forum_user_trans.trans_no); call xforum_help_line_$change ("0"b, "", "", et_temp_line); if et_attend_mtg_type = xamu_SUBJECT then free forum_user_trans; end; else call xforum_help_line_$change ("0"b, "", "", "Press RETURN:enter subject BREAK:abort entry"); if xforum_user_profile$get_remove_menu_while_editing () & et_flavour ^= xamu_REPLY then do; call ioa_$rsnnl ("Entering a new comment in the ^a meeting", et_temp_line, (0), xforum_meeting_info.name); call xforum_status_$update_title (et_temp_line); call xforum_status_$redisplay ((0)); call xforum_window_mgr$resynch_windows (-1, "1"b); end; call window_$clear_window (xforum_windows.bottom.iocb, (0)); call ioa_ ("Please wait for editor..."); if et_flavour = xamu_REPLY & xforum_meeting_info.current = 0 then do; call com_err_$suppress_name (0, xamu_ME, "Invalid current comment specifier for replying to."); call timer_manager_$sleep (3, "11"b); goto exit_enter_trans; end; if ^et_trans.have_trans_seg then do; call initiate_file_$create (get_pdir_ (), "xforum.trans", RW_ACCESS, et_trans.trans_seg_ptr, et_unusedb1, et_unusedfb24, et_code); if et_trans.trans_seg_ptr = null then do; call com_err_$suppress_name (et_code, xamu_ME, "Cannot get temp segment for comment."); call timer_manager_$sleep (3, "11"b); goto exit_enter_trans; end; et_trans.ext_seg = "xforum_emacs_ext_"; et_my_label = here; here: call hcs_$make_ptr (et_my_overlay.my_addr, et_trans.ext_seg, "symbol_table", et_trans.ext_ptr, et_code); if et_code ^= 0 then do; call com_err_$suppress_name (et_code, xamu_ME, "Trying to load emacs extensions."); call timer_manager_$sleep (3, "11"b); goto exit_enter_trans; end; call hcs_$fs_get_path_name (et_trans.ext_ptr, et_trans.ext_dir, (0), (et_trans.ext_seg), et_code); if et_code ^= 0 then do; call com_err_$suppress_name (et_code, xamu_ME, "Trying to load emacs extensions."); call timer_manager_$sleep (3, "11"b); goto exit_enter_trans; end; et_trans.have_trans_seg = xamu_ON; et_trans.process_dir = get_pdir_ (); end; if et_flavour = xamu_REPLY & ^et_trans.have_view_seg then do; call initiate_file_$create (get_pdir_ (), "xforum_view_seg", RW_ACCESS, et_trans.view_seg_ptr, et_unusedb1, et_unusedfb24, et_code); if et_trans.view_seg_ptr = null then do; call com_err_$suppress_name (et_code, xamu_ME, "Cannot get temp segment for comment."); call timer_manager_$sleep (3, "11"b); goto exit_enter_trans; end; et_trans.have_view_seg = xamu_ON; end; call hcs_$set_bc_seg (et_trans.trans_seg_ptr, 0, (0)); if et_flavour = xamu_REPLY then do; if et_attend_mtg_type = xamu_SUBJECT then do; call ioa_$rsnnl ("reply_by_subject [^i]", et_emacs_flavour, (0), xforum_meeting_info.current); et_view_seg_bc = 0; xforum_meeting_info.flags.allref = "1"b; xforum_meeting_info.current_ref = xforum_meeting_info.current; call xforum_get_selected_trans$first (xforum_meeting_info_ptr, forum_user_trans_ptr, et_code); do while (et_code ^= forum_error_table_$invalid_trans_idx); if et_code = 0 then do; call xforum_format_$append (forum_user_trans_ptr, et_trans.view_seg_ptr, "1"b, et_view_seg_bc, et_code); call xforum_get_selected_trans$next (xforum_meeting_info_ptr, forum_user_trans_ptr, et_code); end; end; xforum_meeting_info.flags.allref = "0"b; end; else do; et_emacs_flavour = "reply"; call xforum_format_$write (forum_user_trans_ptr, et_trans.view_seg_ptr, et_code); end; end; else et_emacs_flavour = "talk"; if (et_flavour = xamu_REPLY) then do; call forum_$get_message (et_fidx, et_chairman_msg, et_code); if et_code = 0 then call ioa_ (rtrim (et_chairman_msg)); end; call emacs_ (xforum_windows.bottom.iocb, rtrim (et_trans.process_dir) || ">xforum.trans", rtrim (et_trans.ext_dir) || ">" || rtrim (et_trans.ext_seg), addr (et_emacs_flavour), et_code); if et_code ^= 0 then do; if et_flavour = xamu_REPLY then call collect_spy_data (SPY_AT_8, "QUIT"); else call collect_spy_data (SPY_AT_9, "QUIT"); call ioa_ ("Comment not entered."); call timer_manager_$sleep (3, "11"b); et_code = 0; goto exit_enter_trans; end; call initiate_file_ (et_trans.process_dir, "xforum.trans", RW_ACCESS, et_trans.trans_seg_ptr, et_bc, et_code); /* get bit count */ if et_trans.trans_seg_ptr = null then do; et_trans.have_trans_seg = xamu_OFF; call com_err_$suppress_name (et_code, xamu_ME, "Getting bit count of comment."); call timer_manager_$sleep (3, "11"b); goto exit_enter_trans; end; if et_bc = 0 then do; call com_err_$suppress_name (0, xamu_ME, "No data in comment."); call timer_manager_$sleep (3, "11"b); goto exit_enter_trans; end; et_chars = divide (et_bc, 9, 17, 0); et_str = before (et_seg, et_ESC); if substr (et_str, 1, 9) ^= "Subject: " then do; call com_err_$suppress_name (0, xamu_ME, "No subject in comment."); call timer_manager_$sleep (3, "11"b); goto exit_enter_trans; end; et_sj = after (et_str, "Subject: "); et_prefix_len = 9; et_subj_len = length (et_sj); if et_subj_len > MAX_SUBJECT_LENGTH then do; call com_err_$suppress_name (0, xamu_ME, "Max subject length (256 chars) exceeded."); call timer_manager_$sleep (3, "11"b); goto exit_enter_trans; end; et_txt_len = et_chars - (et_prefix_len + et_subj_len + 2); if et_flavour = xamu_REPLY then et_reply_no = xforum_meeting_info.current; else et_reply_no = 0; call forum_$enter_trans (xforum_meeting_info.idx, et_trans_seg.txt, et_reply_no, et_trans_seg.subj, xamu_OFF, et_trans_num, et_code); if et_code ^= 0 then do; call com_err_$suppress_name (et_code, xamu_ME, "Trying to enter comment."); call timer_manager_$sleep (3, "11"b); goto exit_enter_trans; end; if et_trans_num > xforum_meeting_info.last_trans + 1 then do; do et_i = xforum_meeting_info.last_trans + 1 to et_trans_num - 1; xforum_meeting_info.seen_map_ptr -> seen_map (et_i) = "0"b; xforum_meeting_info.unread_count = xforum_meeting_info.unread_count + 1; end; if xforum_meeting_info.next_unread = -1 then xforum_meeting_info.next_unread = xforum_meeting_info.last_trans + 1; end; xforum_meeting_info.seen_map_ptr -> seen_map (et_trans_num) = "1"b; xforum_meeting_info.last_trans = et_trans_num; call ioa_ ("Comment ^d entered into the ^a meeting.", et_trans_num, xforum_meeting_info.name); call timer_manager_$sleep (3, "11"b); exit_enter_trans: return; collect_spy_data: proc (csd_where, csd_response); /* PARAMETERS */ dcl csd_where fixed bin; /* (input) location response was collected */ dcl csd_response char (*); /* (input) user's response */ spy.count = spy.count + 1; spy.choices (count).at = csd_where; spy.choices (count).choice = csd_response; return; end collect_spy_data; error: proc (e_code, e_message); /* PARAMETERS */ dcl e_code fixed bin (35); /* (input) error code associated with the error */ dcl e_message char (*); /* (input) message to be output to user */ xamu_xforum_error_info.name = xamu_ME; xamu_xforum_error_info.entry = ""; xamu_xforum_error_info.doing = ""; xamu_xforum_error_info.code = e_code; xamu_xforum_error_info.reason = e_message; call signal_ ("xforum_fatal_error", null (), addr (xamu_xforum_error_info), null ()); end error; end xforum_attend_mtg_utilities;  xforum_create_menu_.pl1 04/25/86 0814.5rew 04/24/86 1513.4 43857 /****^ *********************************************************** * * * Copyright, (C) Honeywell Information Systems Inc., 1982 * * * * Copyright (c) 1972 by Massachusetts Institute of * * Technology and Honeywell Information Systems, Inc. * * * *********************************************************** */ /****^ HISTORY COMMENTS: 1) change(85-05-21,Davids), approve(86-02-04,MCR7350), audit(86-04-24,Gilcrease), install(86-04-24,MR12.0-1048): Changed the values of max_width and max_height in the actual_menu_format structure to reflect the actual width of the menu window and a height equal to the sum of the current menu and bottom window heights instead of the constants 80 and XFORUM_WINDOW_HEIGHT which was decleared in xforum_menu_info.incl.pl1 and had a value of 11. removed the reference to xforum_menu_info.incl.pl1 and updated the the header comments. END HISTORY COMMENTS */ xforum_create_menu_: proc (choices, requirements_ptr, menu, code); /* BEGIN DESCRIPTION function: This procedure creates the "static" menus displayed in the menu window. It takes care of the details of header and trailer construction and the info structures needed by the menu_$create_menu procedure, both simplifying the interface for the callers and enforcing some consistency among menus. description of entry points: xforum_create_menu_: input: (*) char (*) varying text describing the menu options ptr ptr to the menu_requirements structure note that contents of structure is output output: ptr pointer to the menu structure fixed bin (35) standard error code The menu created has no header line and a single trailing line made up of dashes. It has 2 columns. The menu is created in the system free area and should be freed when no longer used. description of internal procedures: known bugs: notes: history: 83-??-?? Deryk Barker: Written. 84-07-06 Davids: Changed header from a parameter to an automatic variable. Set its value to "" so that the menu software will generate a menu with no header. The menu header has been moved to the status window so that it will still appear if the process has local menu display. 84-11-06 Davids: Redid declaration section. END DESCRIPTION */ /* PARAMETERS */ dcl choices (*) char (*) varying; /* (input) text describing the menu options */ dcl requirements_ptr ptr; /* (input) ptr to the menu_requirements structure */ dcl menu ptr; /* (output) pointer to the menu structure */ dcl code fixed bin (35); /* (output) standard error code */ /* EXTERNAL STATIC */ /* ENTRIES */ dcl get_system_free_area_ entry () returns (ptr); /* CONDITIONS */ /* INTERNAL AUTOMATIC */ dcl headers (1) char (1) varying; /* constant info to appear on top of the menu */ dcl trailer (1) char (1) varying; /* constant info to appear on the bottom of the menu */ dcl 1 actual_menu_format aligned like menu_format; /* local copy of the menu_format structure */ /* INTERNAL STATIC */ /* CONSTANTS */ dcl ( PAD_CHAR init ("-") char (1), /* used to center header and trailer info in window */ OPTION_CODES (35) init ( /* keys for selecting menu options */ "1", "2", "3", "4", "5", "6", "7", "8", "9", "a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z") char (1) unal ) internal static options (constant); /* BUILTINS */ dcl addr builtin; /* BASED */ /* INCLUDE FILES */ %include menu_dcls; %page; %include xforum_windows; menu_requirements_ptr = requirements_ptr; trailer (1) = PAD_CHAR; headers (1) = ""; actual_menu_format.version = menu_format_version_1; actual_menu_format.max_width = xforum_windows.menu.extent.width; actual_menu_format.max_height = xforum_windows.menu.extent.height + xforum_windows.bottom.extent.height; actual_menu_format.n_columns = 2; actual_menu_format.center_headers = "1"b; actual_menu_format.center_trailers = "1"b; actual_menu_format.pad = "0"b; actual_menu_format.pad_char = PAD_CHAR; call menu_$create (choices, headers, trailer, addr (actual_menu_format), OPTION_CODES, get_system_free_area_ (), menu_requirements_ptr, menu, code); return; end xforum_create_menu_;  xforum_data_.cds 12/07/87 1328.2r w 12/07/87 1321.7 13158 /* HISTORY COMMENTS: 1) change(86-01-17,LJAdams), approve(86-02-18,MCR7350), audit(86-04-24,Gilcrease), install(86-04-24,MR12.0-1048): This program creates the xforum data structure for the help search directories. END HISTORY COMMENTS */ xforum_data_: proc; dcl create_data_segment_ entry (ptr, fixed bin (35)); dcl 1 cdsa aligned like cds_args; dcl code fixed bin (35); dcl name char (12) aligned static init ("xforum_data_") options (constant), exclude_pad (1) char (32) aligned static options (constant) init ("pad*"); dcl (dim, addr, size, string) builtin; %include xforum_data_; dcl 1 xforum_data aligned, 2 help_dirs, 3 N fixed bin, 3 dir_array (2) char(168); /* Set up help directory search paths */ xforum_data.help_dirs.N = dim(xforum_data.dir_array, 1); xforum_data.dir_array(1) = ">doc>ss>xforum"; xforum_data.dir_array(2) = ">doc>info"; /* Now set up call to create data base */ cdsa.sections (1).p = addr (xforum_data); cdsa.sections (1).len = size (xforum_data); cdsa.sections (1).struct_name = "xforum_data"; cdsa.seg_name = name; cdsa.num_exclude_names = 1; cdsa.exclude_array_ptr = addr (exclude_pad); string (cdsa.switches) = "0"b; cdsa.switches.have_text = "1"b; call create_data_segment_ (addr (cdsa), code); % include cds_args; end xforum_data_;  xforum_default_fkeys_.pl1 04/25/86 0814.5rew 04/24/86 1513.4 36486 /****^ *********************************************************** * * * Copyright, (C) Honeywell Information Systems Inc., 1983 * * * *********************************************************** */ /****^ HISTORY COMMENTS: 1) change(84-11-06,Davids), approve(86-02-04,MCR7350), audit(86-04-24,Gilcrease), install(86-04-24,MR12.0-1048): Improved the functional description and redid the declarations. END HISTORY COMMENTS */ xforum_default_fkeys_: proc () returns (ptr) /* must be quick */; /* BEGIN DESCRIPTION function: This module creates a static function key data structure that does not depend on function keys that are part of the currently used terminal. The function key mapping is: 1: ESC? 9: ESCF 2: ESCf 11: ESCP 3: ESCp 12: ESCQ 4: ESCq 13: ESCR 5: ESCr 14: ESCL 6: ESCl 15: ESCH 7: ESCh 16: ESCE 8: ESCe description of entry points: xforum_default_fkeys_: input: output: returns (ptr) A pointer to the function_key_data structure The function key data structure is allocated in the system_free_area_. A pointer to the structure is keep in internal static. If a call is made and the internal static pointer is not null then the pointer value is returned. If the pointer is null, the structure is allocated, the static pointer value set, and the pointer value returned. Note that the structure is NOT FREED when xforum terminates. It is a small structure and it was decided to leave it around so that it could be used in another invocation of xforum. description of internal procedures: known bugs: notes: history: 83-??-?? Deryk Barker: written. 84-09-17 Davids: Added the upper case letters to the list of pseudo function keys. END DESCRIPTION */ /* PARAMETERS */ /* EXTERNAL STATIC */ /* ENTRIES */ dcl get_system_free_area_ entry () returns (ptr); /* CONDITIONS */ /* INTERNAL AUTOMATIC */ dcl i fixed bin; /* loop index */ /* INTERNAL STATIC */ dcl default static ptr init (null); /* pointer to the allocated structure */ /* CONSTANTS */ dcl ( ESC init ("") char (1), /* escape character, \033 */ PSEUDO_KEYS init ("?fpqrlheFPQRLHE") char (15) /* second characters in the */ ) internal static options (constant); /* pseudo function keys */ /* BUILTINS */ dcl length builtin; dcl null builtin; dcl substr builtin; /* BASED */ dcl default_fkey_seq char (default -> function_key_data.seq_len) /* string defining the pseudo */ based (default -> function_key_data.seq_ptr); /* function key character sequences */ dcl system_area area based (get_system_free_area_ ()); /* system free area */ /* INCLUDE FILES */ %include function_key_data; if default ^= null () then return (default); function_key_data_highest = length (PSEUDO_KEYS); allocate function_key_data set (default) in (system_area); default -> function_key_data.version = function_key_data_version_1; default -> function_key_data.seq_len = 2 * function_key_data_highest; allocate default_fkey_seq in (system_area); do i = 1 to function_key_data_highest; substr (default_fkey_seq, 2 * i - 1, 1) = ESC; substr (default_fkey_seq, 2 * i, 1) = substr (PSEUDO_KEYS, i, 1); default -> function_key_data.function_keys (i, KEY_PLAIN).sequence_index = 2 * i - 1; default -> function_key_data.function_keys (i, KEY_PLAIN).sequence_length = 2; end; return (default); end xforum_default_fkeys_;  xforum_dyn_menu_.pl1 08/06/87 1025.1rew 08/06/87 1014.1 278163 /****^ *********************************************************** * * * Copyright, (C) Honeywell Bull Inc., 1987 * * * * Copyright, (C) Honeywell Information Systems Inc., 1983 * * * *********************************************************** */ /****^ HISTORY COMMENTS: 1) change(85-01-08,Davids), approve(86-02-04,MCR7350), audit(86-04-24,Gilcrease), install(86-04-24,MR12.0-1048): Removed the function_key_data_ptr paramater from the calling sequence of get_choice. Replaced it with a call to xforum_user_profile$get_function_key_data_ptr. 85-04-02 Davids: Added the entry point display_and_get_choice. This entry will, given an array of options, create a dynamic menu of those options, display the sub menus created and process the function keys. It will also add to the original list of options a special option that will go at the end of each sub menu. 85-04-03 Davids: Added the entry point prompt_instead_of_menu. This entry point will prompt the user from some input. It will handle the cases of input too long, blank line input, and ?. It will return other responses. It will also handle the help line and quit. This entry was put in this module because it prompts the user for a response that could have been selected via a dynamic menu. It cannot check that response against the choices on the menu because in some cases a special array of menu options will not be built unless the user explicily asks for a menu. 2) change(85-04-16,Davids), approve(86-02-04,MCR7350), audit(86-04-24,Gilcrease), install(86-04-24,MR12.0-1048): Changed the way that the prompt option was being added to the array of choices in the display_and_get_choice routine. It was adding a choice to the array incrementing the count and then if the count indicated the prompt option should be added, adding it and incrementing the count again. When the loop exited it automaticaly added a prompt option to the end. This worked OK except for the case where the options exactly fited in a set of menus. Then the prompt option automatically added caused a subscript out of bounds condition. The solution was to move the test for adding the prompt option in the loop from after the addition of a choice to before it. This way the loop terminates before the final prompt option can be added. 85-05-24 Davids: Converted the create, display, get_choice, and destroy entry points to internal procs. Replaced the return after the main entry point to a call to error and added the error proc. Replaced global variable references in create, display, get_choice, and destroy with internal variables that conform to the prefix naming convension. Replaced the begin block in create that was used to declare a temporary array of choices to be passed to menu by just overlaying the input array of choices. This eliminated the loop that was required to load the temporary array. 3) change(85-05-28,Davids), approve(86-02-04,MCR7350), audit(86-04-24,Gilcrease), install(86-04-24,MR12.0-1048): Completed variable cleanup and testing of new create code. Also added a call to free the xdm_dyn_menu structure after all the menus are destroyed in the destroy procedure. Removed the included file function_key_data, the only thing being used was the declaration of the function_key_data_ptr variable. That is now declared locally in the get_choice procedure. Updated the functional descriptions of the internal procedures. 85-05-29 Davids: Added the functional descriptions of the entry points. 4) change(87-04-13,LJAdams), approve(87-04-22,MCR7684), audit(87-07-30,Blair), install(87-08-06,MR12.1-1065): Changed to allow command_processor_ escapes. END HISTORY COMMENTS */ xforum_dyn_menu_: proc (); /* BEGIN DESCRIPTION function: This module manages dynamic menus. Dynamic menus are menus with no fixed content that are displayed in the bottom window. description of entry points: xforum_dyn_menu: input: output: It is an error to call the main entry point. The xforum_fatal_error condition will be signaled with an "internal programming error" error message. display_and_get_choice: input: (*) char (*) choices in the menu fixed bin number of choices char (*) title of the menu char (*) text of menu option that will abort menu and display prompt char (*) help line break message fixed bin identifies location for spy recording ptr points to xforum_spy structure /* output: fixed bin index into choices array that user selected or -1 if user selected the "prompt_me" option This entry will create, display, get the user's choice, and destroy a dynamic menu. A dynamic menu appears in the bottom (user_io) window. The title of the menu is overlaid on the bottom line of the top (menu) window and is replaced with dashes (-) when the menu is destroyed. There can be any number of choices in the dynamic menu. If there are more choices than can fit in the bottom window several menus will be created. The last option of each menu is the prompt_option. This option should be used to allow the user to indicate that he does not want to select from a menu but wants to be prompted. The user's choice is collected in the spy structure as either a function key or the menu option - the actual name of the choice is not recorded. A zero index returned indicates that the user made no choice and wants to abort the selection process. This is the result of a QUIT. prompt_instead_of_menu: input: char (*) for help line to indicate where BREAK will put the user char (*) variable part of prompt char (*) description of object to be entered, initial capital and plural char (*) description of object to be entered, lower case and singular char (*) prompt info seg identifier fixed bin id for what is being asked for ptr pointer to spy segment output: char (*) varying user's response This entry is used to prompt the user for a choice that could also be obtained from a dynamic menu. It is part of the this module because it is so closely associated with dynamic menus. If the index returned from a call to display_and_get_choice is -1 this entry should be called. Similarly if this entry returns ?? then display_and_get_choice should be called. This entry prompts the user for some input. The reply is checked for length and must not be longer than the output parameter associated with the response. A null response is also checked for. If either of these two cases occur an error message is output and the prompt repeated. If the user enters a question mark the xforum_help info file is searched for the input help text id and the text displayed to the user, after that the prompt is repeated. Any other text is passed on to the called. NOTE that the response is not comapred with the choices on the dynamic menu because it is possible that the choice would not appear on the menu, i.e. the user changed his forum search rules so that new meetings not in the meeting search list can be found. He could enter a new meeting name via a prompt and have it found but could not select it via a dynamic menu of the meetings in the meeting list. This is also why there are two separate entries instead of 1 entry which handles both the prompt and the menu. A null string is returned in the event of a QUIT. description of internal procedures: create: This procedure creates a set of menus each of which has two columns, 1 header line and no trailing line. Each menu except possibly the last menu in the set will have 2N options where N = lines in user_io window - 1. Each menu is created by overlaying the input list of options and giving them in blocks of 2N to menu_$create. The xdm_dyn_menu structure is allocated in the xforum_system_free area and loaded. display: This procedure calls menu_$display to display one of the dynamic menus. The dynamic menu to be displayed is indentified by an index into the dynamic menu structure array. The pointer to that structure is also input. get_choice: This procedure is used to get the user's choice from a dynamic menu. Like display the dynamic menu is identified by an index into the dynamic menu structure array and the pointer to that structure is also input. The menu_$get_choice routine is called to actually get the user's choice. If the error code returned by menu_ is window_status_pending a call to iox_ is made to reset the status pending flag and the call to menu_ repeated. destroy: This procedure frees all the allocated space associated with the dynamic menus. collect_spy_data: Similar to all the other collect_spy_data procedures. See the xforum module. Note that this procedure is duplicated so as to save the expense of an external call for a commonly executed, very short program, whose output is used only during development or special site exposure. error: Similar to all the other error procedures. It records in an internal static structure the details of an error and then signals the xforum_fatal_error condition. known bugs: notes: history: 83-12-?? DBarker: dynamic menu procedure for executive_forum - "adapted" from xmail's code. 84-03-29 Davids: Modified to check for a window_status_pending error being returned from menu_$get_choice in the get_choice entry. If that error is returned the status is reset and the call to menu_$get_choice repeated. Any other error will just cause the call to menu_$get_choice to be repeated. 84-11-14 Davids: Auditing changes: 1) Added a return statement before the create entry so calls to the main entry do not fall into create. 2) In the create entry changed the return statement in the begin block to a goto exit_create and added the exit_create label before the final return. 3) In get_choice changed the variable that controls the loop from P_code to a local variable and set the value of P_code from the local variable once the loop terminates. Other Changes: rearranged the declarations; removed all the declarations from the create begin block except those declarations that must be part of the block. Also move the external declarations from get_choice. END DESCRIPTION */ /* PARAMETERS */ /* EXTERNAL STATIC */ dcl iox_$user_io ptr ext static; dcl video_et_$window_status_pending fixed bin (35) ext static; /* ENTRIES */ dcl ioa_ entry() options(variable); dcl ioa_$rsnnl entry () options (variable); dcl iox_$control entry (ptr, char (*), ptr, fixed bin (35)); dcl xforum_get_str_ entry (char(*) var, ptr, char(*), char(*), char(*) var, fixed bin(35)); dcl signal_ entry () options (variable); dcl window_$bell entry (ptr, fixed bin (35)); dcl window_$clear_window entry (ptr, fixed bin (35)); dcl window_$overwrite_text entry (ptr, char (*), fixed bin (35)); dcl window_$position_cursor entry (ptr, fixed bin, fixed bin, fixed bin (35)); dcl window_$sync entry (ptr, fixed bin (35)); dcl xforum_help_line_$push entry (bit (8) aligned, char (*), char (*), char (*)); dcl xforum_help_line_$pop entry options (variable); dcl xforum_redisplay_ entry options (variable); dcl xforum_user_profile$get_function_key_data_ptr entry () returns (ptr); /* CONDITIONS */ dcl quit condition; /* INTERNAL AUTOMATIC */ dcl xdm_dyn_menup ptr; /* pointer to the xdm_dyn_menu structure */ dcl xdm_n_menus fixed bin; /* number of submenus needed to display all the choices */ /* INTERNAL STATIC */ dcl 01 xdm_xforum_error_info like xforum_error_info internal static; /* CONSTANTS */ dcl ( xdm_ME char (16) init ("xforum_dyn_menu_"), /* module name */ xdm_OPTION_CODES (61) char (1) unal init ("1", "2", "3", "4", "5", "6", "7", "8", "9", "a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z", "A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z"), /* keys for menu choices */ xdm_REDISPLAY fixed bin init (5),/* function keys for redisplay */ xdm_REDISPLAY2 fixed bin init (12), xdm_SCROLL_DOWN fixed bin init (6),/* function keys for previous menu */ xdm_SCROLL_DOWN2 fixed bin init (13), xdm_SCROLL_UP fixed bin init (7),/* function keys for next menu */ xdm_SCROLL_UP2 fixed bin init (14) ) internal static options (constant); /* BUILTINS */ dcl ( addr, ceil, char, divide, float, hbound, length, ltrim, maxlength, mod, null, rtrim, substr ) builtin; /* BASED */ dcl xdm_based_area area based (xforum_system_area_ptr); /* area xdm_dyn_menu allocated in */ dcl 1 xdm_dyn_menu aligned based (xdm_dyn_menup), /* info about all the submenus created */ 2 nth_menu fixed bin, /* number of submenus created */ 2 menu_array (0:xdm_n_menus - 1 refer (xdm_dyn_menu.nth_menu)), 3 location ptr, /* pointer to menu structure for menu_ */ 3 first_option fixed bin, /* index into original array of first option in submenu */ 3 option_count fixed bin; /* number of options in submenu */ /* INCLUDE FILES */ %include menu_dcls; %page; %include window_status; %page; %include xforum_error_info; %page; %include xforum_ptr_struct_; %page; %include xforum_spy; %page; %include xforum_windows; %page; %include xforum_prompts; %include xforum_answers; %include xforum_help_infos; call error (0, "Internal programming error - xforum_dyn_menu$xforum_dyn_menu called."); display_and_get_choice: entry (dagc_choices, dagc_num_choices, dagc_title, dagc_prompt_option, dagc_help_line_break_message, dagc_spy_position, dagc_spy_ptr, dagc_selected_index); /* PARAMETERS */ dcl dagc_choices (*) char (*); /* (input) choices in the menu */ dcl dagc_num_choices fixed bin; /* (input) number of choices */ dcl dagc_title char (*); /* (input) title of the menu */ dcl dagc_prompt_option char (*); /* (input) text of menu option that will */ /* abort menu and display prompt */ dcl dagc_help_line_break_message char (*); /* (input) help line break message */ dcl dagc_spy_position fixed bin; /* (input) identifies location for spy recording */ dcl dagc_spy_ptr ptr; /* (input) points to xforum_spy structure */ dcl dagc_selected_index fixed bin; /* (output) index into dagc_choices array that user selected */ /* or -1 if user selected the "prompt me" option */ /* INTERNAL AUTOMATIC */ dcl dagc_choice fixed bin; /* user's choice on the submenu currently displayed */ dcl dagc_code fixed bin (35); /* standard error code */ dcl dagc_dyn_menup ptr; /* points to the xdm_dyn_menu structure */ dcl dagc_items_per_menu fixed bin; /* number of choices per submenu */ dcl dagc_fkey bit (1) aligned; /* "1"b imples that user selected a function key */ dcl dagc_menu_index fixed bin; /* index of a submenu */ dcl dagc_number_dashes fixed bin; /* left column of title when centered in window */ dcl dagc_number_of_menus fixed bin; /* total number of submenus needed to display all the choices */ dcl dagc_option_index fixed bin; /* user's choice based on total number of choices */ dcl 1 dagc_dyn_menu_req aligned, /* describes the submenus */ 2 options_per_menu fixed bin, 2 options_last_menu fixed bin, 2 n_menus fixed bin; /* CONSTANTS */ dcl dagc_DASHES char (80) init ("--------------------------------------------------------------------------------") internal static options (constant); /* used to restore the top menus */ /* bottom line of dashes when routine returns to caller */ spy_ptr = dagc_spy_ptr; dagc_items_per_menu = (xforum_windows.bottom.height - 1) * 2; dagc_number_of_menus = ceil (float (dagc_num_choices) / float (dagc_items_per_menu - 1)); /* The last item doesn't count its ENTER... */ begin; dcl dagc_i fixed bin; /* array index */ dcl dagc_j fixed bin; /* loop index */ dcl dagc_names (dagc_num_choices + dagc_number_of_menus) char (32) varying; /* submenu choices, including the "prompt me" choices */ dcl dagc_nindex (dagc_num_choices + dagc_number_of_menus) fixed bin; /* maps choices in dagc_names array to original indicies in */ /* dagc_choices array and maps "prompt me" choices to -1 */ dagc_i = 1; dagc_dyn_menup = null (); on quit begin; call collect_spy_data (dagc_spy_position, "QUIT"); dagc_selected_index = 0; goto exit_get_choice_from_menu; end; do dagc_j = 1 to dagc_num_choices while (dagc_i <= (dagc_num_choices + dagc_number_of_menus)); if mod (dagc_i, dagc_items_per_menu) = 0 then do; dagc_names (dagc_i) = dagc_prompt_option; dagc_nindex (dagc_i) = -1; dagc_i = dagc_i + 1; end; dagc_names (dagc_i) = dagc_choices (dagc_j); dagc_nindex (dagc_i) = dagc_j; dagc_i = dagc_i + 1; end; dagc_names (dagc_i) = dagc_prompt_option; dagc_nindex (dagc_i) = -1; call create (dagc_names, addr (xforum_windows.bottom.position), addr (dagc_dyn_menu_req), dagc_dyn_menup, dagc_code); if dagc_code ^= 0 then go to exit_get_choice_from_menu; call xforum_help_line_$push ("00000110"b, "", dagc_help_line_break_message, ""); dagc_menu_index = 0; dagc_number_dashes = (xforum_windows.menu.position.width - length (dagc_title)) / 2; call window_$position_cursor (xforum_windows.menu.iocb, xforum_windows.menu.extent.height, dagc_number_dashes, (0)); call window_$overwrite_text (xforum_windows.menu.iocb, (dagc_title), (0)); do while ("1"b); display_submenu: call display (dagc_dyn_menup, dagc_menu_index, dagc_code); if dagc_code ^= 0 then go to exit_get_choice_from_menu; call get_choice (dagc_dyn_menup, dagc_menu_index, dagc_choice, dagc_fkey, dagc_code); if dagc_code ^= 0 then go to exit_get_choice_from_menu; if dagc_fkey then call collect_spy_data (dagc_spy_position, "F" || rtrim (ltrim (char (dagc_choice)))); else call collect_spy_data (dagc_spy_position, rtrim (ltrim (char (dagc_choice)))); if ^dagc_fkey then do; dagc_option_index = dagc_menu_index * dagc_dyn_menu_req.options_per_menu + dagc_choice; dagc_selected_index = dagc_nindex (dagc_option_index); go to exit_get_choice_from_menu; end; else if dagc_choice = xdm_REDISPLAY | dagc_choice = xdm_REDISPLAY2 then do; call xforum_redisplay_; goto display_submenu; /* Q and D - but WTH */ end; else if dagc_choice = xdm_SCROLL_UP | dagc_choice = xdm_SCROLL_UP2 then dagc_menu_index = mod (dagc_menu_index + 1, dagc_dyn_menu_req.n_menus); else if dagc_choice = xdm_SCROLL_DOWN | dagc_choice = xdm_SCROLL_DOWN2 then dagc_menu_index = mod (dagc_menu_index - 1, dagc_dyn_menu_req.n_menus); else call window_$bell (xforum_windows.menu.iocb, (0)); end; /* do while ... */ exit_get_choice_from_menu: call destroy (dagc_dyn_menup); call window_$clear_window (xforum_windows.bottom.iocb, (0)); call window_$position_cursor (xforum_windows.menu.iocb, xforum_windows.menu.extent.height, dagc_number_dashes, (0)); call window_$overwrite_text (xforum_windows.menu.iocb, substr (dagc_DASHES, 1, length (dagc_title)), (0)); call window_$sync (xforum_windows.menu.iocb, (0)); call xforum_help_line_$pop; end; return; prompt_instead_of_menu: entry (piom_help_line_break_text, piom_prompt_text, piom_error_text_1, piom_error_text_2, piom_help_id, piom_spy_id, piom_spy_ptr, piom_response); /* PARAMETERS */ dcl piom_help_line_break_text char (*); /* (input) for help line to indicate where BREAK will put the user */ dcl piom_prompt_text char (*); /* (input) variable part of prompt */ dcl piom_error_text_1 char (*); /* (input) description of object to be */ /* entered, initial capital and plural */ dcl piom_error_text_2 char (*); /* (input) description of object to be */ /* entered, lower case and singular */ dcl piom_help_id char (*); /* (input) prompt info seg identifier */ dcl piom_spy_id fixed bin; /* (input) id for what is being asked for */ dcl piom_spy_ptr ptr; /* (input) pointer to spy segment */ dcl piom_response char (*) varying; /* (output) user's response */ /* INTERNAL AUTOMATIC */ dcl piom_reply char (256); /* user's reply */ dcl piom_code fixed bin (35); /* EXTERNAL ENTRY */ dcl error_table_$long_record fixed bin(35) ext static; spy_ptr = piom_spy_ptr; call xforum_help_line_$push ("0"b, "", "", "Press ? and RETURN:help BREAK:" || piom_help_line_break_text); on quit begin; piom_response = ""; call window_$clear_window (xforum_windows.bottom.iocb, (0)); goto exit_prompt_instead_of_menu; end; piom_reply = ""; answer_array.N = 0; /* Accept all answers */ answer_array.max_length = maxlength (piom_response); do while (piom_reply = ""); call xforum_get_str_ ((piom_prompt_text || " (or ?? for menu): "), addr(answer_array), PROMPT_HELP, piom_help_id, piom_response, piom_code); if piom_code = error_table_$long_record then do; call ioa_ ("^a cannot be more than ^i characters long.", piom_error_text_1, maxlength(piom_response)); call ioa_ ("Please try again or press BREAK to ^a.", piom_help_line_break_text); end; piom_reply = substr (piom_response, 1); if piom_reply ^= "" then call collect_spy_data (piom_spy_id, substr (piom_response, 1)); end; exit_prompt_instead_of_menu: call xforum_help_line_$pop; return; create: proc (c_choices, c_window_infop, c_dyn_menu_reqp, c_dyn_menup, c_code); /* PARAMETERS */ dcl c_choices (*) char (32) varying; /* (input) text of the menu options */ dcl c_window_infop ptr; /* (input) pointer to a window_position_info str */ dcl c_dyn_menu_reqp ptr; /* (input) pointer to a dyn_menu_req structure */ dcl c_dyn_menup ptr; /* (output) pointer to a dyn_menu structure */ dcl c_code fixed bin (35); /* (output) standard error code */ /* INTERNAL AUTOMATIC */ dcl c_done_with_choices bit (1); /* "1"b imples that all the choices have been placed in a submenu */ dcl c_menu_no fixed bin; /* index of a submenu */ dcl c_choice_count fixed bin; /* count of choices already placed in a submenu */ dcl c_header (1) char (80) varying; /* header line, gives current submenu */ /* number and total number of submenus */ dcl c_slots_avail fixed bin; /* number of choices that can fit in the submenu */ /* 2 columns of choices, 1 line of window for header */ dcl c_slots_needed fixed bin; /* number of choices for all submenus */ dcl c_submenu_choices_count fixed bin; /* number of choices in a submenu */ dcl c_submenu_choices_ptr ptr; /* pointer to the first choice in a submenu */ dcl 01 c_menu_format aligned like menu_format; /* describes the menu to be created by menu_ */ dcl 01 c_menu_requirements aligned like menu_requirements; /* describes the requirements of the menu */ /* BASED */ dcl c_submenu_choices (c_submenu_choices_count) char (32) varying based (c_submenu_choices_ptr); /* choices for a g