~ubuntu-branches/ubuntu/lucid/erlang/lucid-updates

« back to all changes in this revision

Viewing changes to erts/emulator/test/driver_SUITE_data/sys_info_1_0_drv.c

  • Committer: Elliot Murphy
  • Date: 2009-12-22 02:56:21 UTC
  • mfrom: (3.3.5 sid)
  • Revision ID: elliot@elliotmurphy.com-20091222025621-qv3rja8gbpiabkbe
Tags: 1:13.b.3-dfsg-2ubuntu1
* Merge with Debian testing; remaining Ubuntu changes:
  - Drop libwxgtk2.8-dev build dependency. Wx isn't in main, and not
    supposed to. (LP #438365)
  - Drop erlang-wx binary.
  - Drop erlang-wx dependency from -megaco, -common-test, and -reltool, they
    do not really need wx. Also drop it from -debugger; the GUI needs wx,
    but it apparently has CLI bits as well, and is also needed by -megaco,
    so let's keep the package for now.
* Fixed dialyzer(1) manpage which was placed into section 3 and conflicted
  with dialyzer(3erl).
* New upstream release (it adds a new binary package erlang-erl-docgen).
* Refreshed patches, removed most of emacs.patch which is applied upstream.
* Linked run_test binary from erlang-common-test package to /usr/bin.
* Fixed VCS headers in debian/control.
* Moved from prebuilt manpages to generated from sources. This adds
  erlang-manpages binary package and xsltproc build dependency.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/* ``The contents of this file are subject to the Erlang Public License,
 
2
 * Version 1.1, (the "License"); you may not use this file except in
 
3
 * compliance with the License. You should have received a copy of the
 
4
 * Erlang Public License along with this software. If not, it can be
 
5
 * retrieved via the world wide web at http://www.erlang.org/.
 
6
 * 
 
7
 * Software distributed under the License is distributed on an "AS IS"
 
8
 * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
 
9
 * the License for the specific language governing rights and limitations
 
10
 * under the License.
 
11
 * 
 
12
 * The Initial Developer of the Original Code is Ericsson Utvecklings AB.
 
13
 * Portions created by Ericsson are Copyright 1999, Ericsson Utvecklings
 
14
 * AB. All Rights Reserved.''
 
15
 * 
 
16
 *     $Id$
 
17
 */
 
18
 
 
19
/*
 
20
 * Author: Rickard Green
 
21
 *
 
22
 * Description: Driver that fakes driver version 1.0 and tests
 
23
 *              driver_system_info().
 
24
 *
 
25
 */
 
26
 
 
27
#include "sys_info_drv_impl.h"
 
28
 
 
29
#define SYS_INFO_DRV_MAJOR_VSN          1
 
30
#define SYS_INFO_DRV_MINOR_VSN          0
 
31
#define SYS_INFO_DRV_NAME_STR           "sys_info_1_0_drv"
 
32
#define SYS_INFO_DRV_NAME               sys_info_1_0_drv
 
33
#define SYS_INFO_DRV_LAST_FIELD         smp_support
 
34
 
 
35
#define SYS_INFO_DRV_RES_FORMAT "ok: "  \
 
36
  "drv_drv_vsn=%d.%d "                  \
 
37
  "emu_drv_vsn=%d.%d "                  \
 
38
  "erts_vsn=%s "                        \
 
39
  "otp_vsn=%s "                         \
 
40
  "thread=%s "                          \
 
41
  "smp=%s"
 
42
 
 
43
 
 
44
static size_t
 
45
sys_info_drv_max_res_len(ErlDrvSysInfo *sip)
 
46
{
 
47
    size_t slen = strlen(SYS_INFO_DRV_RES_FORMAT) + 1;
 
48
    slen += 2*20;       /* drv_drv_vsn */
 
49
    slen += 2*20;       /* emu_drv_vsn */
 
50
    slen += strlen(sip->erts_version) + 1;
 
51
    slen += strlen(sip->otp_release) + 1;
 
52
    slen += 5;          /* threads */
 
53
    slen += 5;          /* smp */
 
54
    return slen;
 
55
}
 
56
 
 
57
static size_t
 
58
sys_info_drv_sprintf_sys_info(ErlDrvSysInfo *sip, char *str)
 
59
{
 
60
    return sprintf(str,
 
61
                   SYS_INFO_DRV_RES_FORMAT,
 
62
                   SYS_INFO_DRV_MAJOR_VSN,
 
63
                   SYS_INFO_DRV_MINOR_VSN,
 
64
                   sip->driver_major_version,
 
65
                   sip->driver_minor_version,
 
66
                   sip->erts_version,
 
67
                   sip->otp_release,
 
68
                   sip->thread_support ? "true" : "false",
 
69
                   sip->smp_support ? "true" : "false");
 
70
}
 
71
 
 
72
#include "sys_info_drv_impl.c"