%% Basic conduit handling %% call CHATTY_FILE to change the output file name, not _eq_outfile %%include "string.grg" %%include "data.grg" %% %% %% %% %% %% %% %% %% %% %% %% %% %% %% %% %% %% %% %% %% %% %% %% %% %% %% %% USER EQUATE RE-DEFINITIONS %% Redefine as 0 for no progress report messages %%equate _CHATTY_CHAT 1 %% Redefine as 1 to hide default startup messages %%equate _CHATTY_HUSH 0 %% Redefine as the initial output file if non-default, special values "NULL" %% and "STDOUT" are accepted in addition to a file name %%equate _CHATTY_FILE "" %% Redefine as 1 for output file including a directory path %%equate _CHATTY_PATH 0 %% Redefine the chatty output base directory (default is current directory) %%equate _CHATTY_BASE "" %% Redefine the chatty output tree hierarchy (default is just base directory) %%equate _CHATTY_TREE "" %% Redefine the chatty output file extension (default is TEXEXT) %%equate _CHATTY_EXTN "" %% Use these trigger equates in place of standard trigger equates as the %% chatty utility redefines the standard ones and then calls these instead %%equate _C_INIT %%equate _C_PRE_HEADER %%equate _C_POST_RECORD %%equate _C_POST_FOOTER %%equate _C_POST_DATABASE %% %% %% %% %% %% %% %% %% %% %% %% %% %% %% %% %% %% %% %% %% %% %% %% %% %% %% %% TRIGGER EQUATE RE-DEFINITIONS %%equate eq_init _chatty_init() _chatty_file("") if _CHATTY_CHAT or _CHATTY_HUSH then 0 >> _eq_version 0 >> _eq_verbose if _CHATTY_CHAT then _chatty_chat_path(43) SLFORMAT("+ BUILD "+BOLDEN+_eq_chatfile+BOLDDI+":",60) write endif endif _C_INIT %%equate eq_post_database if _CHATTY_CHAT then "RETRIEVED: " + UPPERCASE(_eq_db_name) + "/" + _eq_db_limit >> s s + NCHAR(27-STRLEN(s)," ") >> s s + NCHAR(STRLEN(s),BS) write endif _C_POST_DATABASE %%equate eq_post_record if _CHATTY_CHAT then ++_chatty_filrec >> _chatty_filrec STRING(DECIMAL(_chatty_filrec)/DECIMAL(_chatty_totrec)*100) >> s BS + BS + BS + BS + BS + BS + SLFORMAT(s,5) + "%" write endif _C_POST_RECORD %%equate eq_pre_header if _CHATTY_CHAT then "PROCESSED: 0.000%" + NCHAR(10," ") + NCHAR(10,BS) write _chatty_count() endif _C_PRE_HEADER %%equate eq_post_footer if _CHATTY_CHAT then BS + BS + BS + BS + BS + BS + "100.0%" + NL write endif _C_POST_FOOTER %% %% %% %% %% %% %% %% %% %% %% %% %% %% %% %% %% %% %% %% %% %% %% %% %% %% %% %% PRIVATE SUPPORT EQUATES %%equate _chatty_count() 0 >> _chatty_filrec 0 >> _chatty_totrec roll ++_chatty_totrec >> _chatty_totrec through %%equate _chatty_extn() if _CHATTY_EXTN <> "" then outputs(_CHATTY_EXTN) else outputs(_eq_extn) endif %%equate _chatty_init() BASENAME(_eq_outfile,_eq_extn) >> _conduit_name _chatty_extn() >> _conduit_extn _chatty_tree() >> _conduit_tree %%equate _chatty_file(_conduit_file) _conduit_file >> save if _conduit_file = "" then if _CHATTY_FILE = "" then _conduit_name >> _conduit_file else _CHATTY_FILE >> _conduit_file endif endif if _conduit_file = "NULL" then "/dev/null" >> _eq_outfile elseif _conduit_file = "STDOUT" then "-" >> _eq_outfile else _chatty_path() >> _eq_outfile if _CHATTY_CHAT and save <> "" then _chatty_chat_path(53) NL + SLFORMAT("+ BUILD "+BOLDEN+_eq_chatfile+BOLDDI+":",77) write endif endif %%equate _chatty_tree() if _CHATTY_TREE = "" and _CHATTY_PATH then outputs(_conduit_name+"/") else outputs(_CHATTY_TREE) endif %%equate _chatty_root() if _CHATTY_BASE then _CHATTY_BASE + "/" >> _conduit_root else "" >> _conduit_root endif %%equate _chatty_path() _chatty_root() outputs(_conduit_root+_conduit_tree+_conduit_file+_conduit_extn) %%equate _chatty_chat_path(n) STRLEN(_eq_outfile) >> l if l > n then n - 3 >> n SUBSTR(_eq_outfile,0,(n - 2)/2) + "..." + SUBSTR(_eq_outfile,l-(n/2),l - 1) >> _eq_chatfile else _eq_outfile >> _eq_chatfile endif %% %% %% %% %% %% %% %% %% %% %% %% %% %% %% %% %% %% %% %% %% %% %% %% %% %% %% %% PUBLIC UTILITY EQUATES %%equate CHATTY_FILE(s) _chatty_file(s) %% %% %% %% %% %% %% %% %% %% %% %% %% %% %% %% %% %% %% %% %% %% %% %% %% %% %% %%end