Passing NULL to a c function

new topic     » topic index » view thread      » older message » newer message

------=_NextPart_000_0007_01BF8EA4.1F8D5500
        charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

Hi All.

I have a problem with the following wrapper function for Morfit for EU


global function Morfit_engine_load_world( sequence world_file_name, =
sequence world_directory_path, sequence bitmaps_directory_path, atom =
world_mode)
    -- int Morfit_engine_load_world(char *world_file_name, char =
*world_directory_path, char *bitmaps_directory_path, =20
   --                                                        int  =
world_mode)
    return =
                       allocate_string(world_directory_path),
                       allocate_string(bitmaps_directory_path),
                       world_mode})
end function


The above function can be called something like this (and works fine) :-

 funcval =3D =
SER_DEFINED_BEHAVIOR)


The problem I have is that I need to call it like this :-

Morfit_engine_load_world(NULL,NULL,NULL, EDITOR_MODE);  <-- the way you =
could call it in C=20

My question is how can I pass the "NULL" pointers using the wrapper. Am =
I going to have to do a test and have a function call with the =
allocate_string stuff and then another function call for the NULL's?? =
(perhaps test the sequences for an empty sequence or something?). Or is =
there a "NULL" character I can pass.....??=20

This is beyond my C knowledge. Any ideas would be greatly appreciated.

Mark Brown

mabrown at senet.com.au
=20

------=_NextPart_000_0007_01BF8EA4.1F8D5500
        charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META content=3D"text/html; charset=3Diso-8859-1" =
http-equiv=3DContent-Type>
<META content=3D"MSHTML 5.00.2314.1000" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=3D#ffffff>
<DIV><FONT size=3D2>Hi All.</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT size=3D2>I have a problem with the following wrapper function =
for=20
Morfit for EU</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT size=3D2>global function Morfit_engine_load_world( sequence=20
world_file_name, sequence world_directory_path, sequence =
bitmaps_directory_path,=20
atom world_mode)<BR>&nbsp;&nbsp;&nbsp; -- int =
Morfit_engine_load_world(char=20
*world_file_name, char *world_directory_path, char=20
*bitmaps_directory_path,&nbsp; </FONT></DIV>
<DIV><FONT size=3D2>&nbsp;&nbsp;=20
bsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
int&nbsp;&nbsp;world_mode)<BR>&nbsp;&nbsp;&nbsp; return=20
bsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
world_mode})<BR>end function</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT size=3D2>The above function can be called something like this =
(and=20
works fine) :-</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT size=3D2>&nbsp;funcval =3D=20
SER_DEFINED_BEHAVIOR)</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT size=3D2>The problem I have is that I need to call it like =
this=20
:-</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT size=3D2>Morfit_engine_load_world(NULL,NULL,NULL, =
EDITOR_MODE);&nbsp;=20
&lt;-- the way you could call it in C </FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT size=3D2>My question is how can I pass the "NULL" pointers =
using the=20
wrapper. Am I going to have to do a test and have a function call with =
the=20
allocate_string stuff and then another function call for the NULL's?? =
(perhaps=20
test the sequences for an empty sequence or something?). Or is there a =
"NULL"=20
character I can pass.....?? </FONT></DIV>
<DIV><FONT size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT size=3D2>This is beyond my C knowledge. Any ideas would be =
greatly=20
appreciated.</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT size=3D2>Mark Brown</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT size=3D2><A=20
>

------=_NextPart_000_0007_01BF8EA4.1F8D5500--

new topic     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu