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

« back to all changes in this revision

Viewing changes to erts/emulator/test/port_bif_SUITE_data/control_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
#include <stdio.h>
2
2
#include <stdlib.h>
 
3
#include <string.h>
3
4
#include "erl_driver.h"
4
5
 
5
6
 
6
7
static ErlDrvPort erlang_port;
7
8
static ErlDrvData control_start(ErlDrvPort, char*);
8
9
static void control_stop(ErlDrvData);
9
 
static void control_read(ErlDrvData, char*, int);
10
 
static int control_control(ErlDrvData, unsigned int, char*, int, char**, int);
 
10
static void control_read(ErlDrvData, char*, ErlDrvSizeT);
 
11
static ErlDrvSSizeT control_control(ErlDrvData, unsigned int, char*,
 
12
                                    ErlDrvSizeT, char**, ErlDrvSizeT);
11
13
 
12
14
static ErlDrvEntry control_driver_entry =
13
15
{
21
23
    NULL,
22
24
    NULL,
23
25
    control_control,
24
 
    NULL,
25
 
    NULL,
26
 
    NULL
 
26
    NULL, /* timeout */
 
27
    NULL, /* outputv */
 
28
    NULL, /* ready_async */
 
29
    NULL,
 
30
    NULL,
 
31
    NULL,
 
32
    ERL_DRV_EXTENDED_MARKER,
 
33
    ERL_DRV_EXTENDED_MAJOR_VERSION,
 
34
    ERL_DRV_EXTENDED_MINOR_VERSION,
 
35
    0,
 
36
    NULL,
 
37
    NULL,
 
38
    NULL,
27
39
};
28
40
 
29
41
DRIVER_INIT(control_drv)
41
53
    return (ErlDrvData)port;
42
54
}
43
55
 
44
 
static void control_read(ErlDrvData port, char *buf, int count)
 
56
static void control_read(ErlDrvData port, char *buf, ErlDrvSizeT count)
45
57
{
46
58
    driver_output(erlang_port, buf, count);
47
59
}
51
63
    erlang_port = (ErlDrvPort)-1;
52
64
}
53
65
 
54
 
static int control_control(ErlDrvData port, unsigned command, char* buf, int count,
55
 
                           char** res, int res_size)
 
66
static ErlDrvSSizeT control_control(ErlDrvData port, unsigned command,
 
67
                                    char* buf, ErlDrvSizeT count,
 
68
                                    char** res, ErlDrvSizeT res_size)
56
69
{
57
70
    switch (command) {
58
71
    case 'e':