Sorry, the ! should be a |

bitwise or operator in C

I mixed up bitwise or in C with logical or in PL/1

Kind regards

Bernd




-------- Original-Nachricht --------
Betreff:        Re: PL/I with variable PLISTs (was: LE C calling HLASM)
Datum:  Tue, 10 Apr 2012 23:23:39 +0200
Von:    Bernd Oppolzer <bernd.oppol...@t-online.de>
An:     IBM Mainframe Discussion List <IBM-MAIN@bama.ua.edu>



I don't know if it helps you, but using C I would code the two calls
this way:

rc = THEFUNCTION (&magic, inputbuffer,&inputlength, NULL, NULL);


rc = THEFUNCTION (&magic, inputbuffer,&inputlength, outputbuffer,&outputlength);


Note that the parameters that are probably integers are prefixed with an
ampersand
to pass the addresses.

If it is needed that the 3rd and the 5th address has the high order bit
set,
you can to this in C, too. I would use a macro called HIGHBITON (x), for
example,
which is coded as follows:

#define HIGHBITON(x)  (void *)((unsigned int)(x) ! 0x80000000)

So we have


rc = THEFUNCTION (&magic, inputbuffer, HIGHBITON(&inputlength), NULL, NULL);


rc = THEFUNCTION (&magic, inputbuffer,&inputlength, outputbuffer, 
HIGHBITON(&outputlength));


The two additional NULL parameters after the 3rd address in the first
case do no harm.

Kind regards

Bernd



Am 10.04.2012 23:11, schrieb Phil Smith:
 Steve Comstock wrote:
 Slipperier and slipperier. OK, let's try a different approach:
 You tell me exactly what you want to see from the PL/I routine calling
 your API and I'll see if I can cause PL/I to construct that.
 In other words, your routine will see
 (R1) ->   ????????
 rc = THEFUNCTION(magic,inputbuffer,inputlength)

 (R1) ==>   A(magic),A(inputbuffer),A(inputlength)<== high bit set on the third 
fullword

 OR (the fully specified case):

 rc = THEFUNCTION(magic,inputbuffer,inputlength,outputbuffer,outputlength)

 (R1) ==>   
A(magic),A(inputbuffer),A(inputlength),A(outputbuffer),A(outputlength)<== high bit 
set on the fifth fullword

 Pretty standard, yes?

 ----------------------------------------------------------------------
 For IBM-MAIN subscribe / signoff / archive access instructions,
 send email to lists...@bama.ua.edu with the message: INFO IBM-MAIN



----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to lists...@bama.ua.edu with the message: INFO IBM-MAIN

Reply via email to