CGIDEV2 Library Change History **************************************************** **** Changes made in version 2012-04-18 *** **************************************************** - Replaced module XXXRANDOM of CGISRVPGM2 with the version fixed by Rich Diedrich in 2006. **************************************************** **** Changes made in version 2012-03-21 *** **************************************************** - It was found that CGIDEV2 supports a maximum of 50 output variables in a HTML row. This restriction was due to local subprocedure "SetupArrays" in module XXXWRKHTML. That has been modified in order to support up to 500 output variables in a HTML row. **************************************************** **** Changes made in version 2012-02-07 *** **************************************************** - "HttpOnly" flag now supported by subprocedure CrtCookie. See page http://www.easy400.net/cgidev2o/exhibiu8.htm **************************************************** **** Changes made in version 2012-01-12 *** **************************************************** - Fixed pgms DSPSRC and BOATSCH2. **************************************************** **** Changes made in version 2012-01-06 *** **************************************************** - Service program CGIDEV2 has now activation group CGIDEV2 (previously it was *CALLER). - Added comments on deallocating memory after ZhbGetVarPtr . **************************************************** **** Changes made in version 2011-12-25 *** **************************************************** - Added command DUPSRVPGM. It finds libraries, other than CGIDEV2, containing service program CGISRVPGM2, replaces it with the service program from CGIDEV2, rebinds service programs and programs. **************************************************** **** Changes made in version 2011-12-22 *** **************************************************** - Provided subprocedure DECODE2 (convert character entities to characters), the opposite of subprocedure ENCODE2. - Named entities conversion table (/cgidevexthtml/encode2Fil.txt) already existed. Now provided a conversion table also for number entities (/cgidevexthtml/encode2Fil2.txt). **************************************************** **** Changes made in version 2011-12-16 *** **************************************************** - Replaced many OVRDBF commands with File-description keyword EXTFILE. **************************************************** **** Changes made in version 2011-11-22 *** **************************************************** - Updated ZIP and UNZIP commands to the latest version of utility ZIP (library ZIP). **************************************************** **** Changes made in version 2011-11-02 *** **************************************************** - Some changes to pgm DSPSTMF in order to support file extensions other than PDF, HTML, HTM, TXT. **************************************************** **** Changes made in version 2011-10-25 *** **************************************************** - Added a program (DSPSTMF) to display a stream file without letting the user know its path. See page http://www.easy400.net/cgidev/html/faq41.htm . **************************************************** **** Changes made in version 2011-09-25 *** **************************************************** - Added subprocedure CvtStmf (Convert a stream file to another CCSID) and command STMVCVT. - Fixed program SETCGILIB to handle also UTF (CCSID 1208) HTTP configuration files. **************************************************** **** Changes made in version 2011-09-21 *** **************************************************** - Fixed subprocedure AppHtmlToStmf() (Append HTML to Stream file) in module XXXWRKHTML in order to support also Unicode (CCSID 1208) stream files. - Fixed program FAQ38A. **************************************************** **** Changes made in version 2011-09-15 *** **************************************************** - Made available a PDF version of the CGIDEV2 Tutorial. **************************************************** **** Changes made in version 2011-09-09 *** **************************************************** - Updated some FAQ's. **************************************************** **** Changes made in version 2011-08-17 *** **************************************************** - Added subprocedure AppHtmlToStmf() (Append HTML to Stream file) in module XXXWRKHTML. See page http://www.easy400.net/cgidev2o/exhibiu7.htm#apphtmltostmf . **************************************************** **** Changes made in version 2011-08-02 22:34:00 *** **************************************************** - Some users on V5R2 and on V5R4 reported problems with subprocedure GETHTML in source member XXXWRKHTML. Sometimes it seems to load a source member different from the requested one. A fix was applied to the OVRDBF command preceeding the OPEN of the file member, and it seems to work. **************************************************** **** Changes made in version 2011-07-23 23:50:00 *** **************************************************** 1)Added some monitor code to subprocedure ClrHtmlBuffer of module XXXWRKHTML. If memory reallocation fails, the HTTP CGI job servicing the request is ended. 2)As suggested by Kevin Turner and Mel Rothman, in subprocedure ZhbGetInput of module xxxCGIPARS pointers wkP and wkSaveP changed from static to dynamic and the "Entry data workarea" pointed by WkP is deallocated before returning. **************************************************** **** Changes made in version 2011-03-27 15:00:00 *** **************************************************** 1)Added subprocedure ChkIfsObj3 to module XXXIFS. Subprocedure ChkIfsObj3 provides more information than subprocedure ChkIfsObj2 about a given IFS object. The following information can be retrieved: object type, object size, creation timestamp, codepage, CCSID. **************************************************** **** Changes made in version 2011-03-25 13:00:00 *** **************************************************** 1) In subprocedure WrtHtmlToStmf (module XXXWRKHTML) forced ClrHtmlBuffer before returning. 2) Added module XXXCVTSTG to srvpgm CGISRVPGM2. This module contains subprocedure CvtStg (convert String from one CCSID to another CCSID), based on Iconv() and exspecially useful for conversions to/from Unicode. 3) Added support for Unicode stream files to subprocedure GetHtmlIfsMult (module XXXWRKHTML). **************************************************** **** Changes made in version 2011-03-04 18:30:00 *** **************************************************** 1) In module XXXIFS added subprocedure LOADSTREAMFILE. See page http://www.easy400.net/cgidev2o/exhibiV2.htm?ts=ts20113413313#loadstmf . 2) In module XXXJOB added subprocedure SETJOBCCSID. If the current job CCSID is 65535, this subprocedure sets it to the job default CCSID value, provided that data area CGIDEV2DT/SETJBCCSID contains '*YES'. 3)Subprocedures GetHtml, GetHtmlIfs and GetHtmlIfsMult now run subprocedure SetJobCCSID as soon as they start. This is intended to overcome problems on boxes running with system value QCCSID equal to 65535. 4)Subprocedure LowFy added to module XXXDATA. See page http://www.easy400.net/cgidev2o/exhibit5.htm#lowfy . 5)Subprocedure ZhbGetVarLower added to module XXXCGIPARS. See page http://www.easy400.net/cgidev2o/exhibit2.htm . **************************************************** **** Changes made in version 2011-01-03 23:24:00 *** **************************************************** 1) In module XXXWRKHTML added O_INHERITMODE flag when creating the stmf in procedure WrtHtmlToStmf. In this way the stmf receives the same data authorities as the parent directory. **************************************************** **** Changes made in version 2010-11-21 13:00:00 *** **************************************************** 1)Added command CGIDEV2/UPDALWEXT. This command makes it easy to maintain the list of client extensions allowed for the client side validation script of sample program UPLOAD. For details on this subject, see page http://www.easy400.net/cgidev/html/exhibiv3.htm#validation **************************************************** **** Changes made in version 2010-11-18 20:30:00 *** **************************************************** 1) Provided an exit point for subprocedure ZhbGetInput (module XXXCGIPARS). The exit point allows to call a validation user program when a file upload is processed. For details on this subject, see page http://www.easy400.net/cgidev/html/exhibiv3.htm#validation **************************************************** **** Changes made in version 2010-04-30 02:00:00 *** **************************************************** 1) Command CGIDEV2/SETCGILIB no longer duplicates service program CGISRVPGM2 and binding directory TEMPLATE2 from library CGIDEV2 to the user library(ies). It now also creates an IFS directory (and some subdirectories) with a name same as the production library. The way an Apache HTTP instance is updated, has been changed. 2) Program CGIDEV2/INSTALL, when restoring the IFS directory /cgidev , now will use paramer OPTION(*NEW) not to clobber any changes made by the installer on existing objects. 3) Module XXXCGIPARS has been updated in order to care for data passed from older browsers, when a file upload is requested. **************************************************** **** Changes made in version 2010-01-08 16:00:00 *** **************************************************** 1) Member QRPGLESRC/XXXDATA1 Added subprocedure "UrlUnEscSeq". **************************************************** **** Changes made in version 2009-11-03 10:19:00 *** **************************************************** 1) Member QRPGLESRC/XXXWRKHTML It was found that the fix for error message TCP7531 ("output buffer damaged" when executing subroutine WRTBUFFER on a WRTSECTION('*FINI')), fix dated 2008-12-18, was not working properly. Error fix: The request to end the HTTP server job is now submitted through a bach job with name TCP7531. Note that the time needed for ending the job depends from the value specified in system value QENDJOBLMT. **************************************************** **** Changes made in version 2009-06-15 11:23:00 *** **************************************************** 1) Fixed a bug in the subprocedure uploading PC files (See 2009-05-21). When uploading large files (over 70 Mb), chances were that x'0d25' could be converted to x'0020'. Also CPU usage significantlt lowered. Ron Egyed, June 14, 2009. **************************************************** **** Changes made in version 2009-06-12 19:51:00 *** **************************************************** 1)Added commands ZIP and UNZIP in library CGIDEV2. **************************************************** **** Changes made in version 2009-06-01 09:42:00 *** **************************************************** 1) Fixed a bug in the subprocedure uploading PC files (See 2009-05-21). The bug was related to MS Internet Explorer browser. While Firefox for the name of the file to be uploaded transmits only the file name, I.E. transmits also the path (e.g. C:\aaa\bbb\ ) ahead of the file name. This path was incorrectly added to the name of the IFS stream file created in directory /tmp **************************************************** **** Changes made in version 2009-05-29 18:30:00 *** **************************************************** 1) Subprocedure GetHtmlIfsMult loads external script files into "records" by trimming right the record string. This, while is good for performance (useless blanks are not transmitted to the browser), can damage the output when it is going to be written to a stream file via subprocedure WrtHtmlToIfs, exspecially when the script loaded is a kind of XML document. Therefore, the trimming right operation is now performed only if the external file being loaded has one of the following extensions: html, htm, text or txt. **************************************************** **** Changes made in version 2009-05-21 22:23:00 *** **************************************************** 1) Added a feature to subprocedure zhbGetinput. This feature allows to upload PC files. Documented at page http://www.easy400.net/cgidev/html/exhibiv3.htm The code was developed by Ron Egyed, RJE Consulting Inc, New Port Richey (FL), U.S. **************************************************** **** Changes made in version 2009-05-06 18:45:00 *** **************************************************** 1) Changed the Open()'s in subprocedure WrtHtmlToStmf of module XXXWRTHTML in order to support UTF-8 and UTF-16. That was done according to the suggestion by Scott Klement in the Easy400Group posting number 10335 dated Mon Oct 1, 2007 7:52 pm. **************************************************** **** Changes made in version 2009-04-14 17:00:00 *** **************************************************** 1) Added subprocedure GetHtmlBufferP to module XXXWRTHTML. Returns a pointer to the HTML output buffer and its used length. See page http://www.easy400.net/cgidev2o/exhibit4.htm#buffp **************************************************** **** Changes made in version 2009-03-25 23:00:00 *** **************************************************** 1) Added module XXXJOB to service program CGISRVPGM2. It includes two new subprocedures: - "GetActJob" Get a list of Active Jobs to file QTEMP/JOBLIST - "GetNEndJob" Get a list of Not Ended Jobs to file QTEMP/JOBLIST CGISRVPGM2 service program signature set to zero (no level check any longer) 2) Added command EDBG (Enhanced Debug). It allows a quicker start debugging. **************************************************** **** Changes made in version 2009-02-18 19:00:00 *** **************************************************** 1) Added module XXXDATA1 to service program CGISRVPGM2. It includes the new subprocedure "UrlEscSeq". **************************************************** **** Changes made in version 2009-01-09 15:30:00 *** **************************************************** 1) All XXX... modules, when calling WRTDEBUG procedure, will now - if appropriate - state the qualified name of the job and the qualified name of the program asking a service. **************************************************** **** Changes made in version 2008-12-18 20:32:00 *** **************************************************** 1) Member QRPGLESRC/XXXWRKHTML Fixed an error reported by the Easy400Group several times in 2008. Error description: If a CGI job is kept under debugging for too much time after writing something in the output buffer, the CGI request ends up with ERROR 500 to the browser and any subsequent attempt from the same job to send the output buffer (for instance via section *fini) receives error message TCP7531. The only way out is to end the CGI job or restart the related HTTP instance. Error fix: Subprocedure WRTSECTION, subroutine WRTBUFFER, if receiving error TCP7531, now ends the CGI job. 2) All XXX... modules, when calling WRTDEBUG procedure, will now - if appropriate - state the qualified name of the program asking a service. **************************************************** **** Changes made in version 2008-04-16 10:58:00 *** **************************************************** - Member QRPGLESRC/XXXWRKHTML A new version of this member incorporates a change suggested to the Easy400Group in March 2008 in order to overcome a problem with subprocedure WrtHtmlStmf. The problem was in scanning for a new line character. >>>>The new code operates on the HTML output buffer one byte at a time, >>>>copying each byte to the work buffer unless the byte is a newline character >>>>(x'15') in which case it writes CRLF (x'0D25'). The previous XXXWRKHTML source was saved in file CGIDEV2/QRPGLESRCO. **************************************************** **** Changes made in version 2007-10-22 12:36:05 *** **************************************************** - Command SETCGILIB - RPG module SETCGILIB5 changed the way the APACHE target configuration file is updated. That was done to overcome failure of command CPYFROMSTMF due to inability to convert to target CCSID. **************************************************** **** Changes made in version 2005-03-10 20:21:21 *** **************************************************** - README,CGIDEV2 - Added information about the WrtNoSection subprocedure, which was added to GGIDEV2 with version 2002-03-31 11:37:00, but inadvertantly was not added to the README. - QRPGLESRC - all sample programs that use ZhbGetInput (DSPENCODE2, TEMPLATE3, TEMPLATE4, TEMPLATE5, TEMPLATE5F, PERSIST, STATE) - added logic that executes the *PSSR subroutine if ZhbGetInput returns with an error in the qusec error data structure - QRPGLESRC,XXXCGIPARS - ZhbGetInput subprocedure - added logic that does the following when the call to QzhbCgiParse fails. - Writes a message into the debbugging file - Sets number of variables to 0 and returns - QRPGLESRC,XXXWRKHTML - Fixed bugs in UpdHtmlVar2 subprocedure - when user requested that arrays be cleared, the variable varallocated was incorrectly being set to 0. - when a variable's value was blanks and the trim request was %trim, one blank was being output. - modified code to initialize elements in the varnm, varP, and varlen arrays to correct intermittent errors including corrupted output HTML, realloc errors, etc. Thanks to Ron Egyed for finding, reporting, and developing the fix for this bug. - Fixed a bug in internal subprocedure setarrays used to set up substitution variables. An externally described HTML record like the following caused the calling CGI program to abort and now is fixed: Your test score is /%score%/% A record like the following will still fail with a message to CGIDEBUG that says the substitution variable delimiters are in the wrong order because the order appears to be /% %/ %/ %/: Your test score is /%score%/%/%somevar%/ To correct it use something like one of the following: Your test score is /%score%/% /%somevar%/ or encode the % sign Your test score is /%score%/%/%somevar%/ Or, use different substitution variable delimiters. **************************************************** **** Changes made in version 2004-09-02 17:40:18 *** **************************************************** New Subprocedures ----------------- - ZhbGetVarPtr returns a pointer to an input variable. Intended to be used when an input variable's length might exceed ZhbGetVar's maximum size of 32767. The maximum length is 64000. See details, below, in QRPGLESRC,XXXCGIPARS - UpdHtmlVar2 provided to support very large substitution variables. See details, below, in QRPGLESRC,XXXWRKHTML - TimerStart and TimeElapsed for timing operations. See details, below, in QRPGLESRC,XXXTIME - Encode2. See details, below, in QRGPLESRC,XXXWRKHTML DONE - ChkIfsObj2. See details, below, in QRPGLESRC,XXXIFS DONE  New Programs ------------ - DSPENCODE2 CGI. See details, below, in QRGPLESRC,XXXWRKHTML. Changes, fixes, additions - details ----------------------------------- - Code is now targeted to and distributed for V5R1M0 and later. - ChkNbr subprocedure documentation in README and QRPGLESRC,PROTOTYPEB - Added text to emphasize that the first indicator (any errors) in the returned data structure is NOT turned on when indicator 7 (value is negative) is turned on. Indicator 7 is used only to condition a message when the value is negative. - Sample programs - Now use the new timing subprocedures, TimerStart and TimerElapsed, to calculate execution times. - HTMLSRC,ENCODE2FIL - This new source member contains the default run time data for the encode2 subprocedure. At install time, it is copied to the IFS as /cgidevexthtml/encode2fil.txt. Details for creating your own version of this file are in the README file and in QRPGLESRC member PROTOTYPEB in the Encode2 prototype. - QRPGLESRC,STATE - Changed to use the new encode2 subprocedure instead of encode. - QRPGLESRC,TEMPLATE5 - Now uses ILE RPG free-form calculations. - QRPGLESRC,XXXCGIPARS - New ZhbGetVarPtr subprocedure. Designed to be used when inputs greater than the maximum 32767 allowed by ZhbGetVar are expected. The maximum variable size captured by ZhbGetInput is 64000. If the variable exists and the data length is greater than 0, ZhbGetVarPtr returns a pointer to the data. Otherwise, it returns a null pointer (*null). The length of the data is returned in a parameter. See the prototype in QRPGLESRC,PROTOTYPEB for details. - ZhbGetInput procedure - Internal changes to support ZhbGetVarPtr. - Increased maximum input variable length from 32767 to 64000. ZhbGetVar and ZhbGetVarUpper, still return only a maximum of 32767 bytes. If you have a longer variable, use the new ZhbGetVarPtr subprocedure. - Increased the maximum number of input variables from 5000 to 32767. - Modified CGIMODE logic so that the request is rejected when the CGI_MODE environment variable is either %%MIXED%% or %%MIXED/MIXED%%. Behavior is the same for both the original HTTP server and the HTTP server powered by Apache. - QRPGLESRC,XXXDATA - Uppify subprocedure - Added an optional CCSID parameter. See the prototype in QRPGLESRC,PROTOTYPEB for details. - QRPGLESRC,XXXERRNO - Corrected error in prototype for strerrno function by adding value keyword to the errno parameter. - QRPGLESRC,XXXIFS (new member) - ChkIfsObj2 subprocedure - Checks for the existence/accessibility of an IFS object - QRPGLESRC,XXXTIME (new member) - TimerStart subprocedure - Retrieves and stores in the CGISRVPGM2 service program, the current software timer's value. - TimerElapsed subprocedure - Returns the number of seconds elapsed since TimerStart was last run. Value returned is a 15p 6 field. - QRPGLESRC,XXXWRKHTML - New Encode2 subprocedure. - Supports a large number of character entities. Default run time data for Encode2 is copied at installation time from HTMLSRC,ENCODE2FIL to IFS file /cgidevexthtml/encode2fil.txt - New UpdHtmlVar2 subprocedure allows very large substitution variables. Accomplished by passing the variable's address and length. See the prototype for details. - UpdHtmlVar subprocedure - modified to use UpdHtmlVar2. - GetHtmlIfsMult subprocedure - removed unused d specification for srcdta variable. - WrtHtmlToStmf subprocedure - Added additional error checking at points following linking of new file from temporary file and unlinking of temporary file. - WrtSection subprocedure - added NoDataString parameter to allow caller to determine what is written to the browser when a substitution variable has no value. - modified to handle large substitution variables supported by UpdHtmlVar2. **************************************************** **** Changes made in version 2003-09-01 14:50:19 *** **************************************************** New items --------- - CrtUsrSpc (Create User Space) subprocedure. See details, below, in QRPGLESRC,XXXUSRSPC. - RtvUsrSpcPtr (Retrieve User Space Pointer) subprocedure. See details, below, in QRPGLESRC,XXXUSRSPC. - RandomString (Create Random String) subprocedure. See details, below, in QRPGLESRC,XXXRANDOM. - Encode (Encode HTML special characters) subprocedure. See details, below, in QRPGLESRC,XXXWRKHTML - EncodeBlanks (Encode blanks) subprocedure. See details, below, in QRPGLESRC,XXXWRKHTML - STATE sample program. See details, below, in QRPGLESRC,STATE Changes, fixes, additions - details ----------------------------------- - Binding directory TEMPLATE2 - Removed incorrect binding directory entry for service program CGIDEV2DEV/CGISRVPGM2 - QRPGLESRC,PERSIST - Modified to use ZhbGetInput, ZhbGetVarCnt, ZhbGetVar, and getHtmlIFSMult subprocedures. - QRPGLESRC,STATE - A new sample program that illustrates storing and retrieving state information into and from a user space. It uses the new CrtUsrSpc and RtvUsrSpcPtr subprocedures. - QRPGLESRC,TEMPLATE through TEMPLATE5, PERSIST, STATE, DSPVERSION - Added Callp ClrHtmlBuffer before first callp WrtSection to ensure that any leftover output from a previous abnormally terminated execution will not be output to the browser (WrtSection *fini) or to a stream file (WrtHtmlToStmf). - QRPGLESRC,TEMPLATE through TEMPLATE5, PERSIST, STATE (sample programs) RANDOMNBRS, CLRDEBUG, DSPVERSION - Modified code and installation procedures so that these programs are created with CRTBNDRPG instead of CRTRPGMOD and CRTPGM. - QRPGLESRC,XXXCOOKIES - Corrected a bug in CrtCookie subprocedure that returned an incorrectly formatted date for the expires part of the cookie. - Corrected incorrectly prototyped parameters for the CEEDAYS API in the CrtCookie subprocedure. It was was causing intermittent failures with the message CEE2507, "insufficient data provided." - QRPGLESRC,XXXDATA - ChkNbr subprocedure - Corrected possible problem with unpassed *nopass variable, maxdigits - Removed extra blanks in messages written by AddMsg when there were too many decimal points or too many minus signs. - QRPGLESRC,XXXDEBUG - WrtDebug subprocedure - Corrected possible problem with unpassed *nopass variable, force - WrtJobDbg subprocedure - Corrected possible problem with unpassed *nopass variable, force - QRPGLESRC,XXXRANDOM - New subprocedure, RandomString, returns a string of up to 1024 random characters. The caller controls the number of characters returned, the contents and case of the first character, and the contents and case of the remaining characters. See the prototype for details. - QRPGLESRC,XXXWRKHTML - New subprocedures - Encode - Converts an input varying field to an output varying field in which any " & < > characters are converted to into their corresponding HTML character entities, " & < > - EncodeBlanks - Converts an input varying field to an output varying field in which any blanks are converted to   - UpdHTMLVar subprocedure - Corrected problems with unpassed *nopass variables, one of which caused corruption resulting in exception message "range of subscript value or character string error." - WrtNoSection subprocedure - Failed when called before a successful execution of GetHtml, GetHtmlIfs, or GetHtmlIfsMult. Added logic to perform necessary initialization. - Global variables SecDelim1 and SecDelim2 were too short. Changed from 10 to 20 characters. - QRPGLESRC,XXXUSRSPC - New module with the following new subprocedures. See the prototypes in QRPGLESRC,PROTOTYPEB for details. - CrtUsrSpc subprocedure - Creates a user space and makes it automatically extendible. - RtvUsrSpcPtr subprocedure - Retrieves a pointer to a user space **************************************************** **** Changes made in version 2003-05-19 00:01:01 *** **************************************************** - QRPGLESRC,XXXCGIPARS - Added logic for ZhbGetInput to tolerate more input - input buffer previously was fixed at 32767 bytes - now it is initialized to 50,000 bytes and can grow dynamically to a maximum of about 16,000,000 bytes (this should NEVER happen). - NOTE: the sum of all the occurrences of any ONE variable still cannot exceed 32767 bytes. - Modified subprocedures ZhbGetVar and ZhbGetVarUpper - Added const keyword to the occurrence parameter, thus allowing literals to be used. Programs using this parameter may have to be recompiled (CRTRPGMOD + CRTPGM or CRTBNDRPG). - QRPGLESRC,XXXRANDOM - Random returns an unsigned integer but the return value was being created with built-in function %int. Changed code to use built-in function %uns. - QRPGLESRC,XXXWRKHTML - Modified GetHtmlIfs and GetHtmlIfsMult to right trim blanks from each record in the same way that GetHtml does. - CGIDEBUG changes These changes require that any CGIDEBUG files in your libraries be deleted and recreated, either with CRTPF using member CGIDEBUG from CGIDEV2/QDDSSRC or with CRTDUPOBJ from a newly installed copy of the CGIDEV2 library. - QDDSSRC,CGIDEBUG - Removed field DBGLEN - Added timestamp field, DBGTIME - QRPGLESRC,XXXDEBUG - Modified WrtDebug subprocedure to write a timestamp instead of debug text length - Modified WrtJobDbg to write a timestamp instead of debug text length and removed logic to get and display time and date. **************************************************** **** Changes made in version 2002-07-30 18:00:00 *** **************************************************** - Corrected bug that caused ZhbGetInput to fail when a variable's name was more than 30 characters in length. The maximum length is now 50 characters. **************************************************** **** Changes made in version 2002-05-16 11:36:11 *** **************************************************** - CGIDEV2 now requires OS/400 V4R4 or later. - Documented the noname section in the README file - QRPGLESRC,XXXCOOKIES - Modified subprocedure CrtCookie so that the output always uses English abbreviations for day of the week and month. The previous version used the CEEDATM API which, being national language version compliant, returned these values in the machine's primary language. - QRPGLESRC,XXXRANDOM - The random subprocedure returns an unsigned integer, but the return value was being created with built-in function %int. Changed the code to use built-in function %uns. - QRPGLESRC,XXXWRKHTML - Added the GetHtmlBytesBuffered subprocedure. **************************************************** **** Changes made in version 2002-03-31 11:37:00 *** **************************************************** - QRPGLESRC,TEMPLATE, TEMPLATE2, TEMPLATE3, TEMPLATE4, TEMPLATE5 - Removed use of %trim in all calls to UpdHtmlVar since UpdHtmlVar trims its inputs. - Changed variable oses to varying length and modified logic that uses it to take advantage of its varying length - QRPGLESRC,PERSIST - Removed use of %trim in all calls to UpdHtmlVar since UpdHtmlVar trims its inputs. - Removed use of %trim in all calls to GetEnv's output is already trimmed. - QRPGLESRC,XXXCOOKIES - Fixed a bug that caused an exception when no cookies were in the HTTP_COOKIE environment variable. - QRPGLESRC,XXXDATA - ChkNbr subprocedure - Indicator 6 is now set on for any of the following conditions - more than 21 digits to the left of the decimal point - more than 9 digits to the right of the decimal point - number of digits to the left of the decimal point exceeds maximum specified in the maxdigits parameter - The changes above also removed the failure that occurred when checking the number of digits to the left of the decimal point and the number of digits exceeded the maximum number of digits supported by built-in function %inth. - QRPGLESRC,XXXWRKHTML - Added subprocedure WrtNoSection which allows data to be written to the browser without using WrtSection. This is useful for writing large blocks of data that exceed the 1000 byte maximum allowed for substitution variables in the UpdHtmlVar subprocedure. - Fixed bug in UpdHtmlVar that ignored the trim parameter when the action parameter was set to '0' (clear the arrays and write the variable as the first element). - Fixed bugs that output incorrect file names into the CGIDEBUG file when duplicate sections were found and sometimes failed with an array index error. - Fixed bug in CrtTagOpt: SELECT was being output when the value was blanks and the optional third parameter used to control SELECT's output was not passed. - Modified CrtTagOpt to right trim the text portion of the generated option tag. It is still up to the user to trim the value portion if desired. - Fixed pointer error in WrtHtmlToStmf subprocedure. - HTMLSRC - Removed IBM disclaimer notice from all members and from html files placed in directory /cgidevexthtml. **************************************************** **** Changes made in version 2001-09-21 09:20:36 *** **************************************************** - QREXSRC source physical file - Expanded record length from 142 to 240 bytes - QREXSRC,CRTOBJECTS - Modified to create IFS directory /CgidevExtHtml and its HTML files Talk2Ifs.html, StdEnd.Html, StdMsg.Html, StdPssr.Html, StdRunTime.Html, StdTop.Html, and Talk2Stuff.Html - QRPGLESRC,PERSIST - Changed all uses of %editw to %editc - QRPGLESRC,TEMPLATE, TEMPLATE2, TEMPLATE3, TEMPLATE4 - Removed protocol and counter variables by nesting the GETENV subprocedure inside the UpdHTMLVar subprocedure. - Added output for the SERVER_SOFTWARE environment variable. Used to quickly determine which server is being used (original or powered by Apache). - Modified corresponding HTML in HTMLSRC members TALK2 and TALK2IFS. - Moved code for updating the protocol, counter, and serversoftware variables closer to where they used. - Explicitly coded callp SetNoDebug(*off) in each program. The user is to change it to callp SetNoDebug(*on) if no debugging output is to be produced. - Changed all uses of %editw to %editc - Changed PGMNAME variable from a constant to a subfield of the program status data structure. - QRGPLESRC,TEMPLATE5 - New sample program that uses GetHtmlIfsMult and six externally described HTML files in the IFS. Distribution includes the six files. - QRPGLESRC,XXXCGIPARS - Added subprocedures ZhbCountAllVars and ZhbGetVarDetails - ZhbCountAllVars returns the number of occurrences of all variables in the CGI input. - ZhbGetVarDetails returns detailed information about the nth variable of all variables counted by ZhbCountAllVars. The information includes the variable's name, value, and occurrence. - Modified subprocedures ZhbGetVarUpper and ZhbGetVarCnt - Changed parameter name from varname to varnamein - ZhbGetInput subprocedure - Fixed bug that caused the last variable input to be omitted. - QRPGLESRC,XXXCOOKIES - New source member contains the following subprocedures - CrtCookie creates a cookie - GetCookieByName gets a cookie's value based on its name and occurrence. _ QRPGLESRC,XXXWRKHTML - New subprocedures - GetHtmlIfsMult subprocedure supports reading multiple externally described HTML files at once. All the sections and records in all the files are read into dynamic storage as though they resided in a single file. If a section name appears more than once, only the first occurrence is used. - ClrHtmlBuffer clears the HTML output buffer. Use this subprocedure to empty the buffer without sending it to either the browser or to a stream file. This is useful when program logic dictates you need to output something other than what has already been buffered. - RtvSubsVarInfo retrieves information about substitution variables. - CrtOptTag subprocedure modified to output the tag which hadn't been output before. - UpdHtmlVar subprocedure modified by adding an optional parameter the caller can use to control trimming. - %trim - trim left and right (default) - %triml - trim left only - %trimr - trim right only - %trim0 - don't trim - GetHtml and GetHtmlIfs subprocedures modified to check substitution variables for matching pairs of correctly sequenced starting and ending delimiters. When a record contains any such errors, the entire record is changed to all asterisks (*) and a message is forced into the CGIDEBUG file. The new subprocedure, GetHtmlIfsMult behaves in the same way. - For all methods of getting HTML, changed the maximum number of section names from 200 to 1000 - QRPGLESRC - WrtDebug subprocedure - Modified all uses of WrtDebug in the sample programs and in the service program to start with the sending program's or subprocedure's name. **************************************************** **** Changes made in version 2001-05-31 17:11:26 *** **************************************************** - Fixed bug in CL program CGIDEBUG that allocated but did not deallocate the CGIDEBUG physical file. - Modified subprocedure CgiVarCnt to use a dynamically allocated array for counting the number of times a variable occurs. As a result, the maximum occurrences is increased from 250 to 8200 (slightly more than can fit in the 32767 byte input buffer). Users are encouraged to use the Zhbxxxxx subprocedures instead of the Cgixxxxx subprocedures. **************************************************** **** Changes made in version 2001-05-18 10:14:02 *** **************************************************** - Miscellaneous changes to comments in the code. **************************************************** **** Changes made in version 2001-05-10 21:12:13 *** **************************************************** - Added subprocedure WrtHtmlToStmf to QRPGLESRC,XXXWRKHTML. This subprocedure is used (instead of WrtSection(*fini)) to direct the accumulated HTML to a stream file. Do not use WrtHtmlToStmf in a CGI program. It should be run from an interactive session or from a batch job to create static HTML files. - Added other objects to demonstrate WrtHTMLtoStmf. - HTMLSRC,RANDOMNBRS externally described HTML - QCMDSRC,RANDOMNBRS to create RANDOMNBRS command to drive RANDOMNBRS program - QRPGLESRC,RANDOMNBRS sample program. Creates an HTML stream file containing random numbers - Added subprocedure RtvHtmlRcd to QRPGLESRC,XXXWRKHTML. This subprocedure is used to retrieve an externally described HTML section one record at a time. - Fixed CL program CGIDEBUG to correct error when attempting to CLRPFM when member is in use. - Fixed bug in subprocedure WrtDebug that caused a loop if file CGIDEBUG could not be opened (does not exist, etc.) - Added subprocedure SetNoDebug which sets a global indicator used by the debugging subprocedures. The indicator's default value is *off, which allows debugging to operate normally. If SetNoDebug sets it *on, all the debugging routines do nothing when called, even if forced output is requested. The debugging routines IsDebug, WrtDebug, WrtJobDbg, and WrtPsds were modified to check the indicator's status. This capability was added to allow the programmer to improve performance by turning all debugging off. **************************************************** **** Changes made in version 2001-04-13 **************************************************** - Added VERSION data area to CGIDEV2 library. Contains this version's date and time (there are no version numbers). To display: DSPDTAARA VERSION or run CGI program DSPVERSION (link in HTMLSRC member MENU). - Added member QRPGLESRC,DSPVERSION to display the current version (CGI program). - Added member HTMLSRC,VERSION, used by DSPVERSION CGI program. - Modified member HTMLSRC,MENU to add an option to run DSPVERSION **************************************************** **** Changes made in version 2001-04-05 **************************************************** - Fixed bug in GetHtmlIfs subprocedure **************************************************** **** Changes made in version 2001-03-05 **************************************************** - Bug fixes and minor documentation changes - Added member TALK2IFS to HTMLSRC source physical file **************************************************** **** Changes made in version 2001-03-02 **************************************************** - Added ability to place externally described HTML in the IFS. - New source members - QRPGLESRC,TEMPLATE4 sample program. Same as TEMPLATE3 but uses IFS file /cgidevexthtml/talk2.html for externally described HTML. - QRPGLESRC,XXXERRNO new source member implements subprocedures - errno - errnotxt - HTMLSRC,TALK14, input for program TEMPLATE4 - Modified source members - QRPGLESRC,PROTOTYPEB. - Added prototypes errno, errnotxt, GetHtmlIfs, stat, open, read, write, close. - Added constants for IFS APIs. - QRPGLESRC,XXXWRKHTML - Restructured existing code for GetHtml subprocedure - Added code for GetHtmlIfs subprocedure - QSRVSRC,CGISRVPGM2 - Added exports for GetHtmlIfs errno, errnotxt, GetHtmlIfs - QREXSRC,CRTOBJECTS - README,CGIDEV2 **************************************************** **** Changes made in version 2001-01-24 **************************************************** - TEMPLATE, TEMPLATE2, TEMPLATE3, and PERSIST sample programs. - Added comments explaining the use of the *on (force) parameter in the WrtJobDbg subprocedure. **************************************************** **** Changes made in version 2001-01-18 **************************************************** - QRPGLESRC,XXXFIXMIX - FixMixed subprocedure modified to fix mixed data if CGI_MODE is either %%MIXED%% or %%MIXED/MIXED%%. - QRPGLESRC,XXXCGIPARS - ZhbGetInput subprocedure. Added code to return number of variables = 0 if (request method = POST and CONTENT_LENGTH = 0) or (request method = GET and QUERY_STRING's length is 0). - README,CHANGES - New member **************************************************** **** Changes made in version 2001-01-10 **************************************************** - QRPGLESRC,XXXCGIPARS - ZhbGetInput subprocedure modified to work correctly with Apache 2.00 Alpha server. **************************************************** **** Changes made in version 2000-12-22 **************************************************** - QRPGLSRC,TEMPLATE, TEMPLATE2, TEMPLATE3 - Modified to open HOURSOP only once and to reposition to the beginning of file each time. - QRPGLSRC,XXXCVTDB - Removed obsolete unused D specs for CEEDOD API. **************************************************** **** Original version 2000-11-21 ****************************************************