TIP: Click on subject to list as thread! ANSI
echo: os2prog
to: All
from: Henk den Adel
date: 1994-08-28 14:52:52
subject: REXX extensions in BC4OS/2

Hi All,

Has anyone succeeded to produce a REXX callable .DLL using Borlands C++
compiler (1.0) for OS/2? The floating point handling is not loaded and
cannot be loaded, even if explicitedly demanded. String manipulation works
fine, but floats cannot be handled. 

Strangely, the same code (slightly modified to remove errors at
compilation) run through IBM's Cset compiler (2.01) does produce a working
.DLL, so imho something must be wrong in Borlands float implementation, or
I've missed some point.

Has anyone got a clue?

______________________________ Code 4 Borland _________________________________

#define INCL_REXXSAA
#include 
#include 
#include 
#include 
#include 
#include 
#include 

#pragma extref _floatconvert

ULONG _export APIENTRY HenksFuncties();
ULONG _export APIENTRY wortel();
ULONG _export APIENTRY vulop();


ULONG _export APIENTRY wortel(PSZ name, ULONG argc, RXSTRING args[],
              PSZ queuename, RXSTRING *retstring)
{
   double waarde=1.0;

   waarde = waarde/3.0;

   waarde = sqrt(waarde);

   sscanf(args[0].strptr,"%lf", &waarde);
   waarde = waarde*62;

   sprintf(retstring->strptr,"%lf", waarde);
   retstring->strlength = strlen(retstring->strptr);
   return (0);
}


ULONG _export APIENTRY vulop(PSZ name, ULONG argc, RXSTRING args[],
              PSZ queuename, RXSTRING *retstring)
{
   int     i, aantal;
   char    c;
        

   sscanf(args[0].strptr,"%ld", &aantal);
   sscanf(args[1].strptr,"%c", &c);

   if ( aantal < 256)
     {
     for ( i=0; istrptr + i) = c;
       }
     }
   retstring->strlength = aantal;
   return (0);
}


ULONG _export APIENTRY HenksFuncties(PSZ name, ULONG argc, RXSTRING args[],
              PSZ queuename, RXSTRING *retstring)
   {
   int     rc;
   retstring->strlength = 0;

   if (argc>0)
     return 40;

   RexxRegisterFunctionDll("wortel", "HENKUTIL",
"wortel");
   RexxRegisterFunctionDll("vulop", "HENKUTIL",
"vulop");

   return 0;
   }


_________________________  End Code __________________________________________

d:\b2\bin\bcc -c %1.cc 
d:\b2\bin\tlink /Ld:\b2\lib /Tod %1,%1.dll , prof.lst, c2i os2.lib
c:\os2\doscalls.lib rexxapi.lib

_________________________  End compilation ____________________________________





Cuagn,
 Henk                  (AKA: adel{at}delftgeot.nl)

--- The-Box Point 0.15+ PC


* Origin: Lobster BBS voor programmeurs 0104271432 (2:286/300.1)
SEEN-BY: 12/2442 54/54 620/243 624/50 632/348 640/820 690/660 711/409 410 413
SEEN-BY: 711/430 807 808 809 934 712/353 623 713/888 800/1
@PATH: 286/3 10 280/0 801 24/24 396/1 3615/50 229/2 12/2442
@PATH: 711/409 54/54 711/808 809 934

SOURCE: echomail via fidonet.ozzmosis.com

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.