Hello, Factor talk;
I am trying to use the alien interface and how to pass parameters to the C
function calls.
Here are my C functions (mysql)
FUNCTION: MYSQL* mysql_init ( MYSQL* mysql ) ;
FUNCTION: MYSQL* mysql_real_connect(MYSQL* mysql, char* host, char* user,
char* passwd, char* db, int port, char* unix_socket, long clientflag ) ;
The Factor code:
: init-mysql ( -- conn )
f mysql_init ;
I am having an issue with the word definition below, getting the right
parameters to the C function call.
: connect-mysql ( host user passwd db port -- )
#! Now, hard code the rest of the parameters
#! How do I set it up to have the values above, the hard-coded values,
#! passed to the 'mysql_real_connect' function
>r init-mysql r> swap f 0 mysql_real_connect ;
The error is basically saying that I am passing a fixnum when it expects a
string, etc.
What am I missing?
--
Berlin Brown
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Factor-talk mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/factor-talk