//**** START OF SPECIFICATIONS *****************************************00010000 //* MODULE NAME = APSUC07Y *00020000 //* *00030000 //* $MOD (APSUC07Y) COMP(APS) PROD(PSF) : VERSION 3.3.0 *00040000 //* *00050000 //* DESCRIPTIVE NAME = RESOURCE EXIT - SAMPLE 2 *00060000 //* *00070000 //* STATUS = VERSION 3, RELEASE 3, LEVEL 0 *00080000 //* *00090000 //* FUNCTION = *00100000 //* This is sample installation exit APSUX07Y written in C. *00110000 //* *00120000 //* DEMONSTRATE POSSIBLE USES OF THE RESOURCE EXIT *00130000 //* - SET EXIT INVOLVEMENT BASED ON THE PRINTER *00140000 //* - SET THE RRLV FOR PAGE SEGMENTS TO 1 *00150000 //* - SUBSTITUTE FOR A PAGE SEGMENT AND ADD TEXT TO THE MESSAGE *00160000 //* - MARK THE PAGE SEGMENT AS A PRIORITY LEVEL RESOURCE *00170000 //* - SUBSTITUTE FOR A PAGEDEF WITH NO MESSAGE *00180000 //* - KEEP A SPECIFIC OVERLAY IN THE PRINTER. *00190000 //* *00200000 //* OPERATION = *00210000 //* *00220000 //* *00230000 //* NOTES = *00240000 //* DEPENDENCIES = NONE *00250000 //* RESTRICTIONS = NONE *00260000 //* REGISTER CONVENTIONS = NONE *00270000 //* *00280000 //* MODULE TYPE = PROCEDURE *00290000 //* PROCESSOR = C *00300000 //* ATTRIBUTES = REENTRANT *00310000 //* AMODE 31 *00320000 //* RMODE ANY *00330000 //* *00340000 //* ENTRY POINT = APSUC07 *00350000 //* LINKAGE = *00360000 //* One parameter which is the address of APSGEXTP is passed *00370000 //* *00380000 //* INPUT = *00390000 //* APSGEXTP - PSF INSTALLATION EXIT PARAMETER AREA *00400000 //* *00410000 //* OUTPUT = NONE *00420000 //* *00430000 //* EXIT NORMAL = RETURN TO CALLER *00440000 //* *00450000 //* EXIT ERROR = NONE *00460000 //* *00470000 //* EXTERNAL REFERENCES = *00480000 //* ROUTINES = NONE *00490000 //* DATA AREAS = *00500000 //* APSGEXTP - PSF INSTALLATION EXIT PARAMETER AREA *00510000 //* APSUECA - PSF EXIT COMMUNICATIONS AREA *00520000 //* APSURLST - PSF EXIT RESOURCE LIST AREA *00530000 //* IAZJSPA - JES SEPARATOR PAGE AREA *00540000 //* INCLUDES = NONE *00550000 //* *00560000 //* MACROS = NONE *00570000 //* *00580000 //* MESSAGES = NONE *00590000 //* *00600000 //* CHANGE ACTIVITY = *00610000 //* $B0=LAPS0008, HPRF320, 990930, BDKUAJT: Initial Version @B0A*00620000 //* $EV=LAPS0009,HPRF330,010530,BUQ4RLB: Version 3.3.0 @EVA*00630000 //* *00640000 //**** END OF SPECIFICATIONS *******************************************00650000 00660000 #pragma comment(date) 00670000 #pragma csect(CODE,"$APSUC07") 00680000 #pragma csect(STATIC,"#APSUC07") 00690000 #pragma linkage(APSUC07,OS) 00700000 #pragma runopts(TRAP(OFF)) 00710000 #pragma map(apsuc07,"APSUC07") 00720000 00730000 /*--------------------------------------------------------------------- 00740000 #include these header files for structure & function definitions: 00750000 ---------------------------------------------------------------------*/ 00760000 00770000 #include "apsgextc.h" 00780000 #include "apsurlsc.h" 00790000 #include "apsuecac.h" 00800000 #include "apsujspc.h" 00810000 00820000 /*--------------------------------------------------------------------- 00830000 Declarations 00840000 ---------------------------------------------------------------------*/ 00850000 00860000 APSURLST * rlstptr; // RLST pointer 00870000 char *msgins = "HOW DO YOU LIKE THE NEW LOGO?"; // Pointer to the 00880000 // message insert 00890000 int len = 8; // Length of pagedef and page 00900000 // segment names 00910000 int len1 = 4; // Length of printer name 00920000 00930000 /*--------------------------------------------------------------------- 00940000 Constants 00950000 ---------------------------------------------------------------------*/ 00960000 00970000 #define MSGLNGTH 0x1D 00980000 #define PRT3800 "3800" 00990000 #define FORMSPRT "PRT000 " 01000000 #define OLDPDEF "P1OLD " 01010000 #define NEWPDEF "P1NEW " 01020000 #define OLDLOGO "S1OLD " 01030000 #define NEWLOGO "S1NEW " 01040000 #define MAINFORM "O1FORM " 01050000 01060000 void apsuc07(APSGEXTP * xtpptr) 01070000 { 01080000 01090000 /*--------------------------------------------------------------------- 01100000 Determine what type of call is being made to the exit 01110000 ---------------------------------------------------------------------*/ 01120000 01130000 switch (xtpptr->XTPRECP.XTPRECP7->XTP7ETYP) // Select on the 01140000 // type of call 01150000 { 01160000 case XTP7INIT: // Initialization call 01170000 01180000 /*-------------------------------------------------------------- 01190000 INITIALIZATION ROUTINE 01200000 - Request control at access time for page segments 01210000 - Set the RRLV for segments to 1 01220000 - Request control at access time for pagedefs (3800 only) 01230000 - Request control at delete time for overlays (PRT000 only) 01240000 --------------------------------------------------------------*/ 01250000 01260000 xtpptr->XTPRECP.XTPRECP7->XTP7NOTY.XTP7NACC = XTP7APS; 01270000 // Request control at access 01280000 // time for page segments 01290000 // (all printers) 01300000 xtpptr->XTPRECP.XTPRECP7->XTP7RRLV.XTP7RPS = 1; 01310000 // Set RRLV for segments to 1 01320000 01330000 if ( !(memcmp(xtpptr->XTPRECP.XTPRECP7->XTP7PINF.XTP7PRT. 01340000 XTP7FMLY,PRT3800, len1))) // If this is a 3800 01350000 { // printer 01360000 xtpptr->XTPRECP.XTPRECP7->XTP7NOTY.XTP7NACC |= XTP7APD; 01370000 // Request control at access 01380000 // time for pagedefs (3800's 01390000 // only) 01400000 xtpptr->XTPRECP.XTPRECP7->XTP7RFLG = XTP7HDF; 01410000 // Tell the 3800 to use the 01420000 // first font in the current 01430000 // font list for the hardware 01440000 // default. 01450000 } 01460000 01470000 if ( !(memcmp(xtpptr->XTPRECP.XTPRECP7->XTP7PINF.XTP7PNAM, 01480000 FORMSPRT, len))) // If this is the 01490000 // forms printer 01500000 01510000 xtpptr->XTPRECP.XTPRECP7->XTP7NOTY.XTP7NDEL = XTP7DMO; 01520000 // Request control at delete 01530000 // time for overlays (Forms 01540000 // printer only) 01550000 01560000 break; // Exit from the init call 01570000 01580000 case XTP7ACC: // Resource access call 01590000 01600000 /*---------------------------------------------------------------01610000 ACCESS ROUTINE: 01620000 01630000 - Substitute for a pagedef and do not issue a message. 01640000 - Substitute for a page segment, issue the substitution 01650000 message, and add optional text to the message. 01660000 - Mark the segment as a priority level resource (PLR). 01670000 01680000 NOTES: 01690000 - Pagedefs (& formdefs) never have more than 1 RLST entry at 01700000 access time. 01710000 - Page segments, overlays, and fonts may have more than one 01720000 RLST entry in the chain at access time. 01730000 - If RLSTMSGP or RLSTMSGL are 0, no message insert will be 01740000 added to the substitution message. 01750000 - Marking this segment as a PLR and the setting of the 01760000 segment RRLV to 1 in the initialization routine will result 01770000 in this segment being retained at data set boundaries. 01780000 ---------------------------------------------------------------*/01790000 01800000 switch (xtpptr->XTPRECP.XTPRECP7->XTP7RTYP) // Select on the 01810000 // resource type 01820000 { 01830000 case XTP7PD: // Access call for pagedefs 01840000 01850000 /*-------------------------------------------------------- 01860000 Access routine for pagedefs: Should only get here when 01870000 printer is a 3800. 01880000 --------------------------------------------------------*/ 01890000 01900000 if( !(memcmp(xtpptr->XTPRECP.XTPRECP7->XTP7RLST. 01910000 XTP7LSTP->RLSTRID.RLSTNAME, OLDPDEF, len)))01920000 // If this is the 01930000 { // old pagedef 01940000 memcpy(xtpptr->XTPRECP.XTPRECP7->XTP7RLST.XTP7LSTP-> 01950000 RLSTRID.RLSTNAME, NEWPDEF, len); 01960000 // Replace with the 01970000 // new pagedef 01980000 01990000 xtpptr->XTPRECP.XTPRECP7->XTP7RLST.XTP7LSTP-> 02000000 RLSTFLGS.RLSTAFLG &= (~RLSTSMSG); 02010000 // Don't give the 02020000 // substitution 02030000 // message--turn bit 02040000 // off by anding with02050000 // its complement. 02060000 } 02070000 02080000 break; // Exit from pagedef access call 02090000 02100000 case XTP7PS: // Access call for page segments 02110000 02120000 /*-------------------------------------------------------- 02130000 Access routine for page segments 02140000 --------------------------------------------------------*/ 02150000 02160000 rlstptr = xtpptr->XTPRECP.XTPRECP7->XTP7RLST.XTP7LSTP; 02170000 // Point to 1st RLST entry 02180000 for(;;) // Loop thru all RLST entries 02190000 { 02200000 if( !(memcmp(rlstptr->RLSTRID.RLSTNAME,OLDLOGO,len)))02210000 // If this is the 02220000 { // old company logo: 02230000 02240000 memcpy(rlstptr->RLSTRID.RLSTNAME, NEWLOGO, len); 02250000 // Replace it with the new02260000 // logo 02270000 rlstptr->RLSTRID.RLSTSTAT |= RLSTPLR; 02280000 // Set bit to mark this 02290000 // segment as a PLR. 02300000 rlstptr->RLSTFLGS.RLSTAFLG |= RLSTSMSG; 02310000 // Set bit to give the 02320000 // substitution message. 02330000 02340000 /*-------------------------------------------- 02350000 Add the optional message text to the 02360000 substitution message 02370000 --------------------------------------------*/ 02380000 02390000 rlstptr->RLSTPTRS.RLSTMSGP = msgins; 02400000 // Put the address of the 02410000 // message text into the 02420000 // message pointer. 02430000 rlstptr->RLSTMSGL = MSGLNGTH; 02440000 // Store length of message02450000 // insert. 02460000 break; // Exit from endless 02470000 // RLST loop 02480000 } // End if old company logo02490000 02500000 if(rlstptr->RLSTPTRS.RLSTNEXT != NULL) 02510000 // If there is another 02520000 // RLST: 02530000 02540000 rlstptr = rlstptr->RLSTPTRS.RLSTNEXT; 02550000 // Point to next RLST 02560000 // entry 02570000 else 02580000 break; // Exit from endless RLST loop 02590000 02600000 } // End of RLST loop 02610000 break; // End of page segment case 02620000 02630000 default: // No match found - error 02640000 break; // Exit from default 02650000 } // End of select on the 02660000 // resource type 02670000 02680000 break; // End of resource access call 02690000 02700000 case XTP7DSE: // Data set end call 02710000 /*-------------------------------------------------------------- 02720000 DATA SET END ROUTINE: 02730000 - All resource types are likely to have multiple entries in the02740000 RLST chain at delete time 02750000 --------------------------------------------------------------*/ 02760000 02770000 if (xtpptr->XTPRECP.XTPRECP7->XTP7RTYP & XTP7MO) 02780000 // Check if this is the call for 02790000 // overlays. 02800000 { // Call is for overlays 02810000 02820000 /*------------------------------------------------------------02830000 DELETION ROUTINE FOR OVERLAYS: 02840000 - Tell PSF to keep the overlay over data set boundaries. 02850000 All other overlays will be deleted. 02860000 02870000 NOTES: 02880000 - This overlay delete routine is active only for the printer02890000 PRT000. 02900000 - This code will tell PSF to keep the overlay across data set02910000 boundaries. PSF will attempt to retain all fonts 02920000 and page segments that were mapped in this or any other 02930000 overlay used in this data set. On printers that do 02940000 not support selective deletion of segments (the 3800), 02950000 PSF may not be able to retain the overlay. 02960000 ------------------------------------------------------------*/02970000 02980000 rlstptr = xtpptr->XTPRECP.XTPRECP7->XTP7RLST.XTP7LSTP; 02990000 // Point to 1st RLST entry 03000000 for(;;) // Loop thru all RLST entries 03010000 { 03020000 if ( !(memcmp(rlstptr->RLSTRID.RLSTNAME, MAINFORM,len)))03030000 // If this is the 03040000 { // overlay: 03050000 rlstptr->RLSTFLGS.RLSTDFLG |= RLSTKEEP; 03060000 // Keep this overlay 03070000 break; // Exit from endless 03080000 } // RLST loop 03090000 03100000 if(rlstptr->RLSTPTRS.RLSTNEXT != NULL) 03110000 // If there is another 03120000 // RLST 03130000 03140000 rlstptr = rlstptr->RLSTPTRS.RLSTNEXT; 03150000 // Point to next RLST 03160000 // entry 03170000 else 03180000 break; // Exit from endless RLST loop 03190000 03200000 } // End of RLST loop 03210000 } // End call is for overlays 03220000 03230000 break; // End of dataset end call 03240000 03250000 default: // No match found - error 03260000 break; // Exit from default 03270000 } // End of select on the 03280000 // type of call 03290000 return; // Return with no error 03300000 } // End of main routine 03310000 03320000 03330000 03340000 03350000