HP3000-L Archives

March 2004, Week 1

HP3000-L@RAVEN.UTC.EDU

Options: Use Monospaced Font
Show Text Part by Default
Show All Mail Headers

Message: [<< First] [< Prev] [Next >] [Last >>]
Topic: [<< First] [< Prev] [Next >] [Last >>]
Author: [<< First] [< Prev] [Next >] [Last >>]

Print Reply
Subject:
From:
Keven Miller <[log in to unmask]>
Reply To:
Keven Miller <[log in to unmask]>
Date:
Mon, 1 Mar 2004 16:09:55 -0700
Content-Type:
text/plain
Parts/Attachments:
text/plain (61 lines)
For any who may be creating C code that runs on MPE as well
as other platforms, a heads up on calling option extensible
intrinsics like HPGETPROCPTR, HPFOPEN.... 

When calling an option extensible procedure, the first
parameter is a count of the number of parameters you are
passing to that intrinsic -- generated by your compiler,
in my case, HP-C.

I'm developing on MPE/iX 6.0 pp2
MON MAR  1 2004  3:56 PM  Copyright Hewlett-Packard Co.  1984. PAGE     1
HP C/iX HP31506 A.05.19                                          "$STDIN"



HP-C seems to count all parameters that are provided with a
leading comma -- even those that are missing.

   HPGETPROCPTR ( name, &ptr, ierr, libstring, 1,,,,,);

This counts 10 parameters.

This might be of interest due to the runtime abort we get
when calling HPGETPROCPTR this way with only 5 parameters
but it being told 10.


<detail-on>
We are using GCC on other platforms as our C compiler.
GCC doesn't understand the idea of missing parameters or
MPE intrinsics. So all must be provided.

We have defined in C the following
#ifdef  __mpexl
#define NOARG
#define EXTCNT(n)
#else
#define NOARG           0
#define EXTCNT(n)       n,
#endif

The idea being that the same source code should compile on
MPE and the other platforms.
        HPGETPROCPTR ( EXTCNT(5) name, &ptr, ierr, libstring, 1,
           NOARG, NOARG, NOARG, NOARG, NOARG );

On MPE, we thought, this would call the intrinsic with only 5
parameters. For other intrinsics that are option variable
but not extensible, like FOPEN, it appears to work well.

On HPUX or other platforms, a zero is passed as the NOARG parameter.
Option extensible intrinsics get a parameter count as the
first parameter.
</detail-on>

___________________________________________________________________
Keven Miller   mailto:[log in to unmask]   http://www.exegesys.com

* To join/leave the list, search archives, change list settings, *
* etc., please visit http://raven.utc.edu/archives/hp3000-l.html *

ATOM RSS1 RSS2