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

« back to all changes in this revision

Viewing changes to erts/emulator/beam/erl_binary.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 2000-2010. All Rights Reserved.
 
4
 * Copyright Ericsson AB 2000-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
71
71
 */
72
72
 
73
73
#define binary_size(Bin) (binary_val(Bin)[1])
 
74
#define binary_size_rel(Bin,BasePtr) (binary_val_rel(Bin,BasePtr)[1])
74
75
 
75
76
#define binary_bitsize(Bin)                     \
76
77
  ((*binary_val(Bin) == HEADER_SUB_BIN) ?       \
93
94
 * Bitsize: output variable (Uint)
94
95
 */
95
96
 
96
 
#define ERTS_GET_BINARY_BYTES(Bin,Bytep,Bitoffs,Bitsize)                \
 
97
#define ERTS_GET_BINARY_BYTES(Bin,Bytep,Bitoffs,Bitsize) \
 
98
     ERTS_GET_BINARY_BYTES_REL(Bin,Bytep,Bitoffs,Bitsize,NULL)
 
99
 
 
100
#define ERTS_GET_BINARY_BYTES_REL(Bin,Bytep,Bitoffs,Bitsize,BasePtr)    \
97
101
do {                                                                    \
98
 
    Eterm* _real_bin = binary_val(Bin);                                 \
 
102
    Eterm* _real_bin = binary_val_rel(Bin,BasePtr);                     \
99
103
    Uint _offs = 0;                                                     \
100
104
    Bitoffs = Bitsize = 0;                                              \
101
105
    if (*_real_bin == HEADER_SUB_BIN) {                                 \
103
107
        _offs = _sb->offs;                                              \
104
108
        Bitoffs = _sb->bitoffs;                                         \
105
109
        Bitsize = _sb->bitsize;                                         \
106
 
        _real_bin = binary_val(_sb->orig);                              \
 
110
        _real_bin = binary_val_rel(_sb->orig,BasePtr);                  \
107
111
    }                                                                   \
108
112
    if (*_real_bin == HEADER_PROC_BIN) {                                \
109
113
        Bytep = ((ProcBin *) _real_bin)->bytes + _offs;                 \
125
129
 * BitSize: Extra bit size (Uint)
126
130
 */
127
131
 
128
 
#define ERTS_GET_REAL_BIN(Bin, RealBin, ByteOffset, BitOffset, BitSize) \
 
132
#define ERTS_GET_REAL_BIN(Bin, RealBin, ByteOffset, BitOffset, BitSize) \
 
133
     ERTS_GET_REAL_BIN_REL(Bin, RealBin, ByteOffset, BitOffset, BitSize, NULL)
 
134
 
 
135
#define ERTS_GET_REAL_BIN_REL(Bin, RealBin, ByteOffset, BitOffset, BitSize, BasePtr) \
129
136
  do {                                                                  \
130
 
    ErlSubBin* _sb = (ErlSubBin *) binary_val(Bin);                     \
 
137
    ErlSubBin* _sb = (ErlSubBin *) binary_val_rel(Bin,BasePtr);         \
131
138
    if (_sb->thing_word == HEADER_SUB_BIN) {                            \
132
139
      RealBin = _sb->orig;                                              \
133
140
      ByteOffset = _sb->offs;                                           \