/************************************************************************/ /* File: PROCP4NNAME.QRPGLESRC */ /* exports: GetProcedurePointer */ /* gets Name of Procedure and its Serviceprogram */ /* returns procedure pointer to the activation */ /* of the procedure, wich can be used for procedure call */ /* without the need of binding it */ /* example in TSTREFLECT.QRPGLESRC */ /* Copyright (C) 2002 Dieter Bender */ /* */ /* This program is free software; you can redistribute it and/or modify */ /* it under the terms of the GNU General Public License as published by */ /* the Free Software Foundation. */ /* */ /* This program is distributed in the hope that it will be useful, */ /* but WITHOUT ANY WARRANTY; without even the implied warranty of */ /* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */ /* GNU General Public License for more details. */ /* */ /* You should have received a copy of the GNU General Public License */ /* along with this program; if not, write to the Free Software */ /* Foundation, Inc., 59 Temple Place, */ /* Suite 330, Boston, MA 02111-1307 USA */ /* You might find a version at http://www.gnu.org */ /************************************************************************/ H copyright('Dieter Bender 08/2002 ') H NOMAIN D*B CRTRPGMOD PROCP4NAME D*B+ DBGVIEW(*SOURCE) D*B+ REPLACE(*YES) D*B CRTSRVPGM PROCP4NAME D*B+ BNDDIR(QC2LE) D*B+ REPLACE(*YES) D*B+ EXPORT(*ALL) /COPY QRPGLEH,PROCP4NAME /COPY QRPGLEH,QLICVTTP /COPY QRPGLEH,RSLVSP /COPY QRPGLEH,QLEAWI /*============================================================*/ P GetProcPointer B EXPORT D GetProcPointer PI * PROCPTR D ServicePgm 10A CONST D Procedure 32A CONST /*------------------------------------------------------------*/ D Ergebnis S * PROCPTR D CharType S 10A INZ('*SRVPGM') D HexType S 2A D ServicePgmP S * PROCPTR D ActivateResult S 10i 0 D ActivationMark S 10i 0 D ActivationInfo S LIKE(Qle_ABP_Info_t) D ActInfoLen S 10i 0 INZ(%size(ActivationInfo)) D ExportType S 10i 0 D*Error S LIKEDS(ErrorDS) D* INZ(*LIKEDS) DError DS inz D BytesProvided 10I 0 inz(%size(Error)) D BytesAvailable 10I 0 D MessageId 7A D ErrReserved 1A D ErrParms 128A C callp ConvertObjectTypeHex( C '*SYMTOHEX' : C CharType : C HexType : C Error C ) C eval ServicePgmP = C GetSysPointer( C HexType : C %trim(ServicePgm) : C '*LIBL' : C AUTH_NONE C ) C eval ActivateResult = C ActivateProgram( C ServicePgmP : C ActivationMark : C ActivationInfo : C ActInfolen : C Error C ) C callp GetExport( C ActivationMark : C 0 : C %len(%trim(Procedure)): C %trim(Procedure) : C Ergebnis : C ExportType : C Error C ) C if ExportType <> QLE_EX_PROC C eval Ergebnis = *NULL C endif C return Ergebnis P GetProcPointer E