~clint-fewbar/ubuntu/precise/erlang/merge-15b

« back to all changes in this revision

Viewing changes to lib/erl_interface/test/port_call_SUITE_data/port_call_drv.c

  • Committer: Package Import Robot
  • Author(s): Sergei Golovan
  • Date: 2011-12-15 19:20:10 UTC
  • mfrom: (1.1.18) (3.5.15 sid)
  • mto: (3.5.16 sid)
  • mto: This revision was merged to the branch mainline in revision 33.
  • Revision ID: package-import@ubuntu.com-20111215192010-jnxcfe3tbrpp0big
Tags: 1:15.b-dfsg-1
* New upstream release.
* Upload to experimental because this release breaks external drivers
  API along with ABI, so several applications are to be fixed.
* Removed SSL patch because the old SSL implementation is removed from
  the upstream distribution.
* Removed never used patch which added native code to erlang beam files.
* Removed the erlang-docbuilder binary package because the docbuilder
  application was dropped by upstream.
* Documented dropping ${erlang-docbuilder:Depends} substvar in
  erlang-depends(1) manpage.
* Made erlang-base and erlang-base-hipe provide virtual package
  erlang-abi-15.b (the number means the first erlang version, which
  provides current ABI).

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/*
2
2
 * %CopyrightBegin%
3
3
 * 
4
 
 * Copyright Ericsson AB 2001-2009. All Rights Reserved.
 
4
 * Copyright Ericsson AB 2001-2011. All Rights Reserved.
5
5
 * 
6
6
 * The contents of this file are subject to the Erlang Public License,
7
7
 * Version 1.1, (the "License"); you may not use this file except in
18
18
 */
19
19
 
20
20
#include <stdio.h>
 
21
#include <string.h>
 
22
#include <stdlib.h>
21
23
#include "erl_interface.h"
22
24
#include "erl_driver.h"
23
25
 
24
26
static ErlDrvPort my_erlang_port;
25
27
static ErlDrvData echo_start(ErlDrvPort, char *);
26
 
static void from_erlang(ErlDrvData, char*, int);
27
 
static int do_call(ErlDrvData drv_data, unsigned int command, char *buf, 
28
 
                     int len, char **rbuf, int rlen, unsigned *ret_flags);
 
28
static void from_erlang(ErlDrvData, char*, ErlDrvSizeT);
 
29
static ErlDrvSSizeT do_call(ErlDrvData drv_data, unsigned int command,
 
30
                            char *buf, ErlDrvSizeT len, char **rbuf,
 
31
                            ErlDrvSizeT rlen, unsigned *ret_flags);
29
32
static ErlDrvEntry echo_driver_entry = { 
30
33
    NULL,                       /* Init */
31
34
    echo_start,
41
44
    NULL,
42
45
    NULL,
43
46
    NULL,
44
 
    do_call
 
47
    do_call,
 
48
    NULL,
 
49
    ERL_DRV_EXTENDED_MARKER,
 
50
    ERL_DRV_EXTENDED_MAJOR_VERSION,
 
51
    ERL_DRV_EXTENDED_MINOR_VERSION,
 
52
    0,
 
53
    NULL,
 
54
    NULL,
 
55
    NULL,
45
56
};
46
57
 
47
58
DRIVER_INIT(echo_drv)
56
67
}
57
68
 
58
69
static void
59
 
from_erlang(ErlDrvData data, char *buf, int count)
 
70
from_erlang(ErlDrvData data, char *buf, ErlDrvSizeT count)
60
71
{
61
72
    driver_output((ErlDrvPort) data, buf, count);
62
73
}
63
74
 
64
 
static int 
 
75
static ErlDrvSSizeT
65
76
do_call(ErlDrvData drv_data, unsigned int command, char *buf, 
66
 
          int len, char **rbuf, int rlen, unsigned *ret_flags) 
 
77
          ErlDrvSizeT len, char **rbuf, ErlDrvSizeT rlen, unsigned *ret_flags) 
67
78
{
68
79
    int nlen;
69
80
    ei_x_buff x;