<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
Per,<br>
sorry but I didn't mention I was thinking about a linked-in
driver; I read about
extending the environment, but was wondering if it can be done by
passing parameters; I guess the "char *buff" parameter on the C side
must have that purpose.<br>
Sebastian-<br>
<br>
Per Hedeland escribió:
<blockquote cite="mid200801292140.m0TLeAd0025665@pluto.hedeland.org"
type="cite">
<pre wrap="">Sebastian Bello <a class="moz-txt-link-rfc2396E" href="mailto:sebastian.bello@inswitch.us"><sebastian.bello@inswitch.us></a> wrote:
</pre>
<blockquote type="cite">
<pre wrap="">is there a way to pass parameters (maybe in the form of an Erlang term)
to a port driver while creating it (open_port)? My understanding is that
open_port launches the function
static ErlDrvData driver_start(ErlDrvPort port, char *buff)
on the port; what does "char *buff" contain?
</pre>
</blockquote>
<pre wrap=""><!---->
It's the complete Command string from open_port({spawn, Command}, ...) -
i.e. you can give that as "my_drv param1 param2" and the my_drv driver
will have its start() function invoked with that exact string as its
second argument (in C form of course:-). If you look at the
driver_entry(3) man page, the argument is called 'command', which
perhaps makes this a bit more obvious.
--Per Hedeland
_______________________________________________
erlang-questions mailing list
<a class="moz-txt-link-abbreviated" href="mailto:erlang-questions@erlang.org">erlang-questions@erlang.org</a>
<a class="moz-txt-link-freetext" href="http://www.erlang.org/mailman/listinfo/erlang-questions">http://www.erlang.org/mailman/listinfo/erlang-questions</a>
__________ NOD32 2833 (20080129) Information __________
This message was checked by NOD32 antivirus system.
<a class="moz-txt-link-freetext" href="http://www.eset.com">http://www.eset.com</a>
</pre>
</blockquote>
<br>
</body>
</html>