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

« back to all changes in this revision

Viewing changes to erts/emulator/beam/erl_nif.h

  • 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 2009-2010. All Rights Reserved.
 
4
 * Copyright Ericsson AB 2009-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
30
30
** 0.1: R13B03
31
31
** 1.0: R13B04
32
32
** 2.0: R14A
 
33
** 2.1: R14B02 "vm_variant"
 
34
** 2.2: R14B03 enif_is_exception
 
35
** 2.3: R15 enif_make_reverse_list
33
36
*/
34
37
#define ERL_NIF_MAJOR_VERSION 2
35
 
#define ERL_NIF_MINOR_VERSION 0
 
38
#define ERL_NIF_MINOR_VERSION 3
36
39
 
37
40
#include <stdlib.h>
38
41
 
80
83
#endif
81
84
 
82
85
#ifdef HALFWORD_HEAP_EMULATOR
 
86
#  define ERL_NIF_VM_VARIANT "beam.halfword" 
83
87
typedef unsigned int ERL_NIF_TERM;
84
88
#else
 
89
#  define ERL_NIF_VM_VARIANT "beam.vanilla" 
 
90
#  if SIZEOF_LONG == SIZEOF_VOID_P
85
91
typedef unsigned long ERL_NIF_TERM;
 
92
#  elif SIZEOF_LONG_LONG == SIZEOF_VOID_P
 
93
typedef unsigned long long ERL_NIF_TERM;
 
94
#  endif
86
95
#endif
87
96
 
88
97
struct enif_environment_t;
105
114
    int  (*load)   (ErlNifEnv*, void** priv_data, ERL_NIF_TERM load_info);
106
115
    int  (*reload) (ErlNifEnv*, void** priv_data, ERL_NIF_TERM load_info);
107
116
    int  (*upgrade)(ErlNifEnv*, void** priv_data, void** old_priv_data, ERL_NIF_TERM load_info);
108
 
    void (*unload) (ErlNifEnv*, void* priv_data);    
 
117
    void (*unload) (ErlNifEnv*, void* priv_data);
 
118
    const char* vm_variant;
109
119
}ErlNifEntry;
110
120
 
111
121
 
198
208
#define ERL_NIF_INIT(NAME, FUNCS, LOAD, RELOAD, UPGRADE, UNLOAD) \
199
209
ERL_NIF_INIT_PROLOGUE                   \
200
210
ERL_NIF_INIT_GLOB                       \
 
211
ERL_NIF_INIT_DECL(NAME);                \
201
212
ERL_NIF_INIT_DECL(NAME)                 \
202
213
{                                       \
203
214
    static ErlNifEntry entry =          \
207
218
        #NAME,                          \
208
219
        sizeof(FUNCS) / sizeof(*FUNCS), \
209
220
        FUNCS,                          \
210
 
        LOAD, RELOAD, UPGRADE, UNLOAD   \
 
221
        LOAD, RELOAD, UPGRADE, UNLOAD,  \
 
222
        ERL_NIF_VM_VARIANT              \
211
223
    };                                  \
212
224
    ERL_NIF_INIT_BODY;                  \
213
225
    return &entry;                      \