Skip to content


Subversion checkout URL

You can clone with
Download ZIP
Commits on Dec 11, 2012
  1. @vinoski

    revise driver to use port_control, and add close/1

    vinoski authored
    Use port_control and port_call instead of just port_command to communicate
    with the port driver. The port_control and port_call functions include a
    command integer argument that makes it easy to send specific commands to
    the driver, rather than encoding the commands as atoms in external
    format. They also allow for the easy return of simple terms in their
    preallocated return buffers. They also allow simple constants to be
    returned from the driver for badarg and other general errors. The log
    function still uses port_command, but sends an iolist for priority and
    message data rather than encoding to external format.
    Change open to return a new port, and change the log functions to take the
    log port returned from open as its first argument.
    Add a new variant of the log function that takes a format string and a list
    of format arguments. Drop the timeout argument to log, since it no longer
    is meaningful.
    Add a close/1 function to close the log.
    Modify the determination of the path to the driver shared library, making
    it match idiomatic code used for NIFs and drivers in other components.
    Add checking of the return values from the ei encoding and decoding
    functions in the driver code.
    Use driver_alloc and driver_free in the driver code rather than malloc and
    free. Also add checks for memory allocation failures.
    Use static initialization for the ErlDrvEntry struct. Remove the creation
    of driver atom constants that were no longer used.
    Add a test to verify that logging on a log that's already been closed
    returns an error.
Commits on Feb 8, 2011
Commits on Aug 10, 2010
  1. @athoune

    markdown doc

    athoune authored
Something went wrong with that request. Please try again.