[comp.unix.xenix] Xenix BASIC string parameters

ray@dsiramd.dsir.govt.nz (Ray Brownrigg) (06/08/89)

I post this message on behalf of the person represented by the mail address
below. Please respond directly by E-mail to him. He will summarise and I
will post his summary (as you may guess he does not have direct access to
Usenet yet).

We have a client here who has developed BASIC libraries and wants
to interface them to Btrieve under Xenix. This means being able to call
C modules from BASIC but there are two problems with this - the first is
that the BASIC compiler cannot find the underscore character which begins
each C object module name, and the second is that passing BASIC string
variables means that a 4-byte address of a string descriptor is passed to
C; the string length is available in the first two bytes of the descriptor
and the next two bytes are the string's address - but a large model program
uses 4-byte addresses.

The first problem can be solved using the fixhdr command to translate the
underscore character, but the second problem does not have a simple solution.

Does anybody have any general information concerning calling C from BASIC or
string-passing from BASIC ( to other languages ) in general?

Please respond directly to:
	derek%phoenix.co.nz@marcamd.dsir.govt.nz
-- 
Ray Brownrigg			domain: ray@dsiramd.dsir.govt.nz
Applied Maths Div, DSIR		ACSnet:	ray@dsiramd.nz[@munnari]
PO Box 1335			System:	OLIVETTI/AT&T 3B2/400B+, System V R3.0
Wellington, New Zealand			"unx -rules -OK"
Newsgroups: comp.unix.xenix,comp.unix.questions
Subject: Xenix BASIC string parameters
Expires: 
References: 
Sender: 
Reply-To: ray@dsiramd.dsir.govt.nz (Ray Brownrigg)
Followup-To: 
Distribution: world
Organization: DSIR Applied Mathematics Division, Wellington, NZ
Keywords: 

I post this message on behalf of the person represented by the mail address
below. Please respond directly by E-mail to him. He will summarise and I
will post his summary (as you may guess he does not have direct access to
Usenet yet).

We have a client here who has developed BASIC libraries and wants
to interface them to Btrieve under Xenix. This means being able to call
C modules from BASIC but there are two problems with this - the first is
that the BASIC compiler cannot find the underscore character which begins
each C object module name, and the second is that passing BASIC string
variables means that a 4-byte address of a string descriptor is passed to
C; the string length is available in the first two bytes of the descriptor
and the next two bytes are the string's address - but a large model program
uses 4-byte addresses.

The first problem can be solved using the fixhdr command to translate the
underscore character, but the second problem does not have a simple solution.

Does anybody have any general information concerning calling C from BASIC or
string-passing from BASIC ( to other languages ) in general?

Please respond directly to:
	derek%phoenix.co.nz@marcamd.dsir.govt.nz
-- 
Ray Brownrigg			domain: ray@dsiramd.dsir.govt.nz
Applied Maths Div, DSIR		ACSnet:	ray@dsiramd.nz[@munnari]
PO Box 1335			System:	OLIVETTI/AT&T 3B2/400B+, System V R3.0
Wellington, New Zealand			"unx -rules -OK"