//**** START OF SPECIFICATIONS *****************************************00010000 //* *00020000 //* MODULE NAME = APSUC15X *00030000 //* *00040000 //* $MOD (APSUC15X) COMP(APS) PROD(PSF) : VERSION 3.2.2 *00050000 //* *00060000 //* DESCRIPTIVE NAME = Sample Download for OS/390 Print Parameter Exit *00070000 //* *00080000 //* STATUS = Version 3, Release 2, Level 2 *00090000 //* *00100000 //* FUNCTION = *00110000 //* This is installation sample exit APSUX15X written in C. *00120000 //* *00130000 //* Returns a print parameter keyword and value for Download for *00140000 //* OS/390 to transmit to its server on AIX. *00150000 //* *00160000 //* OPERATION = The following items are done by this sample exit: *00170000 //* 1. Pick up printer device name and output group name *00180000 //* from APSUJSPC. *00190000 //* 2. Formulate a string: *00200000 //* devname=device_name,outgrp_name=outgrp_name *00210000 //* 3. Pass the string to Download for OS/390 *00220000 //* *00230000 //* NOTE: In this exit program, there is no need to remove leading *00240000 //* or trailing blanks/x'00' in device_name or outgrp_name *00250000 //* fields. Download for OS/390 removes them in the string *00260000 //* before transmitting the string to AIX. If you want *00270000 //* blanks/x'00' included in the string, replace them with *00280000 //* x'1C' in this program. *00290000 //* The maximum length of the string is the size of ECA work *00300000 //* area buffer (ECAWKBUF) up to 30K bytes. The default *00310000 //* length for the ECA work area buffer is 1599 bytes. *00320000 //* *00330000 //* NOTES = *00340000 //* DEPENDENCIES = None *00350000 //* RESTRICTIONS = None *00360000 //* *00370000 //* MODULE TYPE = Procedure *00380000 //* PROCESSOR = C *00390000 //* ATTRIBUTES = Reentrant *00400000 //* AMODE 31 *00410000 //* RMODE ANY *00420000 //* *00430000 //* ENTRY POINT = APSUC15 *00440000 //* LINKAGE = *00450000 //* One parameter is passed - the address of APSGEXTC *00460000 //* *00470000 //* INPUT = *00480000 //* APSGEXTC - PSF installation exit paramater area *00490000 //* *00500000 //* OUTPUT = *00510000 //* EBCDIC text string *00520000 //* *00530000 //* EXIT NORMAL = Return to caller *00540000 //* *00550000 //* EXIT ERROR = None *00560000 //* *00570000 //* EXTERNAL REFERENCES = *00580000 //* ROUTINES = None *00590000 //* DATA AREAS = *00600000 //* APSGEXTC - PSF installation exit parameter area *00610000 //* APSUECAC - PSF exit communications area *00620000 //* APSUJSPC - JES separator page area *00630000 //* *00640000 //* MACROS = None *00650000 //* *00660000 //* MESSAGES = None *00670000 //* *00680000 //* CHANGE ACTIVITY = *00690000 //* $B0=LAPS0008, JPRF322, 991027, BDKUEAS: Initial Version @B0A*00700000 //* $EV=LAPS0009,HPRF332,010530,BUQ4RLB: Version 3.3.2 @EVA*00710000 //* *00720000 //**** END OF SPECIFICATIONS *******************************************00730000 00740000 #pragma comment(date) 00750000 #pragma csect(CODE,"$APSUC15") 00760000 #pragma csect(STATIC,"#APSUC15") 00770000 #pragma linkage(APSUC15,OS) 00780000 #pragma runopts(TRAP(OFF)) 00790000 #pragma map(apsuc15,"APSUC15") 00800000 00810000 /*--------------------------------------------------------------------- 00820000 #include these header files for structure & function definitions: 00830000 ---------------------------------------------------------------------*/ 00840000 00850000 #include 00860000 #include "apsgextc.h" 00870000 #include "apsuecac.h" 00880000 #include "apsujspc.h" 00890000 00900000 /*----------------------------------------------------------------------00910000 Miscellaneous declarations: 00920000 ----------------------------------------------------------------------*/00930000 00940000 #define DEVNAME "devname=" 00950000 #define OUTGRPNM "outgrp_name=" 00960000 #define COMMA "," 00970000 #define BLANKS " " 00980000 00990000 void apsuc15(APSGEXTP * xtpptr) 01000000 { 01010000 int strlength = 0; // Set string length to zero 01020000 const int jsp_str_len = 8; // Length of device name and outgrp 01030000 // name in APSUJSPC 01040000 unsigned char (* ecawkptr)Ý1¨; // Will point to ECAWKBUF 01050000 01060000 ecawkptr = &(xtpptr->XTPECAP->ECABASE.ECAWKBUF); 01070000 // Get address of ECA work area 01080000 xtpptr->XTPECAP->ECABASE.ECARECAD = ecawkptr; 01090000 // Store string address 01100000 01110000 01120000 if (memcmp((xtpptr->XTPJSPAP->JSPADEVN),BLANKS,jsp_str_len)) 01130000 // If device name not blanks 01140000 { 01150000 memcpy(ecawkptr,DEVNAME,strlen(DEVNAME)); 01160000 // Pick up 'devname=' 01170000 strlength += strlen(DEVNAME); 01180000 // Increment string length 01190000 ecawkptr += strlen(DEVNAME); 01200000 // Advance wrkarea ptr 01210000 01220000 memcpy(ecawkptr,xtpptr->XTPJSPAP->JSPADEVN,jsp_str_len); 01230000 // Pick up device name 01240000 strlength += jsp_str_len; // Increment string length 01250000 ecawkptr += jsp_str_len; // Advance wrkarea ptr 01260000 } 01270000 01280000 01290000 if (memcmp((xtpptr->XTPJSPAP->JSPJGRPN),BLANKS,jsp_str_len)) 01300000 // If outgrp name not blank 01310000 { 01320000 memcpy(ecawkptr,COMMA,strlen(COMMA)); 01330000 // Pick up comma 01340000 strlength += strlen(COMMA); // Increment string length 01350000 ecawkptr += strlen(COMMA); 01360000 // Advance wrkarea ptr 01370000 01380000 /***************************************************************/ 01390000 /* Note : If device name is blank, the exit will return a */ 01400000 /* string with a leading comma: ,OUTGRP_NAME=nn */ 01410000 /* Download for OS/390 will not prefix an additional */ 01420000 /* comma for the string as the separator from the */ 01430000 /* previous parm. */ 01440000 /***************************************************************/ 01450000 01460000 memcpy(ecawkptr,OUTGRPNM,strlen(OUTGRPNM)); 01470000 // Pick up 'outgrp_name=' 01480000 strlength += strlen(OUTGRPNM); 01490000 // Increment string length 01500000 ecawkptr += strlen(OUTGRPNM); 01510000 // Advance wrkarea ptr 01520000 01530000 memcpy(ecawkptr,(xtpptr->XTPJSPAP->JSPJGRPN),jsp_str_len); 01540000 // Pick up outgrp name 01550000 strlength += jsp_str_len; // Increment string length 01560000 ecawkptr += jsp_str_len; // Advance wrkarea ptr 01570000 } 01580000 01590000 01600000 xtpptr->XTPECAP->ECABASE.ECARECLN = strlength; 01610000 // Store string length 01620000 01630000 } 01640000