Erlang/OTP Forums

Author Message

<  User Contributions  ~  Generic Erlang Port [Driver] Version 0.6

mtruog
Posted: Mon Feb 16, 2009 4:00 am Reply with quote
User Joined: 07 Feb 2009 Posts: 50 Location: San Francisco, CA
GENERIC ERLANG PORT [DRIVER] (GEP[D]), VERSION 0.6

PURPOSE
-------------------------------------------------
To automatically generate an Erlang port driver or Erlang port
for C/C++ bindings using a single self-contained file.

Files:
test_bindings.h contains the ONLY configuration to support the C functions in
test_functions.h and test_functions.c

test_bindings.erl provides the gen_server to manage the port or port driver
erlang_functions_hrl.h creates the erlang function interface
port_driver.cpp and port_driver.h provide the Erlang port driver implementation
port.cpp and port.h provide the Erlang port implementation

Whether PORT_DRIVER_NAME_PREFIX or PORT_NAME_PREFIX is defined determines
if a port driver or port is used, respectively (in test_bindings.h).
If both are defined, a port driver is used.

Features:
- a function binding with only a single line tuple
- efficient passing of function types with no intermediate character buffer
- functionality like the Erlang Driver Tool Kit (EDTK) (no fd handling though)
- macro expansion to avoid code duplication errors
- floating point type handling

Caveat:
The generated port driver code can not be used for hot code updating
if any of the functions are marked asynchronous, since that causes
the driver to use the async thread pool, which locks the driver
(making it "permanent") with driver_lock_driver()
(http://erlang.org/doc/man/erl_driver.html#driver_lock_driver).
With the driver locked, there is no possibility that an async
operation would create instability after a hot code update.

Subversion Link:
http://emuddy.svn.sourceforge.net/viewvc/emuddy/lib/emuddy/src/gepd/

LICENSE
-------------------------------------------------
BSD license



gepd-v0.6.tar.gz
 Description:
Generic Erlang Port [Driver] Version 0.6

Download
 Filename:  gepd-v0.6.tar.gz
 Filesize:  18.05 KB
 Downloaded:  1274 Time(s)

View user's profile Send private message AIM Address Yahoo Messenger

Display posts from previous:  

All times are GMT
Page 1 of 1
This forum is locked: you cannot post, reply to, or edit topics.

Jump to:  

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum