× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



Dan,

The only parm you can legitimately use options(*VARSIZE) on is InputData
(if you'd decided to define it as char(16773000)) and ErrorCode

The key thing with options(*VARSIZE), is that there has to be some way for
the callee to know how much data was actually passed.

InputData has a matching length parm, LengthOfInputData. ErrorCode has a
structure in which the first 4 bytes tell the callee how much space is
available.


I'd do the PR like so:

dcl-pr hash extproc('Qc3CalculateHash');

InputData pointer value;

LengthOfInputData int( 10) const;
InputDataFormatName char( 8) const;
AlgorithmDescription char( 20) const;
AlgorithmDescriptionFormatName char( 8) const;
CryptographicServiceProvider char( 1) const;
CryptographicDeviceName char( 10) const;
Hash char( 16) ;
ErrorCode char( 300) options(*varsize);
end-pr;

You don't need any of the CONST, but I always use them to indicate which
parms are INPUT only. Plus they'd allow you to code the call like so

hash( %addr( DataToHash : *DATA) : inputlen: 'DATA0100':

QC3D0500: 'ALGD0500': cryptoserv:

cryptoDev: HashValue: errorCD);

Charles


On Mon, Apr 2, 2018 at 6:17 AM, Barbara Morris <bmorris@xxxxxxxxxx> wrote:

On 2018-03-31 4:41 PM, Jon Paris wrote:


I have been trying to get IBM to fix their header files (in SQSYSINC) and
in their manuals for years. The problem stems from the fact that years ago,
IBM semi-automated the translation of C header files to RPG - and in the
days before Int was introduced type B (BinDec) was the only option for
binary parms. Why they continued it when RPG IV came along and introduced
true integers I have no idea - particularly when it causes truncation
errors on large values - maybe because without Bruce Vining around there's
nobody left with enough interest in making the automated tools all work
properly. Although come to think of it Bruce was still around long after
Ints came on the scene.


Jon, the QSYSINC header files have had 'I' instead of 'B' for several
releases (not sure exactly when). But I think it might have been Bruce who
made the change.

Qc3CalculateHash doesn't have a prototype in QSYSINC. Dan was using a
Technote example.

--
Barbara


--
This is the RPG programming on the IBM i (AS/400 and iSeries) (RPG400-L)
mailing list
To post a message email: RPG400-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: https://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at https://archive.midrange.com/rpg400-l.

Please contact support@xxxxxxxxxxxx for any subscription related
questions.

Help support midrange.com by shopping at amazon.com with our affiliate
link: http://amzn.to/2dEadiD


As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:
Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.