Re: Interfacing to C (variable argument list)

From: [at]} <pfister{>
Date: Tue, 4 Jul 2000 19:44:36 +0200

> ----- Original Message -----
> From: "Bernhard Treutwein" <jule{([at]})nowhere.xy
> To: <blackbox{([at]})nowhere.xy
> Sent: Sunday, July 02, 2000 12:23 PM
> Subject: Interfacing to C (variable argument list)
>
>
> > Hi folks,
> >
> > is there any chance to interface to variable argument lists
> > from CP, e.g.,
> >
> > printf ( format : ARRAY OF SHORTCHAR; arg0 ... : ANYPTR );
> >
> > or
> >
> > printf ( format : ARRAY OF SHORTCHAR; args : ARRAY OF ? );
> >

A separate definition is needed for every used signature:

PROCEDURE [ccall] printf0* ["printf"] (format : POINTER TO ARRAY [untagged]
OF SHORTCHAR);

PROCEDURE [ccall] printf1* ["printf"] (format : POINTER TO ARRAY [untagged]
OF SHORTCHAR; i: INTEGER);

PROCEDURE [ccall] printf2* ["printf"] (format : POINTER TO ARRAY [untagged]
OF SHORTCHAR; i, j: INTEGER);

PROCEDURE [ccall] printf3* ["printf"] (format : POINTER TO ARRAY [untagged]
OF SHORTCHAR; x: REAL);

etc.

The [ccall] switches to caller-removed parameters, which is mandatory for
open parameter lists.


Beat Heeb, Cuno Pfister

Oberon microsystems, Inc.


--------------------------------------------

To unsubscribe from this mailing list, send a message containing the word "unsubscribe" to:
   blackbox-request{([at]})nowhere.xy

To get a list of valid e-mail commands and instructions on their usage, send a message containing the word "help" to the above address.

Send any problem reports or questions related to this email list to the list owner at
   owner-blackbox{([at]})nowhere.xy
Received on Tue Jul 04 2000 - 17:44:36 UTC

This archive was generated by hypermail 2.3.0 : Thu Sep 26 2013 - 06:27:45 UTC