~ubuntu-branches/debian/squeeze/erlang/squeeze

« back to all changes in this revision

Viewing changes to lib/asn1/src/asn1rt_per_v1.erl

  • Committer: Bazaar Package Importer
  • Author(s): Erlang Packagers, Sergei Golovan
  • Date: 2006-12-03 17:07:44 UTC
  • mfrom: (2.1.11 feisty)
  • Revision ID: james.westby@ubuntu.com-20061203170744-rghjwupacqlzs6kv
Tags: 1:11.b.2-4
[ Sergei Golovan ]
Fixed erlang-base and erlang-base-hipe prerm scripts.

Show diffs side-by-side

added added

removed removed

Lines of Context:
735
735
            exit({error,{asn1,{encode_length,{nyi,above_16k}}}})
736
736
    end;
737
737
        
738
 
encode_length({0,'MAX'},Len) ->
 
738
encode_length({Lb,'MAX'},Len) when integer(Lb),Lb=<Len->
 
739
%    encode_semi_constrained_number(Lb,Len);
739
740
    encode_length(undefined,Len);
740
741
encode_length({Lb,Ub},Len) when Ub =< 65535 ,Lb >= 0 -> % constrained
741
742
    encode_constrained_number({Lb,Ub},Len);
778
779
 
779
780
decode_length(Buffer,{Lb,Ub}) when Ub =< 65535 ,Lb >= 0 -> % constrained
780
781
    decode_constrained_number(Buffer,{Lb,Ub});
 
782
decode_length(Buffer,{Lb,_Ub}) when integer(Lb),Lb>=0 -> %Ub > 64K or 'MAX'. It will work for length < 16K
 
783
    decode_length(Buffer,undefined);
781
784
 
782
785
decode_length(Buffer,{{Lb,Ub},[]}) -> 
783
786
    case getbit(Buffer) of
1201
1204
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1202
1205
 
1203
1206
encode_octet_string(C,{Name,Val}) when atom(Name) ->
1204
 
    encode_octet_string(C,false,Val);
 
1207
    encode_octet_string2(C,Val);
1205
1208
encode_octet_string(C,Val) ->
1206
 
    encode_octet_string(C,false,Val).
 
1209
    encode_octet_string2(C,Val).
1207
1210
 
1208
 
encode_octet_string(C,Bool,{_Name,Val}) ->
1209
 
    encode_octet_string(C,Bool,Val);
1210
 
encode_octet_string(_,true,_) -> 
1211
 
    exit({error,{asn1,{'not_supported',extensionmarker}}});
1212
 
encode_octet_string(C,false,Val) ->
 
1211
% encode_octet_string2(C,Bool,{_Name,Val}) ->
 
1212
%     encode_octet_string2(C,Bool,Val);
 
1213
encode_octet_string2(C,Val) ->
1213
1214
    case get_constraint(C,'SizeConstraint') of
1214
1215
        0 ->
1215
1216
            [];
1287
1288
    NumBits = get_NumBits(C,StringType),
1288
1289
    case get_constraint(C,'SizeConstraint') of
1289
1290
        Ub when integer(Ub), Ub*NumBits =< 16  ->
1290
 
            case {StringType,Result} of
1291
 
                {'BMPString',{octets,Ol}} ->
1292
 
                    [{bits,8,Oct}||Oct <- Ol];
1293
 
                _ ->
1294
 
                    Result
1295
 
            end;
 
1291
            Result;
1296
1292
        0 ->
1297
1293
            [];
1298
1294
        Ub when integer(Ub),Ub =<65535 -> % fixed length