diff options
Diffstat (limited to 'lib')
261 files changed, 15856 insertions, 9484 deletions
diff --git a/lib/.gitignore b/lib/.gitignore index a33916b3bf..340baf5269 100644 --- a/lib/.gitignore +++ b/lib/.gitignore @@ -128,6 +128,7 @@ /megaco/src/text/megaco_text_parser_v1.erl /megaco/src/text/megaco_text_parser_v2.erl /megaco/src/text/megaco_text_parser_v3.erl +/megaco/doc/html/mstone1.jpg # mnesia diff --git a/lib/appmon/src/appmon_web.erl b/lib/appmon/src/appmon_web.erl index e8a8422a80..fb7144246c 100644 --- a/lib/appmon/src/appmon_web.erl +++ b/lib/appmon/src/appmon_web.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2001-2009. All Rights Reserved. +%% Copyright Ericsson AB 2001-2010. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in @@ -38,12 +38,6 @@ %% webtool -export([configData/0]). - -%% The following directive caters for (significantly) faster native -%% code compilation of one function in this file by the HiPE compiler -%% on register-poor architectures like the x86. --compile([{hipe,[{regalloc,graph_color}]}]). - -behaviour(gen_server). %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% diff --git a/lib/appmon/vsn.mk b/lib/appmon/vsn.mk index cfcb5d3eb6..0675a4eb8b 100644 --- a/lib/appmon/vsn.mk +++ b/lib/appmon/vsn.mk @@ -1,19 +1 @@ -# -# %CopyrightBegin% -# -# Copyright Ericsson AB 1997-2010. All Rights Reserved. -# -# The contents of this file are subject to the Erlang Public License, -# Version 1.1, (the "License"); you may not use this file except in -# compliance with the License. You should have received a copy of the -# Erlang Public License along with this software. If not, it can be -# retrieved online at http://www.erlang.org/. -# -# Software distributed under the License is distributed on an "AS IS" -# basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See -# the License for the specific language governing rights and limitations -# under the License. -# -# %CopyrightEnd% - APPMON_VSN = 2.1.12 diff --git a/lib/asn1/src/asn1.appup.src b/lib/asn1/src/asn1.appup.src index 753d308684..2d11eddfbf 100644 --- a/lib/asn1/src/asn1.appup.src +++ b/lib/asn1/src/asn1.appup.src @@ -1,111 +1,9 @@ {"%VSN%", - [ - {"1.6.8", - [ - {load_module, asn1rt, soft_purge, soft_purge, []}, - {load_module, asn1rt_per_bin, soft_purge, soft_purge, []}, - {load_module, asn1rt_per_bin_rt2ct, soft_purge, soft_purge, []}, - {load_module, asn1rt_uper_bin, soft_purge, soft_purge, []}, - {load_module, asn1rt_ber_bin, soft_purge, soft_purge, []}, - {load_module, asn1rt_ber_bin_v2, soft_purge, soft_purge, []}, - {load_module, asn1rt_check, soft_purge, soft_purge, []}, - {load_module, asn1rt_driver_handler, soft_purge, soft_purge, []}, - {apply, {asn1rt_driver_handler,unload_driver,[]}} - ] - }, - {"1.6.8.1", - [ - {load_module, asn1rt, soft_purge, soft_purge, []}, - {load_module, asn1rt_per_bin, soft_purge, soft_purge, []}, - {load_module, asn1rt_per_bin_rt2ct, soft_purge, soft_purge, []}, - {load_module, asn1rt_uper_bin, soft_purge, soft_purge, []}, - {load_module, asn1rt_ber_bin, soft_purge, soft_purge, []}, - {load_module, asn1rt_ber_bin_v2, soft_purge, soft_purge, []}, - {load_module, asn1rt_check, soft_purge, soft_purge, []}, - {load_module, asn1rt_driver_handler, soft_purge, soft_purge, []}, - {apply, {asn1rt_driver_handler,unload_driver,[]}} - ] - }, - {"1.6.9", - [ - {load_module, asn1rt, soft_purge, soft_purge, []}, - {load_module, asn1rt_per_bin, soft_purge, soft_purge, []}, - {load_module, asn1rt_per_bin_rt2ct, soft_purge, soft_purge, []}, - {load_module, asn1rt_uper_bin, soft_purge, soft_purge, []}, - {load_module, asn1rt_ber_bin, soft_purge, soft_purge, []}, - {load_module, asn1rt_ber_bin_v2, soft_purge, soft_purge, []}, - {load_module, asn1rt_check, soft_purge, soft_purge, []}, - {load_module, asn1rt_driver_handler, soft_purge, soft_purge, []}, - {apply, {asn1rt_driver_handler,unload_driver,[]}} - ] - }, - {"1.6.10", - [ - {load_module, asn1rt, soft_purge, soft_purge, []}, - {load_module, asn1rt_per_bin, soft_purge, soft_purge, []}, - {load_module, asn1rt_per_bin_rt2ct, soft_purge, soft_purge, []}, - {load_module, asn1rt_uper_bin, soft_purge, soft_purge, []}, - {load_module, asn1rt_ber_bin, soft_purge, soft_purge, []}, - {load_module, asn1rt_ber_bin_v2, soft_purge, soft_purge, []}, - {load_module, asn1rt_check, soft_purge, soft_purge, []}, - {load_module, asn1rt_driver_handler, soft_purge, soft_purge, []}, - {apply, {asn1rt_driver_handler,unload_driver,[]}} - ] - } +% This version does not change anything of the runtime modules +% Only changes in compile time modules and thus no need for upgrade on target +[ ], [ - {"1.6.8", - [ - {load_module, asn1rt, soft_purge, soft_purge, []}, - {load_module, asn1rt_per_bin, soft_purge, soft_purge, []}, - {load_module, asn1rt_per_bin_rt2ct, soft_purge, soft_purge, []}, - {load_module, asn1rt_uper_bin, soft_purge, soft_purge, []}, - {load_module, asn1rt_ber_bin, soft_purge, soft_purge, []}, - {load_module, asn1rt_ber_bin_v2, soft_purge, soft_purge, []}, - {load_module, asn1rt_check, soft_purge, soft_purge, []}, - {load_module, asn1rt_driver_handler, soft_purge, soft_purge, []}, - {apply, {asn1rt_driver_handler,unload_driver,[]}} - ] - }, - {"1.6.8.1", - [ - {load_module, asn1rt, soft_purge, soft_purge, []}, - {load_module, asn1rt_per_bin, soft_purge, soft_purge, []}, - {load_module, asn1rt_per_bin_rt2ct, soft_purge, soft_purge, []}, - {load_module, asn1rt_uper_bin, soft_purge, soft_purge, []}, - {load_module, asn1rt_ber_bin, soft_purge, soft_purge, []}, - {load_module, asn1rt_ber_bin_v2, soft_purge, soft_purge, []}, - {load_module, asn1rt_check, soft_purge, soft_purge, []}, - {load_module, asn1rt_driver_handler, soft_purge, soft_purge, []}, - {apply, {asn1rt_driver_handler,unload_driver,[]}} - ] - }, - {"1.6.9", - [ - {load_module, asn1rt, soft_purge, soft_purge, []}, - {load_module, asn1rt_per_bin, soft_purge, soft_purge, []}, - {load_module, asn1rt_per_bin_rt2ct, soft_purge, soft_purge, []}, - {load_module, asn1rt_uper_bin, soft_purge, soft_purge, []}, - {load_module, asn1rt_ber_bin, soft_purge, soft_purge, []}, - {load_module, asn1rt_ber_bin_v2, soft_purge, soft_purge, []}, - {load_module, asn1rt_check, soft_purge, soft_purge, []}, - {load_module, asn1rt_driver_handler, soft_purge, soft_purge, []}, - {apply, {asn1rt_driver_handler,unload_driver,[]}} - ] - }, - {"1.6.10", - [ - {load_module, asn1rt, soft_purge, soft_purge, []}, - {load_module, asn1rt_per_bin, soft_purge, soft_purge, []}, - {load_module, asn1rt_per_bin_rt2ct, soft_purge, soft_purge, []}, - {load_module, asn1rt_uper_bin, soft_purge, soft_purge, []}, - {load_module, asn1rt_ber_bin, soft_purge, soft_purge, []}, - {load_module, asn1rt_ber_bin_v2, soft_purge, soft_purge, []}, - {load_module, asn1rt_check, soft_purge, soft_purge, []}, - {load_module, asn1rt_driver_handler, soft_purge, soft_purge, []}, - {apply, {asn1rt_driver_handler,unload_driver,[]}} - ] - } ]}. diff --git a/lib/asn1/src/asn1_records.hrl b/lib/asn1/src/asn1_records.hrl index 8a428b744c..59a9acb7e7 100644 --- a/lib/asn1/src/asn1_records.hrl +++ b/lib/asn1/src/asn1_records.hrl @@ -1,19 +1,19 @@ %% %% %CopyrightBegin% -%% -%% Copyright Ericsson AB 1997-2009. All Rights Reserved. -%% +%% +%% Copyright Ericsson AB 1997-2010. All Rights Reserved. +%% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in %% compliance with the License. You should have received a copy of the %% Erlang Public License along with this software. If not, it can be %% retrieved online at http://www.erlang.org/. -%% +%% %% Software distributed under the License is distributed on an "AS IS" %% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See %% the License for the specific language governing rights and limitations %% under the License. -%% +%% %% %CopyrightEnd% %% %% @@ -36,7 +36,8 @@ -record(module,{pos,name,defid,tagdefault='EXPLICIT',exports={exports,[]},imports={imports,[]}, extensiondefault=empty,typeorval}). --record('SEQUENCE',{pname=false,tablecinf=false,components=[]}). +-record('ExtensionAdditionGroup',{number}). +-record('SEQUENCE',{pname=false,tablecinf=false,extaddgroup,components=[]}). -record('SET',{pname=false,sorted=false,tablecinf=false,components=[]}). -record('ComponentType',{pos,name,typespec,prop,tags,textual_order}). -record('ObjectClassFieldType',{classname,class,fieldname,type}). diff --git a/lib/asn1/src/asn1ct_check.erl b/lib/asn1/src/asn1ct_check.erl index 54a5c7e727..1c9f2c759a 100644 --- a/lib/asn1/src/asn1ct_check.erl +++ b/lib/asn1/src/asn1ct_check.erl @@ -3227,7 +3227,7 @@ check_ptype(_S,_PTDef,Ts) when is_record(Ts,objectclass) -> % check_type(S,Type,ObjSpec={{objectclassname,_},_}) -> -% check_class(S,ObjSpec); + % check_class(S,ObjSpec); check_type(_S,Type,Ts) when is_record(Type,typedef), (Type#typedef.checked==true) -> Ts; @@ -3357,6 +3357,7 @@ check_type(S=#state{recordtopname=TopName},Type,Ts) when is_record(Ts,type) -> merge_tags(Tag,?TAG_PRIMITIVE(?N_INTEGER))}; 'REAL' -> check_real(S,Constr), + TempNewDef#newt{tag=merge_tags(Tag,?TAG_PRIMITIVE(?N_REAL))}; {'BIT STRING',NamedNumberList} -> NewL = check_bitstring(S,NamedNumberList,Constr), @@ -5522,24 +5523,9 @@ check_sequence(S,Type,Comps) -> Components2 = maybe_automatic_tags(S,Components), %% check the table constraints from here. The outermost type %% is Type, the innermost is Comps (the list of components) - NewComps = - case check_each_component(S,Type,Components2) of - NewComponents when is_list(NewComponents) -> - check_unique_sequence_tags(S,NewComponents), - NewComponents; - Ret = {NewComponents,NewEcomps} -> - TagComps = NewComponents ++ - [Comp#'ComponentType'{prop='OPTIONAL'}|| Comp <- NewEcomps], - %% extension components are like optionals when it comes to tagging - check_unique_sequence_tags(S,TagComps), - Ret; - Ret = {Root1,NewE,Root2} -> - TagComps = Root1 ++ [Comp#'ComponentType'{prop='OPTIONAL'}|| Comp <- NewE]++Root2, - %% This is not correct handling if Extension - %% contains ExtensionAdditionGroups - check_unique_sequence_tags(S,TagComps), - Ret - end, + NewComps = check_each_component2(S,Type,Components2), + check_unique_sequence_tags(S,NewComps), + %% CRelInf is the "leading attribute" information %% necessary for code generating of the look up in the %% object set table, @@ -5553,12 +5539,45 @@ check_sequence(S,Type,Comps) -> %% the involved class removed, as the class of the object %% set. CompListWithTblInf = get_tableconstraint_info(S,Type,NewComps2), - - {CRelInf,CompListWithTblInf}; + %% If encoding rule is in the PER family the Root Components + %% after the second extension mark should be encoded before + %% all extensions i.e together with the first Root components + + NewComps3 = textual_order(CompListWithTblInf), + CompListTuple = + complist_as_tuple(is_erule_per(S#state.erule),NewComps3), + {CRelInf,CompListTuple}; Dupl -> - throw({error,{asn1,{duplicate_components,Dupl}}}) + throw({error,{asn1,{duplicate_components,Dupl}}}) end. +complist_as_tuple(Per,CompList) -> + complist_as_tuple(Per,CompList,[],[],[],root). + +complist_as_tuple(Per,[#'EXTENSIONMARK'{}|T],Acc,Ext,Acc2,root) -> + complist_as_tuple(Per,T,Acc,Ext,Acc2,ext); +complist_as_tuple(Per,[#'EXTENSIONMARK'{}|T],Acc,Ext,Acc2,ext) -> + complist_as_tuple(Per,T,Acc,Ext,Acc2,root2); +complist_as_tuple(_Per,[#'EXTENSIONMARK'{}|_T],_Acc,_Ext,_Acc2,root2) -> + throw({error,{asn1,{too_many_extension_marks}}}); +complist_as_tuple(Per,[C|T],Acc,Ext,Acc2,root) -> + complist_as_tuple(Per,T,[C|Acc],Ext,Acc2,root); +complist_as_tuple(Per,[C|T],Acc,Ext,Acc2,ext) -> + complist_as_tuple(Per,T,Acc,[C|Ext],Acc2,ext); +complist_as_tuple(Per,[C|T],Acc,Ext,Acc2,root2) -> + complist_as_tuple(Per,T,Acc,Ext,[C|Acc2],root2); +complist_as_tuple(_Per,[],Acc,_Ext,_Acc2,root) -> + lists:reverse(Acc); +complist_as_tuple(_Per,[],Acc,Ext,_Acc2,ext) -> + {lists:reverse(Acc),lists:reverse(Ext)}; +%%complist_as_tuple(_Per = true,[],Acc,Ext,Acc2,root2) -> +%% {lists:reverse(Acc)++lists:reverse(Acc2),lists:reverse(Ext)}; +complist_as_tuple(_Per,[],Acc,Ext,Acc2,root2) -> + {lists:reverse(Acc),lists:reverse(Ext),lists:reverse(Acc2)}. + +is_erule_per(Erule) -> + lists:member(Erule,[per,per_bin,uper_bin]). + expand_components(S, [{'COMPONENTS OF',Type}|T]) -> CompList = expand_components2(S,get_referenced_type(S,Type#type.def)), expand_components(S,CompList) ++ expand_components(S,T); @@ -5601,13 +5620,26 @@ take_only_rootset([#'EXTENSIONMARK'{}|_T])-> take_only_rootset([H|T]) -> [H|take_only_rootset(T)]. -check_unique_sequence_tags(S,[#'ComponentType'{prop=mandatory}|Rest]) -> - check_unique_sequence_tags(S,Rest); -check_unique_sequence_tags(S,[C|Rest]) when is_record(C,'ComponentType') -> +check_unique_sequence_tags(S,CompList) -> + TagComps = case complist_as_tuple(false,CompList) of + {R1,Ext,R2} -> + R1 ++ [C#'ComponentType'{prop='OPTIONAL'}|| + C = #'ComponentType'{} <- Ext]++R2; + {R1,Ext} -> + R1 ++ [C#'ComponentType'{prop='OPTIONAL'}|| + C = #'ComponentType'{} <- Ext]; + _ -> + CompList + end, + check_unique_sequence_tags0(S,TagComps). + +check_unique_sequence_tags0(S,[#'ComponentType'{prop=mandatory}|Rest]) -> + check_unique_sequence_tags0(S,Rest); +check_unique_sequence_tags0(S,[C=#'ComponentType'{}|Rest]) -> check_unique_sequence_tags1(S,Rest,[C]);% optional or default -check_unique_sequence_tags(S,[_ExtensionMarker|Rest]) -> - check_unique_sequence_tags(S,Rest); -check_unique_sequence_tags(_S,[]) -> +check_unique_sequence_tags0(S,[_ExtensionMarker|Rest]) -> + check_unique_sequence_tags0(S,Rest); +check_unique_sequence_tags0(_S,[]) -> true. check_unique_sequence_tags1(S,[C|Rest],Acc) when is_record(C,'ComponentType') -> @@ -5807,8 +5839,10 @@ get_least_tag(TagList) -> %% adds the textual order to the components to keep right order of %% components in the asn1-value. textual_order(Cs) -> - Fun = fun(C,Index) -> - {C#'ComponentType'{textual_order=Index},Index+1} + Fun = fun(C=#'ComponentType'{},Index) -> + {C#'ComponentType'{textual_order=Index},Index+1}; + (Other,Index) -> + {Other,Index} end, {NewCs,_} = textual_order(Cs,Fun,1), NewCs. @@ -5879,7 +5913,6 @@ check_selectiontype2(S,Name,TypeDef) -> error({type,Msg,S}) end. - check_restrictedstring(_S,_Def,_Constr) -> ok. @@ -5899,16 +5932,16 @@ check_choice(S,Type,Components) when is_list(Components) -> [] -> %% sort_canonical(Components), Components2 = maybe_automatic_tags(S,Components), - %NewComps = - case check_each_alternative(S,Type,Components2) of - {NewComponents,NewEcomps} -> - check_unique_tags(S,NewComponents ++ NewEcomps), - {NewComponents,NewEcomps}; - NewComponents -> - check_unique_tags(S,NewComponents), - NewComponents - end; - + NewComps = check_each_alternative2(S,Type,Components2), + %% ExtensionAdditionGroup markers i.e '[[' ']]' are not + %% significant for encoding/decoding a choice + %% therefore we remove them here + NewComps2 = lists:filter(fun(#'ExtensionAdditionGroup'{}) -> false; + ('ExtensionAdditionGroupEnd') -> false; + (_) -> true + end,NewComps), + check_unique_tags(S,NewComps2), + complist_as_tuple(is_erule_per(S#state.erule),NewComps2); Dupl -> throw({error,{asn1,{duplicate_choice_alternatives,Dupl}}}) end; @@ -6036,12 +6069,17 @@ check_unique2([_|T],Pos,Acc) -> check_unique2([],_,Acc) -> lists:reverse(Acc). -check_each_component(S,Type,Components) -> - check_each_component(S,Type,Components,[],[],[],root1). -check_each_component(S = #state{abscomppath=Path,recordtopname=TopName},Type, - [C|Ct],Acc,Extacc,Acc2,Ext) when is_record(C,'ComponentType') -> - #'ComponentType'{name=Cname,typespec=Ts,prop=Prop} = C, +%% Replaces check_each_component and does the same work except that +%% it keeps the complist as a flat list and does not create a tuple with root and +%% extensions separated +check_each_component2(S,Type,Components) -> + check_each_component2(S,Type,Components,[]). + +check_each_component2(S = #state{abscomppath=Path,recordtopname=TopName}, + Type, + [C = #'ComponentType'{name=Cname,typespec=Ts,prop=Prop}|Ct], + Acc) -> NewAbsCPath = case Ts#type.def of #'Externaltypereference'{} -> []; @@ -6058,75 +6096,48 @@ check_each_component(S = #state{abscomppath=Path,recordtopname=TopName},Type, DefaultValue -> {'DEFAULT',DefaultValue} end, NewC = C#'ComponentType'{typespec=CheckedTs,prop=NewProp,tags=NewTags}, - case Ext of - root1 -> - check_each_component(S,Type,Ct,[NewC|Acc],Extacc,Acc2,Ext); - ext -> - check_each_component(S,Type,Ct,Acc,[NewC|Extacc],Acc2,Ext); - root2 -> - check_each_component(S,Type,Ct,Acc,Extacc,[NewC|Acc2],Ext) - end; -check_each_component(S,Type,[_|Ct],Acc,Extacc,Acc2,root1) -> % skip 'EXTENSIONMARK' - check_each_component(S,Type,Ct,Acc,Extacc,Acc2,ext); -check_each_component(S,Type,[_|Ct],Acc,Extacc,Acc2,ext) -> % skip 'EXTENSIONMARK' - check_each_component(S,Type,Ct,Acc,Extacc,Acc2,root2); -check_each_component(_S,_,[_C|_Ct],_,_,_,root2) -> % 'EXTENSIONMARK' - throw({error,{asn1,{too_many_extension_marks}}}); -check_each_component(_S,_,[],Acc,Extacc,_,ext) -> - {lists:reverse(Acc),lists:reverse(Extacc)}; -check_each_component(_S,_,[],Acc1,ExtAcc,Acc2,root2) -> - {lists:reverse(Acc1),lists:reverse(ExtAcc),lists:reverse(Acc2)}; -check_each_component(_S,_,[],Acc,_,_,root1) -> + check_each_component2(S,Type,Ct,[NewC|Acc]); + +check_each_component2(S,Type,[OtherMarker|Ct],Acc) -> + %% let 'EXTENSIONMARK' and 'ExtensionAdditionGroup' markers pass through as is + check_each_component2(S,Type,Ct,[OtherMarker|Acc]); +check_each_component2(_S,_,[],Acc) -> lists:reverse(Acc). -%% check_each_alternative(S,Type,{Rlist,ExtList}) -> + +%% check_each_alternative2(S,Type,{Rlist,ExtList}) -> %% {check_each_alternative(S,Type,Rlist), %% check_each_alternative(S,Type,ExtList)}; -check_each_alternative(S,Type,[C|Ct]) -> - check_each_alternative(S,Type,[C|Ct],[],[],noext). +check_each_alternative2(S,Type,[C|Ct]) -> + check_each_alternative2(S,Type,[C|Ct],[]). -check_each_alternative(S=#state{abscomppath=Path,recordtopname=TopName},Type,[C|Ct], - Acc,Extacc,Ext) when is_record(C,'ComponentType') -> - #'ComponentType'{name=Cname,typespec=Ts,prop=_Prop} = C, +check_each_alternative2(S=#state{abscomppath=Path,recordtopname=TopName}, + Type, + [C = #'ComponentType'{name=Cname,typespec=Ts}|Ct], + Acc) -> NewAbsCPath = case Ts#type.def of #'Externaltypereference'{} -> []; _ -> [Cname|Path] end, - NewState = - S#state{abscomppath=NewAbsCPath,recordtopname=[Cname|TopName]}, - CheckedTs = check_type(NewState,Type,Ts), + CheckedTs = check_type(S#state{abscomppath=NewAbsCPath, + recordtopname=[Cname|TopName]},Type,Ts), NewTags = get_taglist(S,CheckedTs), + NewC = C#'ComponentType'{typespec=CheckedTs,tags=NewTags}, - case Ext of - noext -> - check_each_alternative(S,Type,Ct,[NewC|Acc],Extacc,Ext); - ext -> - check_each_alternative(S,Type,Ct,Acc,[NewC|Extacc],Ext) - end; + check_each_alternative2(S,Type,Ct,[NewC|Acc]); -check_each_alternative(S,Type,[_|Ct],Acc,Extacc,noext) -> % skip 'EXTENSIONMARK' - check_each_alternative(S,Type,Ct,Acc,Extacc,ext); -check_each_alternative(_S,_,[_C|_Ct],_,_,ext) -> % skip 'EXTENSIONMARK' - throw({error,{asn1,{too_many_extension_marks}}}); -check_each_alternative(_S,_,[],Acc,Extacc,ext) -> - {lists:reverse(Acc),lists:reverse(Extacc)}; -check_each_alternative(_S,_,[],Acc,_,noext) -> +check_each_alternative2(S,Type,[OtherMarker|Ct],Acc) -> + %% let 'EXTENSIONMARK' and 'ExtensionAdditionGroup' markers pass through as is + check_each_alternative2(S,Type,Ct,[OtherMarker|Acc]); +check_each_alternative2(_S,_,[],Acc) -> lists:reverse(Acc). + %% componentrelation_leadingattr/2 searches the structure for table %% constraints, if any is found componentrelation_leadingattr/5 is %% called. componentrelation_leadingattr(S,CompList) -> - Cs = - case CompList of - {Comp1, EComps, Comp2} -> - Comp1++EComps++Comp2; - {Components,EComponents} when is_list(Components) -> - Components ++ EComponents; - CompList when is_list(CompList) -> - CompList - end, %% get_simple_table_if_used/2 should find out whether there are any %% component relation constraints in the entire tree of Cs1 that @@ -6135,12 +6146,22 @@ componentrelation_leadingattr(S,CompList) -> %% componentrelation_leadingattr/6. The step when the leading %% attribute and the syntax tree is modified to support the code %% generating. - case get_simple_table_if_used(S,Cs) of + case get_simple_table_if_used(S,CompList) of [] -> {false,CompList}; - STList -> - componentrelation_leadingattr(S,Cs,Cs,STList,[],[]) + _ -> + componentrelation_leadingattr(S,CompList,CompList,[],[]) end. + +%%FIXME expand_ExtAddGroups([C#'ExtensionAdditionGroup'{components=ExtAdds}|T], +%% CurrPos,PosAcc,CompAcc) -> +%% expand_ExtAddGroups(T,CurrPos+ L = lenght(ExtAdds),[{CurrPos,L}|PosAcc],ExtAdds++CompAcc); +%% expand_ExtAddGroups([C|T],CurrPos,PosAcc,CompAcc) -> +%% expand_ExtAddGroups(T,CurrPos+ 1,PosAcc,[C|CompAcc]); +%% expand_ExtAddGroups([],_CurrPos,PosAcc,CompAcc) -> +%% {lists:reverse(PosAcc),lists:reverse(CompAcc)}. + + %% componentrelation_leadingattr/6 when all components are searched %% the new modified components are returned together with the "leading %% attribute" information, which later is stored in the tablecinf @@ -6150,11 +6171,12 @@ componentrelation_leadingattr(S,CompList) -> %% is used in code generating phase too, to recognice the proper %% components for "open type" encoding and to propagate the result of %% the object set lookup when needed. -componentrelation_leadingattr(_,[],_CompList,_,[],NewCompList) -> +componentrelation_leadingattr(_,[],_CompList,[],NewCompList) -> {false,lists:reverse(NewCompList)}; -componentrelation_leadingattr(_,[],_CompList,_,LeadingAttr,NewCompList) -> +componentrelation_leadingattr(_,[],_CompList,LeadingAttr,NewCompList) -> {lists:last(LeadingAttr),lists:reverse(NewCompList)}; %send all info in Ts later -componentrelation_leadingattr(S,[C|Cs],CompList,STList,Acc,CompAcc) -> + +componentrelation_leadingattr(S,[C= #'ComponentType'{}|Cs],CompList,Acc,CompAcc) -> {LAAcc,NewC} = case catch componentrelation1(S,C#'ComponentType'.typespec, [C#'ComponentType'.name]) of @@ -6205,7 +6227,7 @@ componentrelation_leadingattr(S,[C|Cs],CompList,STList,Acc,CompAcc) -> %% no constraint was found {[],C} end, - componentrelation_leadingattr(S,Cs,CompList,STList,LAAcc++Acc, + componentrelation_leadingattr(S,Cs,CompList,LAAcc++Acc, [NewC|CompAcc]). object_set_mod_name(_S,ObjSet) when is_atom(ObjSet) -> @@ -6228,11 +6250,9 @@ object_set_mod_name(S,#'Externaltypereference'{module=M,type=T}) -> %% generation of the look up functionality in the object set table are %% returned. get_simple_table_if_used(S,Cs) -> - CNames = lists:map(fun(#'ComponentType'{name=Name}) -> Name; - (_) -> [] %% in case of extension marks - end, - Cs), - RefedSimpleTable=any_component_relation(S,Cs,CNames,[],[]), + CNames = [Name||#'ComponentType'{name=Name}<-Cs], + JustComponents = [C || C = #'ComponentType'{}<-Cs], + RefedSimpleTable=any_component_relation(S,JustComponents,CNames,[],[]), get_simple_table_info(S,Cs,remove_doubles(RefedSimpleTable)). remove_doubles(L) -> @@ -6336,9 +6356,7 @@ simple_table_info(S,Type,_) -> %% beginning of the search. CNames holds the names of all components %% of the start level, this info is used if an outermost at-notation %% is found to check the validity of the at-list. -any_component_relation(S,[C|Cs],CNames,NamePath,Acc) -> - CName = C#'ComponentType'.name, - Type = C#'ComponentType'.typespec, +any_component_relation(S,[#'ComponentType'{name=CName,typespec=Type}|Cs],CNames,NamePath,Acc) -> CRelPath = case constraint_member(componentrelation,Type#type.constraint) of %% [{componentrelation,_,AtNotation}] -> @@ -6358,9 +6376,9 @@ any_component_relation(S,[C|Cs],CNames,NamePath,Acc) -> case {Type#type.inlined, asn1ct_gen:type(asn1ct_gen:get_inner(Type#type.def))} of {no,{constructed,bif}} -> + {InnerCs,NewNamePath} = case get_components(Type#type.def) of - {IC1,_IC2} -> {IC1 ++ IC1,[CName|NamePath]}; T when is_record(T,type) -> {T,NamePath}; IC -> {IC,[CName|NamePath]} end, @@ -6384,11 +6402,7 @@ any_component_relation(S,Type,CNames,NamePath,Acc) when is_record(Type,type) -> case {Type#type.inlined, asn1ct_gen:type(asn1ct_gen:get_inner(Type#type.def))} of {no,{constructed,bif}} -> - InnerCs = - case get_components(Type#type.def) of - {IC1,_IC2} -> IC1 ++ IC1; - IC -> IC - end, + InnerCs = get_components(Type#type.def), any_component_relation(S,InnerCs,CNames,NamePath,[]); _ -> [] @@ -6456,11 +6470,11 @@ get_components(Def) -> get_components(any,Def). get_components(_,#'SEQUENCE'{components=Cs}) -> - Cs; + tuple2complist(Cs); get_components(_,#'SET'{components=Cs}) -> - Cs; + tuple2complist(Cs); get_components(_,{'CHOICE',Cs}) -> - Cs; + tuple2complist(Cs); %do not step in inlined structures get_components(any,{'SEQUENCE OF',T = #type{def=_Def,inlined=no}}) -> % get_components(any,Def); @@ -6471,6 +6485,13 @@ get_components(any,{'SET OF',T = #type{def=_Def,inlined=no}}) -> get_components(_,_) -> []. +tuple2complist({R,E}) -> + R ++ E; +tuple2complist({R1,E,R2}) -> + R1 ++ E ++ R2; +tuple2complist(List) when is_list(List) -> + List. + get_choice_components(_S,{'CHOICE',Components}) when is_list(Components)-> Components; get_choice_components(_S,{'CHOICE',{C1,C2}}) when is_list(C1),is_list(C2) -> @@ -6731,8 +6752,7 @@ get_tableconstraint_info(S,Type,CheckedTs) -> get_tableconstraint_info(_S,_Type,[],Acc) -> lists:reverse(Acc); -get_tableconstraint_info(S,Type,[C|Cs],Acc) -> - CheckedTs = C#'ComponentType'.typespec, +get_tableconstraint_info(S,Type,[C=#'ComponentType'{typespec=CheckedTs}|Cs],Acc) -> AccComp = case CheckedTs#type.def of %% ObjectClassFieldType @@ -6768,7 +6788,9 @@ get_tableconstraint_info(S,Type,[C|Cs],Acc) -> _ -> C end, - get_tableconstraint_info(S,Type,Cs,[AccComp|Acc]). + get_tableconstraint_info(S,Type,Cs,[AccComp|Acc]); +get_tableconstraint_info(S,Type,[C|Cs],Acc) -> + get_tableconstraint_info(S,Type,Cs,[C|Acc]). get_referenced_fieldname([{_,FirstFieldname}]) -> {FirstFieldname,[]}; @@ -6850,7 +6872,9 @@ get_taglist(S,Type) when is_record(Type,type) -> [asn1ct_gen:def_to_tag(Tag)] end; get_taglist(S,{'CHOICE',{Rc,Ec}}) -> - get_taglist(S,{'CHOICE',Rc ++ Ec}); + get_taglist1(S,Rc ++ Ec); +get_taglist(S,{'CHOICE',{R1,E,R2}}) -> + get_taglist1(S,R1 ++ E ++ R2); get_taglist(S,{'CHOICE',Components}) -> get_taglist1(S,Components); %% ObjectClassFieldType OTP-4390 diff --git a/lib/asn1/src/asn1ct_constructed_ber.erl b/lib/asn1/src/asn1ct_constructed_ber.erl index 51a241ffbd..77b78dcac7 100644 --- a/lib/asn1/src/asn1ct_constructed_ber.erl +++ b/lib/asn1/src/asn1ct_constructed_ber.erl @@ -1,19 +1,19 @@ %% %% %CopyrightBegin% -%% -%% Copyright Ericsson AB 1997-2009. All Rights Reserved. -%% +%% +%% Copyright Ericsson AB 1997-2010. All Rights Reserved. +%% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in %% compliance with the License. You should have received a copy of the %% Erlang Public License along with this software. If not, it can be %% retrieved online at http://www.erlang.org/. -%% +%% %% Software distributed under the License is distributed on an "AS IS" %% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See %% the License for the specific language governing rights and limitations %% under the License. -%% +%% %% %CopyrightEnd% %% %% @@ -71,13 +71,15 @@ gen_encode_sequence(Erules,Typename,D) when is_record(D,type) -> ok end, - {SeqOrSet,TableConsInfo,CompList} = + {SeqOrSet,TableConsInfo,CompList0} = case D#type.def of #'SEQUENCE'{tablecinf=TCI,components=CL} -> {'SEQUENCE',TCI,CL}; #'SET'{tablecinf=TCI,components=CL} -> {'SET',TCI,CL} end, + %% filter away extensionAdditiongroup markers + CompList = filter_complist(CompList0), Ext = extensible(CompList), CompList1 = case CompList of {Rl1,El,Rl2} -> Rl1 ++ El ++ Rl2; @@ -189,7 +191,11 @@ gen_encode_sequence(Erules,Typename,D) when is_record(D,type) -> gen_decode_sequence(Erules,Typename,D) when is_record(D,type) -> asn1ct_name:start(), asn1ct_name:new(tag), - #'SEQUENCE'{tablecinf=TableConsInfo,components=CList} = D#type.def, + #'SEQUENCE'{tablecinf=TableConsInfo,components=CList0} = D#type.def, + + %% filter away extensionAdditiongroup markers + CList = filter_complist(CList0), + Ext = extensible(CList), {CompList,CompList2} = case CList of {Rl1,El,Rl2} -> {Rl1 ++ El ++ Rl2,CList}; @@ -369,7 +375,10 @@ gen_decode_set(Erules,Typename,D) when is_record(D,type) -> asn1ct_name:clear(), asn1ct_name:new(term), asn1ct_name:new(tag), - #'SET'{components=TCompList} = D#type.def, + #'SET'{components=TCompList0} = D#type.def, + + %% filter away extensionAdditiongroup markers + TCompList = filter_complist(TCompList0), Ext = extensible(TCompList), ToOptional = fun(mandatory) -> 'OPTIONAL'; @@ -1473,6 +1482,22 @@ extensible({RootList,ExtList}) -> {ext,length(RootList)+1,length(ExtList)}; extensible({_Rl1,_ExtL,_Rl2}) -> extensible. +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%% filter away ExtensionAdditionGroup start and end marks since these +%% have no significance for the BER encoding +%% +filter_complist(CompList) when is_list(CompList) -> + lists:filter(fun(#'ExtensionAdditionGroup'{}) -> + false; + ('ExtensionAdditionGroupEnd') -> + false; + (_) -> + true + end, CompList); +filter_complist({Root,Ext}) -> + {Root,filter_complist(Ext)}; +filter_complist({Root1,Ext,Root2}) -> + {Root1,filter_complist(Ext),Root2}. print_attribute_comment(InnerType,Pos,Prop) -> CommentLine = "%%-------------------------------------------------", diff --git a/lib/asn1/src/asn1ct_constructed_per.erl b/lib/asn1/src/asn1ct_constructed_per.erl index 2a1c0ebc6b..df430c4f88 100644 --- a/lib/asn1/src/asn1ct_constructed_per.erl +++ b/lib/asn1/src/asn1ct_constructed_per.erl @@ -1,19 +1,19 @@ %% %% %CopyrightBegin% -%% -%% Copyright Ericsson AB 1997-2009. All Rights Reserved. -%% +%% +%% Copyright Ericsson AB 1997-2010. All Rights Reserved. +%% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in %% compliance with the License. You should have received a copy of the %% Erlang Public License along with this software. If not, it can be %% retrieved online at http://www.erlang.org/. -%% +%% %% Software distributed under the License is distributed on an "AS IS" %% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See %% the License for the specific language governing rights and limitations %% under the License. -%% +%% %% %CopyrightEnd% %% %% @@ -46,13 +46,24 @@ gen_encode_constructed(Erule,Typename,D) when is_record(D,type) -> asn1ct_name:start(), asn1ct_name:new(term), asn1ct_name:new(bytes), - {CompList,TableConsInfo} = + {ExtAddGroup,TmpCompList,TableConsInfo} = case D#type.def of - #'SEQUENCE'{tablecinf=TCI,components=CL} -> - {CL,TCI}; + #'SEQUENCE'{tablecinf=TCI,components=CL,extaddgroup=ExtAddGroup0} -> + {ExtAddGroup0,CL,TCI}; #'SET'{tablecinf=TCI,components=CL} -> - {CL,TCI} + {undefined,CL,TCI} end, + + CompList = case ExtAddGroup of + undefined -> + TmpCompList; + _ when is_integer(ExtAddGroup) -> + %% This is a fake SEQUENCE representing an ExtensionAdditionGroup + %% Reset the textual order so we get the right + %% index of the components + [Comp#'ComponentType'{textual_order=undefined}|| + Comp<-TmpCompList] + end, case Typename of ['EXTERNAL'] -> emit({{var,asn1ct_name:next(val)}, @@ -78,7 +89,7 @@ gen_encode_constructed(Erule,Typename,D) when is_record(D,type) -> ",",{var,asn1ct_name:curr(val)},"),",nl}) end, asn1ct_name:new(val), - Ext = extensible(CompList), + Ext = extensible_enc(CompList), case Ext of {ext,_,NumExt} when NumExt > 0 -> emit(["Extensions = ?RT_PER:fixextensions(",{asis,Ext}, @@ -188,9 +199,10 @@ gen_decode_constructed(Erules,Typename,D) when is_record(D,type) -> #'SEQUENCE'{tablecinf=TCI,components=CL} -> {add_textual_order(CL),TCI}; #'SET'{tablecinf=TCI,components=CL} -> - {add_textual_order(CL),TCI} +%% {add_textual_order(CL),TCI} + {CL,TCI} % the textual order is already taken care of end, - Ext = extensible(CompList), + Ext = extensible_dec(CompList), MaybeComma1 = case Ext of {ext,_Pos,_NumExt} -> gen_dec_extension_value("Bytes"), @@ -243,8 +255,9 @@ gen_decode_constructed(Erules,Typename,D) when is_record(D,type) -> {false,false,false} end end, + NewCompList = wrap_compList(CompList), {AccTerm,AccBytes} = - gen_dec_components_call(Erules,Typename,CompList,MaybeComma2,DecObjInf,Ext,length(Optionals)), + gen_dec_components_call(Erules,Typename,NewCompList,MaybeComma2,DecObjInf,Ext,length(Optionals)), case asn1ct_name:all(term) of [] -> emit(MaybeComma2); % no components at all _ -> emit({com,nl}) @@ -284,7 +297,10 @@ gen_decode_constructed(Erules,Typename,D) when is_record(D,type) -> emit(" {ASN11994Format,"); _ -> emit(["{{'",RecordName,"'"]), - mkvlist(textual_order(CompList,asn1ct_name:all(term))), + %% CompList is used here because we don't want + %% ExtensionAdditionGroups to be wrapped in SEQUENCES when + %% we are ordering the fields according to textual order + mkvlist(textual_order(to_encoding_order(CompList),asn1ct_name:all(term))), emit("},") end, emit({{var,asn1ct_name:curr(bytes)},"}"}), @@ -293,17 +309,12 @@ gen_decode_constructed(Erules,Typename,D) when is_record(D,type) -> textual_order([#'ComponentType'{textual_order=undefined}|_],TermList) -> TermList; textual_order(CompList,TermList) when is_list(CompList) -> - TermTuple = list_to_tuple(TermList), %% ['Term1','Term2',...'TermN'] - %% OrderList is ordered by canonical order of tags - TmpTuple = TermTuple, - OrderList = [Ix||#'ComponentType'{textual_order=Ix} <- CompList], - Fun = fun(X,{Tpl,Ix}) -> - - {setelement(X,Tpl,element(Ix,TermTuple)),Ix+1} - end, - {Ret,_} = lists:foldl(Fun,{TmpTuple,1},OrderList), -%% io:format("TermTuple: ~p~nOrderList: ~p~nRet: ~p~n",[TermTuple,OrderList,tuple_to_list(Ret)]), - tuple_to_list(Ret); + OrderList = [Ix||#'ComponentType'{textual_order=Ix} <- CompList], + [Term||{_,Term}<- + lists:sort(lists:zip(OrderList, + lists:sublist(TermList,length(OrderList))))]; + %% sublist is just because Termlist can sometimes be longer than + %% OrderList, which it really shouldn't textual_order({Root,Ext},TermList) -> textual_order(Root ++ Ext,TermList); textual_order({Root1,Ext,Root2},TermList) -> @@ -379,7 +390,7 @@ emit_opt_or_mand_check(Val,Term) -> gen_encode_choice(Erule,Typename,D) when is_record(D,type) -> {'CHOICE',CompList} = D#type.def, emit({"[",nl}), - Ext = extensible(CompList), + Ext = extensible_enc(CompList), gen_enc_choice(Erule,Typename,CompList,Ext), emit({nl,"].",nl}). @@ -388,7 +399,7 @@ gen_decode_choice(Erules,Typename,D) when is_record(D,type) -> asn1ct_name:clear(), asn1ct_name:new(bytes), {'CHOICE',CompList} = D#type.def, - Ext = extensible(CompList), + Ext = extensible_enc(CompList), gen_dec_choice(Erules,Typename,CompList,Ext), emit({".",nl}). @@ -558,12 +569,32 @@ mkvlist2([H|T]) -> mkvlist2([]) -> true. -extensible(CompList) when is_list(CompList) -> + +extensible_dec(CompList) when is_list(CompList) -> + noext; +extensible_dec({RootList,ExtList}) -> + {ext,length(RootList)+1,ext_length(ExtList)}; +extensible_dec({Rl1,Ext,Rl2}) -> + {ext,length(Rl1)+length(Rl2)+1,ext_length(Ext)}. + +extensible_enc(CompList) when is_list(CompList) -> noext; -extensible({RootList,ExtList}) -> - {ext,length(RootList)+1,length(ExtList)}; -extensible({Rl1,Ext,_Rl2}) -> - {ext,length(Rl1)+1,length(Ext)}. +extensible_enc({RootList,ExtList}) -> + {ext,length(RootList)+1,ext_length(ExtList)}; +extensible_enc({Rl1,Ext,_Rl2}) -> + {ext,length(Rl1)+1,ext_length(Ext)}. + +ext_length(ExtList) -> ext_length(ExtList,normal,0). +ext_length([{'ExtensionAdditionGroup',_Num}|T],_,Acc)-> + ext_length(T,group,Acc); +ext_length(['ExtensionAdditionGroupEnd'|T],group,Acc) -> + ext_length(T,normal,Acc+1); +ext_length([#'ComponentType'{}|T],State=group,Acc) -> + ext_length(T,State,Acc); +ext_length([#'ComponentType'{}|T],State=normal,Acc) -> + ext_length(T,State,Acc+1); +ext_length([],_,Acc) -> + Acc. gen_dec_extension_value(_) -> emit({"{Ext,",{next,bytes},"} = ?RT_PER:getext(",{curr,bytes},")"}), @@ -574,7 +605,11 @@ gen_dec_extension_value(_) -> %% there are optional components, start with 2 because first element %% is the record name -optionals({L1,_Ext,L2}) -> optionals(L1++L2,[],2); +optionals({L1,Ext,L2}) -> + Opt1 = optionals(L1,[],2), + ExtComps = length([C||C = #'ComponentType'{}<-Ext]), + Opt2 = optionals(L2,[],2+length(L1)+ExtComps), + Opt1 ++ Opt2; optionals({L,_Ext}) -> optionals(L,[],2); optionals(L) -> optionals(L,[],2). @@ -617,6 +652,13 @@ get_optionality_pos(TextPos,OptTable) -> no_num end. +to_encoding_order(Cs) when is_list(Cs) -> + Cs; +to_encoding_order(Cs = {_Root,_Ext}) -> + Cs; +to_encoding_order({R1,Ext,R2}) -> + {R1++R2,Ext}. + add_textual_order(Cs) when is_list(Cs) -> {NewCs,_} = add_textual_order1(Cs,1), NewCs; @@ -629,26 +671,20 @@ add_textual_order({R1,Ext,R2}) -> {NewExt,Num2} = add_textual_order1(Ext,Num1), {NewR2,_} = add_textual_order1(R2,Num2), {NewR1,NewExt,NewR2}. -add_textual_order1(Cs=[#'ComponentType'{textual_order=Int}|_],I) - when is_integer(Int) -> - {Cs,I}; +%%add_textual_order1(Cs=[#'ComponentType'{textual_order=Int}|_],I) +%% when is_integer(Int) -> +%% {Cs,I}; add_textual_order1(Cs,NumIn) -> - lists:mapfoldl(fun(C,Num) -> + lists:mapfoldl(fun(C=#'ComponentType'{},Num) -> {C#'ComponentType'{textual_order=Num}, - Num+1} + Num+1}; + (OtherMarker,Num) -> + {OtherMarker,Num} end, NumIn,Cs). gen_enc_components_call(Erule,TopType,{Root1,ExtList,Root2},MaybeComma,DynamicEnc,Ext) -> - Rpos = gen_enc_components_call1(Erule,TopType,Root1,1,MaybeComma,DynamicEnc,noext), - case Ext of - {ext,_,ExtNum} when ExtNum > 0 -> - emit([nl, - ",Extensions",nl]); - _ -> true - end, - Rpos2 = gen_enc_components_call1(Erule,TopType,ExtList,Rpos,MaybeComma,DynamicEnc,Ext), - gen_enc_components_call1(Erule,TopType,Root2,Rpos2,MaybeComma,DynamicEnc,noext); + gen_enc_components_call(Erule,TopType,{Root1++Root2,ExtList},MaybeComma,DynamicEnc,Ext); gen_enc_components_call(Erule,TopType,{CompList,ExtList},MaybeComma,DynamicEnc,Ext) -> %% The type has extensionmarker Rpos = gen_enc_components_call1(Erule,TopType,CompList,1,MaybeComma,DynamicEnc,noext), @@ -659,7 +695,8 @@ gen_enc_components_call(Erule,TopType,{CompList,ExtList},MaybeComma,DynamicEnc,E _ -> true end, %handle extensions - gen_enc_components_call1(Erule,TopType,ExtList,Rpos,MaybeComma,DynamicEnc,Ext); + NewExtList = wrap_extensionAdditionGroups(ExtList), + gen_enc_components_call1(Erule,TopType,NewExtList,Rpos,MaybeComma,DynamicEnc,Ext); gen_enc_components_call(Erule,TopType, CompList, MaybeComma, DynamicEnc, Ext) -> %% The type has no extensionmarker gen_enc_components_call1(Erule,TopType,CompList,1,MaybeComma,DynamicEnc,Ext). @@ -719,6 +756,26 @@ gen_enc_component_default(Erule,TopType,Cname,Type,Pos,DynamicEnc,Ext,DefaultVal NextElement = asn1ct_gen:mk_var(asn1ct_name:curr(tmpval)), gen_enc_line(Erule,TopType,Cname,Type,NextElement, Pos,DynamicEnc,Ext), emit({nl,"end"}). + +gen_enc_component_optional(Erule,TopType,Cname, + Type=#type{def=#'SEQUENCE'{ + extaddgroup=Number, + components=ExtGroupCompList}}, + Pos,DynamicEnc,Ext) when is_integer(Number) -> + emit({nl,"begin",nl}), + + asn1ct_name:new(tmpval), + ExtAddGroupTypeName = asn1ct_gen:list2name([Cname|TopType]), + emit({{curr,tmpval}," = {'",ExtAddGroupTypeName,"', "}), + ExtNames = [ExtName||#'ComponentType'{name=ExtName}<-ExtGroupCompList], + Elements = make_elements(Pos+1,"Val1",ExtNames), + emit({Elements,"},"}), + InnerType = asn1ct_gen:get_inner(Type#type.def), + emit({nl,"%% attribute number ",Pos," with type ", + InnerType,nl}), + NextElement = asn1ct_gen:mk_var(asn1ct_name:curr(tmpval)), + gen_enc_line(Erule,TopType,Cname,Type,NextElement, Pos,DynamicEnc,Ext), + emit({nl,"end"}); gen_enc_component_optional(Erule,TopType,Cname,Type,Pos,DynamicEnc,Ext) -> Element = make_element(Pos+1,"Val1",Cname), emit({"case ",Element," of",nl}), @@ -834,29 +891,7 @@ gen_enc_line(Erule,TopType,Cname,Type,Element, _Pos,DynamicEnc,Ext) -> _ -> true end. gen_dec_components_call(Erule,TopType,{Root1,ExtList,Root2},MaybeComma,DecInfObj,Ext,NumberOfOptionals) -> - %% The type has extensionmarker - OptTable = create_optionality_table(Root1 ++ Root2), - {Rpos,AccTerm,AccBytes} = - gen_dec_components_call1(Erule,TopType, Root1, 1, OptTable, - MaybeComma,DecInfObj, noext,[],[], - NumberOfOptionals), - emit([",",nl,"{Extensions,",{next,bytes},"} = "]), - emit(["?RT_PER:getextension(Ext,",{curr,bytes},"),",nl]), - asn1ct_name:new(bytes), - {Epos,AccTermE,AccBytesE} = - gen_dec_components_call1(Erule,TopType,ExtList,Rpos, OptTable, "", - DecInfObj,Ext,[],[],NumberOfOptionals), - case ExtList of - [] -> true; - _ -> emit([",",nl]) - end, - emit([{next,bytes},"= ?RT_PER:skipextensions(",{curr,bytes},",", - length(ExtList)+1,",Extensions),",nl]), - asn1ct_name:new(bytes), - {_RPos2,AccTerm2,AccBytes2} = - gen_dec_components_call1(Erule,TopType,Root2,Epos,OptTable, - "",DecInfObj,noext,[],[],NumberOfOptionals), - {AccTerm++AccTermE++AccTerm2,AccBytes++AccBytesE++AccBytes2}; + gen_dec_components_call(Erule,TopType,{Root1++Root2,ExtList},MaybeComma,DecInfObj,Ext,NumberOfOptionals); gen_dec_components_call(Erule,TopType,{CompList,ExtList},MaybeComma, DecInfObj,Ext,NumberOfOptionals) -> %% The type has extensionmarker @@ -868,8 +903,9 @@ gen_dec_components_call(Erule,TopType,{CompList,ExtList},MaybeComma, emit([",",nl,"{Extensions,",{next,bytes},"} = "]), emit(["?RT_PER:getextension(Ext,",{curr,bytes},"),",nl]), asn1ct_name:new(bytes), + NewExtList = wrap_extensionAdditionGroups(ExtList), {_Epos,AccTermE,AccBytesE} = - gen_dec_components_call1(Erule,TopType,ExtList,Rpos, OptTable, + gen_dec_components_call1(Erule,TopType,NewExtList,Rpos, OptTable, "",DecInfObj,Ext,[],[],NumberOfOptionals), case ExtList of [] -> true; @@ -942,8 +978,18 @@ gen_dec_components_call1(Erule,TopType, asn1ct_name:new(tmpterm), emit({"{",{curr,tmpterm},", ",{next,bytes},"} = "}); _ -> - asn1ct_name:new(term), - emit({"{",{curr,term},",",{next,bytes},"} = "}) + case Type of + #type{def=#'SEQUENCE'{ + extaddgroup=Number1, + components=ExtGroupCompList1}} when is_integer(Number1)-> + emit({"{{_,"}), + emit_extaddgroupTerms(term,ExtGroupCompList1), + emit({"}"}); + _ -> + asn1ct_name:new(term), + emit({"{",{curr,term}}) + end, + emit({",",{next,bytes},"} = "}) end, case {Ext,Prop,is_optimized(Erule)} of @@ -967,11 +1013,24 @@ gen_dec_components_call1(Erule,TopType, {noext,mandatory} -> true; % generate nothing {noext,_} -> emit([";",nl,"0 ->"]), - gen_dec_component_no_val(TopType,Cname,Type,Prop,Tpos,Ext), + emit(["{"]), + gen_dec_component_no_val(Ext,Prop), + emit({",",{curr,bytes},"}",nl}), emit([nl,"end"]); _ -> emit([";",nl,"_ ->",nl]), - gen_dec_component_no_val(TopType,Cname,Type,Prop,Tpos,Ext), + emit(["{"]), + case Type of + #type{def=#'SEQUENCE'{ + extaddgroup=Number2, + components=ExtGroupCompList2}} when is_integer(Number2)-> + emit({"{extAddGroup,"}), + gen_dec_extaddGroup_no_val(Ext,ExtGroupCompList2), + emit({"}"}); + _ -> + gen_dec_component_no_val(Ext,Prop) + end, + emit({",",{curr,bytes},"}",nl}), emit([nl,"end"]) end, asn1ct_name:new(bytes), @@ -988,13 +1047,22 @@ gen_dec_components_call1(Erule,TopType, gen_dec_components_call1(_,_TopType,[],Pos,_OptTable,_,_,_,AccTerm,AccBytes,_NumberOfOptionals) -> {Pos,AccTerm,AccBytes}. - -gen_dec_component_no_val(_,_,_,{'DEFAULT',DefVal},_,_) -> - emit(["{",{asis,DefVal},",",{curr,bytes},"}",nl]); -gen_dec_component_no_val(_,_,_,'OPTIONAL',_,_) -> - emit({"{asn1_NOVALUE,",{curr,bytes},"}",nl}); -gen_dec_component_no_val(_,_,_,mandatory,_,{ext,_,_}) -> - emit({"{asn1_NOVALUE,",{curr,bytes},"}",nl}). +gen_dec_extaddGroup_no_val(Ext,[#'ComponentType'{prop=Prop}])-> + gen_dec_component_no_val(Ext,Prop), + ok; +gen_dec_extaddGroup_no_val(Ext,[#'ComponentType'{prop=Prop}|Rest])-> + gen_dec_component_no_val(Ext,Prop), + emit({","}), + gen_dec_extaddGroup_no_val(Ext,Rest); +gen_dec_extaddGroup_no_val(_, []) -> + ok. + +gen_dec_component_no_val(_,{'DEFAULT',DefVal}) -> + emit([{asis,DefVal}]); +gen_dec_component_no_val(_,'OPTIONAL') -> + emit({"asn1_NOVALUE"}); +gen_dec_component_no_val({ext,_,_},mandatory) -> + emit({"asn1_NOVALUE"}). gen_dec_line(Erule,TopType,Cname,Type,Pos,DecInfObj,Ext,Prop) -> @@ -1192,6 +1260,14 @@ gen_enc_choice_tag({C1,C2},_,_) -> N2 = get_name_list(C2), emit(["?RT_PER:set_choice(element(1,Val),", {asis,{N1,N2}},", ",{asis,{length(N1),length(N2)}},")"]); + +gen_enc_choice_tag({C1,C2,C3},_,_) -> + N1 = get_name_list(C1), + N2 = get_name_list(C2), + N3 = get_name_list(C3), + Root = N1 ++ N3, + emit(["?RT_PER:set_choice(element(1,Val),", + {asis,{Root,N2}},", ",{asis,{length(Root),length(N2)}},")"]); gen_enc_choice_tag(C,_,_) -> N = get_name_list(C), emit(["?RT_PER:set_choice(element(1,Val),", @@ -1208,6 +1284,8 @@ get_name_list([], Acc) -> gen_enc_choice2(Erule,TopType, {L1,L2}, Ext) -> gen_enc_choice2(Erule,TopType, L1 ++ L2, 0, Ext); +gen_enc_choice2(Erule,TopType, {L1,L2,L3}, Ext) -> + gen_enc_choice2(Erule,TopType, L1 ++ L3 ++ L2, 0, Ext); gen_enc_choice2(Erule,TopType, L, Ext) -> gen_enc_choice2(Erule,TopType, L, 0, Ext). @@ -1279,6 +1357,9 @@ gen_dec_choice1(Erule,TopType,CompList,noext) -> gen_dec_choice1(Erule,TopType,{RootList,ExtList},Ext) -> NewList = RootList ++ ExtList, gen_dec_choice1(Erule,TopType, NewList, Ext); +gen_dec_choice1(Erule,TopType,{RootList,ExtList,RootList2},Ext) -> + NewList = RootList ++ RootList2 ++ ExtList, + gen_dec_choice1(Erule,TopType, NewList, Ext); gen_dec_choice1(Erule,TopType,CompList,{ext,ExtPos,ExtNum}) -> emit({"{Choice,",{curr,bytes}, "} = ?RT_PER:getchoice(",{prev,bytes},",", @@ -1347,6 +1428,18 @@ gen_encode_prim_wrapper(CtgenMod,Erule,Cont,DoTag,Value) -> CtgenMod:gen_encode_prim(Erule,Cont,DoTag,Value). % erase(component_type). +make_elements(I,Val,ExtCnames) -> + make_elements(I,Val,ExtCnames,[]). + +make_elements(I,Val,[ExtCname],Acc)-> % the last one, no comma needed + Element = make_element(I,Val,ExtCname), + make_elements(I+1,Val,[],[Element|Acc]); +make_elements(I,Val,[ExtCname|Rest],Acc)-> + Element = make_element(I,Val,ExtCname), + make_elements(I+1,Val,Rest,[", ",Element|Acc]); +make_elements(_I,_,[],Acc) -> + lists:reverse(Acc). + make_element(I,Val,Cname) -> case tuple_notation_allowed() of true -> @@ -1355,6 +1448,55 @@ make_element(I,Val,Cname) -> io_lib:format("element(~w,~s)",[I,Val]) end. +emit_extaddgroupTerms(VarSeries,[_]) -> + asn1ct_name:new(VarSeries), + emit({curr,VarSeries}), + ok; +emit_extaddgroupTerms(VarSeries,[_|Rest]) -> + asn1ct_name:new(VarSeries), + emit({{curr,VarSeries},","}), + emit_extaddgroupTerms(VarSeries,Rest); +emit_extaddgroupTerms(_,[]) -> + ok. +wrap_compList({Root1,Ext,Root2}) -> + {Root1,wrap_extensionAdditionGroups(Ext),Root2}; +wrap_compList({Root1,Ext}) -> + {Root1,wrap_extensionAdditionGroups(Ext)}; +wrap_compList(CompList) -> + CompList. +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%% Will convert all componentTypes following 'ExtensionAdditionGroup' +%% up to the matching 'ExtensionAdditionGroupEnd' into one componentType +%% of type SEQUENCE with the componentTypes as components +%% +wrap_extensionAdditionGroups(ExtCompList) -> + wrap_extensionAdditionGroups(ExtCompList,[],0). + +wrap_extensionAdditionGroups([{'ExtensionAdditionGroup',_Number}|Rest],Acc,0) -> + {ExtGroupCompList= + [#'ComponentType'{textual_order=TextPos}|_], + ['ExtensionAdditionGroupEnd'|Rest2]} = + lists:splitwith(fun(#'ComponentType'{}) -> true; + (_) -> false + end, + Rest), + wrap_extensionAdditionGroups(Rest2, + [#'ComponentType'{ + name='ExtAddGroup', % FIXME: handles ony one ExtAddGroup + typespec=#type{def=#'SEQUENCE'{ + extaddgroup=1,% FIXME: handles only one + components=ExtGroupCompList}}, + textual_order = TextPos, + prop='OPTIONAL'}|Acc],length(ExtGroupCompList)-1); +wrap_extensionAdditionGroups([H=#'ComponentType'{textual_order=Tord}|T],Acc,ExtAddGroupDiff) when is_integer(Tord) -> + wrap_extensionAdditionGroups(T,[H#'ComponentType'{ + textual_order=Tord - ExtAddGroupDiff}|Acc],ExtAddGroupDiff); +wrap_extensionAdditionGroups([H|T],Acc,ExtAddGroupDiff) -> + wrap_extensionAdditionGroups(T,[H|Acc],ExtAddGroupDiff); +wrap_extensionAdditionGroups([],Acc,_) -> + lists:reverse(Acc). + + tuple_notation_allowed() -> Options = get(encoding_options), not (lists:member(optimize,Options) orelse lists:member(uper_bin,Options)). diff --git a/lib/asn1/src/asn1ct_gen.erl b/lib/asn1/src/asn1ct_gen.erl index eab5fb4a2a..6b511a66da 100644 --- a/lib/asn1/src/asn1ct_gen.erl +++ b/lib/asn1/src/asn1ct_gen.erl @@ -536,14 +536,34 @@ gen_part_decode_funcs({primitive,bif},_TypeName, gen_part_decode_funcs(WhatKind,_TypeName,{_,Directive,_,_}) -> throw({error,{asn1,{"Not implemented yet",WhatKind," partial incomplete directive:",Directive}}}). + +extaddgroup2sequence(ExtList) -> + extaddgroup2sequence(ExtList,[]). + +extaddgroup2sequence([{'ExtensionAdditionGroup',Number0}|T],Acc) -> + Number = case Number0 of undefined -> 1; _ -> Number0 end, + {ExtGroupComps,['ExtensionAdditionGroupEnd'|T2]} = + lists:splitwith(fun(Elem) -> is_record(Elem,'ComponentType') end,T), + extaddgroup2sequence(T2,[#'ComponentType'{ + name='ExtAddGroup', + typespec=#type{def=#'SEQUENCE'{ + extaddgroup=Number, + components=ExtGroupComps}}, + prop='OPTIONAL'}|Acc]); +extaddgroup2sequence([C|T],Acc) -> + extaddgroup2sequence(T,[C|Acc]); +extaddgroup2sequence([],Acc) -> + lists:reverse(Acc). + + gen_types(Erules,Tname,{RootL1,ExtList,RootL2}) when is_list(RootL1), is_list(RootL2) -> gen_types(Erules,Tname,RootL1), - gen_types(Erules,Tname,ExtList), + gen_types(Erules,Tname,extaddgroup2sequence(ExtList)), gen_types(Erules,Tname,RootL2); gen_types(Erules,Tname,{RootList,ExtList}) when is_list(RootList) -> gen_types(Erules,Tname,RootList), - gen_types(Erules,Tname,ExtList); + gen_types(Erules,Tname,extaddgroup2sequence(ExtList)); gen_types(Erules,Tname,[{'EXTENSIONMARK',_,_}|Rest]) -> gen_types(Erules,Tname,Rest); gen_types(Erules,Tname,[ComponentType|Rest]) -> @@ -1543,19 +1563,18 @@ gen_record2(Name,SeqOrSet,Comps) -> gen_record2(_Name,_SeqOrSet,[],_Com,_Extension) -> true; -gen_record2(Name,SeqOrSet,[{'EXTENSIONMARK',_,_}|T],Com,Extension) -> - gen_record2(Name,SeqOrSet,T,Com,Extension); -gen_record2(_Name,_SeqOrSet,[H],Com,Extension) -> - #'ComponentType'{name=Cname} = H, +gen_record2(_Name,_SeqOrSet,[H = #'ComponentType'{name=Cname}],Com,Extension) -> emit(Com), emit({asis,Cname}), gen_record_default(H, Extension); -gen_record2(Name,SeqOrSet,[H|T],Com, Extension) -> - #'ComponentType'{name=Cname} = H, +gen_record2(Name,SeqOrSet,[H = #'ComponentType'{name=Cname}|T],Com, Extension) -> emit(Com), emit({asis,Cname}), gen_record_default(H, Extension), - gen_record2(Name,SeqOrSet,T,", ", Extension). + gen_record2(Name,SeqOrSet,T,", ", Extension); +gen_record2(Name,SeqOrSet,[_|T],Com,Extension) -> + %% skip EXTENSIONMARK, ExtensionAdditionGroup and other markers + gen_record2(Name,SeqOrSet,T,Com,Extension). gen_record_default(#'ComponentType'{prop='OPTIONAL'}, _)-> emit(" = asn1_NOVALUE"); diff --git a/lib/asn1/src/asn1ct_parser2.erl b/lib/asn1/src/asn1ct_parser2.erl index 46d7ad6fdb..224a535e87 100644 --- a/lib/asn1/src/asn1ct_parser2.erl +++ b/lib/asn1/src/asn1ct_parser2.erl @@ -417,10 +417,22 @@ parse_BuiltinType([{'CHARACTER',_},{'STRING',_}|Rest]) -> {#type{def='CHARACTER STRING'},Rest}; parse_BuiltinType([{'CHOICE',_},{'{',_}|Rest]) -> - {AlternativeTypeLists,Rest2} = parse_AlternativeTypeLists(Rest,get(extensiondefault)), + {AlternativeTypeLists,Rest2} = parse_AlternativeTypeLists(Rest), + AlternativeTypeLists1 = + lists:filter(fun(#'ExtensionAdditionGroup'{}) -> false; + ('ExtensionAdditionGroupEnd') -> false; + (_) -> true + end,AlternativeTypeLists), case Rest2 of [{'}',_}|Rest3] -> - {#type{def={'CHOICE',AlternativeTypeLists}},Rest3}; + AlternativeTypeLists2 = + case {[Ext||Ext = #'EXTENSIONMARK'{} <- AlternativeTypeLists1], + get(extensiondefault)} of + {[],'IMPLIED'} -> AlternativeTypeLists1 ++ [#'EXTENSIONMARK'{}]; + _ -> AlternativeTypeLists1 + end, + + {#type{def={'CHOICE',AlternativeTypeLists2}},Rest3}; _ -> throw({asn1_error,{get_line(hd(Rest2)),get(asn1_module), [got,get_token(hd(Rest2)),expected,'}']}}) @@ -479,16 +491,19 @@ parse_BuiltinType([{'REAL',_}|Rest]) -> {#type{def='REAL'},Rest}; parse_BuiltinType([{'RELATIVE-OID',_}|Rest]) -> {#type{def='RELATIVE-OID'},Rest}; -parse_BuiltinType([{'SEQUENCE',_},{'{',_},{'...',Line},{'}',_}|Rest]) -> - {#type{def=#'SEQUENCE'{components=[{'EXTENSIONMARK',Line,undefined}]}}, +parse_BuiltinType([{'SEQUENCE',_},{'{',_},{'}',_}|Rest]) -> + {#type{def=#'SEQUENCE'{components=[]}}, Rest}; +parse_BuiltinType([{'SEQUENCE',_},{'{',_},{'...',Line},{'}',_}|Rest]) -> + {#type{def=#'SEQUENCE'{components=[#'EXTENSIONMARK'{pos = Line}]}},Rest}; parse_BuiltinType([{'SEQUENCE',_},{'{',_},{'...',Line},{'!',_}|Rest]) -> {ExceptionIdentification,Rest2} = parse_ExceptionIdentification(Rest), case Rest2 of [{'}',_}|Rest3] -> - {#type{def=#'SEQUENCE'{components=[{'EXTENSIONMARK', - Line, - ExceptionIdentification}]}}, + {#type{def=#'SEQUENCE'{ + components=[#'EXTENSIONMARK'{ + pos = Line, + val = ExceptionIdentification}]}}, Rest3}; _ -> {ComponentTypeLists,Rest3}= @@ -537,13 +552,14 @@ parse_BuiltinType([{'SEQUENCE',_},{'OF',_}|Rest]) -> parse_BuiltinType([{'SET',_},{'{',_},{'...',Line},{'}',_}|Rest]) -> - {#type{def=#'SET'{components=[{'EXTENSIONMARK',Line,undefined}]}},Rest}; + {#type{def=#'SET'{components=[#'EXTENSIONMARK'{pos = Line}]}},Rest}; parse_BuiltinType([{'SET',_},{'{',_},{'...',Line},{'!',_}|Rest]) -> {ExceptionIdentification,Rest2} = parse_ExceptionIdentification(Rest), case Rest2 of [{'}',_}|Rest3] -> {#type{def=#'SET'{components= - [{'EXTENSIONMARK',Line,ExceptionIdentification}]}}, + [#'EXTENSIONMARK'{pos = Line, + val = ExceptionIdentification}]}}, Rest3}; _ -> throw({asn1_error,{get_line(hd(Rest2)),get(asn1_module), @@ -2323,101 +2339,197 @@ to_set(V) when is_list(V) -> to_set(V) -> ordsets:from_list([V]). +parse_AlternativeTypeLists(Tokens) -> + parse_AlternativeTypeLists(Tokens,[]). -parse_AlternativeTypeLists(Tokens,ExtensionDefault) -> - {AltTypeList,Rest1} = parse_AlternativeTypeList(Tokens), - {ExtensionAndException,Rest2} = - case Rest1 of - [{',',_},{'...',L1},{'!',_}|Rest12] -> - {_,Rest13} = parse_ExceptionIdentification(Rest12), - %% Exception info is currently thrown away - {[#'EXTENSIONMARK'{pos=L1}],Rest13}; - [{',',_},{'...',L1}|Rest12] -> - {[#'EXTENSIONMARK'{pos=L1}],Rest12}; - _ -> - {[],Rest1} - end, - {AltTypeList2,Rest5} = - case ExtensionAndException of - [] -> - {AltTypeList,Rest2}; - _ -> - {ExtensionAddition,Rest3} = - case Rest2 of - [{',',_}|Rest23] -> - parse_ExtensionAdditionAlternativeList(Rest23); - _ -> - {[],Rest2} - end, - {OptionalExtensionMarker,Rest4} = - case Rest3 of - [{',',_},{'...',L3}|Rest31] -> - {[#'EXTENSIONMARK'{pos=L3}],Rest31}; - _ -> - {[],Rest3} - end, - {AltTypeList ++ ExtensionAndException ++ - ExtensionAddition ++ OptionalExtensionMarker, Rest4} - end, - AltTypeList3 = - case [X || X=#'EXTENSIONMARK'{} <- AltTypeList2] of - [] when ExtensionDefault == 'IMPLIED' -> - AltTypeList2 ++ [#'EXTENSIONMARK'{}]; - _ -> - AltTypeList2 - end, - {AltTypeList3,Rest5}. - +parse_AlternativeTypeLists(Tokens = [{identifier,_,_}|_Rest0],Clist) -> + {CompList,Rest1} = parse_AlternativeTypeList(Tokens,[]), + parse_AlternativeTypeLists(Rest1,Clist++CompList); +parse_AlternativeTypeLists([{'...',L1},{'!',_}|Rest02],Clist0) -> + {_,Rest03} = parse_ExceptionIdentification(Rest02), + %% Exception info is currently thrown away + parse_AlternativeTypeLists2(Rest03,Clist0++[#'EXTENSIONMARK'{pos=L1}]); +parse_AlternativeTypeLists([{',',L1},{'...',_},{'!',_}|Rest02],Clist0) when Clist0 =/= []-> + {_,Rest03} = parse_ExceptionIdentification(Rest02), + %% Exception info is currently thrown away + parse_AlternativeTypeLists2(Rest03,Clist0++[#'EXTENSIONMARK'{pos=L1}]); + +parse_AlternativeTypeLists([{',',_},{'...',L1}|Rest02],Clist0) when Clist0 =/= []-> + parse_AlternativeTypeLists2(Rest02,Clist0++[#'EXTENSIONMARK'{pos=L1}]); +parse_AlternativeTypeLists([{'...',L1}|Rest02],Clist0) -> + parse_AlternativeTypeLists2(Rest02,Clist0++[#'EXTENSIONMARK'{pos=L1}]); +parse_AlternativeTypeLists(Tokens = [{'}',_L1}|_Rest02],Clist0) -> + {Clist0,Tokens}. + +parse_AlternativeTypeLists2(Tokens,Clist) -> + {ExtAdd,Rest} = parse_ExtensionAdditionAlternatives(Tokens,Clist), + {Clist2,Rest2} = parse_OptionalExtensionMarker(Rest,lists:flatten(ExtAdd)), + case Rest2 of + [{',',_}|Rest3] -> + {CompList,Rest4} = parse_AlternativeTypeList(Rest3,[]), + {Clist2 ++ CompList,Rest4}; + _ -> + {Clist2,Rest2} + end. -parse_AlternativeTypeList(Tokens) -> - parse_AlternativeTypeList(Tokens,[]). -parse_AlternativeTypeList(Tokens,Acc) -> - {NamedType,Rest} = parse_NamedType(Tokens), + +parse_AlternativeTypeList([{',',_},Id = {identifier,_,_}|Rest],Acc) when Acc =/= [] -> + {AlternativeType,Rest2} = parse_NamedType([Id|Rest]), + parse_AlternativeTypeList(Rest2,[AlternativeType|Acc]); +parse_AlternativeTypeList(Tokens = [{'}',_}|_],Acc) -> + {lists:reverse(Acc),Tokens}; +parse_AlternativeTypeList(Tokens = [{']',_},{']',_}|_],Acc) -> + {lists:reverse(Acc),Tokens}; +parse_AlternativeTypeList(Tokens = [{',',_},{'...',_}|_],Acc) -> + {lists:reverse(Acc),Tokens}; +parse_AlternativeTypeList(Tokens,[]) -> + {AlternativeType,Rest} = parse_NamedType(Tokens), + parse_AlternativeTypeList(Rest,[AlternativeType]); +parse_AlternativeTypeList(Tokens,_) -> + throw({asn1_error, + {get_line(hd(Tokens)),get(asn1_module), + [got,[get_token(hd(Tokens)),get_token(hd(tl(Tokens)))], + expected,['}',', identifier']]}}). + +parse_ExtensionAdditionAlternatives(Tokens =[{',',_}|_],Clist) -> + {ExtAddList,Rest2} = parse_ExtensionAdditionAlternativesList(Tokens,[]), + {Clist++lists:flatten(ExtAddList),Rest2}; +parse_ExtensionAdditionAlternatives(Tokens,Clist) -> + %% Empty + {Clist,Tokens}. + +parse_ExtensionAdditionAlternativesList([{',',_},Id = {identifier,_,_}|Rest],Acc) -> + {AlternativeType,Rest2} = parse_NamedType([Id|Rest]), + parse_ExtensionAdditionAlternativesList(Rest2,[AlternativeType|Acc]); +parse_ExtensionAdditionAlternativesList([{',',_},C1 = {'[',_},C2 = {'[',_}|Rest],Acc) -> + {ExtAddGroup,Rest2} = parse_ExtensionAdditionAlternativesGroup([C1,C2|Rest],[]), + parse_ExtensionAdditionAlternativesList(Rest2,[ExtAddGroup|Acc]); +parse_ExtensionAdditionAlternativesList(Tokens = [{'}',_}|_],Acc) -> + {lists:reverse(Acc),Tokens}; +parse_ExtensionAdditionAlternativesList(Tokens = [{',',_},{'...',_}|_],Acc) -> + {lists:reverse(Acc),Tokens}; +parse_ExtensionAdditionAlternativesList(Tokens,_) -> + throw({asn1_error, + {get_line(hd(Tokens)),get(asn1_module), + [got,[get_token(hd(Tokens)),get_token(hd(tl(Tokens)))], + expected,['}',', identifier']]}}). + + +parse_ExtensionAdditionAlternativesGroup([ {'[',_},{'[',_},_VsnNr = {number,_,Num},{':',_}|Rest],[]) -> + parse_ExtensionAdditionAlternativesGroup2(Rest,Num); +parse_ExtensionAdditionAlternativesGroup([ {'[',_},{'[',_}|Rest],[]) -> + parse_ExtensionAdditionAlternativesGroup2(Rest,undefined); +parse_ExtensionAdditionAlternativesGroup(Tokens,_) -> + throw({asn1_error, + {get_line(hd(Tokens)),get(asn1_module), + [got,[get_token(hd(Tokens)),get_token(hd(tl(Tokens)))], + expected,['[[']]}}). + + +parse_ExtensionAdditionAlternativesGroup2(Tokens,Num) -> + {CompTypeList,Rest} = parse_AlternativeTypeList(Tokens,[]), case Rest of - [{',',_},Id = {identifier,_,_}|Rest2] -> - parse_AlternativeTypeList([Id|Rest2],[NamedType|Acc]); + [{']',_},{']',_}|Rest2] -> + {[{'ExtensionAdditionGroup',Num}|CompTypeList] ++ + ['ExtensionAdditionGroupEnd'],Rest2}; _ -> - {lists:reverse([NamedType|Acc]),Rest} - end. - + throw({asn1_error,{get_line(hd(Rest)),get(asn1_module), + [got,get_token(hd(Rest)),expected,[']]']]}}) + end. + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +%% parse_AlternativeTypeLists(Tokens,ExtensionDefault) -> +%% {AltTypeList,Rest1} = parse_AlternativeTypeList(Tokens), +%% {ExtensionAndException,Rest2} = +%% case Rest1 of +%% [{',',_},{'...',L1},{'!',_}|Rest12] -> +%% {_,Rest13} = parse_ExceptionIdentification(Rest12), +%% %% Exception info is currently thrown away +%% {[#'EXTENSIONMARK'{pos=L1}],Rest13}; +%% [{',',_},{'...',L1}|Rest12] -> +%% {[#'EXTENSIONMARK'{pos=L1}],Rest12}; +%% _ -> +%% {[],Rest1} +%% end, +%% {AltTypeList2,Rest5} = +%% case ExtensionAndException of +%% [] -> +%% {AltTypeList,Rest2}; +%% _ -> +%% {ExtensionAddition,Rest3} = +%% case Rest2 of +%% [{',',_}|Rest23] -> +%% parse_ExtensionAdditionAlternativeList(Rest23); +%% _ -> +%% {[],Rest2} +%% end, +%% {OptionalExtensionMarker,Rest4} = +%% case Rest3 of +%% [{',',_},{'...',L3}|Rest31] -> +%% {[#'EXTENSIONMARK'{pos=L3}],Rest31}; +%% _ -> +%% {[],Rest3} +%% end, +%% {AltTypeList ++ ExtensionAndException ++ +%% ExtensionAddition ++ OptionalExtensionMarker, Rest4} +%% end, +%% AltTypeList3 = +%% case [X || X=#'EXTENSIONMARK'{} <- AltTypeList2] of +%% [] when ExtensionDefault == 'IMPLIED' -> +%% AltTypeList2 ++ [#'EXTENSIONMARK'{}]; +%% _ -> +%% AltTypeList2 +%% end, +%% {AltTypeList3,Rest5}. -parse_ExtensionAdditionAlternativeList(Tokens) -> - parse_ExtensionAdditionAlternativeList(Tokens,[]). +%% parse_AlternativeTypeList(Tokens) -> +%% parse_AlternativeTypeList(Tokens,[]). + +%% parse_AlternativeTypeList(Tokens,Acc) -> +%% {NamedType,Rest} = parse_NamedType(Tokens), +%% case Rest of +%% [{',',_},Id = {identifier,_,_}|Rest2] -> +%% parse_AlternativeTypeList([Id|Rest2],[NamedType|Acc]); +%% _ -> +%% {lists:reverse([NamedType|Acc]),Rest} +%% end. + -parse_ExtensionAdditionAlternativeList(Tokens,Acc) -> - {Element,Rest0} = - case Tokens of - [{identifier,_,_}|_Rest] -> - parse_NamedType(Tokens); - [{'[',_},{'[',_}|_] -> - parse_ExtensionAdditionAlternatives(Tokens) - end, - case Rest0 of - [{',',_}|Rest01] -> - parse_ExtensionAdditionAlternativeList(Rest01,[Element|Acc]); - _ -> - {lists:reverse([Element|Acc]),Rest0} - end. -parse_ExtensionAdditionAlternatives([{'[',_},{'[',_}|Rest]) -> - parse_ExtensionAdditionAlternatives(Rest,[]); -parse_ExtensionAdditionAlternatives(Tokens) -> - throw({asn1_error,{get_line(hd(Tokens)),get(asn1_module), - [got,get_token(hd(Tokens)),expected,'[[']}}). +%% parse_ExtensionAdditionAlternativeList(Tokens) -> +%% parse_ExtensionAdditionAlternativeList(Tokens,[]). + +%% parse_ExtensionAdditionAlternativeList([{'[[',_}|Rest],Acc) -> +%% parse_ExtensionAdditionAlternativeList(Rest,Acc); +%% parse_ExtensionAdditionAlternativeList(Tokens = [{identifier,_,_}|_Rest],Acc) -> +%% {Element,Rest0} = parse_NamedType(Tokens); +%% case Rest0 of +%% [{',',_}|Rest01] -> +%% parse_ExtensionAdditionAlternativeList(Rest01,[Element|Acc]); +%% _ -> +%% {lists:reverse([Element|Acc]),Rest0} +%% end. -parse_ExtensionAdditionAlternatives([Id = {identifier,_,_}|Rest],Acc) -> - {NamedType, Rest2} = parse_NamedType([Id|Rest]), - case Rest2 of - [{',',_}|Rest21] -> - parse_ExtensionAdditionAlternatives(Rest21,[NamedType|Acc]); - [{']',_},{']',_}|Rest21] -> - {lists:reverse(Acc),Rest21}; - _ -> - throw({asn1_error,{get_line(hd(Rest2)),get(asn1_module), - [got,get_token(hd(Rest2)),expected,[',',']]']]}}) - end. +%% parse_ExtensionAdditionAlternatives([{'[[',_}|Rest]) -> +%% parse_ExtensionAdditionAlternatives(Rest,[]); +%% parse_ExtensionAdditionAlternatives(Tokens) -> +%% throw({asn1_error,{get_line(hd(Tokens)),get(asn1_module), +%% [got,get_token(hd(Tokens)),expected,'[[']}}). + +%% parse_ExtensionAdditionAlternatives([Id = {identifier,_,_}|Rest],Acc) -> +%% {NamedType, Rest2} = parse_NamedType([Id|Rest]), +%% case Rest2 of +%% [{',',_}|Rest21] -> +%% parse_ExtensionAdditionAlternatives(Rest21,[NamedType|Acc]); +%% [{']]',_}|Rest21] -> +%% {lists:reverse(Acc),Rest21}; +%% _ -> +%% throw({asn1_error,{get_line(hd(Rest2)),get(asn1_module), +%% [got,get_token(hd(Rest2)),expected,[',',']]']]}}) +%% end. parse_NamedType([{identifier,L1,Idname}|Rest]) -> {Type,Rest2} = parse_Type(Rest), @@ -2428,144 +2540,123 @@ parse_NamedType(Tokens) -> parse_ComponentTypeLists(Tokens) -> -% Resulting tuple {ComponentTypeList,Rest1} is returned - case Tokens of - [{identifier,_,_}|_Rest0] -> - {Clist,Rest01} = parse_ComponentTypeList(Tokens), - case Rest01 of - [{',',_}|Rest02] -> - parse_ComponentTypeLists(Rest02,Clist); % 5 - 13 - _ -> - {Clist,Rest01} - end; - [{'COMPONENTS',_},{'OF',_}|_Rest] -> - {Clist,Rest01} = parse_ComponentTypeList(Tokens), - case Rest01 of - [{',',_}|Rest02] -> - parse_ComponentTypeLists(Rest02,Clist); - _ -> - {Clist,Rest01} - end; + parse_ComponentTypeLists(Tokens,[]). + +parse_ComponentTypeLists(Tokens = [{identifier,_,_}|_Rest0],Clist) -> + {CompList,Rest1} = parse_ComponentTypeList(Tokens,[]), + parse_ComponentTypeLists(Rest1,Clist++CompList); +parse_ComponentTypeLists(Tokens = [{'COMPONENTS',_},{'OF',_}|_Rest],Clist) -> + {CompList,Rest1} = parse_ComponentTypeList(Tokens,[]), + parse_ComponentTypeLists(Rest1,Clist++CompList); +parse_ComponentTypeLists([{'...',L1},{'!',_}|Rest02],Clist0) -> + {_,Rest03} = parse_ExceptionIdentification(Rest02), + %% Exception info is currently thrown away + parse_ComponentTypeLists2(Rest03,Clist0++[#'EXTENSIONMARK'{pos=L1}]); +parse_ComponentTypeLists([{',',L1},{'...',_},{'!',_}|Rest02],Clist0) when Clist0 =/= []-> + {_,Rest03} = parse_ExceptionIdentification(Rest02), + %% Exception info is currently thrown away + parse_ComponentTypeLists2(Rest03,Clist0++[#'EXTENSIONMARK'{pos=L1}]); + + parse_ComponentTypeLists([{',',_},{'...',L1}|Rest02],Clist0) when Clist0 =/= []-> + parse_ComponentTypeLists2(Rest02,Clist0++[#'EXTENSIONMARK'{pos=L1}]); +parse_ComponentTypeLists([{'...',L1}|Rest02],Clist0) -> + parse_ComponentTypeLists2(Rest02,Clist0++[#'EXTENSIONMARK'{pos=L1}]); +parse_ComponentTypeLists(Tokens = [{'}',_L1}|_Rest02],Clist0) -> + {Clist0,Tokens}. + +parse_ComponentTypeLists2(Tokens,Clist) -> + {ExtAdd,Rest} = parse_ExtensionAdditions(Tokens,Clist), + {Clist2,Rest2} = parse_OptionalExtensionMarker(Rest,lists:flatten(ExtAdd)), + case Rest2 of + [{',',_}|Rest3] -> + {CompList,Rest4} = parse_ComponentTypeList(Rest3,[]), + {Clist2 ++ CompList,Rest4}; _ -> - parse_ComponentTypeLists(Tokens,[]) + {Clist2,Rest2} end. -parse_ComponentTypeLists([{'...',L1},{'!',_}|Rest],Clist1) -> - {_,Rest2} = parse_ExceptionIdentification(Rest), - %% Exception info is currently thrown away - parse_ComponentTypeLists2(Rest2,Clist1++[#'EXTENSIONMARK'{pos=L1}]); -parse_ComponentTypeLists([{'...',L1}|Rest],Clist1) -> %% first Extensionmark - parse_ComponentTypeLists2(Rest,Clist1++[#'EXTENSIONMARK'{pos=L1}]); -parse_ComponentTypeLists(Tokens,Clist1) -> - {Clist1,Tokens}. - - -parse_ComponentTypeLists2(Tokens,Clist1) -> - {ExtensionAddition,Rest2} = - case Tokens of - [{',',_}|Rest1] -> - parse_ExtensionAdditionList(Rest1); - _ -> - {[],Tokens} - end, - {OptionalExtensionMarker,Rest3} = - case Rest2 of - [{',',_},{'...',L2}|Rest21] -> - {[#'EXTENSIONMARK'{pos=L2}],Rest21}; - _ -> - {[],Rest2} - end, - {RootComponentTypeList,Rest4} = - case Rest3 of - [{',',_}|Rest31] -> - parse_ComponentTypeList(Rest31); - _ -> - {[],Rest3} - end, - {Clist1 ++ ExtensionAddition ++ OptionalExtensionMarker ++ RootComponentTypeList, Rest4}. - +parse_OptionalExtensionMarker([{',',_},{'...',L1}|Rest],Clist)-> + {Clist++[#'EXTENSIONMARK'{pos=L1}],Rest}; +parse_OptionalExtensionMarker(Tokens,Clist) -> + {Clist,Tokens}. -parse_ComponentTypeList(Tokens) -> - parse_ComponentTypeList(Tokens,[]). -parse_ComponentTypeList(Tokens,Acc) -> +parse_ComponentTypeList([{',',_},Id = {identifier,_,_}|Rest],Acc) when Acc =/= [] -> + {ComponentType,Rest2} = parse_ComponentType([Id|Rest]), + parse_ComponentTypeList(Rest2,[ComponentType|Acc]); +parse_ComponentTypeList([{',',_},C1={'COMPONENTS',_},C2={'OF',_}|Rest],Acc) when Acc =/= [] -> + {ComponentType,Rest2} = parse_ComponentType([C1,C2|Rest]), + parse_ComponentTypeList(Rest2,[ComponentType|Acc]); +parse_ComponentTypeList(Tokens = [{'}',_}|_],Acc) -> + {lists:reverse(Acc),Tokens}; +parse_ComponentTypeList(Tokens = [{']',_},{']',_}|_],Acc) -> + {lists:reverse(Acc),Tokens}; +parse_ComponentTypeList(Tokens = [{',',_},{'...',_}|_],Acc) -> + {lists:reverse(Acc),Tokens}; +parse_ComponentTypeList(Tokens,[]) -> {ComponentType,Rest} = parse_ComponentType(Tokens), + parse_ComponentTypeList(Rest,[ComponentType]); +parse_ComponentTypeList(Tokens,_) -> + throw({asn1_error, + {get_line(hd(Tokens)),get(asn1_module), + [got,[get_token(hd(Tokens)),get_token(hd(tl(Tokens)))], + expected,['}',', identifier']]}}). + +parse_ExtensionAdditions(Tokens=[{',',_}|_],Clist) -> + {ExtAddList,Rest2} = parse_ExtensionAdditionList(Tokens,[]), + {Clist++ExtAddList,Rest2}; +parse_ExtensionAdditions(Tokens,Clist) -> + %% Empty + {Clist,Tokens}. + +parse_ExtensionAdditionList([{',',_},Id = {identifier,_,_}|Rest],Acc) -> + {ComponentType,Rest2} = parse_ComponentType([Id|Rest]), + parse_ExtensionAdditionList(Rest2,[ComponentType|Acc]); +parse_ExtensionAdditionList([{',',_},C1={'COMPONENTS',_},C2={'OF',_}|Rest],Acc) -> + {ComponentType,Rest2} = parse_ComponentType([C1,C2|Rest]), + parse_ExtensionAdditionList(Rest2,[ComponentType|Acc]); +parse_ExtensionAdditionList([{',',_},C1 = {'[',_},C2 = {'[',_}|Rest],Acc) -> + {ExtAddGroup,Rest2} = parse_ExtensionAdditionGroup([C1,C2|Rest],[]), + parse_ExtensionAdditionList(Rest2,[ExtAddGroup|Acc]); +parse_ExtensionAdditionList(Tokens = [{'}',_}|_],Acc) -> + {lists:reverse(Acc),Tokens}; +parse_ExtensionAdditionList(Tokens = [{',',_},{'...',_}|_],Acc) -> + {lists:reverse(Acc),Tokens}; +parse_ExtensionAdditionList(Tokens,_) -> + throw({asn1_error, + {get_line(hd(Tokens)),get(asn1_module), + [got,[get_token(hd(Tokens)),get_token(hd(tl(Tokens)))], + expected,['}',', identifier']]}}). + + +parse_ExtensionAdditionGroup([ {'[',_},{'[',_},_VsnNr = {number,_,Num},{':',_}|Rest],[]) -> + parse_ExtensionAdditionGroup2(Rest,Num); +parse_ExtensionAdditionGroup([ {'[',_},{'[',_}|Rest],[]) -> + parse_ExtensionAdditionGroup2(Rest,undefined); +parse_ExtensionAdditionGroup(Tokens,_) -> + throw({asn1_error, + {get_line(hd(Tokens)),get(asn1_module), + [got,[get_token(hd(Tokens)),get_token(hd(tl(Tokens)))], + expected,['[[']]}}). + + +parse_ExtensionAdditionGroup2(Tokens,Num) -> + {CompTypeList,Rest} = parse_ComponentTypeList(Tokens,[]), case Rest of - [{',',_},Id = {identifier,_,_}|Rest2] -> - parse_ComponentTypeList([Id|Rest2],[ComponentType|Acc]); - [{',',_},C1={'COMPONENTS',_},C2={'OF',_}|Rest2] -> - parse_ComponentTypeList([C1,C2|Rest2],[ComponentType|Acc]); -% _ -> -% {lists:reverse([ComponentType|Acc]),Rest} - [{'}',_}|_] -> - {lists:reverse([ComponentType|Acc]),Rest}; -% [{',',_},{'...',_},{'}',_}|_] -> -% {lists:reverse([ComponentType|Acc]),Rest}; - [{',',_},{'...',_}|_] ->%% here comes the dubble ellipse - {lists:reverse([ComponentType|Acc]),Rest}; + [{']',_},{']',_}|Rest2] -> + {[{'ExtensionAdditionGroup',Num}|CompTypeList] ++ + ['ExtensionAdditionGroupEnd'],Rest2}; _ -> - throw({asn1_error, - {get_line(hd(Tokens)),get(asn1_module), - [got,[get_token(hd(Rest)),get_token(hd(tl(Rest)))], - expected,['}',', identifier']]}}) - end. - - -parse_ExtensionAdditionList(Tokens) -> - parse_ExtensionAdditionList(Tokens,[]). - -parse_ExtensionAdditionList(Tokens,Acc) -> - {Element,Rest0} = - case Tokens of - [{identifier,_,_}|_Rest] -> - parse_ComponentType(Tokens); - [{'[',_},{'[',_}|_] -> - parse_ExtensionAdditions(Tokens); - [{'...',L1}|_Rest] -> - {#'EXTENSIONMARK'{pos=L1},Tokens}; - _ -> - throw({asn1_error,{get_line(hd(Tokens)),get(asn1_module), - [got,get_token(hd(Tokens)),expected, - [identifier,'[[']]}}) - end, - case Rest0 of - [{',',_}|Rest01] -> - parse_ExtensionAdditionList(Rest01,[Element|Acc]); - [{'...',_}|Rest01] -> - {lists:reverse([Element|Acc]),Rest01}; - _ -> - {lists:reverse([Element|Acc]),Rest0} + throw({asn1_error,{get_line(hd(Rest)),get(asn1_module), + [got,get_token(hd(Rest)),expected,[']]']]}}) end. -parse_ExtensionAdditions([{'[',_},{'[',_}|Rest]) -> - parse_ExtensionAdditions(Rest,[]); -parse_ExtensionAdditions(Tokens) -> - throw({asn1_error,{get_line(hd(Tokens)),get(asn1_module), - [got,get_token(hd(Tokens)),expected,'[[']}}). - -parse_ExtensionAdditions([_VsnNr = {number,_,_},{':',_}|Rest],Acc) -> - %% ignor version number for now - parse_ExtensionAdditions(Rest,Acc); -parse_ExtensionAdditions([Id = {identifier,_,_}|Rest],Acc) -> - {ComponentType, Rest2} = parse_ComponentType([Id|Rest]), - case Rest2 of - [{',',_}|Rest21] -> - parse_ExtensionAdditions(Rest21,[ComponentType|Acc]); - [{']',_},{']',_}|Rest21] -> - {lists:reverse(Acc),Rest21}; - _ -> - throw({asn1_error,{get_line(hd(Rest2)),get(asn1_module), - [got,get_token(hd(Rest2)),expected,[',',']]']]}}) - end; -parse_ExtensionAdditions(Tokens,_) -> - throw({asn1_error,{get_line(hd(Tokens)),get(asn1_module), - [got,get_token(hd(Tokens)),expected,identifier]}}). parse_ComponentType([{'COMPONENTS',_},{'OF',_}|Rest]) -> {Type,Rest2} = parse_Type(Rest), {{'COMPONENTS OF',Type},Rest2}; parse_ComponentType(Tokens) -> - {NamedType,Rest} = parse_NamedType(Tokens), + Result = {NamedType,Rest} = parse_NamedType(Tokens), case Rest of [{'OPTIONAL',_}|Rest2] -> {NamedType#'ComponentType'{prop='OPTIONAL'},Rest2}; @@ -2573,7 +2664,7 @@ parse_ComponentType(Tokens) -> {Value,Rest21} = parse_Value(Rest2), {NamedType#'ComponentType'{prop={'DEFAULT',Value}},Rest21}; _ -> - {NamedType,Rest} + Result end. diff --git a/lib/asn1/src/asn1ct_tok.erl b/lib/asn1/src/asn1ct_tok.erl index f0ce31bdb2..85199c65ec 100644 --- a/lib/asn1/src/asn1ct_tok.erl +++ b/lib/asn1/src/asn1ct_tok.erl @@ -21,7 +21,7 @@ %% Tokenize ASN.1 code (input to parser generated with yecc) --export([get_name/2,tokenise/2, file/1]). +-export([get_name/2,tokenise/4, file/1]). file(File) -> @@ -29,12 +29,9 @@ file(File) -> {error, Reason} -> {error,{File,file:format_error(Reason)}}; {ok,Stream} -> - process0(Stream) + process(Stream,0,[]) end. -process0(Stream) -> - process(Stream,0,[]). - process(Stream,Lno,R) -> process(io:get_line(Stream, ''), Stream,Lno+1,R). @@ -45,131 +42,128 @@ process(eof, Stream,Lno,R) -> process(L, Stream,Lno,R) when is_list(L) -> %%io:format('read:~s',[L]), - case catch tokenise(L,Lno) of + case catch tokenise(Stream,L,Lno,[]) of {'ERR',Reason} -> io:format("Tokeniser error on line: ~w ~w~n",[Lno,Reason]), exit(0); - {multiline_comment,NestingLevel} -> - {RestL,Lno2} = process_skip_multiline_comment(Stream,Lno,NestingLevel), - process(RestL,Stream,Lno2,R); - T -> + {NewLno,T} -> %%io:format('toks:~w~n',[T]), - process(Stream,Lno,[T|R]) + process(Stream,NewLno,[T|R]) end. -process_skip_multiline_comment(Stream,Lno,NestingLevel) -> - process_skip_multiline_comment(io:get_line(Stream, ''), - Stream, Lno + 1, NestingLevel). -process_skip_multiline_comment(eof,_Stream,Lno,_NestingLevel) -> - io:format("Tokeniser error on line: ~w, premature end of multiline comment~n",[Lno]), - exit(0); -process_skip_multiline_comment(Line,Stream,Lno,NestingLevel) -> - case catch skip_multiline_comment(Line,NestingLevel) of - {multiline_comment,NestingLevel2} -> - process_skip_multiline_comment(Stream,Lno,NestingLevel2); - T -> - {T,Lno} - end. - -tokenise([H|T],Lno) when $a =< H , H =< $z -> +tokenise(Stream,[H|T],Lno,R) when $a =< H , H =< $z -> {X, T1} = get_name(T, [H]), - [{identifier,Lno, list_to_atom(X)}|tokenise(T1,Lno)]; + tokenise(Stream,T1,Lno,[{identifier,Lno, list_to_atom(X)}|R]); -tokenise([$&,H|T],Lno) when $A =< H , H =< $Z -> +tokenise(Stream,[$&,H|T],Lno,R) when $A =< H , H =< $Z -> {Y, T1} = get_name(T, [H]), X = list_to_atom(Y), - [{typefieldreference, Lno, X} | tokenise(T1, Lno)]; + tokenise(Stream,T1,Lno,[{typefieldreference, Lno, X} | R]); -tokenise([$&,H|T],Lno) when $a =< H , H =< $z -> +tokenise(Stream,[$&,H|T],Lno,R) when $a =< H , H =< $z -> {Y, T1} = get_name(T, [H]), X = list_to_atom(Y), - [{valuefieldreference, Lno, X} | tokenise(T1, Lno)]; + tokenise(Stream,T1,Lno,[{valuefieldreference, Lno, X} | R]); -tokenise([H|T],Lno) when $A =< H , H =< $Z -> +tokenise(Stream,[H|T],Lno,R) when $A =< H , H =< $Z -> {Y, T1} = get_name(T, [H]), X = list_to_atom(Y), case reserved_word(X) of true -> - [{X,Lno}|tokenise(T1,Lno)]; + tokenise(Stream,T1,Lno,[{X,Lno}|R]); false -> - [{typereference,Lno,X}|tokenise(T1,Lno)]; + tokenise(Stream,T1,Lno,[{typereference,Lno,X}|R]); rstrtype -> - [{restrictedcharacterstringtype,Lno,X}|tokenise(T1,Lno)] + tokenise(Stream,T1,Lno,[{restrictedcharacterstringtype,Lno,X}|R]) end; -tokenise([$-,H|T],Lno) when $0 =< H , H =< $9 -> +tokenise(Stream,[$-,H|T],Lno,R) when $0 =< H , H =< $9 -> {X, T1} = get_number(T, [H]), - [{number,Lno,-1 * list_to_integer(X)}|tokenise(T1,Lno)]; + tokenise(Stream,T1,Lno,[{number,Lno,-1 * list_to_integer(X)}|R]); -tokenise([H|T],Lno) when $0 =< H , H =< $9 -> +tokenise(Stream,[H|T],Lno,R) when $0 =< H , H =< $9 -> {X, T1} = get_number(T, [H]), - [{number,Lno,list_to_integer(X)}|tokenise(T1,Lno)]; + tokenise(Stream,T1,Lno,[{number,Lno,list_to_integer(X)}|R]); -tokenise([$-,$-|T],Lno) -> - tokenise(skip_comment(T),Lno); +tokenise(Stream,[$-,$-|T],Lno,R) -> + tokenise(Stream,skip_comment(T),Lno,R); -tokenise([$/,$*|T],Lno) -> - tokenise(skip_multiline_comment(T,0),Lno); +tokenise(Stream,[$/,$*|T],Lno,R) -> + {NewLno,T1} = skip_multiline_comment(Stream,T,Lno,0), + tokenise(Stream,T1,NewLno,R); -tokenise([$:,$:,$=|T],Lno) -> - [{'::=',Lno}|tokenise(T,Lno)]; +tokenise(Stream,[$:,$:,$=|T],Lno,R) -> + tokenise(Stream,T,Lno,[{'::=',Lno}|R]); -tokenise([$'|T],Lno) -> +tokenise(Stream,[$'|T],Lno,R) -> case catch collect_quoted(T,Lno,[]) of {'ERR',_} -> throw({'ERR','bad_quote'}); {Thing, T1} -> - [Thing|tokenise(T1,Lno)] + tokenise(Stream,T1,Lno,[Thing|R]) end; -tokenise([$"|T],Lno) -> - collect_string(T,Lno); +tokenise(Stream,[$"|T],Lno,R) -> + {Str,T1} = collect_string(T,Lno), + tokenise(Stream,T1,Lno,[Str|R]); + +tokenise(Stream,[${|T],Lno,R) -> + tokenise(Stream,T,Lno,[{'{',Lno}|R]); + +tokenise(Stream,[$}|T],Lno,R) -> + tokenise(Stream,T,Lno,[{'}',Lno}|R]); -tokenise([${|T],Lno) -> - [{'{',Lno}|tokenise(T,Lno)]; +%% tokenise(Stream,[$],$]|T],Lno,R) -> +%% tokenise(Stream,T,Lno,[{']]',Lno}|R]); -tokenise([$}|T],Lno) -> - [{'}',Lno}|tokenise(T,Lno)]; +%% Even though x.680 specify '[[' and ']]' as lexical items +%% it does not work to have them as such since the single [ and ] can +%% be used beside each other in the SYNTAX OF in x.681 +%% the solution chosen here , i.e. to have them as separate lexical items +%% will not detect the cases where there is white space between them +%% which would be an error in the use in ExtensionAdditionGroups -tokenise([$]|T],Lno) -> - [{']',Lno}|tokenise(T,Lno)]; +%% tokenise(Stream,[$[,$[|T],Lno,R) -> +%% tokenise(Stream,T,Lno,[{'[[',Lno}|R]); -tokenise([$[|T],Lno) -> - [{'[',Lno}|tokenise(T,Lno)]; +tokenise(Stream,[$]|T],Lno,R) -> + tokenise(Stream,T,Lno,[{']',Lno}|R]); -tokenise([$,|T],Lno) -> - [{',',Lno}|tokenise(T,Lno)]; +tokenise(Stream,[$[|T],Lno,R) -> + tokenise(Stream,T,Lno,[{'[',Lno}|R]); -tokenise([$(|T],Lno) -> - [{'(',Lno}|tokenise(T,Lno)]; -tokenise([$)|T],Lno) -> - [{')',Lno}|tokenise(T,Lno)]; +tokenise(Stream,[$,|T],Lno,R) -> + tokenise(Stream,T,Lno,[{',',Lno}|R]); -tokenise([$.,$.,$.|T],Lno) -> - [{'...',Lno}|tokenise(T,Lno)]; +tokenise(Stream,[$(|T],Lno,R) -> + tokenise(Stream,T,Lno,[{'(',Lno}|R]); +tokenise(Stream,[$)|T],Lno,R) -> + tokenise(Stream,T,Lno,[{')',Lno}|R]); -tokenise([$.,$.|T],Lno) -> - [{'..',Lno}|tokenise(T,Lno)]; +tokenise(Stream,[$.,$.,$.|T],Lno,R) -> + tokenise(Stream,T,Lno,[{'...',Lno}|R]); -tokenise([$.|T],Lno) -> - [{'.',Lno}|tokenise(T,Lno)]; -tokenise([$^|T],Lno) -> - [{'^',Lno}|tokenise(T,Lno)]; -tokenise([$!|T],Lno) -> - [{'!',Lno}|tokenise(T,Lno)]; -tokenise([$||T],Lno) -> - [{'|',Lno}|tokenise(T,Lno)]; +tokenise(Stream,[$.,$.|T],Lno,R) -> + tokenise(Stream,T,Lno,[{'..',Lno}|R]); +tokenise(Stream,[$.|T],Lno,R) -> + tokenise(Stream,T,Lno,[{'.',Lno}|R]); +tokenise(Stream,[$^|T],Lno,R) -> + tokenise(Stream,T,Lno,[{'^',Lno}|R]); +tokenise(Stream,[$!|T],Lno,R) -> + tokenise(Stream,T,Lno,[{'!',Lno}|R]); +tokenise(Stream,[$||T],Lno,R) -> + tokenise(Stream,T,Lno,[{'|',Lno}|R]); -tokenise([H|T],Lno) -> +tokenise(Stream,[H|T],Lno,R) -> case white_space(H) of true -> - tokenise(T,Lno); + tokenise(Stream,T,Lno,R); false -> - [{list_to_atom([H]),Lno}|tokenise(T,Lno)] + tokenise(Stream,T,Lno,[{list_to_atom([H]),Lno}|R]) end; -tokenise([],_) -> - []. +tokenise(_Stream,[],Lno,R) -> + {Lno,lists:reverse(R)}. collect_string(L,Lno) -> @@ -181,7 +175,7 @@ collect_string([],_,_) -> collect_string([H|T],Lno,Str) -> case H of $" -> - [{cstring,1,lists:reverse(Str)}|tokenise(T,Lno)]; + {{cstring,1,lists:reverse(Str)},T}; Ch -> collect_string(T,Lno,[Ch|Str]) end. @@ -252,17 +246,23 @@ skip_comment([_|T]) -> skip_comment(T). -skip_multiline_comment([],L) -> - throw({multiline_comment,L}); -skip_multiline_comment([$*,$/|T],0) -> - T; -skip_multiline_comment([$*,$/|T],Level) -> - skip_multiline_comment(T,Level - 1); -skip_multiline_comment([$/,$*|T],Level) -> - skip_multiline_comment(T,Level + 1); -skip_multiline_comment([_|T],Level) -> - skip_multiline_comment(T,Level). - +skip_multiline_comment(Stream,[],Lno,Level) -> + case io:get_line(Stream,'') of + eof -> + io:format("Tokeniser error on line: ~w~n" + "premature end of multiline comment~n",[Lno]), + exit(0); + Line -> + skip_multiline_comment(Stream,Line,Lno+1,Level) + end; +skip_multiline_comment(_Stream,[$*,$/|T],Lno,0) -> + {Lno,T}; +skip_multiline_comment(Stream,[$*,$/|T],Lno,Level) -> + skip_multiline_comment(Stream,T,Lno,Level - 1); +skip_multiline_comment(Stream,[$/,$*|T],Lno,Level) -> + skip_multiline_comment(Stream,T,Lno,Level + 1); +skip_multiline_comment(Stream,[_|T],Lno,Level) -> + skip_multiline_comment(Stream,T,Lno,Level). collect_quoted([$',$B|T],Lno, L) -> case check_bin(L) of diff --git a/lib/asn1/test/Makefile b/lib/asn1/test/Makefile index 5014eb902b..e8f65ec70b 100644 --- a/lib/asn1/test/Makefile +++ b/lib/asn1/test/Makefile @@ -189,27 +189,16 @@ release_spec: opt release_tests_spec: opt $(INSTALL_DIR) $(RELSYSDIR) - $(INSTALL_DATA) asn1.spec $(EMAKEFILE) $(ERL_FILES) $(HRL_FILES) $(RELSYSDIR) - chmod -f -R u+w $(RELSYSDIR) - @tar cf - *_SUITE_data | (cd $(RELSYSDIR); tar xf -) + $(INSTALL_DIR) $(RELSYSDIR)/asn1_SUITE_data $(INSTALL_DIR) $(RELSYSDIR)/asn1_bin_SUITE_data - @(cd asn1_SUITE_data; tar cf - *) | (cd $(RELSYSDIR)/asn1_bin_SUITE_data; tar xf -) $(INSTALL_DIR) $(RELSYSDIR)/asn1_bin_v2_SUITE_data - @(cd asn1_SUITE_data; tar cf - *) | (cd $(RELSYSDIR)/asn1_bin_v2_SUITE_data; tar xf -) - + $(INSTALL_DATA) $(ERL_FILES) $(HRL_FILES) $(RELSYSDIR) + $(INSTALL_DATA) asn1.spec $(INSTALL_PROGS) $(RELSYSDIR) + chmod -f -R u+w $(RELSYSDIR) + cd asn1_SUITE_data; tar cfh $(RELSYSDIR)/asn1_SUITE_data.tar * + cd $(RELSYSDIR)/asn1_SUITE_data; tar xf $(RELSYSDIR)/asn1_SUITE_data.tar + cd $(RELSYSDIR)/asn1_bin_SUITE_data; tar xf $(RELSYSDIR)/asn1_SUITE_data.tar + cd $(RELSYSDIR)/asn1_bin_v2_SUITE_data; tar xf $(RELSYSDIR)/asn1_SUITE_data.tar + rm $(RELSYSDIR)/asn1_SUITE_data.tar release_docs_spec: - - - - - - - - - - - - - - diff --git a/lib/asn1/test/asn1_SUITE.erl.src b/lib/asn1/test/asn1_SUITE.erl.src index ca73d259af..f0228546a5 100644 --- a/lib/asn1/test/asn1_SUITE.erl.src +++ b/lib/asn1/test/asn1_SUITE.erl.src @@ -74,6 +74,7 @@ all(suite) -> [compile,parse,default_per,default_ber,default_per_opt,per, testSeqTypeRefPrim, testSeqTypeRefSeq, testSeqTypeRefSet, testSeqOf, testSeqOfIndefinite, testSeqOfCho, testSeqOfExternal, testSetDefault, testSetExtension, + testExtensionAdditionGroup, testSetExternal, testSeqOfTag, testSetOptional, testSetPrim, testSetTag, testSetTypeRefCho, testSetTypeRefPrim, testSetTypeRefSeq, testSetTypeRefSet, testSetOf, testSetOfCho, @@ -95,7 +96,7 @@ all(suite) -> [compile,parse,default_per,default_ber,default_per_opt,per, testSSLspecs, testNortel,test_undecoded_rest, test_inline, testTcapsystem, testNBAPsystem, test_compile_options,testDoubleEllipses, test_modified_x420, - testX420, test_x691,ticket_6143 + testX420, test_x691,ticket_6143, testExtensionAdditionGroup ] ++ common() ++ particular(). %all(suite) -> [test_inline,testNBAPsystem,test_compile_options,ticket_6143]. @@ -1036,7 +1037,6 @@ testSetExtension_cases(Rules) -> ?line testSetExtension:main(Rules). - testSetExternal(suite) -> []; testSetExternal(Config) -> ?line true = code:add_patha(?config(priv_dir,Config)), @@ -2292,6 +2292,21 @@ ticket_6143(suite) -> []; ticket_6143(Config) -> ?line ok = test_compile_options:ticket_6143(Config). +testExtensionAdditionGroup(suite) -> []; +testExtensionAdditionGroup(Config) -> + ?line DataDir = ?config(data_dir,Config), + ?line PrivDir = ?config(priv_dir,Config), + ?line Path = code:get_path(), + ?line code:add_patha(PrivDir), + DoIt = fun(Erule) -> + ?line ok = asn1ct:compile(filename:join(DataDir,"Extension-Addition-Group"),[Erule,{outdir,PrivDir}]), + ?line {ok,_M} = compile:file(filename:join(DataDir,"extensionAdditionGroup"),[{i,PrivDir},{outdir,PrivDir},debug_info]), + ?line ok = extensionAdditionGroup:run(Erule) + end, + ?line [DoIt(Rule)|| Rule <- [per_bin,uper_bin,ber_bin]], + ?line code:set_path(Path). + + % parse_modules() -> % ["ImportsFrom"]. diff --git a/lib/asn1/test/asn1_SUITE_data/AA2.asn1db b/lib/asn1/test/asn1_SUITE_data/AA2.asn1db Binary files differindex 3bf2c1b89d..163dbb032d 100644 --- a/lib/asn1/test/asn1_SUITE_data/AA2.asn1db +++ b/lib/asn1/test/asn1_SUITE_data/AA2.asn1db diff --git a/lib/asn1/test/asn1_SUITE_data/Extension-Addition-Group.asn b/lib/asn1/test/asn1_SUITE_data/Extension-Addition-Group.asn new file mode 100644 index 0000000000..b985c970ac --- /dev/null +++ b/lib/asn1/test/asn1_SUITE_data/Extension-Addition-Group.asn @@ -0,0 +1,66 @@ +-- +-- %CopyrightBegin% +-- +-- Copyright Ericsson AB 2001-2010. All Rights Reserved. +-- +-- The contents of this file are subject to the Erlang Public License, +-- Version 1.1, (the "License"); you may not use this file except in +-- compliance with the License. You should have received a copy of the +-- Erlang Public License along with this software. If not, it can be +-- retrieved online at http://www.erlang.org/. +-- +-- Software distributed under the License is distributed on an "AS IS" +-- basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See +-- the License for the specific language governing rights and limitations +-- under the License. +-- +-- %CopyrightEnd% + +Extension-Addition-Group DEFINITIONS AUTOMATIC TAGS ::= + +BEGIN + +-- fetched from ITU-T Rec. X691 (07/2002) + +Ax ::= SEQUENCE { + a INTEGER (250..253), + b BOOLEAN, + c CHOICE { + d INTEGER, + ..., + + [[ + e BOOLEAN, + f IA5String + ]], + ... + }, + ..., + [[ + g NumericString (SIZE(3)), + h BOOLEAN OPTIONAL + ]] +, + ..., + i BMPString OPTIONAL, + j PrintableString OPTIONAL + +} + +-- valAx Ax ::= { a 253, b TRUE, c e: TRUE, g "123", h TRUE } +Ax2 ::= SEQUENCE { + a INTEGER (250..253), + b BOOLEAN, + ..., + ug NumericString + +} +END + +-- The value { a 253, b TRUE, c e: TRUE, g "123", h TRUE } +-- is encoded in PER as +-- Hexadecimal view +-- 9E000180 010291A4 + +-- is encoded in Unaligned PER as +-- 9E000600 040A4690 diff --git a/lib/asn1/test/asn1_SUITE_data/extensionAdditionGroup.erl b/lib/asn1/test/asn1_SUITE_data/extensionAdditionGroup.erl new file mode 100644 index 0000000000..79e200f561 --- /dev/null +++ b/lib/asn1/test/asn1_SUITE_data/extensionAdditionGroup.erl @@ -0,0 +1,43 @@ +%%%------------------------------------------------------------------- +%%% File : extensionAdditionGroup.erl +%%% Author : Kenneth Lundin +%%% Description : +%%% +%%% Created : 18 May 2010 by kenneth +%% +%% %CopyrightBegin% +%% +%% Copyright Ericsson AB 2001-2010. All Rights Reserved. +%% +%% The contents of this file are subject to the Erlang Public License, +%% Version 1.1, (the "License"); you may not use this file except in +%% compliance with the License. You should have received a copy of the +%% Erlang Public License along with this software. If not, it can be +%% retrieved online at http://www.erlang.org/. +%% +%% Software distributed under the License is distributed on an "AS IS" +%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See +%% the License for the specific language governing rights and limitations +%% under the License. +%% +%% %CopyrightEnd% + +%%%------------------------------------------------------------------- +-module(extensionAdditionGroup). +-include("Extension-Addition-Group.hrl"). + + +-compile(export_all). + +run(Erule) -> + Val = #'Ax'{a=253, b = true, c= {e,true}, g="123", h = true}, + io:format("~p:~p~n",[Erule,Val]), + {ok,List}= asn1rt:encode('Extension-Addition-Group','Ax',Val), + Enc = iolist_to_binary(List), + io:format("~p~n",[Enc]), + {ok,Val2} = asn1rt:decode('Extension-Addition-Group','Ax',Enc), + io:format("~p~n",[Val2]), + case Val2 of + Val -> ok; + _ -> exit({expected,Val, got, Val2}) + end. diff --git a/lib/asn1/vsn.mk b/lib/asn1/vsn.mk index b7e91e42a0..c0393f84fe 100644 --- a/lib/asn1/vsn.mk +++ b/lib/asn1/vsn.mk @@ -1,323 +1,2 @@ #next version number to use is 1.6.15 | 1.7 | 2.0 ASN1_VSN = 1.6.14 - -TICKETS = OTP-8565 \ - OTP-8516 - -TICKETS_1.6.14 = \ - OTP-8565 \ - OTP-8516 - -TICKETS_1.6.13 = \ - OTP-8463 - -TICKETS_1.6.12 = \ - OTP-8256 - -TICKETS_1.6.11 = \ - OTP-8136 \ - OTP-8047 \ - OTP-8046 \ - OTP-8043 \ - OTP-7972 - -TICKETS_1.6.10 = \ - OTP-7954 \ - OTP-7953 - -TICKETS_1.6.10 = \ - OTP-7954 \ - OTP-7953 - -TICKETS_1.6.9 = \ - OTP-7909 \ - OTP-7904 - -TICKETS_1.6.8.1 = \ - OTP-7900 \ - OTP-7910 - -TICKETS_1.6.8 = \ - OTP-7876 - -TICKETS_1.6.7 = \ - OTP-7801 \ - OTP-7806 - -TICKETS_1.6.6 = \ - OTP-7759 \ - OTP-7763 - -TICKETS_1.6.5 = \ - OTP-7734 - -TICKETS_1.6.4 = \ - OTP-7708 - -TICKETS_1.6.3 = \ - OTP-7681 \ - OTP-7678 - -TICKETS_1.6.2 = \ - OTP-7608 - -TICKETS_1.6.1 = \ - OTP-7602 \ - OTP-7533 \ - OTP-7476 \ - OTP-7334 \ - OTP-7332 \ - OTP-7322 \ - OTP-7306 \ - OTP-7299 \ - OTP-7295 \ - OTP-7204 \ - OTP-7174 \ - OTP-7166 - -TICKETS_1.6 = \ - OTP-7407 \ - OTP-7403 \ - OTP-7400 \ - OTP-7375 \ - OTP-7374 \ - OTP-7335 - -TICKETS_1.5.2 = \ - OTP-7263 \ - OTP-7264 \ - OTP-7268 \ - OTP-7269 \ - OTP-7273 - -TICKETS_1.5.1 = \ - OTP-7149 \ - OTP-7151 \ - OTP-7154 \ - OTP-7155 \ - OTP-7169 \ - OTP-7171 \ - OTP-7193 \ - OTP-7199 - -TICKETS_1.5 = \ - OTP-6835 \ - OTP-6882 - -TICKETS_1.4.7 = \ - OTP-6828 - -TICKETS_1.4.6 = \ - OTP-5067 \ - OTP-6763 \ - OTP-6769 \ - OTP-6770 \ - OTP-6786 - -TICKETS_1.4.5 = \ - OTP-6493 \ - OTP-6601 \ - OTP-6695 \ - OTP-6698 \ - OTP-6702 \ - OTP-6707 \ - OTP-6717 - -TICKETS_1.4.4.14 = \ - OTP-6462 \ - OTP-6506 - -TICKETS_1.4.4.13 = \ - OTP-6405 - -TICKETS_1.4.4.12 = \ - OTP-6314 - -TICKETS_1.4.4.11 = \ - OTP-6143 - -TICKETS_1.4.4.10 = \ - OTP-6111 \ - OTP-5932 - -TICKETS_1.4.4.9 = \ - OTP-5783 \ - OTP-5788 \ - OTP-5812 \ - OTP-5831 \ - OPT-5832 - -TICKETS_1.4.4.8 = \ - OTP-5687 \ - OTP-5688 \ - OTP-5689 \ - OTP-5701 \ - OTP-5710 - -TICKETS_1.4.4.7 = \ - OTP-5477 \ - OTP-5509 \ - OTP-5511 \ - OTP-5602 \ - OTP-5616 - -TICKETS_1.4.4.6 = \ - OTP-5457 \ - OTP-5466 - -TICKETS_1.4.4.5 = \ - OTP-5302 \ - OTP-5378 - -TICKETS_1.4.4.4 = \ - OTP-5240 \ - OTP-5243 - -TICKETS_1.4.4.3 = \ - OTP-5103 \ - OTP-5104 - -TICKETS_1.4.4.2 = \ - OTP-5022 - -TICKETS_1.4.4.1 = \ - OTP-4970 - -TICKETS_1.4.4 = \ - OTP-4893 \ - OTP-4894 \ - OTP-4895 \ - OTP-4917 \ - OTP-4918 \ - OTP-4919 \ - OTP-4944 \ - OTP-4953 \ - OTP-4955 \ - OTP-4957 \ - OTP-4965 - -TICKETS_1.4.3.1 = \ - OTP-4866 \ - OTP-4869 \ - OTP-4872 - -TICKETS_1.4.3 = \ - OTP-4832 \ - OTP-4833 \ - OTP-4835 \ - OTP-4856 - -TICKETS_1.4.2.1 = \ - OTP-4773 \ - OTP-4791 \ - OTP-4792 \ - OTP-4797 \ - OTP-4798 \ - OTP-4799 \ - OTP-4809 - -# OTP R9C -TICKETS_1.4.2 = \ - OTP-4693 \ - OTP-4744 - -TICKETS_1.4.1.1 = \ - OTP-4663 \ - OTP-4665 \ - OTP-4666 - -TICKETS_1.4.1 = \ - OTP-4559 \ - OTP-4560 \ - OTP-4590 \ - OTP-4591 \ - OTP-4592 \ - OTP-4631 \ - OTP-4633 - -TICKETS_1.4 = \ - OTP-3304 - -TICKETS_1.3.3.1 = \ - OTP-4353 \ - OTP-4354 \ - OTP-4390 \ - OTP-4395 - -TICKETS_1.3.3 = \ - OTP-4381 \ - OTP-4358 \ - OTP-4355 \ - OTP-4275 \ - OTP-4248 \ - OTP-4247 \ - OTP-4242 \ - OTP-4235 \ - OTP-4234 \ - OTP-4232 \ - OTP-4200 \ - OTP-4161 \ - OTP-4129 - -TICKETS_1.3.2 = \ - OTP-4094 \ - OTP-4103 \ - OTP-3980 \ - OTP-4073 - -TICKETS_1.3.1.1 = \ - OTP-4037 \ - OTP-4057 \ - OTP-4058 - -TICKETS_1.3.1 = \ - OTP-4025 \ - OTP-4026 - -TICKETS_1.3 = \ - OTP-3463 \ - OTP-3659 \ - OTP-3978 \ - OTP-3979 \ - OTP-3981 \ - OTP-3982 \ - OTP-3983 \ - OTP-3985 \ - OTP-3988 \ - OTP-3984 \ - OTP-3994 - -TICKETS_1.2.9.6 = \ - OTP-3830 - -TICKETS_1.2.9.5 = \ - OTP-3713 \ - OTP-3796 \ - OTP-3811 - -TICKETS_1.2.9.3 = \ - OTP-3700 \ - OTP-3701 - -TICKETS_1.2.9.2 = \ - OTP-xxxx - -TICKETS_1.2.9.1 = \ - OTP-xxxx - -TICKETS_1.2.9 = \ - OTP-3569 \ - OTP-3573 - -TICKETS_1.2.8 = \ - OTP-3496 - -TICKETS_1.2.7 = \ - OTP-3395 - -TICKETS_1.2.6 = \ - OTP-3352 - -TICKETS_1.2.5 = \ - OTP-3341 - diff --git a/lib/common_test/Makefile b/lib/common_test/Makefile index e16efd0c9d..aecec1a50d 100644 --- a/lib/common_test/Makefile +++ b/lib/common_test/Makefile @@ -25,12 +25,12 @@ include $(ERL_TOP)/make/$(TARGET)/otp.mk # ifeq ($(findstring linux,$(TARGET)),linux) -SUB_DIRECTORIES = doc/src src +SUB_DIRECTORIES = doc/src src priv else ifeq ($(findstring solaris,$(TARGET)),solaris) -SUB_DIRECTORIES = doc/src src +SUB_DIRECTORIES = doc/src src priv else -SUB_DIRECTORIES = doc/src src +SUB_DIRECTORIES = doc/src src priv endif endif diff --git a/lib/common_test/doc/src/run_test.xml b/lib/common_test/doc/src/run_test.xml index d609c4287f..2f0a94afba 100644 --- a/lib/common_test/doc/src/run_test.xml +++ b/lib/common_test/doc/src/run_test.xml @@ -45,6 +45,11 @@ flags start an Erlang node prepared for running Common Test in a particular mode.</p> + <p>There is an interface function that corresponds to this program, + called <c>ct:run_test/1</c>, for starting Common Test from the Erlang + shell (or an Erlang program). Please see the <c>ct</c> man page for + details.</p> + <p><c>run_test</c> also accepts Erlang emulator flags. These are used when <c>run_test</c> calls <c>erl</c> to start the Erlang node (making it possible to e.g. add directories to the code server path, @@ -72,6 +77,8 @@ <p>it prints all valid start flags to stdout.</p> </description> + <marker id="run_test"></marker> + <section> <title>Run tests from command line</title> <pre> @@ -83,6 +90,7 @@ [-userconfig CallbackModule1 ConfigString1 and CallbackModule2 ConfigString2 and .. and CallbackModuleN ConfigStringN] [-decrypt_key Key] | [-decrypt_file KeyFile] + [-label Label] [-logdir LogDir] [-silent_connections [ConnType1 ConnType2 .. ConnTypeN]] [-stylesheet CSSFile] @@ -107,6 +115,7 @@ [-userconfig CallbackModule1 ConfigString1 and CallbackModule2 ConfigString2 and .. and CallbackModuleN ConfigStringN] [-decrypt_key Key] | [-decrypt_file KeyFile] + [-label Label] [-logdir LogDir] [-allow_user_terms] [-silent_connections [ConnType1 ConnType2 .. ConnTypeN]] @@ -128,12 +137,12 @@ <title>Run tests in web based GUI</title> <pre> run_test -vts [-browser Browser] + [-dir TestDir1 TestDir2 .. TestDirN] | + [-suite Suite [[-group Group] [-case Case]]] [-config ConfigFile1 ConfigFile2 .. ConfigFileN] [-userconfig CallbackModule1 ConfigString1 and CallbackModule2 ConfigString2 and .. and CallbackModuleN ConfigStringN] [-decrypt_key Key] | [-decrypt_file KeyFile] - [-dir TestDir1 TestDir2 .. TestDirN] | - [-suite Suite [[-group Group] [-case Case]]] [-include InclDir1 InclDir2 .. InclDirN] [-no_auto_compile] [-muliply_timetraps Multiplier] diff --git a/lib/common_test/doc/src/run_test_chapter.xml b/lib/common_test/doc/src/run_test_chapter.xml index 207df7f5b5..1efff25f5b 100644 --- a/lib/common_test/doc/src/run_test_chapter.xml +++ b/lib/common_test/doc/src/run_test_chapter.xml @@ -21,7 +21,7 @@ </legalnotice> - <title>Running Test Suites</title> + <title>Running Tests</title> <prepared>Peter Andersson, Kenneth Lundin</prepared> <docno></docno> <date></date> @@ -130,6 +130,8 @@ <p>Other flags that may be used with <c>run_test</c>:</p> <list> <item><c><![CDATA[-logdir <dir>]]></c>, specifies where the HTML log files are to be written.</item> + <item><c><![CDATA[-label <name_of_test_run>]]></c>, associates the test run with a name that gets printed + in the overview HTML log files.</item> <item><c>-refresh_logs</c>, refreshes the top level HTML index files.</item> <item><c>-vts</c>, start web based GUI (see below).</item> <item><c>-shell</c>, start interactive shell mode (see below).</item> @@ -335,43 +337,72 @@ <marker id="test_specifications"></marker> <title>Using test specifications</title> - <p>The most expressive way to specify what to test is to use a so - called test specification. A test specification is a sequence of - Erlang terms. The terms may be declared in a text file or passed - to the test server at runtime as a list (see <c>run_testspec/1</c> - in the manual page for <c>ct</c>). There are two general types - of terms: configuration terms and test specification terms.</p> - <p>With configuration terms it is possible to import configuration - data (similar to <c>run_test -config</c>), specify HTML log - directories (similar to <c>run_test -logdir</c>), give aliases - to test nodes and test directories (to make a specification - easier to read and maintain), enable code coverage analysis - (see the <seealso marker="cover_chapter#cover">Code Coverage - Analysis</seealso> chapter) and specify event_handler plugins + <p>The most flexible way to specify what to test, is to use a so + called test specification. A test specification is a sequence of + Erlang terms. The terms may be declared in a text file or passed + to the test server at runtime as a list + (see <c>run_testspec/1</c> in the manual page + for <c>ct</c>). There are two general types of terms: + configuration terms and test specification terms.</p> + <p>With configuration terms it is possible to e.g. label the test + run (similar to <c>run_test -label</c>), evaluate arbitrary expressions + before starting a test, import configuration + data (similar to + <c>run_test -config/-userconfig</c>), specify HTML log directories (similar + to + <c>run_test -logdir</c>), give aliases to test nodes and test + directories (to make a specification easier to read and + maintain), enable code coverage analysis (see + the <seealso marker="cover_chapter#cover">Code Coverage + Analysis</seealso> chapter) and specify event_handler plugins (see the <seealso marker="event_handler_chapter#event_handling"> - Event Handling</seealso> chapter). There is also a term - for specifying include directories that should be passed on - to the compiler when automatic compilation is performed - (similar to <c>run_test -include</c>, see above).</p> - <p>With test specification terms it is possible to state exactly which - tests should run and in which order. A test term specifies either - one or more suites or one or more test cases. An arbitrary number of test - terms may be declared in sequence. A test term can also specify one or - more test suites or test cases to be skipped. Skipped suites and cases - are not executed and show up in the HTML test log as SKIPPED.</p> - - <note><p>It is not yet possible to specify test case groups in - test specifications. This will be supported in a soon upcoming - release.</p></note> + Event Handling</seealso> chapter). There is also a term for + specifying include directories that should be passed on to the + compiler when automatic compilation is performed (similar + to <c>run_test -include</c>, see above).</p> + <p>With test specification terms it is possible to state exactly + which tests should run and in which order. A test term specifies + either one or more suites, one or more test case groups, or one + or more test cases in a group or suite.</p> + <p>An arbitrary number of test terms may be declared in sequence. + Common Test will compile the terms into one or more tests to be + performed in one resulting test run. Note that a term that + specifies a set of test cases will "swallow" one that only + specifies a subset of these cases. E.g. the result of merging + one term that specifies that all cases in suite S should be + executed, with another term specifying only test case X and Y in + S, is a test of all cases in S. However, if a term specifying + test case X and Y in S is merged with a term specifying case Z + in S, the result is a test of X, Y and Z in S.</p> + <p>A test term can also specify one or more test suites, groups, + or test cases to be skipped. Skipped suites, groups and cases + are not executed and show up in the HTML test log files as + SKIPPED.</p> + <p>When a test case group is specified, the resulting test + executes the + <c>init_per_group</c> function, followed by all test cases and + sub groups (including their configuration functions), and + finally the <c>end_per_group</c> function. Also if particular + test cases in a group are specified, <c>init_per_group</c> + and <c>end_per_group</c> for the group in question are + called. If a group which is defined (in <c>Suite:group/0</c>) to + be a sub group of another group, is specified (or particular test + cases of a sub group are), Common Test will call the configuration + functions for the top level groups as well as for the sub group + in question (making it possible to pass configuration data all + the way from <c>init_per_suite</c> down to the test cases in the + sub group).</p> <p>Below is the test specification syntax. Test specifications can - be used to run tests both in a single test host environment and in - a distributed Common Test environment (Large Scale Testing). The init term, - as well as node parameters, are only relevant in the latter (see the - <seealso marker="ct_master_chapter#test_specifications">Large Scale Testing</seealso> - chapter for information). For details on the event_handler term, see the - <seealso marker="event_handler_chapter#event_handling">Event Handling</seealso> - chapter.</p> + be used to run tests both in a single test host environment and + in a distributed Common Test environment (Large Scale + Testing). The node parameters in the init term are only + relevant in the latter (see the + <seealso marker="ct_master_chapter#test_specifications">Large + Scale Testing</seealso> chapter for information). For details on + the event_handler term, see the + <seealso marker="event_handler_chapter#event_handling">Event + Handling</seealso> chapter.</p> <p>Config terms:</p> <pre> {node, NodeAlias, Node}. @@ -379,11 +410,17 @@ {init, InitOptions}. {init, [NodeAlias], InitOptions}. + {label, Label}. + {label, NodeRefs, Label}. + {multiply_timetraps, N}. + {multiply_timetraps, NodeRefs, N}. + {scale_timetraps, Bool}. + {scale_timetraps, NodeRefs, Bool}. {cover, CoverSpecFile}. - {cover, NodeRef, CoverSpecFile}. + {cover, NodeRefs, CoverSpecFile}. {include, IncludeDirs}. {include, NodeRefs, IncludeDirs}. @@ -409,6 +446,12 @@ {suites, DirRef, Suites}. {suites, NodeRefs, DirRef, Suites}. + {groups, DirRef, Suite, Groups}. + {groups, NodeRefsDirRef, Suite, Groups}. + + {groups, DirRef, Suite, Group, {cases,Cases}}. + {groups, NodeRefsDirRef, Suite, Group, {cases,Cases}}. + {cases, DirRef, Suite, Cases}. {cases, NodeRefs, DirRef, Suite, Cases}. @@ -437,6 +480,9 @@ InitArgs = [term()] DirRef = DirAlias | Dir Suites = atom() | [atom()] | all + Suite = atom() + Groups = atom() | [atom()] | all + Group = atom() Cases = atom() | [atom()] | all Comment = string() | "" </pre> diff --git a/lib/common_test/priv/Makefile.in b/lib/common_test/priv/Makefile.in index f144847a29..6372bbc8d5 100644 --- a/lib/common_test/priv/Makefile.in +++ b/lib/common_test/priv/Makefile.in @@ -56,8 +56,9 @@ ifneq ($(findstring win32,$(TARGET)),win32) # # Files # -FILES = vts.tool run_test.in -SCRIPTS = install.sh +FILES = +SCRIPTS = +IMAGES = tile1.jpg # # Rules @@ -83,14 +84,12 @@ include $(ERL_TOP)/make/otp_release_targets.mk ifeq ($(XNIX),true) release_spec: opt - $(INSTALL_DIR) $(RELSYSDIR)/priv/bin - $(INSTALL_SCRIPT) $(SCRIPTS) $(RELSYSDIR) - $(INSTALL_DATA) $(FILES) $(RELSYSDIR)/priv + $(INSTALL_DIR) $(RELSYSDIR)/priv + $(INSTALL_DATA) $(FILES) $(IMAGES) $(RELSYSDIR)/priv else release_spec: opt - $(INSTALL_DIR) $(RELSYSDIR)/priv/bin - $(INSTALL_SCRIPT) $(SCRIPTS) $(RELSYSDIR) - $(INSTALL_DATA) $(FILES) $(RELSYSDIR)/priv + $(INSTALL_DIR) $(RELSYSDIR)/priv + $(INSTALL_DATA) $(FILES) $(IMAGES) $(RELSYSDIR)/priv endif release_docs_spec: @@ -105,6 +104,7 @@ else # Files # FILES = vts.tool +IMAGES = tile1.jpg # # Rules @@ -123,8 +123,8 @@ clean: include $(ERL_TOP)/make/otp_release_targets.mk release_spec: opt - $(INSTALL_DIR) $(RELSYSDIR)/priv/bin - $(INSTALL_DATA) $(FILES) $(RELSYSDIR)/priv + $(INSTALL_DIR) $(RELSYSDIR)/priv + $(INSTALL_DATA) $(FILES) $(IMAGES) $(RELSYSDIR)/priv release_docs_spec: diff --git a/lib/common_test/priv/tile1.jpg b/lib/common_test/priv/tile1.jpg Binary files differnew file mode 100644 index 0000000000..8749383716 --- /dev/null +++ b/lib/common_test/priv/tile1.jpg diff --git a/lib/common_test/src/ct.erl b/lib/common_test/src/ct.erl index 0d82a86e7d..8ae175f10d 100644 --- a/lib/common_test/src/ct.erl +++ b/lib/common_test/src/ct.erl @@ -138,10 +138,10 @@ run(TestDirs) -> %%%----------------------------------------------------------------- %%% @spec run_test(Opts) -> Result %%% Opts = [OptTuples] -%%% OptTuples = {config,CfgFiles} | {dir,TestDirs} | {suite,Suites} | -%%% {userconfig, UserConfig} | -%%% {testcase,Cases} | {group,Groups} | {spec,TestSpecs} | -%%% {allow_user_terms,Bool} | {logdir,LogDir} | +%%% OptTuples = {dir,TestDirs} | {suite,Suites} | {group,Groups} | +%%% {testcase,Cases} | {spec,TestSpecs} | {label,Label} | +%%% {config,CfgFiles} | {userconfig, UserConfig} | +%%% {allow_user_terms,Bool} | {logdir,LogDir} | %%% {silent_connections,Conns} | {stylesheet,CSSFile} | %%% {cover,CoverSpecFile} | {step,StepOpts} | %%% {event_handler,EventHandlers} | {include,InclDirs} | @@ -149,15 +149,16 @@ run(TestDirs) -> %%% {repeat,N} | {duration,DurTime} | {until,StopTime} | %%% {force_stop,Bool} | {decrypt,DecryptKeyOrFile} | %%% {refresh_logs,LogDir} | {basic_html,Bool} -%%% CfgFiles = [string()] | string() -%%% UserConfig = [{CallbackMod,CfgStrings}] | {CallbackMod,CfgStrings} -%%% CallbackMod = atom() -%%% CfgStrings = [string()] | string() %%% TestDirs = [string()] | string() %%% Suites = [string()] | string() %%% Cases = [atom()] | atom() %%% Groups = [atom()] | atom() %%% TestSpecs = [string()] | string() +%%% Label = string() | atom() +%%% CfgFiles = [string()] | string() +%%% UserConfig = [{CallbackMod,CfgStrings}] | {CallbackMod,CfgStrings} +%%% CallbackMod = atom() +%%% CfgStrings = [string()] | string() %%% LogDir = string() %%% Conns = all | [atom()] %%% CSSFile = string() @@ -177,7 +178,8 @@ run(TestDirs) -> %%% DecryptFile = string() %%% Result = [TestResult] | {error,Reason} %%% @doc Run tests as specified by the combination of options in <code>Opts</code>. -%%% The options are the same as those used with the <code>run_test</code> program. +%%% The options are the same as those used with the +%%% <seealso marker="run_test#run_test"><code>run_test</code></seealso> program. %%% Note that here a <code>TestDir</code> can be used to point out the path to %%% a <code>Suite</code>. Note also that the option <code>testcase</code> %%% corresponds to the <code>-case</code> option in the <code>run_test</code> diff --git a/lib/common_test/src/ct_framework.erl b/lib/common_test/src/ct_framework.erl index 3dd1026f13..f2ca023cff 100644 --- a/lib/common_test/src/ct_framework.erl +++ b/lib/common_test/src/ct_framework.erl @@ -27,8 +27,12 @@ -export([init_tc/3, end_tc/3, get_suite/2, report/2, warn/1]). -export([error_notification/4]). +-export([overview_html_header/1]). + -export([error_in_suite/1, ct_init_per_group/2, ct_end_per_group/2]). +-export([make_all_conf/3, make_conf/5]). + -include("ct_event.hrl"). -include("ct_util.hrl"). @@ -101,7 +105,8 @@ init_tc1(Mod,Func,[Config0],DoInit) when is_list(Config0) -> [{saved_config,{LastFunc,SavedConfig}} | lists:keydelete(saved_config,1,Config0)]; {{LastSuite,InitOrEnd},SavedConfig} when InitOrEnd == init_per_suite ; - InitOrEnd == end_per_suite -> % last suite + InitOrEnd == end_per_suite -> + %% last suite [{saved_config,{LastSuite,SavedConfig}} | lists:keydelete(saved_config,1,Config0)]; undefined -> @@ -649,7 +654,7 @@ get_suite(Mod, all) -> {'EXIT',_} -> get_all(Mod, []); GroupDefs when is_list(GroupDefs) -> - case catch check_groups(Mod, GroupDefs) of + case catch find_groups(Mod, all, all, GroupDefs) of {error,_} = Error -> %% this makes test_server call error_in_suite as first %% (and only) test case so we can report Error properly @@ -664,102 +669,193 @@ get_suite(Mod, all) -> %%!============================================================ %%! Note: The handling of sequences in get_suite/2 and get_all/2 -%%! is deprecated and should be removed after OTP R13! +%%! is deprecated and should be removed at some point... %%!============================================================ -get_suite(Mod, Name) -> - %% Name may be name of a group or a test case. If it's a group, - %% it should be expanded to list of cases (in a conf term) +%% group +get_suite(Mod, Group={conf,Props,_Init,TCs,_End}) -> + Name = proplists:get_value(name, Props), case catch apply(Mod, groups, []) of {'EXIT',_} -> - get_seq(Mod, Name); + [Group]; GroupDefs when is_list(GroupDefs) -> - case catch check_groups(Mod, GroupDefs) of + case catch find_groups(Mod, Name, TCs, GroupDefs) of {error,_} = Error -> %% this makes test_server call error_in_suite as first %% (and only) test case so we can report Error properly [{?MODULE,error_in_suite,[[Error]]}]; + [] -> + {error,{invalid_group_spec,Name}}; ConfTests -> - - %%! --- Thu Jun 3 19:13:22 2010 --- peppe was here! - %%! HEERE! - %%! Must be able to search recursively for group Name, - %%! this only handles top level groups! - - FindConf = fun({conf,Props,_,_,_}) -> - case proplists:get_value(name, Props) of - Name -> true; - _ -> false - end - end, - case lists:filter(FindConf, ConfTests) of - [] -> % must be a test case - get_seq(Mod, Name); - [ConfTest|_] -> - ConfTest + case lists:member(skipped, Props) of + true -> + %% a *subgroup* specified *only* as skipped (and not + %% as an explicit test) should not be returned, or + %% init/end functions for top groups will be executed + case catch proplists:get_value(name, element(2, hd(ConfTests))) of + Name -> % top group + ConfTests; + _ -> + [] + end; + false -> + ConfTests end end; _ -> E = "Bad return value from "++atom_to_list(Mod)++":groups/0", [{?MODULE,error_in_suite,[[{error,list_to_atom(E)}]]}] - end. + end; -check_groups(_Mod, []) -> - []; -check_groups(Mod, Defs) -> - check_groups(Mod, Defs, Defs, []). +%% testcase +get_suite(Mod, Name) -> + get_seq(Mod, Name). -check_groups(Mod, [TC | Gs], Defs, Levels) when is_atom(TC), length(Levels)>0 -> - [TC | check_groups(Mod, Gs, Defs, Levels)]; +%%%----------------------------------------------------------------- -check_groups(Mod, [{group,SubName} | Gs], Defs, Levels) when is_atom(SubName) -> - case lists:member(SubName, Levels) of - true -> - E = "Cyclic reference to group "++atom_to_list(SubName)++ - " in "++atom_to_list(Mod)++":groups/0", - throw({error,list_to_atom(E)}); - false -> - case find_group(Mod, SubName, Defs) of - {error,_} = Error -> - throw(Error); - G -> - [check_groups(Mod, [G], Defs, Levels) | - check_groups(Mod, Gs, Defs, Levels)] - end +find_groups(Mod, Name, TCs, GroupDefs) -> + Found = find(Mod, Name, TCs, GroupDefs, [], GroupDefs, false), + Trimmed = trim(Found), + delete_subs(Trimmed, Trimmed). + +find(Mod, all, _TCs, [{Name,Props,Tests} | Gs], Known, Defs, _) -> + cyclic_test(Mod, Name, Known), + [make_conf(Mod, Name, Props, + find(Mod, all, all, Tests, [Name | Known], Defs, true)) | + find(Mod, all, all, Gs, [], Defs, true)]; + +find(Mod, Name, TCs, [{Name,Props,Tests} | _Gs], Known, Defs, false) + when is_atom(Name), is_list(Props), is_list(Tests) -> + cyclic_test(Mod, Name, Known), + case TCs of + all -> + [make_conf(Mod, Name, Props, + find(Mod, Name, TCs, Tests, [Name | Known], Defs, true))]; + _ -> + Tests1 = [TC || TC <- TCs, + lists:member(TC, Tests) == true], + [make_conf(Mod, Name, Props, Tests1)] end; -check_groups(Mod, [{Name,Tests} | Gs], Defs, Levels) when is_atom(Name), - is_list(Tests) -> - check_groups(Mod, [{Name,[],Tests} | Gs], Defs, Levels); - -check_groups(Mod, [{Name,Props,Tests} | Gs], Defs, Levels) when is_atom(Name), - is_list(Props), - is_list(Tests) -> - {TestSpec,Levels1} = - case Levels of - [] -> - {check_groups(Mod, Tests, Defs, [Name]),[]}; - _ -> - {check_groups(Mod, Tests, Defs, [Name|Levels]),Levels} - end, - [make_conf(Mod, Name, Props, TestSpec) | - check_groups(Mod, Gs, Defs, Levels1)]; +find(Mod, Name, TCs, [{Name1,Props,Tests} | Gs], Known, Defs, false) + when is_atom(Name1), is_list(Props), is_list(Tests) -> + cyclic_test(Mod, Name1, Known), + [make_conf(Mod, Name1, Props, + find(Mod, Name, TCs, Tests, [Name1 | Known], Defs, false)) | + find(Mod, Name, TCs, Gs, [], Defs, false)]; + +find(Mod, Name, _TCs, [{Name,_Props,_Tests} | _Gs], _Known, _Defs, true) + when is_atom(Name) -> + E = "Duplicate groups named "++atom_to_list(Name)++" in "++ + atom_to_list(Mod)++":groups/0", + throw({error,list_to_atom(E)}); + +find(Mod, Name, all, [{Name1,Props,Tests} | Gs], Known, Defs, true) + when is_atom(Name1), is_list(Props), is_list(Tests) -> + cyclic_test(Mod, Name1, Known), + [make_conf(Mod, Name1, Props, + find(Mod, Name, all, Tests, [Name1 | Known], Defs, true)) | + find(Mod, Name, all, Gs, [], Defs, true)]; + +find(Mod, Name, TCs, [{group,Name1} | Gs], Known, Defs, Found) when is_atom(Name1) -> + find(Mod, Name, TCs, [expand(Mod, Name1, Defs) | Gs], Known, Defs, Found); + +find(Mod, Name, TCs, [{Name1,Tests} | Gs], Known, Defs, Found) + when is_atom(Name1), is_list(Tests) -> + find(Mod, Name, TCs, [{Name1,[],Tests} | Gs], Known, Defs, Found); + +find(Mod, Name, TCs, [TC | Gs], Known, Defs, false) when is_atom(TC) -> + find(Mod, Name, TCs, Gs, Known, Defs, false); -check_groups(Mod, [BadTerm | _Gs], _Defs, Levels) -> - Where = if length(Levels) == 0 -> +find(Mod, Name, TCs, [TC | Gs], Known, Defs, true) when is_atom(TC) -> + [TC | find(Mod, Name, TCs, Gs, Known, Defs, true)]; + +find(Mod, _Name, _TCs, [BadTerm | _Gs], Known, _Defs, _Found) -> + Where = if length(Known) == 0 -> atom_to_list(Mod)++":groups/0"; true -> - "group "++atom_to_list(lists:last(Levels))++ + "group "++atom_to_list(lists:last(Known))++ " in "++atom_to_list(Mod)++":groups/0" end, Term = io_lib:format("~p", [BadTerm]), E = "Bad term "++lists:flatten(Term)++" in "++Where, throw({error,list_to_atom(E)}); -check_groups(_Mod, [], _Defs, _) -> +find(_Mod, _Name, _TCs, [], _Known, _Defs, false) -> + ['$NOMATCH']; + +find(_Mod, _Name, _TCs, [], _Known, _Defs, _Found) -> + []. + +delete_subs([Conf | Confs], All) -> + All1 = delete_conf(Conf, All), + case is_sub(Conf, All1) of + true -> + delete_subs(Confs, All1); + false -> + delete_subs(Confs, All) + end; + +delete_subs([], All) -> + All. + +delete_conf({conf,Props,_,_,_}, Confs) -> + Name = proplists:get_value(name, Props), + [Conf || Conf = {conf,Props0,_,_,_} <- Confs, + Name =/= proplists:get_value(name, Props0)]. + +is_sub({conf,Props,_,_,_}=Conf, [{conf,_,_,Tests,_} | Confs]) -> + Name = proplists:get_value(name, Props), + case lists:any(fun({conf,Props0,_,_,_}) -> + case proplists:get_value(name, Props0) of + N when N == Name -> + true; + _ -> + false + end; + (_) -> + false + end, Tests) of + true -> + true; + false -> + is_sub(Conf, Tests) or is_sub(Conf, Confs) + end; + +is_sub(Conf, [_TC | Tests]) -> + is_sub(Conf, Tests); + +is_sub(_Conf, []) -> + false. + +trim(['$NOMATCH' | Tests]) -> + trim(Tests); + +trim([{conf,Props,Init,Tests,End} | Confs]) -> + case trim(Tests) of + [] -> + trim(Confs); + Trimmed -> + [{conf,Props,Init,Trimmed,End} | trim(Confs)] + end; + +trim([TC | Tests]) -> + [TC | trim(Tests)]; + +trim([]) -> []. -find_group(Mod, Name, Defs) -> +cyclic_test(Mod, Name, Names) -> + case lists:member(Name, Names) of + true -> + E = "Cyclic reference to group "++atom_to_list(Name)++ + " in "++atom_to_list(Mod)++":groups/0", + throw({error,list_to_atom(E)}); + false -> + ok + end. + +expand(Mod, Name, Defs) -> case lists:keysearch(Name, 1, Defs) of {value,Def} -> Def; @@ -769,7 +865,48 @@ find_group(Mod, Name, Defs) -> throw({error,list_to_atom(E)}) end. +make_all_conf(Dir, Mod, _Props) -> + case code:is_loaded(Mod) of + false -> + code:load_abs(filename:join(Dir,atom_to_list(Mod))); + _ -> + ok + end, + make_all_conf(Mod). + +make_all_conf(Mod) -> + case catch apply(Mod, groups, []) of + {'EXIT',_} -> + {error,{invalid_group_definition,Mod}}; + GroupDefs when is_list(GroupDefs) -> + case catch find_groups(Mod, all, all, GroupDefs) of + {error,_} = Error -> + %% this makes test_server call error_in_suite as first + %% (and only) test case so we can report Error properly + [{?MODULE,error_in_suite,[[Error]]}]; + [] -> + {error,{invalid_group_spec,Mod}}; + ConfTests -> + [{conf,Props,Init,all,End} || {conf,Props,Init,_,End} <- ConfTests] + end + end. + +make_conf(Dir, Mod, Name, Props, TestSpec) -> + case code:is_loaded(Mod) of + false -> + code:load_abs(filename:join(Dir,atom_to_list(Mod))); + _ -> + ok + end, + make_conf(Mod, Name, Props, TestSpec). + make_conf(Mod, Name, Props, TestSpec) -> + case code:is_loaded(Mod) of + false -> + code:load_file(Mod); + _ -> + ok + end, {InitConf,EndConf} = case erlang:function_exported(Mod,init_per_group,2) of true -> @@ -780,6 +917,7 @@ make_conf(Mod, Name, Props, TestSpec) -> end, {conf,[{name,Name}|Props],InitConf,TestSpec,EndConf}. +%%%----------------------------------------------------------------- get_all(Mod, ConfTests) -> case catch apply(Mod, all, []) of @@ -1095,4 +1233,31 @@ add_data_dir(File,Config) when is_list(File) -> File end. +%%%----------------------------------------------------------------- +%%% @spec overview_html_header(TestName) -> Header +overview_html_header(TestName) -> + TestName1 = lists:flatten(io_lib:format("~p", [TestName])), + Label = case application:get_env(common_test, test_label) of + {ok,Lbl} when Lbl =/= undefined -> + "<H1><FONT color=\"green\">" ++ Lbl ++ "</FONT></H1>\n"; + _ -> + "" + end, + Bgr = case ct_logs:basic_html() of + true -> + ""; + false -> + CTPath = code:lib_dir(common_test), + TileFile = filename:join(filename:join(CTPath,"priv"),"tile1.jpg"), + " background=\"" ++ TileFile ++ "\"" + end, + + ["<html>\n", + "<head><title>Test ", TestName1, " results</title>\n", + "<meta http-equiv=\"cache-control\" content=\"no-cache\">\n", + "</head>\n", + "<body", Bgr, " bgcolor=\"white\" text=\"black\" ", + "link=\"blue\" vlink=\"purple\" alink=\"red\">\n", + Label, + "<H2>Results from test ", TestName1, "</H2>\n"]. diff --git a/lib/common_test/src/ct_logs.erl b/lib/common_test/src/ct_logs.erl index 5683d06aa7..f8ae7202e6 100644 --- a/lib/common_test/src/ct_logs.erl +++ b/lib/common_test/src/ct_logs.erl @@ -36,7 +36,8 @@ -export([make_all_suites_index/1,make_all_runs_index/1]). %% Logging stuff directly from testcase --export([tc_log/3,tc_print/3,tc_pal/3]). +-export([tc_log/3,tc_print/3,tc_pal/3, + basic_html/0]). %% Simulate logger process for use without ct environment running -export([simulate/0]). @@ -57,7 +58,7 @@ -define(table_color2,"#E4F0FE"). -define(table_color3,"#F0F8FF"). --define(testname_width, 70). +-define(testname_width, 60). -define(abs(Name), filename:absname(Name)). @@ -716,7 +717,7 @@ make_last_run_index1(StartTime,IndexName) -> [Log]; Logs -> case read_totals_file(?totals_name) of - {_Node,Logs0,_Totals} -> + {_Node,_Lbl,Logs0,_Totals} -> insert_dirs(Logs,Logs0); _ -> %% someone deleted the totals file!? @@ -728,10 +729,15 @@ make_last_run_index1(StartTime,IndexName) -> {ok,Bin} -> binary_to_term(Bin); _ -> [] end, - {ok,Index0,Totals} = make_last_run_index(Logs1, index_header(StartTime), + Label = case application:get_env(common_test, test_label) of + {ok,Lbl} -> Lbl; + _ -> undefined + end, + {ok,Index0,Totals} = make_last_run_index(Logs1, + index_header(Label,StartTime), 0, 0, 0, 0, 0, Missing), %% write current Totals to file, later to be used in all_runs log - write_totals_file(?totals_name,Logs1,Totals), + write_totals_file(?totals_name,Label,Logs1,Totals), Index = [Index0|index_footer()], case force_write_file(IndexName, Index) of ok -> @@ -761,7 +767,7 @@ make_last_run_index([Name|Rest], Result, TotSucc, TotFail, UserSkip, AutoSkip, TotNotBuilt, Missing); LastLogDir -> SuiteName = filename:rootname(filename:basename(Name)), - case make_one_index_entry(SuiteName, LastLogDir, false, Missing) of + case make_one_index_entry(SuiteName, LastLogDir, "-", false, Missing) of {Result1,Succ,Fail,USkip,ASkip,NotBuilt} -> %% for backwards compatibility AutoSkip1 = case catch AutoSkip+ASkip of @@ -780,18 +786,18 @@ make_last_run_index([], Result, TotSucc, TotFail, UserSkip, AutoSkip, TotNotBuil {ok, [Result|total_row(TotSucc, TotFail, UserSkip, AutoSkip, TotNotBuilt, false)], {TotSucc,TotFail,UserSkip,AutoSkip,TotNotBuilt}}. -make_one_index_entry(SuiteName, LogDir, All, Missing) -> +make_one_index_entry(SuiteName, LogDir, Label, All, Missing) -> case count_cases(LogDir) of {Succ,Fail,UserSkip,AutoSkip} -> NotBuilt = not_built(SuiteName, LogDir, All, Missing), - NewResult = make_one_index_entry1(SuiteName, LogDir, Succ, Fail, + NewResult = make_one_index_entry1(SuiteName, LogDir, Label, Succ, Fail, UserSkip, AutoSkip, NotBuilt, All), {NewResult,Succ,Fail,UserSkip,AutoSkip,NotBuilt}; error -> error end. -make_one_index_entry1(SuiteName, Link, Success, Fail, UserSkip, AutoSkip, +make_one_index_entry1(SuiteName, Link, Label, Success, Fail, UserSkip, AutoSkip, NotBuilt, All) -> LogFile = filename:join(Link, ?suitelog_name ++ ".html"), CrashDumpName = SuiteName ++ "_erl_crash.dump", @@ -803,7 +809,7 @@ make_one_index_entry1(SuiteName, Link, Success, Fail, UserSkip, AutoSkip, false -> "" end, - {Timestamp,Node,AllInfo} = + {Lbl,Timestamp,Node,AllInfo} = case All of {true,OldRuns} -> [_Prefix,NodeOrDate|_] = string:tokens(Link,"."), @@ -811,20 +817,21 @@ make_one_index_entry1(SuiteName, Link, Success, Fail, UserSkip, AutoSkip, 0 -> "-"; _ -> NodeOrDate end, - N = ["<TD ALIGN=right>",Node1,"</TD>\n"], + N = ["<TD ALIGN=right><FONT SIZE=-1>",Node1,"</FONT></TD>\n"], CtRunDir = filename:dirname(filename:dirname(Link)), - T = ["<TD>",timestamp(CtRunDir),"</TD>\n"], + L = ["<TD ALIGN=center><FONT SIZE=-1><B>",Label,"</FONT></B></TD>\n"], + T = ["<TD><FONT SIZE=-1>",timestamp(CtRunDir),"</FONT></TD>\n"], CtLogFile = filename:join(CtRunDir,?ct_log_name), OldRunsLink = case OldRuns of [] -> "none"; _ -> "<A HREF=\""++?all_runs_name++"\">Old Runs</A>" end, - A=["<TD><A HREF=\"",CtLogFile,"\">CT Log</A></TD>\n", - "<TD>",OldRunsLink,"</TD>\n"], - {T,N,A}; + A=["<TD><FONT SIZE=-1><A HREF=\"",CtLogFile,"\">CT Log</A></FONT></TD>\n", + "<TD><FONT SIZE=-1>",OldRunsLink,"</FONT></TD>\n"], + {L,T,N,A}; false -> - {"","",""} + {"","","",""} end, NotBuiltStr = if NotBuilt == 0 -> @@ -851,7 +858,8 @@ make_one_index_entry1(SuiteName, Link, Success, Fail, UserSkip, AutoSkip, {UserSkip+AutoSkip,integer_to_list(UserSkip),ASStr} end, ["<TR valign=top>\n", - "<TD><A HREF=\"",LogFile,"\">",SuiteName,"</A>",CrashDumpLink,"</TD>\n", + "<TD><FONT SIZE=-1><A HREF=\"",LogFile,"\">",SuiteName,"</A>",CrashDumpLink,"</FONT></TD>\n", + Lbl, Timestamp, "<TD ALIGN=right>",integer_to_list(Success),"</TD>\n", "<TD ALIGN=right>",FailStr,"</TD>\n", @@ -862,12 +870,14 @@ make_one_index_entry1(SuiteName, Link, Success, Fail, UserSkip, AutoSkip, AllInfo, "</TR>\n"]. total_row(Success, Fail, UserSkip, AutoSkip, NotBuilt, All) -> - {TimestampCell,AllInfo} = + {Label,TimestampCell,AllInfo} = case All of - true -> - {"<TD> </TD>\n","<TD> </TD>\n<TD> </TD>\n"}; + true -> + {"<TD> </TD>\n", + "<TD> </TD>\n", + "<TD> </TD>\n<TD> </TD>\n"}; false -> - {"",""} + {"","",""} end, {AllSkip,UserSkipStr,AutoSkipStr} = @@ -877,6 +887,7 @@ total_row(Success, Fail, UserSkip, AutoSkip, NotBuilt, All) -> end, ["<TR valign=top>\n", "<TD><B>Total</B></TD>", + Label, TimestampCell, "<TD ALIGN=right><B>",integer_to_list(Success),"<B></TD>\n", "<TD ALIGN=right><B>",integer_to_list(Fail),"<B></TD>\n", @@ -937,13 +948,21 @@ term_to_text(Term) -> %%% Headers and footers. -index_header(StartTime) -> - [header("Test Results " ++ format_time(StartTime)) | +index_header(Label, StartTime) -> + Head = + case Label of + undefined -> + header("Test Results", format_time(StartTime)); + _ -> + header("Test Results for \"" ++ Label ++ "\"", + format_time(StartTime)) + end, + [Head | ["<CENTER>\n", "<P><A HREF=\"",?ct_log_name,"\">Common Test Framework Log</A></P>", "<TABLE border=\"3\" cellpadding=\"5\" " "BGCOLOR=\"",?table_color3,"\">\n" - "<th><B>Name</B></th>\n", + "<th><B>Test Name</B></th>\n", "<th><font color=\"",?table_color3,"\">_</font>Ok" "<font color=\"",?table_color3,"\">_</font></th>\n" "<th>Failed</th>\n", @@ -952,13 +971,17 @@ index_header(StartTime) -> "\n"]]. all_suites_index_header() -> + {ok,Cwd} = file:get_cwd(), + LogDir = filename:basename(Cwd), + AllRuns = "All test runs in \"" ++ LogDir ++ "\"", [header("Test Results") | ["<CENTER>\n", - "<A HREF=\"",?all_runs_name,"\">All Test Runs in this directory</A>\n", + "<A HREF=\"",?all_runs_name,"\">",AllRuns,"</A>\n", "<br><br>\n", "<TABLE border=\"3\" cellpadding=\"5\" " "BGCOLOR=\"",?table_color2,"\">\n" - "<th>Name</th>\n", + "<th>Test Name</th>\n", + "<th>Label</th>\n", "<th>Test Run Started</th>\n", "<th><font color=\"",?table_color2,"\">_</font>Ok" "<font color=\"",?table_color2,"\">_</font></th>\n" @@ -971,13 +994,17 @@ all_suites_index_header() -> "\n"]]. all_runs_header() -> - [header("All test runs in current directory") | + {ok,Cwd} = file:get_cwd(), + LogDir = filename:basename(Cwd), + Title = "All test runs in \"" ++ LogDir ++ "\"", + [header(Title) | ["<CENTER><TABLE border=\"3\" cellpadding=\"5\" " "BGCOLOR=\"",?table_color1,"\">\n" "<th><B>History</B></th>\n" "<th><B>Node</B></th>\n" + "<th><B>Label</B></th>\n" "<th>Tests</th>\n" - "<th><B>Names</B></th>\n" + "<th><B>Test Names</B></th>\n" "<th>Total</th>\n" "<th><font color=\"",?table_color1,"\">_</font>Ok" "<font color=\"",?table_color1,"\">_</font></th>\n" @@ -987,12 +1014,23 @@ all_runs_header() -> "\n"]]. header(Title) -> + header1(Title, ""). +header(Title, SubTitle) -> + header1(Title, SubTitle). + +header1(Title, SubTitle) -> + SubTitleHTML = if SubTitle =/= "" -> + ["<CENTER>\n", + "<H2>" ++ SubTitle ++ "</H2>\n", + "</CENTER>\n<BR>\n"]; + true -> "<BR>\n" + end, ["<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 3.2 Final//EN\">\n" "<!-- autogenerated by '"++atom_to_list(?MODULE)++"'. -->\n" "<HTML>\n", "<HEAD>\n", - "<TITLE>" ++ Title ++ "</TITLE>\n", + "<TITLE>" ++ Title ++ " " ++ SubTitle ++ "</TITLE>\n", "<META HTTP-EQUIV=\"CACHE-CONTROL\" CONTENT=\"NO-CACHE\">\n", "</HEAD>\n", @@ -1004,6 +1042,7 @@ header(Title) -> "<CENTER>\n", "<H1>" ++ Title ++ "</H1>\n", "</CENTER>\n", + SubTitleHTML, "<!-- ---- CONTENT ---- -->\n"]. @@ -1013,19 +1052,28 @@ index_footer() -> footer() -> ["<P><CENTER>\n" - "<HR>\n" - "<P><FONT SIZE=-1>\n" - "Copyright © ", year(), - " <A HREF=\"http://erlang.ericsson.se\">Open Telecom Platform</A><BR>\n" - "Updated: <!date>", current_time(), "<!/date><BR>\n" - "</FONT>\n" - "</CENTER>\n" - "</body>\n"]. + "<BR><BR>\n" + "<HR>\n" + "<P><FONT SIZE=-1>\n" + "Copyright © ", year(), + " <A HREF=\"http://erlang.ericsson.se\">Open Telecom Platform</A><BR>\n" + "Updated: <!date>", current_time(), "<!/date><BR>\n" + "</FONT>\n" + "</CENTER>\n" + "</body>\n"]. body_tag() -> - "<body bgcolor=\"#FFFFFF\" text=\"#000000\" link=\"#0000FF\"" - "vlink=\"#800080\" alink=\"#FF0000\">\n". + case basic_html() of + true -> + "<body bgcolor=\"#FFFFFF\" text=\"#000000\" link=\"#0000FF\" " + "vlink=\"#800080\" alink=\"#FF0000\">\n"; + false -> + CTPath = code:lib_dir(common_test), + TileFile = filename:join(filename:join(CTPath,"priv"),"tile1.jpg"), + "<body background=\"" ++ TileFile ++ "\" bgcolor=\"#FFFFFF\" text=\"#000000\" link=\"#0000FF\" " + "vlink=\"#800080\" alink=\"#FF0000\">\n" + end. current_time() -> format_time(calendar:local_time()). @@ -1217,7 +1265,7 @@ runentry(Dir, BasicHtml) -> TotalsFile = filename:join(Dir,?totals_name), TotalsStr = case read_totals_file(TotalsFile) of - {Node,Logs,{TotSucc,TotFail,UserSkip,AutoSkip,NotBuilt}} -> + {Node,Label,Logs,{TotSucc,TotFail,UserSkip,AutoSkip,NotBuilt}} -> TotFailStr = if TotFail > 0 -> ["<FONT color=\"red\">", @@ -1263,6 +1311,7 @@ runentry(Dir, BasicHtml) -> end, Total = TotSucc+TotFail+AllSkip, A = ["<TD ALIGN=center><FONT SIZE=-1>",Node,"</FONT></TD>\n", + "<TD ALIGN=center><FONT SIZE=-1><B>",Label,"</B></FONT></TD>\n", "<TD ALIGN=right>",NoOfTests,"</TD>\n"], B = if BasicHtml -> ["<TD ALIGN=center><FONT SIZE=-1>",TestNamesTrunc,"</FONT></TD>\n"]; @@ -1283,17 +1332,19 @@ runentry(Dir, BasicHtml) -> end, Index = filename:join(Dir,?index_name), ["<TR>\n" - "<TD><A HREF=\"",Index,"\">",timestamp(Dir),"</A>",TotalsStr,"</TD>\n" + "<TD><FONT SIZE=-1><A HREF=\"",Index,"\">",timestamp(Dir),"</A>",TotalsStr,"</FONT></TD>\n" "</TR>\n"]. -write_totals_file(Name,Logs,Totals) -> +write_totals_file(Name,Label,Logs,Totals) -> AbsName = ?abs(Name), notify_and_lock_file(AbsName), force_write_file(AbsName, term_to_binary({atom_to_list(node()), - Logs,Totals})), + Label,Logs,Totals})), notify_and_unlock_file(AbsName). +%% this function needs to convert from old formats to new so that old +%% test results (prev ct versions) can be listed together with new read_totals_file(Name) -> AbsName = ?abs(Name), notify_and_lock_file(AbsName), @@ -1303,12 +1354,23 @@ read_totals_file(Name) -> case catch binary_to_term(Bin) of {'EXIT',_Reason} -> % corrupt file {"-",[],undefined}; - R = {Node,Ls,Tot} -> + {Node,Label,Ls,Tot} -> % all info available + Label1 = case Label of + undefined -> "-"; + _ -> Label + end, + case Tot of + {_Ok,_Fail,_USkip,_ASkip,_NoBuild} -> % latest format + {Node,Label1,Ls,Tot}; + {TotSucc,TotFail,AllSkip,NotBuilt} -> + {Node,Label1,Ls,{TotSucc,TotFail,AllSkip,undefined,NotBuilt}} + end; + {Node,Ls,Tot} -> % no label found case Tot of - {_,_,_,_,_} -> % latest format - R; + {_Ok,_Fail,_USkip,_ASkip,_NoBuild} -> % latest format + {Node,"-",Ls,Tot}; {TotSucc,TotFail,AllSkip,NotBuilt} -> - {Node,Ls,{TotSucc,TotFail,AllSkip,undefined,NotBuilt}} + {Node,"-",Ls,{TotSucc,TotFail,AllSkip,undefined,NotBuilt}} end; %% for backwards compatibility {Ls,Tot} -> {"-",Ls,Tot}; @@ -1411,7 +1473,7 @@ make_all_suites_index1(When,AllSuitesLogDirs) -> make_all_suites_index2(IndexName,AllSuitesLogDirs) -> {ok,Index0,_Totals} = make_all_suites_index3(AllSuitesLogDirs, all_suites_index_header(), - 0, 0, 0, 0, 0), + 0, 0, 0, 0, 0, []), Index = [Index0|index_footer()], case force_write_file(IndexName, Index) of ok -> @@ -1421,14 +1483,25 @@ make_all_suites_index2(IndexName,AllSuitesLogDirs) -> end. make_all_suites_index3([{SuiteName,[LastLogDir|OldDirs]}|Rest], - Result, TotSucc, TotFail, UserSkip, AutoSkip, TotNotBuilt) -> + Result, TotSucc, TotFail, UserSkip, AutoSkip, TotNotBuilt, + Labels) -> [EntryDir|_] = filename:split(LastLogDir), Missing = case file:read_file(filename:join(EntryDir,?missing_suites_info)) of {ok,Bin} -> binary_to_term(Bin); _ -> [] end, - case make_one_index_entry(SuiteName, LastLogDir, {true,OldDirs}, Missing) of + {Label,Labels1} = + case proplists:get_value(EntryDir, Labels) of + undefined -> + case read_totals_file(filename:join(EntryDir,?totals_name)) of + {_,Lbl,_,_} -> {Lbl,[{EntryDir,Lbl}|Labels]}; + _ -> {"-",[{EntryDir,"-"}|Labels]} + end; + Lbl -> + {Lbl,Labels} + end, + case make_one_index_entry(SuiteName, LastLogDir, Label, {true,OldDirs}, Missing) of {Result1,Succ,Fail,USkip,ASkip,NotBuilt} -> %% for backwards compatibility AutoSkip1 = case catch AutoSkip+ASkip of @@ -1437,13 +1510,13 @@ make_all_suites_index3([{SuiteName,[LastLogDir|OldDirs]}|Rest], end, make_all_suites_index3(Rest, [Result|Result1], TotSucc+Succ, TotFail+Fail, UserSkip+USkip, AutoSkip1, - TotNotBuilt+NotBuilt); + TotNotBuilt+NotBuilt,Labels1); error -> make_all_suites_index3(Rest, Result, TotSucc, TotFail, - UserSkip, AutoSkip, TotNotBuilt) + UserSkip, AutoSkip, TotNotBuilt,Labels1) end; make_all_suites_index3([], Result, TotSucc, TotFail, UserSkip, AutoSkip, - TotNotBuilt) -> + TotNotBuilt,_) -> {ok, [Result|total_row(TotSucc, TotFail, UserSkip, AutoSkip, TotNotBuilt,true)], {TotSucc,TotFail,UserSkip,AutoSkip,TotNotBuilt}}. diff --git a/lib/common_test/src/ct_run.erl b/lib/common_test/src/ct_run.erl index 6a9c42d1b9..c5bfd01642 100644 --- a/lib/common_test/src/ct_run.erl +++ b/lib/common_test/src/ct_run.erl @@ -45,7 +45,8 @@ -define(abs(Name), filename:absname(Name)). -define(testdir(Name, Suite), ct_util:get_testdir(Name, Suite)). --record(opts, {vts, +-record(opts, {label, + vts, shell, cover, coverspec, @@ -153,14 +154,16 @@ script_start(Args) -> Result end, stop_trace(Tracing), + timer:sleep(1000), Res. script_start1(Parent, Args) -> %% read general start flags + Label = get_start_opt(label, fun([Lbl]) -> Lbl end, Args), Vts = get_start_opt(vts, true, Args), Shell = get_start_opt(shell, true, Args), Cover = get_start_opt(cover, fun([CoverFile]) -> ?abs(CoverFile) end, Args), - LogDir = get_start_opt(logdir, fun([LogD]) -> LogD end, ".", Args), + LogDir = get_start_opt(logdir, fun([LogD]) -> LogD end, Args), MultTT = get_start_opt(multiply_timetraps, fun([MT]) -> list_to_integer(MT) end, 1, Args), ScaleTT = get_start_opt(scale_timetraps, @@ -229,7 +232,7 @@ script_start1(Parent, Args) -> application:set_env(common_test, basic_html, true) end, - StartOpts = #opts{vts = Vts, shell = Shell, cover = Cover, + StartOpts = #opts{label = Label, vts = Vts, shell = Shell, cover = Cover, logdir = LogDir, event_handlers = EvHandlers, include = IncludeDirs, silent_connections = SilentConns, @@ -288,6 +291,9 @@ script_start2(StartOpts = #opts{vts = undefined, TS -> SpecStartOpts = get_data_for_node(TS, node()), + Label = choose_val(StartOpts#opts.label, + SpecStartOpts#opts.label), + LogDir = choose_val(StartOpts#opts.logdir, SpecStartOpts#opts.logdir), @@ -303,7 +309,8 @@ script_start2(StartOpts = #opts{vts = undefined, SpecStartOpts#opts.include]), application:set_env(common_test, include, AllInclude), - {TS,StartOpts#opts{testspecs = Specs, + {TS,StartOpts#opts{label = Label, + testspecs = Specs, cover = Cover, logdir = LogDir, config = SpecStartOpts#opts.config, @@ -317,29 +324,30 @@ script_start2(StartOpts = #opts{vts = undefined, end, %% read config/userconfig from start flags InitConfig = ct_config:prepare_config_list(Args), + TheLogDir = which(logdir, Opts#opts.logdir), case {TestSpec,Terms} of {_,{error,_}=Error} -> Error; {[],_} -> {error,no_testspec_specified}; {undefined,_} -> % no testspec used - case check_and_install_configfiles(InitConfig, - which(logdir,Opts#opts.logdir), + case check_and_install_configfiles(InitConfig, TheLogDir, Opts#opts.event_handlers) of ok -> % go on read tests from start flags - script_start3(Opts#opts{config=InitConfig}, Args); + script_start3(Opts#opts{config=InitConfig, + logdir=TheLogDir}, Args); Error -> Error end; {_,_} -> % testspec used %% merge config from start flags with config from testspec AllConfig = merge_vals([InitConfig, Opts#opts.config]), - case check_and_install_configfiles(AllConfig, - which(logdir,Opts#opts.logdir), + case check_and_install_configfiles(AllConfig, TheLogDir, Opts#opts.event_handlers) of ok -> % read tests from spec {Run,Skip} = ct_testspec:prepare_tests(Terms, node()), - do_run(Run, Skip, Opts#opts{config=AllConfig}, Args); + do_run(Run, Skip, Opts#opts{config=AllConfig, + logdir=TheLogDir}, Args); Error -> Error end @@ -348,11 +356,12 @@ script_start2(StartOpts = #opts{vts = undefined, script_start2(StartOpts, Args) -> %% read config/userconfig from start flags InitConfig = ct_config:prepare_config_list(Args), - case check_and_install_configfiles(InitConfig, - which(logdir,StartOpts#opts.logdir), + LogDir = which(logdir, StartOpts#opts.logdir), + case check_and_install_configfiles(InitConfig, LogDir, StartOpts#opts.event_handlers) of ok -> % go on read tests from start flags - script_start3(StartOpts#opts{config=InitConfig}, Args); + script_start3(StartOpts#opts{config=InitConfig, + logdir=LogDir}, Args); Error -> Error end. @@ -427,8 +436,12 @@ script_start4(#opts{vts = true, config = Config, event_handlers = EvHandlers, end, [], Config), vts:init_data(ConfigFiles, EvHandlers, ?abs(LogDir), Tests); -script_start4(#opts{shell = true, config = Config, event_handlers = EvHandlers, +script_start4(#opts{label = Label, shell = true, config = Config, + event_handlers = EvHandlers, logdir = LogDir, testspecs = Specs}, _Args) -> + %% label - used by ct_logs + application:set_env(common_test, test_label, Label), + InstallOpts = [{config,Config},{event_handler,EvHandlers}], if Config == [] -> ok; @@ -613,9 +626,13 @@ run_test(StartOpts) when is_list(StartOpts) -> end. run_test1(StartOpts) -> + %% label + Label = get_start_opt(label, fun(Lbl) when is_list(Lbl) -> Lbl; + (Lbl) when is_atom(Lbl) -> atom_to_list(Lbl) + end, StartOpts), %% logdir LogDir = get_start_opt(logdir, fun(LD) when is_list(LD) -> LD end, - ".", StartOpts), + StartOpts), %% config & userconfig CfgFiles = ct_config:get_config_file_list(StartOpts), @@ -711,7 +728,8 @@ run_test1(StartOpts) -> %% stepped execution Step = get_start_opt(step, value, StartOpts), - Opts = #opts{cover = Cover, step = Step, logdir = LogDir, config = CfgFiles, + Opts = #opts{label = Label, + cover = Cover, step = Step, logdir = LogDir, config = CfgFiles, event_handlers = EvHandlers, include = Include, silent_connections = SilentConns, stylesheet = Stylesheet, @@ -747,6 +765,8 @@ run_spec_file(Relaxed, exit(CTReason); TS -> SpecOpts = get_data_for_node(TS, node()), + Label = choose_val(Opts#opts.label, + SpecOpts#opts.label), LogDir = choose_val(Opts#opts.logdir, SpecOpts#opts.logdir), AllConfig = merge_vals([CfgFiles, SpecOpts#opts.config]), @@ -766,8 +786,9 @@ run_spec_file(Relaxed, which(logdir,LogDir), AllEvHs) of ok -> - Opts1 = Opts#opts{cover = Cover, - logdir = LogDir, + Opts1 = Opts#opts{label = Label, + cover = Cover, + logdir = which(logdir, LogDir), config = AllConfig, event_handlers = AllEvHs, include = AllInclude, @@ -775,7 +796,7 @@ run_spec_file(Relaxed, multiply_timetraps = MultTT, scale_timetraps = ScaleTT}, {Run,Skip} = ct_testspec:prepare_tests(TS, node()), - do_run(Run, Skip, Opts1, StartOpts); + reformat_result(catch do_run(Run, Skip, Opts1, StartOpts)); {error,GCFReason} -> exit(GCFReason) end @@ -785,9 +806,11 @@ run_prepared(Run, Skip, Opts = #opts{logdir = LogDir, config = CfgFiles, event_handlers = EvHandlers}, StartOpts) -> - case check_and_install_configfiles(CfgFiles, LogDir, EvHandlers) of + LogDir1 = which(logdir, LogDir), + case check_and_install_configfiles(CfgFiles, LogDir1, EvHandlers) of ok -> - do_run(Run, Skip, Opts, StartOpts); + reformat_result(catch do_run(Run, Skip, Opts#opts{logdir = LogDir1}, + StartOpts)); {error,Reason} -> exit(Reason) end. @@ -816,6 +839,8 @@ check_config_file(Callback, File)-> run_dir(Opts = #opts{logdir = LogDir, config = CfgFiles, event_handlers = EvHandlers}, StartOpts) -> + LogDir1 = which(logdir, LogDir), + Opts1 = Opts#opts{logdir = LogDir1}, AbsCfgFiles = lists:map(fun({Callback,FileList})-> case code:is_loaded(Callback) of @@ -834,7 +859,7 @@ run_dir(Opts = #opts{logdir = LogDir, check_config_file(Callback, File) end, FileList)} end, CfgFiles), - case install([{config,AbsCfgFiles},{event_handler,EvHandlers}], LogDir) of + case install([{config,AbsCfgFiles},{event_handler,EvHandlers}], LogDir1) of ok -> ok; {error,IReason} -> exit(IReason) end, @@ -842,7 +867,7 @@ run_dir(Opts = #opts{logdir = LogDir, {value,{_,Dirs=[Dir|_]}} when not is_integer(Dir), length(Dirs)>1 -> %% multiple dirs (no suite) - do_run(tests(Dirs), [], Opts, StartOpts); + reformat_result(catch do_run(tests(Dirs), [], Opts1, StartOpts)); false -> % no dir %% fun for converting suite name to {Dir,Mod} tuple S2M = fun(S) when is_list(S) -> @@ -857,12 +882,15 @@ run_dir(Opts = #opts{logdir = LogDir, case listify(proplists:get_value(group, StartOpts, [])) ++ listify(proplists:get_value(testcase, StartOpts, [])) of [] -> - do_run(tests(Dir, listify(Mod)), [], Opts, StartOpts); + reformat_result(catch do_run(tests(Dir, listify(Mod)), + [], Opts1, StartOpts)); GsAndCs -> - do_run(tests(Dir, Mod, GsAndCs), [], Opts, StartOpts) + reformat_result(catch do_run(tests(Dir, Mod, GsAndCs), + [], Opts1, StartOpts)) end; {value,{_,Suites}} -> - do_run(tests(lists:map(S2M, Suites)), [], Opts, StartOpts); + reformat_result(catch do_run(tests(lists:map(S2M, Suites)), + [], Opts1, StartOpts)); _ -> exit(no_tests_specified) end; @@ -875,17 +903,22 @@ run_dir(Opts = #opts{logdir = LogDir, case listify(proplists:get_value(group, StartOpts, [])) ++ listify(proplists:get_value(testcase, StartOpts, [])) of [] -> - do_run(tests(Dir, listify(Mod)), [], Opts, StartOpts); + reformat_result(catch do_run(tests(Dir, listify(Mod)), + [], Opts1, StartOpts)); GsAndCs -> - do_run(tests(Dir, Mod, GsAndCs), [], Opts, StartOpts) + reformat_result(catch do_run(tests(Dir, Mod, GsAndCs), + [], Opts1, StartOpts)) end; {value,{_,Suites=[Suite|_]}} when is_list(Suite) -> Mods = lists:map(fun(Str) -> list_to_atom(Str) end, Suites), - do_run(tests(delistify(Dir), Mods), [], Opts, StartOpts); + reformat_result(catch do_run(tests(delistify(Dir), Mods), + [], Opts1, StartOpts)); {value,{_,Suites}} -> - do_run(tests(delistify(Dir), Suites), [], Opts, StartOpts); + reformat_result(catch do_run(tests(delistify(Dir), Suites), + [], Opts1, StartOpts)); false -> % no suite, only dir - do_run(tests(listify(Dir)), [], Opts, StartOpts) + reformat_result(catch do_run(tests(listify(Dir)), + [], Opts1, StartOpts)) end end. @@ -925,28 +958,30 @@ run_testspec1(TestSpec) -> EnvInclude++Opts#opts.include end, application:set_env(common_test, include, AllInclude), - - case check_and_install_configfiles(Opts#opts.config, - which(logdir,Opts#opts.logdir), + LogDir1 = which(logdir,Opts#opts.logdir), + case check_and_install_configfiles(Opts#opts.config, LogDir1, Opts#opts.event_handlers) of ok -> - Opts1 = Opts#opts{testspecs = [TestSpec], + Opts1 = Opts#opts{testspecs = [], + logdir = LogDir1, include = AllInclude}, {Run,Skip} = ct_testspec:prepare_tests(TS, node()), - do_run(Run, Skip, Opts1, []); + reformat_result(catch do_run(Run, Skip, Opts1, [])); {error,GCFReason} -> exit(GCFReason) end end. -get_data_for_node(#testspec{logdir=LogDirs, - cover=CoverFs, - config=Cfgs, - userconfig=UsrCfgs, - event_handler=EvHs, - include=Incl, - multiply_timetraps=MTs, - scale_timetraps=STs}, Node) -> +get_data_for_node(#testspec{label = Labels, + logdir = LogDirs, + cover = CoverFs, + config = Cfgs, + userconfig = UsrCfgs, + event_handler = EvHs, + include = Incl, + multiply_timetraps = MTs, + scale_timetraps = STs}, Node) -> + Label = proplists:get_value(Node, Labels), LogDir = case proplists:get_value(Node, LogDirs) of undefined -> "."; Dir -> Dir @@ -958,7 +993,8 @@ get_data_for_node(#testspec{logdir=LogDirs, [CBF || {N,CBF} <- UsrCfgs, N==Node], EvHandlers = [{H,A} || {N,H,A} <- EvHs, N==Node], Include = [I || {N,I} <- Incl, N==Node], - #opts{logdir = LogDir, + #opts{label = Label, + logdir = LogDir, cover = Cover, config = ConfigFiles, event_handlers = EvHandlers, @@ -1023,21 +1059,26 @@ delistify(E) -> E. %%% @equiv ct:run/3 run(TestDir, Suite, Cases) -> install([]), - do_run(tests(TestDir, Suite, Cases), []). + reformat_result(catch do_run(tests(TestDir, Suite, Cases), [])). %%%----------------------------------------------------------------- %%% @hidden %%% @equiv ct:run/2 run(TestDir, Suite) when is_list(TestDir), is_integer(hd(TestDir)) -> install([]), - do_run(tests(TestDir, Suite), []). + reformat_result(catch do_run(tests(TestDir, Suite), [])). %%%----------------------------------------------------------------- %%% @hidden %%% @equiv ct:run/1 run(TestDirs) -> install([]), - do_run(tests(TestDirs), []). + reformat_result(catch do_run(tests(TestDirs), [])). + +reformat_result({user_error,Reason}) -> + {error,Reason}; +reformat_result(Result) -> + Result. suite_to_test(Suite) -> {filename:dirname(Suite),list_to_atom(filename:rootname(filename:basename(Suite)))}. @@ -1092,7 +1133,17 @@ do_run(Tests, Misc, LogDir) when is_list(Misc) -> do_run(Tests, [], Opts1#opts{logdir = LogDir}, []). do_run(Tests, Skip, Opts, Args) -> - #opts{cover = Cover} = Opts, + #opts{label = Label, cover = Cover} = Opts, + + %% label - used by ct_logs + TestLabel = + if Label == undefined -> undefined; + is_atom(Label) -> atom_to_list(Label); + is_list(Label) -> Label; + true -> undefined + end, + application:set_env(common_test, test_label, TestLabel), + case code:which(test_server) of non_existing -> exit({error,no_path_to_test_server}); @@ -1156,10 +1207,19 @@ do_run(Tests, Skip, Opts, Args) -> true -> SavedErrors = save_make_errors(SuiteMakeErrors), ct_repeat:log_loop_info(Args), - {Tests1,Skip1} = final_tests(Tests,[],Skip,SavedErrors), - R = do_run_test(Tests1, Skip1, Opts1), - ct_util:stop(normal), - R; + + {Tests1,Skip1} = final_tests(Tests,Skip,SavedErrors), + + R = (catch do_run_test(Tests1, Skip1, Opts1)), + case R of + {EType,_} = Error when EType == user_error ; + EType == error -> + ct_util:stop(clean), + exit(Error); + _ -> + ct_util:stop(normal), + R + end; false -> io:nl(), ct_util:stop(clean), @@ -1316,8 +1376,22 @@ suite_tuples([{TestDir,Suite,_} | Tests]) when is_atom(Suite) -> suite_tuples([]) -> []. -final_tests([{TestDir,Suites,_}|Tests], - Final, Skip, Bad) when is_list(Suites), is_atom(hd(Suites)) -> +final_tests(Tests, Skip, Bad) -> + + %%! --- Thu Jun 24 15:47:27 2010 --- peppe was here! + %%! io:format(user, "FINAL0 = ~p~nSKIP0 = ~p~n", [Tests, Skip]), + + {Tests1,Skip1} = final_tests1(Tests, [], Skip, Bad), + Skip2 = final_skip(Skip1, []), + + + %%! --- Thu Jun 24 15:47:27 2010 --- peppe was here! + %%! io:format(user, "FINAL1 = ~p~nSKIP1 = ~p~n", [Tests1, Skip2]), + + {Tests1,Skip2}. + +final_tests1([{TestDir,Suites,_}|Tests], Final, Skip, Bad) when + is_list(Suites), is_atom(hd(Suites)) -> % Separate = % fun(S,{DoSuite,Dont}) -> % case lists:keymember({TestDir,S},1,Bad) of @@ -1336,9 +1410,9 @@ final_tests([{TestDir,Suites,_}|Tests], Skip1 = [{TD,S,"Make failed"} || {{TD,S},_} <- Bad, S1 <- Suites, S == S1, TD == TestDir], Final1 = [{TestDir,S,all} || S <- Suites], - final_tests(Tests, lists:reverse(Final1)++Final, Skip++Skip1, Bad); + final_tests1(Tests, lists:reverse(Final1)++Final, Skip++Skip1, Bad); -final_tests([{TestDir,all,all}|Tests], Final, Skip, Bad) -> +final_tests1([{TestDir,all,all}|Tests], Final, Skip, Bad) -> MissingSuites = case lists:keysearch({TestDir,all}, 1, Bad) of {value,{_,Failed}} -> @@ -1348,26 +1422,58 @@ final_tests([{TestDir,all,all}|Tests], Final, Skip, Bad) -> end, Missing = [{TestDir,S,"Make failed"} || S <- MissingSuites], Final1 = [{TestDir,all,all}|Final], - final_tests(Tests, Final1, Skip++Missing, Bad); + final_tests1(Tests, Final1, Skip++Missing, Bad); -final_tests([{TestDir,Suite,Cases}|Tests], - Final, Skip, Bad) when Cases==[]; Cases==all -> - final_tests([{TestDir,[Suite],all}|Tests], Final, Skip, Bad); +final_tests1([{TestDir,Suite,Cases}|Tests], Final, Skip, Bad) when + Cases==[]; Cases==all -> + final_tests1([{TestDir,[Suite],all}|Tests], Final, Skip, Bad); -final_tests([{TestDir,Suite,Cases}|Tests], Final, Skip, Bad) -> +final_tests1([{TestDir,Suite,GrsOrCs}|Tests], Final, Skip, Bad) when + is_list(GrsOrCs) -> case lists:keymember({TestDir,Suite}, 1, Bad) of - false -> - Do = {TestDir,Suite,Cases}, - final_tests(Tests, [Do|Final], Skip, Bad); true -> - Do = {TestDir,Suite,Cases}, - Skip1 = Skip ++ [{TestDir,Suite,Cases,"Make failed"}], - final_tests(Tests, [Do|Final], Skip1, Bad) + Skip1 = Skip ++ [{TestDir,Suite,all,"Make failed"}], + final_tests1(Tests, [{TestDir,Suite,all}|Final], Skip1, Bad); + false -> + GrsOrCs1 = + lists:flatmap( + %% for now, only flat group defs are allowed as + %% start options and test spec terms + fun({all,all}) -> + ct_framework:make_all_conf(TestDir, + Suite, []); + ({skipped,Group,TCs}) -> + [ct_framework:make_conf(TestDir, Suite, + Group, [skipped], TCs)]; + ({Group,TCs}) -> + [ct_framework:make_conf(TestDir, Suite, + Group, [], TCs)]; + (TC) -> + [TC] + end, GrsOrCs), + Do = {TestDir,Suite,GrsOrCs1}, + final_tests1(Tests, [Do|Final], Skip, Bad) end; -final_tests([], Final, Skip, _Bad) -> +final_tests1([], Final, Skip, _Bad) -> {lists:reverse(Final),Skip}. +final_skip([{TestDir,Suite,{all,all},Reason}|Skips], Final) -> + SkipConf = ct_framework:make_conf(TestDir, Suite, all, [], all), + Skip = {TestDir,Suite,SkipConf,Reason}, + final_skip(Skips, [Skip|Final]); + +final_skip([{TestDir,Suite,{Group,TCs},Reason}|Skips], Final) -> + Conf = ct_framework:make_conf(TestDir, Suite, Group, [], TCs), + Skip = {TestDir,Suite,Conf,Reason}, + final_skip(Skips, [Skip|Final]); + +final_skip([Skip|Skips], Final) -> + final_skip(Skips, [Skip|Final]); + +final_skip([], Final) -> + lists:reverse(Final). + continue([]) -> true; continue(_MakeErrors) -> @@ -1489,6 +1595,7 @@ do_run_test(Tests, Skip, Opts) -> _ -> false end, + %% let test_server expand the test tuples and count no of cases {Suites,NoOfCases} = count_test_cases(Tests, Skip), Suites1 = delete_dups(Suites), @@ -1544,19 +1651,30 @@ count_test_cases(Tests, Skip) -> TSPid = test_server_ctrl:start_get_totals(SendResult), Ref = erlang:monitor(process, TSPid), add_jobs(Tests, Skip, #opts{}, []), - {Suites,NoOfCases} = count_test_cases1(length(Tests), 0, [], Ref), + Counted = (catch count_test_cases1(length(Tests), 0, [], Ref)), erlang:demonitor(Ref, [flush]), - test_server_ctrl:stop_get_totals(), - {Suites,NoOfCases}. + case Counted of + {error,{test_server_died}} = Error -> + throw(Error); + {error,Reason} -> + unlink(whereis(test_server_ctrl)), + test_server_ctrl:stop(), + throw({user_error,Reason}); + Result -> + test_server_ctrl:stop_get_totals(), + Result + end. count_test_cases1(0, N, Suites, _) -> {lists:flatten(Suites), N}; count_test_cases1(Jobs, N, Suites, Ref) -> receive + {_,{error,_Reason} = Error} -> + throw(Error); {no_of_cases,{Ss,N1}} -> count_test_cases1(Jobs-1, add_known(N,N1), [Ss|Suites], Ref); - {'DOWN', Ref, _, _, _} -> - {[],0} + {'DOWN', Ref, _, _, Info} -> + throw({error,{test_server_died,Info}}) end. add_known(unknown, _) -> @@ -1604,13 +1722,36 @@ add_jobs([{TestDir,Suite,all}|Tests], Skip, Opts, CleanUp) -> Error end; -%% group -add_jobs([{TestDir,Suite,[{GroupName,_Cases}]}|Tests], Skip, Opts, CleanUp) when - is_atom(GroupName) -> - add_jobs([{TestDir,Suite,GroupName}|Tests], Skip, Opts, CleanUp); -add_jobs([{TestDir,Suite,{GroupName,_Cases}}|Tests], Skip, Opts, CleanUp) when - is_atom(GroupName) -> - add_jobs([{TestDir,Suite,GroupName}|Tests], Skip, Opts, CleanUp); +%% group (= conf case in test_server) +add_jobs([{TestDir,Suite,Confs}|Tests], Skip, Opts, CleanUp) when + element(1, hd(Confs)) == conf -> + Group = fun(Conf) -> proplists:get_value(name, element(2, Conf)) end, + TestCases = fun(Conf) -> element(4, Conf) end, + TCTestName = fun(all) -> ""; + ([C]) when is_atom(C) -> "." ++ atom_to_list(C); + (Cs) when is_list(Cs) -> ".cases" + end, + GrTestName = + case Confs of + [Conf] -> + "." ++ atom_to_list(Group(Conf)) ++ TCTestName(TestCases(Conf)); + _ -> + ".groups" + end, + TestName = get_name(TestDir) ++ "." ++ atom_to_list(Suite) ++ GrTestName, + case maybe_interpret(Suite, init_per_group, Opts) of + ok -> + case catch test_server_ctrl:add_conf_with_skip(TestName, Suite, Confs, + skiplist(TestDir,Skip)) of + {'EXIT',_} -> + CleanUp; + _ -> + wait_for_idle(), + add_jobs(Tests, Skip, Opts, [Suite|CleanUp]) + end; + Error -> + Error + end; %% test case add_jobs([{TestDir,Suite,[Case]}|Tests], Skip, Opts, CleanUp) when is_atom(Case) -> diff --git a/lib/common_test/src/ct_testspec.erl b/lib/common_test/src/ct_testspec.erl index 0f68b062f6..f5069427a2 100644 --- a/lib/common_test/src/ct_testspec.erl +++ b/lib/common_test/src/ct_testspec.erl @@ -185,7 +185,15 @@ prepare_cases(Node,Dir,Suite,Cases) -> {[{{Node,Dir},{Suite,all}}],SkipAll}; Skipped -> %% note: this adds a test even if only skip is specified - PrepC = lists:foldr(fun({C,{skip,_Cmt}},Acc) -> + PrepC = lists:foldr(fun({{G,Cs},{skip,_Cmt}}, Acc) when + is_atom(G) -> + case lists:keymember(G, 1, Cases) of + true -> + Acc; + false -> + [{skipped,G,Cs}|Acc] + end; + ({C,{skip,_Cmt}},Acc) -> case lists:member(C,Cases) of true -> Acc; @@ -194,7 +202,7 @@ prepare_cases(Node,Dir,Suite,Cases) -> end; (C,Acc) -> [C|Acc] end, [], Cases), - {{{Node,Dir},{Suite,PrepC}},Skipped} + {{{Node,Dir},{Suite,PrepC}},Skipped} end. get_skipped_suites(Node,Dir,Suites) -> @@ -210,7 +218,7 @@ get_skipped_cases(Node,Dir,Suite,Cases) -> case lists:keysearch(all,1,Cases) of {value,{all,{skip,Cmt}}} -> [{{Node,Dir},{Suite,Cmt}}]; - false -> + _ -> get_skipped_cases1(Node,Dir,Suite,Cases) end. @@ -432,6 +440,15 @@ save_nodes(Nodes,Spec=#testspec{nodes=NodeRefs}) -> list_nodes(#testspec{nodes=NodeRefs}) -> lists:map(fun({_Ref,Node}) -> Node end, NodeRefs). + + +%% --------------------------------------------------------- +%% / \ +%% | When adding tests, remember to update valid_terms/0 also! | +%% \ / +%% --------------------------------------------------------- + + %% Associate a "global" logdir with all nodes %% except those with specific logdir, e.g: %% ["/tmp/logdir",{ct1@finwe,"/tmp/logdir2"}] @@ -457,6 +474,24 @@ add_tests([{logdir,Node,Dir}|Ts],Spec) -> add_tests([{logdir,Dir}|Ts],Spec) -> add_tests([{logdir,all_nodes,Dir}|Ts],Spec); +%% --- label --- +add_tests([{label,all_nodes,Lbl}|Ts],Spec) -> + Labels = Spec#testspec.label, + Tests = [{label,N,Lbl} || N <- list_nodes(Spec), + lists:keymember(ref2node(N,Spec#testspec.nodes), + 1,Labels) == false], + add_tests(Tests++Ts,Spec); +add_tests([{label,Nodes,Lbl}|Ts],Spec) when is_list(Nodes) -> + Ts1 = separate(Nodes,label,[Lbl],Ts,Spec#testspec.nodes), + add_tests(Ts1,Spec); +add_tests([{label,Node,Lbl}|Ts],Spec) -> + Labels = Spec#testspec.label, + Labels1 = [{ref2node(Node,Spec#testspec.nodes),Lbl} | + lists:keydelete(ref2node(Node,Spec#testspec.nodes),1,Labels)], + add_tests(Ts,Spec#testspec{label=Labels1}); +add_tests([{label,Lbl}|Ts],Spec) -> + add_tests([{label,all_nodes,Lbl}|Ts],Spec); + %% --- cover --- add_tests([{cover,all_nodes,File}|Ts],Spec) -> Tests = lists:map(fun(N) -> {cover,N,File} end, list_nodes(Spec)), @@ -878,8 +913,13 @@ skip_suites(_Node,_Dir,[],_Cmt,Tests) -> skip_suites(Node,Dir,S,Cmt,Tests) -> skip_suites(Node,Dir,[S],Cmt,Tests). -skip_groups(Node,Dir,Suite,Group,Case,Cmt,Tests) when is_atom(Group) -> - skip_groups(Node,Dir,Suite,[Group],[Case],Cmt,Tests); +skip_groups(Node,Dir,Suite,Group,all,Cmt,Tests) when is_atom(Group) -> + skip_groups(Node,Dir,Suite,[Group],all,Cmt,Tests); +skip_groups(Node,Dir,Suite,Group,Cases,Cmt,Tests) when is_atom(Group) -> + skip_groups(Node,Dir,Suite,[Group],Cases,Cmt,Tests); +skip_groups(Node,Dir,Suite,Groups,Case,Cmt,Tests) when is_atom(Case), + Case =/= all -> + skip_groups(Node,Dir,Suite,Groups,[Case],Cmt,Tests); skip_groups(Node,Dir,Suite,Groups,Cases,Cmt,Tests) when ((Cases == all) or is_list(Cases)) and is_list(Groups) -> Suites = @@ -1001,22 +1041,34 @@ valid_terms() -> {cover,3}, {config,2}, {config,3}, - {userconfig, 2}, - {userconfig, 3}, + {userconfig,2}, + {userconfig,3}, {alias,3}, {logdir,2}, {logdir,3}, + {label,2}, + {label,3}, {event_handler,2}, {event_handler,3}, {event_handler,4}, + {multiply_timetraps,2}, + {multiply_timetraps,3}, + {scale_timetraps,2}, + {scale_timetraps,3}, {include,2}, {include,3}, {suites,3}, {suites,4}, + {groups,4}, + {groups,5}, + {groups,6}, {cases,4}, {cases,5}, {skip_suites,4}, {skip_suites,5}, + {skip_groups,5}, + {skip_groups,6}, + {skip_groups,7}, {skip_cases,5}, {skip_cases,6} ]. diff --git a/lib/common_test/src/ct_util.erl b/lib/common_test/src/ct_util.erl index eddaf4c8b9..0a434666fa 100644 --- a/lib/common_test/src/ct_util.erl +++ b/lib/common_test/src/ct_util.erl @@ -619,7 +619,6 @@ get_testdir(Dir, Suite) when is_list(Suite) -> get_testdir(Dir, _) -> get_testdir(Dir, all). - %%%----------------------------------------------------------------- %%% @spec %%% diff --git a/lib/common_test/src/ct_util.hrl b/lib/common_test/src/ct_util.hrl index 54eed29415..ee973f6220 100644 --- a/lib/common_test/src/ct_util.hrl +++ b/lib/common_test/src/ct_util.hrl @@ -30,6 +30,7 @@ -record(testspec, {spec_dir, nodes=[], init=[], + label=[], logdir=["."], cover=[], config=[], diff --git a/lib/common_test/test/Makefile b/lib/common_test/test/Makefile index 97ded5eb9a..3fb0d627a0 100644 --- a/lib/common_test/test/Makefile +++ b/lib/common_test/test/Makefile @@ -32,6 +32,7 @@ MODULES= \ ct_event_handler_SUITE \ ct_groups_test_1_SUITE \ ct_groups_test_2_SUITE \ + ct_testspec_1_SUITE \ ct_skip_SUITE \ ct_error_SUITE \ ct_test_server_if_1_SUITE \ diff --git a/lib/common_test/test/ct_groups_test_1_SUITE_data/groups_1/test/groups_11_SUITE.erl b/lib/common_test/test/ct_groups_test_1_SUITE_data/groups_1/test/groups_11_SUITE.erl index c6d50443d0..c69400e938 100644 --- a/lib/common_test/test/ct_groups_test_1_SUITE_data/groups_1/test/groups_11_SUITE.erl +++ b/lib/common_test/test/ct_groups_test_1_SUITE_data/groups_1/test/groups_11_SUITE.erl @@ -99,6 +99,7 @@ init_per_group(Group, Config) -> {Grs,_} = grs_and_tcs(), case lists:member(Group, Grs) of true -> + ct:comment(Group), init = ?config(suite,Config), [{Group,Group} | Config]; false -> @@ -109,6 +110,7 @@ end_per_group(Group, Config) -> {Grs,_} = grs_and_tcs(), case lists:member(Group, Grs) of true -> + ct:comment(Group), init = ?config(suite,Config), Group = ?config(Group,Config), ok; diff --git a/lib/common_test/test/ct_groups_test_2_SUITE.erl b/lib/common_test/test/ct_groups_test_2_SUITE.erl index 56e0ac30c7..c4371501b3 100644 --- a/lib/common_test/test/ct_groups_test_2_SUITE.erl +++ b/lib/common_test/test/ct_groups_test_2_SUITE.erl @@ -60,7 +60,7 @@ all(doc) -> ["Run smoke tests of Common Test."]; all(suite) -> - [missing_conf, testspec_1, repeat_1]. + [missing_conf, repeat_1]. %%-------------------------------------------------------------------- %% TEST CASES @@ -88,25 +88,6 @@ missing_conf(Config) when is_list(Config) -> %%%----------------------------------------------------------------- %%% -testspec_1(Config) when is_list(Config) -> - DataDir = ?config(data_dir, Config), - - TestSpec = filename:join(DataDir, "specs/groups_2.1.spec"), - - {Opts,ERPid} = setup({spec,TestSpec}, Config), - ok = ct_test_support:run(Opts, Config), - Events = ct_test_support:get_events(ERPid, Config), - - ct_test_support:log_events(testspec_1, - reformat(Events, ?eh), - ?config(priv_dir, Config)), - - TestEvents = events_to_check(testspec_1), - ok = ct_test_support:verify_events(TestEvents, Events, Config). - -%%%----------------------------------------------------------------- -%%% - repeat_1(Config) when is_list(Config) -> DataDir = ?config(data_dir, Config), @@ -173,9 +154,6 @@ test_events(missing_conf) -> {?eh,stop_logging,[]} ]; -test_events(testspec_1) -> - []; - test_events(repeat_1) -> [ {?eh,start_logging,{'DEF','RUNDIR'}}, diff --git a/lib/common_test/test/ct_groups_test_2_SUITE_data/specs/groups_2.1.spec b/lib/common_test/test/ct_groups_test_2_SUITE_data/specs/groups_2.1.spec deleted file mode 100644 index 24d778ac44..0000000000 --- a/lib/common_test/test/ct_groups_test_2_SUITE_data/specs/groups_2.1.spec +++ /dev/null @@ -1,26 +0,0 @@ - -{config, "../cfgs/groups_2.1.cfg"}. -{alias, groups_2, "../groups_2"}. - -{suites, groups_2, groups_21_SUITE}. -%{skip_groups, groups_2, groups_21_SUITE, -% [test_group_1b, test_group_7], "Skip tg_1b & tg_7"}. -{skip_cases, groups_2, groups_21_SUITE, - [testcase_1b, testcase_3a], "Skip tc_1b & tc_3a"}. - -{groups, groups_2, groups_22_SUITE, - test_group_1a}. -{skip_cases, groups_2, groups_22_SUITE, - testcase_1a, "Skip tc_1a"}. - -{groups, groups_2, groups_22_SUITE, - test_group_1b}. -{skip_cases, groups_2, groups_22_SUITE, - testcase_1b, "Skip tc_1b"}. -%{skip_groups, groups_2, groups_21_SUITE, -% [test_group_3], "Skip tg_3"}. - -{groups, groups_2, groups_22_SUITE, - test_group_5}. -{skip_cases, groups_2, groups_22_SUITE, - [testcase_7a, testcase_7b], "Skip tc_7a & tc_7b"}. diff --git a/lib/common_test/test/ct_test_support.erl b/lib/common_test/test/ct_test_support.erl index 6a75c8f789..7bfb9ffb49 100644 --- a/lib/common_test/test/ct_test_support.erl +++ b/lib/common_test/test/ct_test_support.erl @@ -23,7 +23,7 @@ %%% -module(ct_test_support). --include("test_server.hrl"). +-include_lib("test_server/include/test_server.hrl"). -include_lib("common_test/include/ct_event.hrl"). -export([init_per_suite/1, init_per_suite/2, end_per_suite/1, @@ -111,8 +111,9 @@ init_per_testcase(_TestCase, Config) -> case lists:keysearch(master, 1, Config) of false-> test_server:format("See Common Test logs here:\n\n" - "<a href=\"file://~s/all_runs.html\">~s/all_runs.html</a>", - [LogDir,LogDir]); + "<a href=\"file://~s/all_runs.html\">~s/all_runs.html</a>\n" + "<a href=\"file://~s/index.html\">~s/index.html</a>", + [LogDir,LogDir,LogDir,LogDir]); {value, _}-> test_server:format("See CT Master Test logs here:\n\n" "<a href=\"file://~s/master_runs.html\">~s/master_runs.html</a>", diff --git a/lib/common_test/test/ct_testspec_1_SUITE.erl b/lib/common_test/test/ct_testspec_1_SUITE.erl new file mode 100644 index 0000000000..dc399bfb4c --- /dev/null +++ b/lib/common_test/test/ct_testspec_1_SUITE.erl @@ -0,0 +1,433 @@ +%% +%% %CopyrightBegin% +%% +%% Copyright Ericsson AB 2009-2010. All Rights Reserved. +%% +%% The contents of this file are subject to the Erlang Public License, +%% Version 1.1, (the "License"); you may not use this file except in +%% compliance with the License. You should have received a copy of the +%% Erlang Public License along with this software. If not, it can be +%% retrieved online at http://www.erlang.org/. +%% +%% Software distributed under the License is distributed on an "AS IS" +%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See +%% the License for the specific language governing rights and limitations +%% under the License. +%% +%% %CopyrightEnd% +%% + +%%%------------------------------------------------------------------- +%%% File: ct_testspec_1_SUITE +%%% +%%% Description: +%%% Test test specifications +%%% +%%% The suites used for the test are located in the data directory. +%%%------------------------------------------------------------------- +-module(ct_testspec_1_SUITE). + +-compile(export_all). + +-include_lib("test_server/include/test_server.hrl"). +-include_lib("common_test/include/ct_event.hrl"). + +-define(eh, ct_test_support_eh). + +%%-------------------------------------------------------------------- +%% TEST SERVER CALLBACK FUNCTIONS +%%-------------------------------------------------------------------- + +%%-------------------------------------------------------------------- +%% Description: Since Common Test starts another Test Server +%% instance, the tests need to be performed on a separate node (or +%% there will be clashes with logging processes etc). +%%-------------------------------------------------------------------- +init_per_suite(Config) -> + Config1 = ct_test_support:init_per_suite(Config), + Config1. + +end_per_suite(Config) -> + ct_test_support:end_per_suite(Config). + +init_per_testcase(TestCase, Config) -> + ct_test_support:init_per_testcase(TestCase, Config). + +end_per_testcase(TestCase, Config) -> + ct_test_support:end_per_testcase(TestCase, Config). + +all(doc) -> + ["Run smoke tests of Common Test."]; + +all(suite) -> + [all_suites, skip_all_suites, + suite, skip_suite, + all_testcases, skip_all_testcases, + testcase, skip_testcase, + all_groups, skip_all_groups, + group, skip_group, + group_all_testcases, skip_group_all_testcases, + group_testcase, skip_group_testcase, + topgroup, + subgroup, skip_subgroup, + subgroup_all_testcases, skip_subgroup_all_testcases, + subgroup_testcase, skip_subgroup_testcase, + sub_skipped_by_top, + testcase_in_multiple_groups]. + +%%-------------------------------------------------------------------- +%% TEST CASES +%%-------------------------------------------------------------------- + +%%%----------------------------------------------------------------- +%%% + +all_suites(Config) when is_list(Config) -> + DataDir = ?config(data_dir, Config), + + TestDir = filename:join(DataDir, "suites_1"), + TestSpec = [{label,"all_suites"}, + {suites,TestDir,all}], + + setup_and_execute(all_suites, TestSpec, Config). + +skip_all_suites(Config) when is_list(Config) -> + DataDir = ?config(data_dir, Config), + + TestDir = filename:join(DataDir, "suites_1"), + TestSpec = [{label,skip_all_suites}, + {suites,TestDir,all}, + {skip_suites,TestDir,all,"SKIPPED!"}], + + setup_and_execute(skip_all_suites, TestSpec, Config). + +%%%----------------------------------------------------------------- +%%% + +suite(Config) when is_list(Config) -> + DataDir = ?config(data_dir, Config), + + TestDir = filename:join(DataDir, "suites_1"), + TestSpec = [{label,undefined}, + {suites,TestDir,simple_1_SUITE}], + + setup_and_execute(suite, TestSpec, Config). + +skip_suite(Config) when is_list(Config) -> + DataDir = ?config(data_dir, Config), + + TestDir = filename:join(DataDir, "suites_1"), + TestSpec = [{suites,TestDir,[simple_1_SUITE,simple_2_SUITE]}, + {skip_suites,TestDir,simple_1_SUITE,"SKIPPED!"}], + + setup_and_execute(skip_suite, TestSpec, Config). + +%%%----------------------------------------------------------------- +%%% + +all_testcases(Config) when is_list(Config) -> + DataDir = ?config(data_dir, Config), + + TestDir = filename:join(DataDir, "suites_1"), + TestSpec = [{cases,TestDir,simple_1_SUITE,all}], + + setup_and_execute(all_testcases, TestSpec, Config). + +skip_all_testcases(Config) when is_list(Config) -> + DataDir = ?config(data_dir, Config), + + TestDir = filename:join(DataDir, "suites_1"), + TestSpec = [{suites,TestDir,[simple_1_SUITE]}, + {skip_cases,TestDir,simple_1_SUITE,all,"SKIPPED!"}], + + setup_and_execute(skip_all_testcases, TestSpec, Config). + +%%%----------------------------------------------------------------- +%%% + +testcase(Config) when is_list(Config) -> + DataDir = ?config(data_dir, Config), + + TestDir = filename:join(DataDir, "suites_1"), + TestSpec = [{cases,TestDir,simple_1_SUITE,tc1}], + + setup_and_execute(testcase, TestSpec, Config). + +skip_testcase(Config) when is_list(Config) -> + DataDir = ?config(data_dir, Config), + + TestDir = filename:join(DataDir, "suites_1"), + TestSpec = [{cases,TestDir,simple_1_SUITE,[tc1,tc2]}, + {cases,TestDir,simple_2_SUITE,[tc2,tc1]}, + {skip_cases,TestDir,simple_1_SUITE,[tc1],"SKIPPED!"}, + {skip_cases,TestDir,simple_2_SUITE,tc2,"SKIPPED!"}], + + setup_and_execute(skip_testcase, TestSpec, Config). + +%%%----------------------------------------------------------------- +%%% + +all_groups(Config) when is_list(Config) -> + DataDir = ?config(data_dir, Config), + + TestDir = filename:join(DataDir, "groups_1"), + TestSpec = [{groups,TestDir,groups_11_SUITE,all}], + + setup_and_execute(all_groups, TestSpec, Config). + +skip_all_groups(Config) when is_list(Config) -> + DataDir = ?config(data_dir, Config), + + TestDir = filename:join(DataDir, "groups_1"), + TestSpec = [{groups,TestDir,groups_11_SUITE,all}, + {skip_groups,TestDir,groups_11_SUITE,all,"SKIPPED!"}], + + setup_and_execute(skip_all_groups, TestSpec, Config). + +%%%----------------------------------------------------------------- +%%% + +group(Config) when is_list(Config) -> + DataDir = ?config(data_dir, Config), + + TestDir = filename:join(DataDir, "groups_1"), + TestSpec = [{groups,TestDir,groups_11_SUITE,test_group_1a}], + + setup_and_execute(group, TestSpec, Config). + +skip_group(Config) when is_list(Config) -> + DataDir = ?config(data_dir, Config), + + TestDir = filename:join(DataDir, "groups_1"), + TestSpec = [{groups,TestDir,groups_11_SUITE,[test_group_1a, + test_group_1b]}, + {skip_groups,TestDir,groups_11_SUITE, + [test_group_1b,test_group_2,test_group_7],"SKIPPED!"}], + + setup_and_execute(skip_group, TestSpec, Config). + + +%%%----------------------------------------------------------------- +%%% + +group_all_testcases(Config) when is_list(Config) -> + DataDir = ?config(data_dir, Config), + + TestDir = filename:join(DataDir, "groups_1"), + TestSpec = [{groups,TestDir,groups_11_SUITE,test_group_1a,{cases,all}}], + + setup_and_execute(group_all_testcases, TestSpec, Config). + +skip_group_all_testcases(Config) when is_list(Config) -> + DataDir = ?config(data_dir, Config), + + TestDir = filename:join(DataDir, "groups_1"), + TestSpec = [{groups,TestDir,groups_11_SUITE,[test_group_1a, + test_group_1b]}, + {skip_groups,TestDir,groups_11_SUITE, + test_group_1b,{cases,all},"SKIPPED!"}, + {skip_groups,TestDir,groups_11_SUITE, + test_group_1a,{cases,all},"SKIPPED!"}], + + setup_and_execute(skip_group_all_testcases, TestSpec, Config). + +%%%----------------------------------------------------------------- +%%% + +group_testcase(Config) when is_list(Config) -> + DataDir = ?config(data_dir, Config), + + TestDir = filename:join(DataDir, "groups_1"), + TestSpec = [{groups,TestDir,groups_11_SUITE,test_group_1a,{cases,testcase_1a}}], + + setup_and_execute(group_testcase, TestSpec, Config). + +skip_group_testcase(Config) when is_list(Config) -> + DataDir = ?config(data_dir, Config), + + TestDir = filename:join(DataDir, "groups_1"), + TestSpec = [{groups,TestDir,groups_11_SUITE,test_group_1a, + {cases,[testcase_1a,testcase_1b]}}, + {groups,TestDir,groups_11_SUITE,test_group_1b, + {cases,[testcase_1b,testcase_1a]}}, + {skip_groups,TestDir,groups_11_SUITE, + test_group_1a,{cases,testcase_1b},"SKIPPED!"}, + {skip_groups,TestDir,groups_11_SUITE, + test_group_1b,{cases,[testcase_1a]},"SKIPPED!"}], + + setup_and_execute(skip_group_testcase, TestSpec, Config). + +%%%----------------------------------------------------------------- +%%% + +topgroup(Config) when is_list(Config) -> + DataDir = ?config(data_dir, Config), + + TestDir = filename:join(DataDir, "groups_1"), + TestSpec = [{groups,TestDir,groups_12_SUITE,test_group_2}, + {groups,TestDir,groups_12_SUITE,test_group_4}], + + setup_and_execute(topgroup, TestSpec, Config). + +%%%----------------------------------------------------------------- +%%% + +subgroup(Config) when is_list(Config) -> + DataDir = ?config(data_dir, Config), + + TestDir = filename:join(DataDir, "groups_1"), + TestSpec = [{groups,TestDir,groups_12_SUITE,test_group_3}], + + setup_and_execute(subgroup, TestSpec, Config). + +skip_subgroup(Config) when is_list(Config) -> + DataDir = ?config(data_dir, Config), + + TestDir = filename:join(DataDir, "groups_1"), + TestSpec = [{groups,TestDir,groups_12_SUITE,[test_group_4]}, + {skip_groups,TestDir,groups_12_SUITE, + test_group_8,"SKIPPED!"}], + + setup_and_execute(skip_subgroup, TestSpec, Config). + +%%%----------------------------------------------------------------- +%%% + +subgroup_all_testcases(Config) when is_list(Config) -> + DataDir = ?config(data_dir, Config), + + TestDir = filename:join(DataDir, "groups_1"), + TestSpec = [{groups,TestDir,groups_12_SUITE, + test_group_5,{cases,all}}, + {groups,TestDir,groups_12_SUITE, + test_group_3,{cases,all}}], + + setup_and_execute(subgroup_all_testcases, TestSpec, Config). + +skip_subgroup_all_testcases(Config) when is_list(Config) -> + DataDir = ?config(data_dir, Config), + + TestDir = filename:join(DataDir, "groups_1"), + TestSpec = [{groups,TestDir,groups_12_SUITE,test_group_4}, + {skip_groups,TestDir,groups_12_SUITE, + test_group_5,{cases,all},"SKIPPED!"}], + + setup_and_execute(skip_subgroup_all_testcases, TestSpec, Config). + +%%%----------------------------------------------------------------- +%%% + +subgroup_testcase(Config) when is_list(Config) -> + DataDir = ?config(data_dir, Config), + + TestDir = filename:join(DataDir, "groups_1"), + TestSpec = [{groups,TestDir,groups_12_SUITE, + test_group_7,{cases,testcase_7a}}, + {groups,TestDir,groups_12_SUITE, + test_group_3,{cases,testcase_3b}}], + + setup_and_execute(subgroup_testcase, TestSpec, Config). + +skip_subgroup_testcase(Config) when is_list(Config) -> + DataDir = ?config(data_dir, Config), + + TestDir = filename:join(DataDir, "groups_1"), + TestSpec = [{groups,TestDir,groups_12_SUITE,test_group_5}, + {skip_groups,TestDir,groups_12_SUITE, + test_group_7,{cases,[testcase_7a,testcase_7b]},"SKIPPED!"}], + + setup_and_execute(skip_subgroup_testcase, TestSpec, Config). + +%%%----------------------------------------------------------------- +%%% + +%%! +%%! Somewhat weird result from this one: +%%! +sub_skipped_by_top(Config) when is_list(Config) -> + DataDir = ?config(data_dir, Config), + + TestDir = filename:join(DataDir, "groups_1"), + TestSpec = [{groups,TestDir,groups_12_SUITE,test_group_5}, + {skip_groups,TestDir,groups_12_SUITE,test_group_4,"SKIPPED!"}], + + setup_and_execute(sub_skipped_by_top, TestSpec, Config). + +%%%----------------------------------------------------------------- +%%% + +testcase_in_multiple_groups(Config) when is_list(Config) -> + DataDir = ?config(data_dir, Config), + + TestDir = filename:join(DataDir, "groups_1"), + TestSpec = [{cases,TestDir,groups_12_SUITE,[testcase_1a,testcase_1b]}, + {skip_cases,TestDir,groups_12_SUITE,[testcase_1b],"SKIPPED!"}], + + setup_and_execute(testcase_in_multiple_groups, TestSpec, Config). + +%%%----------------------------------------------------------------- +%%% HELP FUNCTIONS +%%%----------------------------------------------------------------- + +setup_and_execute(TCName, TestSpec, Config) -> + SpecFile = create_spec_file(?config(priv_dir, Config), + TCName, TestSpec), + TestTerms = + case lists:keymember(label, 1, TestSpec) of + true -> [{spec,SpecFile}]; + false -> [{spec,SpecFile},{label,TCName}] + end, + {Opts,ERPid} = setup(TestTerms, Config), + ok = ct_test_support:run(Opts, Config), + TestSpec1 = [{logdir,proplists:get_value(logdir,Opts)}, + {label,proplists:get_value(label,TestTerms)} | TestSpec], + ok = ct_test_support:run(ct, run_testspec, [TestSpec1], Config), + Events = ct_test_support:get_events(ERPid, Config), + + ct_test_support:log_events(TCName, + reformat(Events, ?eh), + ?config(priv_dir, Config)), + + TestEvents = events_to_check(TCName), + ok = ct_test_support:verify_events(TestEvents, Events, Config). + +create_spec_file(SpecDir, TCName, TestSpec) -> + FileName = filename:join(SpecDir, + atom_to_list(TCName)++".spec"), + {ok,Dev} = file:open(FileName, [write]), + [io:format(Dev, "~p.~n", [Term]) || Term <- TestSpec], + file:close(Dev), + io:format("~nTest spec created here~n~n<a href=\"file://~s\">~s</a>~n", + [FileName,FileName]), + FileName. + +setup(Test, Config) when is_tuple(Test) -> + setup([Test], Config); +setup(Tests, Config) -> + Opts0 = ct_test_support:get_opts(Config), + Level = ?config(trace_level, Config), + EvHArgs = [{cbm,ct_test_support},{trace_level,Level}], + Opts = Opts0 ++ Tests ++ [{event_handler,{?eh,EvHArgs}}], + ERPid = ct_test_support:start_event_receiver(Config), + {Opts,ERPid}. + +reformat(Events, EH) -> + ct_test_support:reformat(Events, EH). +%reformat(Events, _EH) -> +% Events. + +%%%----------------------------------------------------------------- +%%% TEST EVENTS +%%%----------------------------------------------------------------- +events_to_check(Test) -> + %% 2 tests (ct:run_test + script_start) is default + events_to_check(Test, 2). + +events_to_check(_, 0) -> + []; +events_to_check(Test, N) -> + test_events(Test) ++ events_to_check(Test, N-1). + +test_events(_) -> + [ + ]. diff --git a/lib/common_test/test/ct_testspec_1_SUITE_data/groups_1/groups_11_SUITE.erl b/lib/common_test/test/ct_testspec_1_SUITE_data/groups_1/groups_11_SUITE.erl new file mode 100644 index 0000000000..4f11d8a0e8 --- /dev/null +++ b/lib/common_test/test/ct_testspec_1_SUITE_data/groups_1/groups_11_SUITE.erl @@ -0,0 +1,281 @@ +%% +%% %CopyrightBegin% +%% +%% Copyright Ericsson AB 2009-2010. All Rights Reserved. +%% +%% The contents of this file are subject to the Erlang Public License, +%% Version 1.1, (the "License"); you may not use this file except in +%% compliance with the License. You should have received a copy of the +%% Erlang Public License along with this software. If not, it can be +%% retrieved online at http://www.erlang.org/. +%% +%% Software distributed under the License is distributed on an "AS IS" +%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See +%% the License for the specific language governing rights and limitations +%% under the License. +%% +%% %CopyrightEnd% +%% +-module(groups_11_SUITE). + +-compile(export_all). + +-include_lib("common_test/include/ct.hrl"). + +%%==================================================================== +%% COMMON TEST CALLBACK FUNCTIONS +%%==================================================================== + +suite() -> + [{timetrap,{minutes,1}}]. + +groups() -> + [ + {test_group_1a, [testcase_1a,testcase_1b]}, + + {test_group_1b, [], [testcase_1a,testcase_1b]}, + + {test_group_2, [], [testcase_2a, + + {test_group_3, [], [testcase_3a, + testcase_3b]}, + testcase_2b]}, + + {test_group_4, [{test_group_5, [], [testcase_5a, + + {group, test_group_6}, + + testcase_5b]}]}, + {test_group_6, [{group, test_group_7}]}, + + {test_group_7, [testcase_7a,testcase_7b]} + ]. + +all() -> + [testcase_1, + {group, test_group_1a}, + {group, test_group_1b}, + testcase_2, + {group, test_group_2}, + testcase_3, + {group, test_group_4}]. + +%% this func only for internal test purposes +grs_and_tcs() -> + {[ + test_group_1a, test_group_1b, + test_group_2, test_group_3, + test_group_4, test_group_5, + test_group_6, test_group_7 + ], + [ + testcase_1, + testcase_1a, testcase_1b, + testcase_2, + testcase_2a, testcase_2b, + testcase_3a, testcase_3b, + testcase_3, + testcase_5a, testcase_5b, + testcase_7a, testcase_7b + ]}. + +%%-------------------------------------------------------------------- +%% Suite Configuration +%%-------------------------------------------------------------------- + +init_per_suite(Config) -> + [{suite,init}|Config]. + +end_per_suite(Config) -> + init = ?config(suite,Config). + +%%-------------------------------------------------------------------- +%% Group Configuration +%%-------------------------------------------------------------------- + +init_per_group(Group, Config) -> + [{name,Group}] = ?config(tc_group_properties,Config), + {Grs,_} = grs_and_tcs(), + case lists:member(Group, Grs) of + true -> + ct:comment(Group), + init = ?config(suite,Config), + [{Group,Group} | Config]; + false -> + ct:fail({bad_group,Group}) + end. + +end_per_group(Group, Config) -> + {Grs,_} = grs_and_tcs(), + case lists:member(Group, Grs) of + true -> + ct:comment(Group), + init = ?config(suite,Config), + Group = ?config(Group,Config), + ok; + false -> + ct:fail({bad_group,Group}) + end. + +%%-------------------------------------------------------------------- +%% Testcase Configuration +%%-------------------------------------------------------------------- + +init_per_testcase(TestCase, Config) -> + {_,TCs} = grs_and_tcs(), + case lists:member(TestCase, TCs) of + true -> + init = ?config(suite,Config), + [{TestCase,TestCase} | Config]; + false -> + ct:fail({unknown_testcase,TestCase}) + end. + +end_per_testcase(TestCase, Config) -> + {_,TCs} = grs_and_tcs(), + case lists:member(TestCase, TCs) of + true -> + init = ?config(suite,Config), + TestCase = ?config(TestCase,Config), + ok; + false -> + ct:fail({unknown_testcase,TestCase}) + end. + + +%%-------------------------------------------------------------------- +%% Testcases +%%-------------------------------------------------------------------- + +testcase_1() -> + []. +testcase_1(Config) -> + init = ?config(suite,Config), + testcase_1 = ?config(testcase_1,Config), + ok. + +testcase_1a() -> + []. +testcase_1a(Config) -> + init = ?config(suite,Config), + case ?config(test_group_1a,Config) of + test_group_1a -> ok; + _ -> + case ?config(test_group_1b,Config) of + test_group_1b -> ok; + _ -> ct:fail(no_group_data) + end + end, + testcase_1a = ?config(testcase_1a,Config), + ok. +testcase_1b() -> + []. +testcase_1b(Config) -> + init = ?config(suite,Config), + case ?config(test_group_1a,Config) of + test_group_1a -> ok; + _ -> + case ?config(test_group_1b,Config) of + test_group_1b -> ok; + _ -> ct:fail(no_group_data) + end + end, + undefined = ?config(testcase_1a,Config), + testcase_1b = ?config(testcase_1b,Config), + ok. + +testcase_2() -> + []. +testcase_2(Config) -> + init = ?config(suite,Config), + undefined = ?config(test_group_1a,Config), + undefined = ?config(test_group_1b,Config), + testcase_2 = ?config(testcase_2,Config), + ok. + +testcase_2a() -> + []. +testcase_2a(Config) -> + init = ?config(suite,Config), + test_group_2 = ?config(test_group_2,Config), + testcase_2a = ?config(testcase_2a,Config), + ok. +testcase_2b() -> + []. +testcase_2b(Config) -> + init = ?config(suite,Config), + test_group_2 = ?config(test_group_2,Config), + undefined = ?config(testcase_2a,Config), + testcase_2b = ?config(testcase_2b,Config), + ok. + +testcase_3a() -> + []. +testcase_3a(Config) -> + init = ?config(suite,Config), + test_group_2 = ?config(test_group_2,Config), + test_group_3 = ?config(test_group_3,Config), + undefined = ?config(testcase_2b,Config), + testcase_3a = ?config(testcase_3a,Config), + ok. +testcase_3b() -> + []. +testcase_3b(Config) -> + init = ?config(suite,Config), + test_group_2 = ?config(test_group_2,Config), + test_group_3 = ?config(test_group_3,Config), + undefined = ?config(testcase_3a,Config), + testcase_3b = ?config(testcase_3b,Config), + ok. + +testcase_3() -> + []. +testcase_3(Config) -> + init = ?config(suite,Config), + undefined = ?config(test_group_2,Config), + undefined = ?config(test_group_3,Config), + testcase_3 = ?config(testcase_3,Config), + ok. + +testcase_5a() -> + []. +testcase_5a(Config) -> + init = ?config(suite,Config), + undefined = ?config(test_group_3,Config), + test_group_4 = ?config(test_group_4,Config), + test_group_5 = ?config(test_group_5,Config), + undefined = ?config(testcase_3,Config), + testcase_5a = ?config(testcase_5a,Config), + ok. +testcase_5b() -> + []. +testcase_5b(Config) -> + init = ?config(suite,Config), + test_group_4 = ?config(test_group_4,Config), + test_group_5 = ?config(test_group_5,Config), + undefined = ?config(testcase_5a,Config), + testcase_5b = ?config(testcase_5b,Config), + ok. + +testcase_7a() -> + []. +testcase_7a(Config) -> + init = ?config(suite,Config), + undefined = ?config(test_group_3,Config), + test_group_4 = ?config(test_group_4,Config), + test_group_5 = ?config(test_group_5,Config), + test_group_6 = ?config(test_group_6,Config), + test_group_7 = ?config(test_group_7,Config), + testcase_7a = ?config(testcase_7a,Config), + ok. +testcase_7b() -> + []. +testcase_7b(Config) -> + init = ?config(suite,Config), + test_group_4 = ?config(test_group_4,Config), + test_group_5 = ?config(test_group_5,Config), + test_group_6 = ?config(test_group_6,Config), + test_group_7 = ?config(test_group_7,Config), + undefined = ?config(testcase_7a,Config), + testcase_7b = ?config(testcase_7b,Config), + ok. diff --git a/lib/common_test/test/ct_testspec_1_SUITE_data/groups_1/groups_12_SUITE.erl b/lib/common_test/test/ct_testspec_1_SUITE_data/groups_1/groups_12_SUITE.erl new file mode 100644 index 0000000000..69c06f9b83 --- /dev/null +++ b/lib/common_test/test/ct_testspec_1_SUITE_data/groups_1/groups_12_SUITE.erl @@ -0,0 +1,344 @@ +%% +%% %CopyrightBegin% +%% +%% Copyright Ericsson AB 2009-2010. All Rights Reserved. +%% +%% The contents of this file are subject to the Erlang Public License, +%% Version 1.1, (the "License"); you may not use this file except in +%% compliance with the License. You should have received a copy of the +%% Erlang Public License along with this software. If not, it can be +%% retrieved online at http://www.erlang.org/. +%% +%% Software distributed under the License is distributed on an "AS IS" +%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See +%% the License for the specific language governing rights and limitations +%% under the License. +%% +%% %CopyrightEnd% +%% +-module(groups_12_SUITE). + +-compile(export_all). + +-include_lib("common_test/include/ct.hrl"). + +%%==================================================================== +%% COMMON TEST CALLBACK FUNCTIONS +%%==================================================================== + +suite() -> + [{timetrap,{minutes,1}}]. + +groups() -> + [ + {test_group_1a, [shuffle], [testcase_1a,testcase_1b,testcase_1c]}, + + {test_group_1b, [parallel], [testcase_1a,testcase_1b]}, + + {test_group_2, [parallel], [testcase_2a, + + {test_group_3, [{repeat,2}], + [testcase_3a, testcase_3b]}, + + testcase_2b]}, + + {test_group_4, [{test_group_5, [parallel], [testcase_5a, + + {group, test_group_6}, + + testcase_5b]}]}, + + {test_group_6, [parallel], [{group, test_group_7}, + {group, test_group_8}]}, + + {test_group_7, [sequence], [testcase_7a,testcase_7b]}, + + {test_group_8, [shuffle,sequence], [testcase_8a,testcase_8b]} + ]. + +all() -> + [{group, test_group_1a}, + {group, test_group_1b}, + testcase_1, + testcase_2, + {group, test_group_2}, + testcase_3, + {group, test_group_4}]. + +%% this func only for internal test purposes +grs_and_tcs() -> + {[ + test_group_1a, test_group_1b, + test_group_2, test_group_3, + test_group_4, test_group_5, + test_group_6, test_group_7, + test_group_8 + ], + [ + testcase_1a, testcase_1b, testcase_1c, + testcase_1, + testcase_2, + testcase_2a, testcase_2b, + testcase_3a, testcase_3b, + testcase_3, + testcase_5a, testcase_5b, + testcase_7a, testcase_7b, + testcase_8a, testcase_8b + ]}. + +%%-------------------------------------------------------------------- +%% Suite Configuration +%%-------------------------------------------------------------------- + +init_per_suite(Config) -> + [{suite,init}|Config]. + +end_per_suite(Config) -> + init = ?config(suite,Config). + +%%-------------------------------------------------------------------- +%% Group Configuration +%%-------------------------------------------------------------------- + +init_per_group(Group, Config) -> + Cmt = + case {Group,?config(tc_group_properties,Config)} of + {test_group_1a,[{shuffle,S},{name,test_group_1a}]} -> + io_lib:format("shuffled, ~w", [S]); + {test_group_1b,[{name,test_group_1b},parallel]} -> "parallel"; + {test_group_2,[{name,test_group_2},parallel]} -> "parallel"; + {test_group_3,[{name,test_group_3},{repeat,2}]} -> "repeat 2"; + {test_group_3,[{name,test_group_3}]} -> "repeat 1"; + {test_group_4,[{name,test_group_4}]} -> ok; + {test_group_5,[{name,test_group_5},parallel]} -> "parallel"; + {test_group_6,[{name,test_group_6},parallel]} -> "parallel"; + {test_group_7,[{name,test_group_7},sequence]} -> "sequence"; + {test_group_8,[{shuffle,_},{name,test_group_8},sequence]} -> + "shuffle & sequence" + end, + {Grs,_} = grs_and_tcs(), + case lists:member(Group, Grs) of + true -> + init = ?config(suite,Config), + ct:comment(io_lib:format("~w, ~s", [Group,Cmt])), + [{Group,Group} | Config]; + false -> + ct:fail({bad_group,Group}) + end. + +end_per_group(Group, Config) -> + {Grs,_} = grs_and_tcs(), + case lists:member(Group, Grs) of + true -> + init = ?config(suite,Config), + Group = ?config(Group,Config), + ok; + false -> + ct:fail({bad_group,Group}) + end. + +%%-------------------------------------------------------------------- +%% Testcase Configuration +%%-------------------------------------------------------------------- + +init_per_testcase(TestCase, Config) -> + {_,TCs} = grs_and_tcs(), + case lists:member(TestCase, TCs) of + true -> + init = ?config(suite,Config), + [{TestCase,TestCase} | Config]; + false -> + ct:fail({unknown_testcase,TestCase}) + end. + +end_per_testcase(TestCase, Config) -> + {_,TCs} = grs_and_tcs(), + case lists:member(TestCase, TCs) of + true -> + init = ?config(suite,Config), + TestCase = ?config(TestCase,Config), + ok; + false -> + ct:fail({unknown_testcase,TestCase}) + end. + + +%%-------------------------------------------------------------------- +%% Testcases +%%-------------------------------------------------------------------- + +testcase_1a() -> + []. +testcase_1a(Config) -> + init = ?config(suite,Config), + case ?config(test_group_1a,Config) of + test_group_1a -> ok; + _ -> + case ?config(test_group_1b,Config) of + test_group_1b -> ok; + _ -> ct:fail(no_group_data) + end + end, + testcase_1a = ?config(testcase_1a,Config), + ok. +testcase_1b() -> + []. +testcase_1b(Config) -> + init = ?config(suite,Config), + case ?config(test_group_1a,Config) of + test_group_1a -> ok; + _ -> + case ?config(test_group_1b,Config) of + test_group_1b -> ok; + _ -> ct:fail(no_group_data) + end + end, + undefined = ?config(testcase_1a,Config), + testcase_1b = ?config(testcase_1b,Config), + ok. + +testcase_1c() -> + []. +testcase_1c(Config) -> + init = ?config(suite,Config), + case ?config(test_group_1a,Config) of + test_group_1a -> ok; + _ -> + case ?config(test_group_1b,Config) of + test_group_1b -> ok; + _ -> ct:fail(no_group_data) + end + end, + undefined = ?config(testcase_1b,Config), + testcase_1c = ?config(testcase_1c,Config), + ok. + +testcase_1() -> + []. +testcase_1(Config) -> + init = ?config(suite,Config), + testcase_1 = ?config(testcase_1,Config), + ok. + +testcase_2() -> + []. +testcase_2(Config) -> + init = ?config(suite,Config), + undefined = ?config(test_group_1a,Config), + undefined = ?config(test_group_1b,Config), + testcase_2 = ?config(testcase_2,Config), + ok. + +testcase_2a() -> + []. +testcase_2a(Config) -> + init = ?config(suite,Config), + test_group_2 = ?config(test_group_2,Config), + testcase_2a = ?config(testcase_2a,Config), + ok. +testcase_2b() -> + []. +testcase_2b(Config) -> + init = ?config(suite,Config), + test_group_2 = ?config(test_group_2,Config), + undefined = ?config(testcase_2a,Config), + testcase_2b = ?config(testcase_2b,Config), + ok. + +testcase_3a() -> + []. +testcase_3a(Config) -> + init = ?config(suite,Config), + test_group_2 = ?config(test_group_2,Config), + test_group_3 = ?config(test_group_3,Config), + undefined = ?config(testcase_2b,Config), + testcase_3a = ?config(testcase_3a,Config), + ok. +testcase_3b() -> + []. +testcase_3b(Config) -> + init = ?config(suite,Config), + test_group_2 = ?config(test_group_2,Config), + test_group_3 = ?config(test_group_3,Config), + undefined = ?config(testcase_3a,Config), + testcase_3b = ?config(testcase_3b,Config), + ok. + +testcase_3() -> + []. +testcase_3(Config) -> + init = ?config(suite,Config), + undefined = ?config(test_group_2,Config), + undefined = ?config(test_group_3,Config), + testcase_3 = ?config(testcase_3,Config), + ok. + +testcase_5a() -> + []. +testcase_5a(Config) -> + init = ?config(suite,Config), + undefined = ?config(test_group_3,Config), + test_group_4 = ?config(test_group_4,Config), + test_group_5 = ?config(test_group_5,Config), + undefined = ?config(testcase_3,Config), + testcase_5a = ?config(testcase_5a,Config), + %% increase chance the done event will come + %% during execution of subgroup (could be + %% tricky to handle) + timer:sleep(3), + ok. +testcase_5b() -> + []. +testcase_5b(Config) -> + init = ?config(suite,Config), + test_group_4 = ?config(test_group_4,Config), + test_group_5 = ?config(test_group_5,Config), + undefined = ?config(testcase_5a,Config), + testcase_5b = ?config(testcase_5b,Config), + ok. + +testcase_7a() -> + []. +testcase_7a(Config) -> + init = ?config(suite,Config), + undefined = ?config(test_group_3,Config), + test_group_4 = ?config(test_group_4,Config), + test_group_5 = ?config(test_group_5,Config), + test_group_6 = ?config(test_group_6,Config), + test_group_7 = ?config(test_group_7,Config), + testcase_7a = ?config(testcase_7a,Config), + ok. +testcase_7b() -> + []. +testcase_7b(Config) -> + init = ?config(suite,Config), + test_group_4 = ?config(test_group_4,Config), + test_group_5 = ?config(test_group_5,Config), + test_group_6 = ?config(test_group_6,Config), + test_group_7 = ?config(test_group_7,Config), + undefined = ?config(testcase_7a,Config), + testcase_7b = ?config(testcase_7b,Config), + ok. + +testcase_8a() -> + []. +testcase_8a(Config) -> + init = ?config(suite,Config), + undefined = ?config(test_group_3,Config), + test_group_4 = ?config(test_group_4,Config), + test_group_5 = ?config(test_group_5,Config), + test_group_6 = ?config(test_group_6,Config), + test_group_8 = ?config(test_group_8,Config), + testcase_8a = ?config(testcase_8a,Config), + ok. +testcase_8b() -> + []. +testcase_8b(Config) -> + init = ?config(suite,Config), + test_group_4 = ?config(test_group_4,Config), + test_group_5 = ?config(test_group_5,Config), + test_group_6 = ?config(test_group_6,Config), + test_group_8 = ?config(test_group_8,Config), + undefined = ?config(testcase_8a,Config), + testcase_8b = ?config(testcase_8b,Config), + ok. diff --git a/lib/common_test/test/ct_testspec_1_SUITE_data/groups_2/groups_21_SUITE.erl b/lib/common_test/test/ct_testspec_1_SUITE_data/groups_2/groups_21_SUITE.erl new file mode 100644 index 0000000000..2533ac8e84 --- /dev/null +++ b/lib/common_test/test/ct_testspec_1_SUITE_data/groups_2/groups_21_SUITE.erl @@ -0,0 +1,281 @@ +%% +%% %CopyrightBegin% +%% +%% Copyright Ericsson AB 2010. All Rights Reserved. +%% +%% The contents of this file are subject to the Erlang Public License, +%% Version 1.1, (the "License"); you may not use this file except in +%% compliance with the License. You should have received a copy of the +%% Erlang Public License along with this software. If not, it can be +%% retrieved online at http://www.erlang.org/. +%% +%% Software distributed under the License is distributed on an "AS IS" +%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See +%% the License for the specific language governing rights and limitations +%% under the License. +%% +%% %CopyrightEnd% +%% +-module(groups_21_SUITE). + +-compile(export_all). + +-include_lib("common_test/include/ct.hrl"). + +%%==================================================================== +%% COMMON TEST CALLBACK FUNCTIONS +%%==================================================================== + +suite() -> + [{timetrap,{minutes,1}}]. + +groups() -> + [ + {test_group_1a, [testcase_1a,testcase_1b]}, + + {test_group_1b, [], [testcase_1a,testcase_1b]}, + + {test_group_2, [], [testcase_2a, + + {test_group_3, [], [testcase_3a, + testcase_3b]}, + testcase_2b]}, + + {test_group_4, [{test_group_5, [], [testcase_5a, + + {group, test_group_6}, + + testcase_5b]}]}, + + {test_group_6, [{group, test_group_7}]}, + + {test_group_7, [testcase_7a,testcase_7b]} + ]. + +all() -> + [testcase_1, + {group, test_group_1a}, + {group, test_group_1b}, + testcase_2, + {group, test_group_2}, + testcase_3, + {group, test_group_4}]. + +%% this func only for internal test purposes +grs_and_tcs() -> + {[ + test_group_1a, test_group_1b, + test_group_2, test_group_3, + test_group_4, test_group_5, + test_group_6, test_group_7 + ], + [ + testcase_1, + testcase_1a, testcase_1b, + testcase_2, + testcase_2a, testcase_2b, + testcase_3a, testcase_3b, + testcase_3, + testcase_5a, testcase_5b, + testcase_7a, testcase_7b + ]}. + +%%-------------------------------------------------------------------- +%% Suite Configuration +%%-------------------------------------------------------------------- + +init_per_suite(Config) -> + [{suite,init}|Config]. + +end_per_suite(Config) -> + init = ?config(suite,Config). + +%%-------------------------------------------------------------------- +%% Group Configuration +%%-------------------------------------------------------------------- + +init_per_group(Group, Config) -> + [{name,Group}] = ?config(tc_group_properties,Config), + {Grs,_} = grs_and_tcs(), + case lists:member(Group, Grs) of + true -> + ct:comment(io_lib:format("~w", [Group])), + init = ?config(suite,Config), + [{Group,Group} | Config]; + false -> + ct:fail({bad_group,Group}) + end. + +end_per_group(Group, Config) -> + {Grs,_} = grs_and_tcs(), + case lists:member(Group, Grs) of + true -> + init = ?config(suite,Config), + Group = ?config(Group,Config), + ok; + false -> + ct:fail({bad_group,Group}) + end. + +%%-------------------------------------------------------------------- +%% Testcase Configuration +%%-------------------------------------------------------------------- + +init_per_testcase(TestCase, Config) -> + {_,TCs} = grs_and_tcs(), + case lists:member(TestCase, TCs) of + true -> + init = ?config(suite,Config), + [{TestCase,TestCase} | Config]; + false -> + ct:fail({unknown_testcase,TestCase}) + end. + +end_per_testcase(TestCase, Config) -> + {_,TCs} = grs_and_tcs(), + case lists:member(TestCase, TCs) of + true -> + init = ?config(suite,Config), + TestCase = ?config(TestCase,Config), + ok; + false -> + ct:fail({unknown_testcase,TestCase}) + end. + + +%%-------------------------------------------------------------------- +%% Testcases +%%-------------------------------------------------------------------- + +testcase_1() -> + []. +testcase_1(Config) -> + init = ?config(suite,Config), + testcase_1 = ?config(testcase_1,Config), + ok. + +testcase_1a() -> + []. +testcase_1a(Config) -> + init = ?config(suite,Config), + case ?config(test_group_1a,Config) of + test_group_1a -> ok; + _ -> + case ?config(test_group_1b,Config) of + test_group_1b -> ok; + _ -> ct:fail(no_group_data) + end + end, + testcase_1a = ?config(testcase_1a,Config), + ok. +testcase_1b() -> + []. +testcase_1b(Config) -> + init = ?config(suite,Config), + case ?config(test_group_1a,Config) of + test_group_1a -> ok; + _ -> + case ?config(test_group_1b,Config) of + test_group_1b -> ok; + _ -> ct:fail(no_group_data) + end + end, + undefined = ?config(testcase_1a,Config), + testcase_1b = ?config(testcase_1b,Config), + ok. + +testcase_2() -> + []. +testcase_2(Config) -> + init = ?config(suite,Config), + undefined = ?config(test_group_1a,Config), + undefined = ?config(test_group_1b,Config), + testcase_2 = ?config(testcase_2,Config), + ok. + +testcase_2a() -> + []. +testcase_2a(Config) -> + init = ?config(suite,Config), + test_group_2 = ?config(test_group_2,Config), + testcase_2a = ?config(testcase_2a,Config), + ok. +testcase_2b() -> + []. +testcase_2b(Config) -> + init = ?config(suite,Config), + test_group_2 = ?config(test_group_2,Config), + undefined = ?config(testcase_2a,Config), + testcase_2b = ?config(testcase_2b,Config), + ok. + +testcase_3a() -> + []. +testcase_3a(Config) -> + init = ?config(suite,Config), + test_group_2 = ?config(test_group_2,Config), + test_group_3 = ?config(test_group_3,Config), + undefined = ?config(testcase_2b,Config), + testcase_3a = ?config(testcase_3a,Config), + ok. +testcase_3b() -> + []. +testcase_3b(Config) -> + init = ?config(suite,Config), + test_group_2 = ?config(test_group_2,Config), + test_group_3 = ?config(test_group_3,Config), + undefined = ?config(testcase_3a,Config), + testcase_3b = ?config(testcase_3b,Config), + ok. + +testcase_3() -> + []. +testcase_3(Config) -> + init = ?config(suite,Config), + undefined = ?config(test_group_2,Config), + undefined = ?config(test_group_3,Config), + testcase_3 = ?config(testcase_3,Config), + ok. + +testcase_5a() -> + []. +testcase_5a(Config) -> + init = ?config(suite,Config), + undefined = ?config(test_group_3,Config), + test_group_4 = ?config(test_group_4,Config), + test_group_5 = ?config(test_group_5,Config), + undefined = ?config(testcase_3,Config), + testcase_5a = ?config(testcase_5a,Config), + ok. +testcase_5b() -> + []. +testcase_5b(Config) -> + init = ?config(suite,Config), + test_group_4 = ?config(test_group_4,Config), + test_group_5 = ?config(test_group_5,Config), + undefined = ?config(testcase_5a,Config), + testcase_5b = ?config(testcase_5b,Config), + ok. + +testcase_7a() -> + []. +testcase_7a(Config) -> + init = ?config(suite,Config), + undefined = ?config(test_group_3,Config), + test_group_4 = ?config(test_group_4,Config), + test_group_5 = ?config(test_group_5,Config), + test_group_6 = ?config(test_group_6,Config), + test_group_7 = ?config(test_group_7,Config), + testcase_7a = ?config(testcase_7a,Config), + ok. +testcase_7b() -> + []. +testcase_7b(Config) -> + init = ?config(suite,Config), + test_group_4 = ?config(test_group_4,Config), + test_group_5 = ?config(test_group_5,Config), + test_group_6 = ?config(test_group_6,Config), + test_group_7 = ?config(test_group_7,Config), + undefined = ?config(testcase_7a,Config), + testcase_7b = ?config(testcase_7b,Config), + ok. diff --git a/lib/common_test/test/ct_testspec_1_SUITE_data/groups_2/groups_22_SUITE.erl b/lib/common_test/test/ct_testspec_1_SUITE_data/groups_2/groups_22_SUITE.erl new file mode 100644 index 0000000000..cd517876df --- /dev/null +++ b/lib/common_test/test/ct_testspec_1_SUITE_data/groups_2/groups_22_SUITE.erl @@ -0,0 +1,314 @@ +%% +%% %CopyrightBegin% +%% +%% Copyright Ericsson AB 2010. All Rights Reserved. +%% +%% The contents of this file are subject to the Erlang Public License, +%% Version 1.1, (the "License"); you may not use this file except in +%% compliance with the License. You should have received a copy of the +%% Erlang Public License along with this software. If not, it can be +%% retrieved online at http://www.erlang.org/. +%% +%% Software distributed under the License is distributed on an "AS IS" +%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See +%% the License for the specific language governing rights and limitations +%% under the License. +%% +%% %CopyrightEnd% +%% +-module(groups_22_SUITE). + +-compile(export_all). + +-include_lib("common_test/include/ct.hrl"). + +%%==================================================================== +%% COMMON TEST CALLBACK FUNCTIONS +%%==================================================================== + +suite() -> + [{timetrap,{minutes,1}}]. + +groups() -> + [ + {test_group_1a, [shuffle], [testcase_1a,testcase_1b,testcase_1c]}, + + {test_group_1b, [parallel], [testcase_1a,testcase_1b]}, + + {test_group_2, [parallel], [testcase_2a, + + {test_group_3, [{repeat,1}], + [testcase_3a, testcase_3b]}, + + testcase_2b]}, + + {test_group_4, [{test_group_5, [parallel], [testcase_5a, + + {group, test_group_6}, + + testcase_5b]}]}, + + {test_group_6, [parallel], [{group, test_group_7}]}, + + {test_group_7, [sequence], [testcase_7a,testcase_7b]} + ]. + +all() -> + [{group, test_group_1a}, + {group, test_group_1b}, + testcase_1, + testcase_2, + {group, test_group_2}, + testcase_3, + {group, test_group_4}]. + +%% this func only for internal test purposes +grs_and_tcs() -> + {[ + test_group_1a, test_group_1b, + test_group_2, test_group_3, + test_group_4, test_group_5, + test_group_6, test_group_7 + ], + [ + testcase_1a, testcase_1b, testcase_1c, + testcase_1, + testcase_2, + testcase_2a, testcase_2b, + testcase_3a, testcase_3b, + testcase_3, + testcase_5a, testcase_5b, + testcase_7a, testcase_7b + ]}. + +%%-------------------------------------------------------------------- +%% Suite Configuration +%%-------------------------------------------------------------------- + +init_per_suite(Config) -> + [{suite,init}|Config]. + +end_per_suite(Config) -> + init = ?config(suite,Config). + +%%-------------------------------------------------------------------- +%% Group Configuration +%%-------------------------------------------------------------------- + +init_per_group(Group, Config) -> + Cmt = + case {Group,?config(tc_group_properties,Config)} of + {test_group_1a,[{shuffle,S},{name,test_group_1a}]} -> + io_lib:format("shuffled, ~w", [S]); + {test_group_1b,[{name,test_group_1b},parallel]} -> "parallel"; + {test_group_2,[{name,test_group_2},parallel]} -> "parallel"; + {test_group_3,[{name,test_group_3},{repeat,1}]} -> "repeat 1"; + {test_group_3,[{name,test_group_3}]} -> "repeat 0"; + {test_group_4,[{name,test_group_4}]} -> ok; + {test_group_5,[{name,test_group_5},parallel]} -> "parallel"; + {test_group_6,[{name,test_group_6},parallel]} -> "parallel"; + {test_group_7,[{name,test_group_7},sequence]} -> "sequence" + end, + {Grs,_} = grs_and_tcs(), + case lists:member(Group, Grs) of + true -> + init = ?config(suite,Config), + ct:comment(io_lib:format("~w, ~s", [Group,Cmt])), + [{Group,Group} | Config]; + false -> + ct:fail({bad_group,Group}) + end. + +end_per_group(Group, Config) -> + {Grs,_} = grs_and_tcs(), + case lists:member(Group, Grs) of + true -> + init = ?config(suite,Config), + Group = ?config(Group,Config), + ok; + false -> + ct:fail({bad_group,Group}) + end. + +%%-------------------------------------------------------------------- +%% Testcase Configuration +%%-------------------------------------------------------------------- + +init_per_testcase(TestCase, Config) -> + {_,TCs} = grs_and_tcs(), + case lists:member(TestCase, TCs) of + true -> + init = ?config(suite,Config), + [{TestCase,TestCase} | Config]; + false -> + ct:fail({unknown_testcase,TestCase}) + end. + +end_per_testcase(TestCase, Config) -> + {_,TCs} = grs_and_tcs(), + case lists:member(TestCase, TCs) of + true -> + init = ?config(suite,Config), + TestCase = ?config(TestCase,Config), + ok; + false -> + ct:fail({unknown_testcase,TestCase}) + end. + + +%%-------------------------------------------------------------------- +%% Testcases +%%-------------------------------------------------------------------- + +testcase_1a() -> + []. +testcase_1a(Config) -> + init = ?config(suite,Config), + case ?config(test_group_1a,Config) of + test_group_1a -> ok; + _ -> + case ?config(test_group_1b,Config) of + test_group_1b -> ok; + _ -> ct:fail(no_group_data) + end + end, + testcase_1a = ?config(testcase_1a,Config), + ok. +testcase_1b() -> + []. +testcase_1b(Config) -> + init = ?config(suite,Config), + case ?config(test_group_1a,Config) of + test_group_1a -> ok; + _ -> + case ?config(test_group_1b,Config) of + test_group_1b -> ok; + _ -> ct:fail(no_group_data) + end + end, + undefined = ?config(testcase_1a,Config), + testcase_1b = ?config(testcase_1b,Config), + ok. + +testcase_1c() -> + []. +testcase_1c(Config) -> + init = ?config(suite,Config), + case ?config(test_group_1a,Config) of + test_group_1a -> ok; + _ -> + case ?config(test_group_1b,Config) of + test_group_1b -> ok; + _ -> ct:fail(no_group_data) + end + end, + undefined = ?config(testcase_1b,Config), + testcase_1c = ?config(testcase_1c,Config), + ok. + +testcase_1() -> + []. +testcase_1(Config) -> + init = ?config(suite,Config), + testcase_1 = ?config(testcase_1,Config), + ok. + +testcase_2() -> + []. +testcase_2(Config) -> + init = ?config(suite,Config), + undefined = ?config(test_group_1a,Config), + undefined = ?config(test_group_1b,Config), + testcase_2 = ?config(testcase_2,Config), + ok. + +testcase_2a() -> + []. +testcase_2a(Config) -> + init = ?config(suite,Config), + test_group_2 = ?config(test_group_2,Config), + testcase_2a = ?config(testcase_2a,Config), + ok. +testcase_2b() -> + []. +testcase_2b(Config) -> + init = ?config(suite,Config), + test_group_2 = ?config(test_group_2,Config), + undefined = ?config(testcase_2a,Config), + testcase_2b = ?config(testcase_2b,Config), + ok. + +testcase_3a() -> + []. +testcase_3a(Config) -> + init = ?config(suite,Config), + test_group_2 = ?config(test_group_2,Config), + test_group_3 = ?config(test_group_3,Config), + undefined = ?config(testcase_2b,Config), + testcase_3a = ?config(testcase_3a,Config), + ok. +testcase_3b() -> + []. +testcase_3b(Config) -> + init = ?config(suite,Config), + test_group_2 = ?config(test_group_2,Config), + test_group_3 = ?config(test_group_3,Config), + undefined = ?config(testcase_3a,Config), + testcase_3b = ?config(testcase_3b,Config), + ok. + +testcase_3() -> + []. +testcase_3(Config) -> + init = ?config(suite,Config), + undefined = ?config(test_group_2,Config), + undefined = ?config(test_group_3,Config), + testcase_3 = ?config(testcase_3,Config), + ok. + +testcase_5a() -> + []. +testcase_5a(Config) -> + init = ?config(suite,Config), + undefined = ?config(test_group_3,Config), + test_group_4 = ?config(test_group_4,Config), + test_group_5 = ?config(test_group_5,Config), + undefined = ?config(testcase_3,Config), + testcase_5a = ?config(testcase_5a,Config), + %% increase chance the done event will come + %% during execution of subgroup (could be + %% tricky to handle) + timer:sleep(3), + ok. +testcase_5b() -> + []. +testcase_5b(Config) -> + init = ?config(suite,Config), + test_group_4 = ?config(test_group_4,Config), + test_group_5 = ?config(test_group_5,Config), + undefined = ?config(testcase_5a,Config), + testcase_5b = ?config(testcase_5b,Config), + ok. + +testcase_7a() -> + []. +testcase_7a(Config) -> + init = ?config(suite,Config), + undefined = ?config(test_group_3,Config), + test_group_4 = ?config(test_group_4,Config), + test_group_5 = ?config(test_group_5,Config), + test_group_6 = ?config(test_group_6,Config), + test_group_7 = ?config(test_group_7,Config), + testcase_7a = ?config(testcase_7a,Config), + ok. +testcase_7b() -> + []. +testcase_7b(Config) -> + init = ?config(suite,Config), + test_group_4 = ?config(test_group_4,Config), + test_group_5 = ?config(test_group_5,Config), + test_group_6 = ?config(test_group_6,Config), + test_group_7 = ?config(test_group_7,Config), + undefined = ?config(testcase_7a,Config), + testcase_7b = ?config(testcase_7b,Config), + ok. diff --git a/lib/common_test/test/ct_testspec_1_SUITE_data/suites_1/simple_1_SUITE.erl b/lib/common_test/test/ct_testspec_1_SUITE_data/suites_1/simple_1_SUITE.erl new file mode 100644 index 0000000000..b789851134 --- /dev/null +++ b/lib/common_test/test/ct_testspec_1_SUITE_data/suites_1/simple_1_SUITE.erl @@ -0,0 +1,146 @@ +%% +%% %CopyrightBegin% +%% +%% Copyright Ericsson AB 2008-2010. All Rights Reserved. +%% +%% The contents of this file are subject to the Erlang Public License, +%% Version 1.1, (the "License"); you may not use this file except in +%% compliance with the License. You should have received a copy of the +%% Erlang Public License along with this software. If not, it can be +%% retrieved online at http://www.erlang.org/. +%% +%% Software distributed under the License is distributed on an "AS IS" +%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See +%% the License for the specific language governing rights and limitations +%% under the License. +%% +%% %CopyrightEnd% +%% + +-module(simple_1_SUITE). + +%% Note: This directive should only be used in test suites. +-compile(export_all). + +-include_lib("common_test/include/ct.hrl"). + +%%-------------------------------------------------------------------- +%% COMMON TEST CALLBACK FUNCTIONS +%%-------------------------------------------------------------------- + +%%-------------------------------------------------------------------- +%% Function: suite() -> Info +%% +%% Info = [tuple()] +%% List of key/value pairs. +%% +%% Description: Returns list of tuples to set default properties +%% for the suite. +%% +%% Note: The suite/0 function is only meant to be used to return +%% default data values, not perform any other operations. +%%-------------------------------------------------------------------- +suite() -> + [ + {timetrap,{seconds,10}} + ]. + +%%-------------------------------------------------------------------- +%% Function: init_per_suite(Config0) -> +%% Config1 | {skip,Reason} | {skip_and_save,Reason,Config1} +%% +%% Config0 = Config1 = [tuple()] +%% A list of key/value pairs, holding the test case configuration. +%% Reason = term() +%% The reason for skipping the suite. +%% +%% Description: Initialization before the suite. +%% +%% Note: This function is free to add any key/value pairs to the Config +%% variable, but should NOT alter/remove any existing entries. +%%-------------------------------------------------------------------- +init_per_suite(Config) -> + [{ips,ips_data} | Config]. + +%%-------------------------------------------------------------------- +%% Function: end_per_suite(Config0) -> void() | {save_config,Config1} +%% +%% Config0 = Config1 = [tuple()] +%% A list of key/value pairs, holding the test case configuration. +%% +%% Description: Cleanup after the suite. +%%-------------------------------------------------------------------- +end_per_suite(Config) -> + ips_data = ?config(ips, Config). + +%%-------------------------------------------------------------------- +%% Function: init_per_testcase(TestCase, Config0) -> +%% Config1 | {skip,Reason} | {skip_and_save,Reason,Config1} +%% +%% TestCase = atom() +%% Name of the test case that is about to run. +%% Config0 = Config1 = [tuple()] +%% A list of key/value pairs, holding the test case configuration. +%% Reason = term() +%% The reason for skipping the test case. +%% +%% Description: Initialization before each test case. +%% +%% Note: This function is free to add any key/value pairs to the Config +%% variable, but should NOT alter/remove any existing entries. +%%-------------------------------------------------------------------- +init_per_testcase(TestCase, Config) -> + [{TestCase,{TestCase,data}} | Config]. + +%%-------------------------------------------------------------------- +%% Function: end_per_testcase(TestCase, Config0) -> +%% void() | {save_config,Config1} +%% +%% TestCase = atom() +%% Name of the test case that is finished. +%% Config0 = Config1 = [tuple()] +%% A list of key/value pairs, holding the test case configuration. +%% +%% Description: Cleanup after each test case. +%%-------------------------------------------------------------------- +end_per_testcase(TestCase, Config) -> + {TestCase,data} = ?config(TestCase, Config). + +%%-------------------------------------------------------------------- +%% Function: all() -> TestCases | {skip,Reason} +%% +%% TestCases = [TestCase | {sequence,SeqName}] +%% TestCase = atom() +%% Name of a test case. +%% SeqName = atom() +%% Name of a test case sequence. +%% Reason = term() +%% The reason for skipping all test cases. +%% +%% Description: Returns the list of test cases that are to be executed. +%%-------------------------------------------------------------------- +all() -> + [tc1, + tc2]. + + +%%-------------------------------------------------------------------- +%% TEST CASES +%%-------------------------------------------------------------------- + +tc1() -> + [{userdata,{info, "This is a testcase"}}]. + +tc1(Config) -> + ips_data = ?config(ips, Config), + {tc1,data} = ?config(tc1, Config), + ok. + +tc2() -> + [{timetrap,5000}]. + +tc2(Config) -> + ips_data = ?config(ips, Config), + undefined = ?config(tc1, Config), + {tc2,data} = ?config(tc2, Config), + ok. diff --git a/lib/common_test/test/ct_testspec_1_SUITE_data/suites_1/simple_2_SUITE.erl b/lib/common_test/test/ct_testspec_1_SUITE_data/suites_1/simple_2_SUITE.erl new file mode 100644 index 0000000000..eb7e9cdf7b --- /dev/null +++ b/lib/common_test/test/ct_testspec_1_SUITE_data/suites_1/simple_2_SUITE.erl @@ -0,0 +1,146 @@ +%% +%% %CopyrightBegin% +%% +%% Copyright Ericsson AB 2008-2010. All Rights Reserved. +%% +%% The contents of this file are subject to the Erlang Public License, +%% Version 1.1, (the "License"); you may not use this file except in +%% compliance with the License. You should have received a copy of the +%% Erlang Public License along with this software. If not, it can be +%% retrieved online at http://www.erlang.org/. +%% +%% Software distributed under the License is distributed on an "AS IS" +%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See +%% the License for the specific language governing rights and limitations +%% under the License. +%% +%% %CopyrightEnd% +%% + +-module(simple_2_SUITE). + +%% Note: This directive should only be used in test suites. +-compile(export_all). + +-include_lib("common_test/include/ct.hrl"). + +%%-------------------------------------------------------------------- +%% COMMON TEST CALLBACK FUNCTIONS +%%-------------------------------------------------------------------- + +%%-------------------------------------------------------------------- +%% Function: suite() -> Info +%% +%% Info = [tuple()] +%% List of key/value pairs. +%% +%% Description: Returns list of tuples to set default properties +%% for the suite. +%% +%% Note: The suite/0 function is only meant to be used to return +%% default data values, not perform any other operations. +%%-------------------------------------------------------------------- +suite() -> + [ + {timetrap,{seconds,10}} + ]. + +%%-------------------------------------------------------------------- +%% Function: init_per_suite(Config0) -> +%% Config1 | {skip,Reason} | {skip_and_save,Reason,Config1} +%% +%% Config0 = Config1 = [tuple()] +%% A list of key/value pairs, holding the test case configuration. +%% Reason = term() +%% The reason for skipping the suite. +%% +%% Description: Initialization before the suite. +%% +%% Note: This function is free to add any key/value pairs to the Config +%% variable, but should NOT alter/remove any existing entries. +%%-------------------------------------------------------------------- +init_per_suite(Config) -> + [{ips,ips_data} | Config]. + +%%-------------------------------------------------------------------- +%% Function: end_per_suite(Config0) -> void() | {save_config,Config1} +%% +%% Config0 = Config1 = [tuple()] +%% A list of key/value pairs, holding the test case configuration. +%% +%% Description: Cleanup after the suite. +%%-------------------------------------------------------------------- +end_per_suite(Config) -> + ips_data = ?config(ips, Config). + +%%-------------------------------------------------------------------- +%% Function: init_per_testcase(TestCase, Config0) -> +%% Config1 | {skip,Reason} | {skip_and_save,Reason,Config1} +%% +%% TestCase = atom() +%% Name of the test case that is about to run. +%% Config0 = Config1 = [tuple()] +%% A list of key/value pairs, holding the test case configuration. +%% Reason = term() +%% The reason for skipping the test case. +%% +%% Description: Initialization before each test case. +%% +%% Note: This function is free to add any key/value pairs to the Config +%% variable, but should NOT alter/remove any existing entries. +%%-------------------------------------------------------------------- +init_per_testcase(TestCase, Config) -> + [{TestCase,{TestCase,data}} | Config]. + +%%-------------------------------------------------------------------- +%% Function: end_per_testcase(TestCase, Config0) -> +%% void() | {save_config,Config1} +%% +%% TestCase = atom() +%% Name of the test case that is finished. +%% Config0 = Config1 = [tuple()] +%% A list of key/value pairs, holding the test case configuration. +%% +%% Description: Cleanup after each test case. +%%-------------------------------------------------------------------- +end_per_testcase(TestCase, Config) -> + {TestCase,data} = ?config(TestCase, Config). + +%%-------------------------------------------------------------------- +%% Function: all() -> TestCases | {skip,Reason} +%% +%% TestCases = [TestCase | {sequence,SeqName}] +%% TestCase = atom() +%% Name of a test case. +%% SeqName = atom() +%% Name of a test case sequence. +%% Reason = term() +%% The reason for skipping all test cases. +%% +%% Description: Returns the list of test cases that are to be executed. +%%-------------------------------------------------------------------- +all() -> + [tc1, + tc2]. + + +%%-------------------------------------------------------------------- +%% TEST CASES +%%-------------------------------------------------------------------- + +tc1() -> + [{userdata,{info, "This is a testcase"}}]. + +tc1(Config) -> + ips_data = ?config(ips, Config), + {tc1,data} = ?config(tc1, Config), + ok. + +tc2() -> + [{timetrap,5000}]. + +tc2(Config) -> + ips_data = ?config(ips, Config), + undefined = ?config(tc1, Config), + {tc2,data} = ?config(tc2, Config), + ok. diff --git a/lib/common_test/vsn.mk b/lib/common_test/vsn.mk index 2947c6a152..413ef21df3 100644 --- a/lib/common_test/vsn.mk +++ b/lib/common_test/vsn.mk @@ -1,3 +1,3 @@ -COMMON_TEST_VSN = 1.5 +COMMON_TEST_VSN = 1.5.1 diff --git a/lib/compiler/src/beam_dict.erl b/lib/compiler/src/beam_dict.erl index 4ffe8bc606..a1f994dfbd 100644 --- a/lib/compiler/src/beam_dict.erl +++ b/lib/compiler/src/beam_dict.erl @@ -33,7 +33,7 @@ exports = [] :: [{label(), arity(), label()}], locals = [] :: [{label(), arity(), label()}], imports = gb_trees:empty() :: gb_tree(), %{{M,F,A},Index} - strings = [] :: [string()], %String pool + strings = <<>> :: binary(), %String pool lambdas = [], %[{...}] literals = dict:new() :: dict(), %Format: {Literal,Number} next_atom = 1 :: pos_integer(), @@ -119,10 +119,11 @@ import(Mod0, Name0, Arity, #asm{imports=Imp0,next_import=NextIndex}=D0) string(Str, Dict) when is_list(Str) -> #asm{strings=Strings,string_offset=NextOffset} = Dict, - case old_string(Str, Strings) of + StrBin = list_to_binary(Str), + case old_string(StrBin, Strings) of none -> - NewDict = Dict#asm{strings=Strings++Str, - string_offset=NextOffset+length(Str)}, + NewDict = Dict#asm{strings = <<Strings/binary,StrBin/binary>>, + string_offset=NextOffset+byte_size(StrBin)}, {NextOffset,NewDict}; Offset when is_integer(Offset) -> {NextOffset-Offset,Dict} @@ -187,7 +188,7 @@ import_table(#asm{imports=Imp,next_import=NumImports}) -> ImpTab = [MFA || {MFA,_} <- Sorted], {NumImports,ImpTab}. --spec string_table(bdict()) -> {non_neg_integer(), [string()]}. +-spec string_table(bdict()) -> {non_neg_integer(), binary()}. string_table(#asm{strings=Strings,string_offset=Size}) -> {Size,Strings}. @@ -217,15 +218,12 @@ literal_table(#asm{literals=Tab,next_literal=NumLiterals}) -> my_term_to_binary(Term) -> term_to_binary(Term, [{minor_version,1}]). -%% Search for string Str in the string pool Pool. +%% Search for binary string Str in the binary string pool Pool. %% old_string(Str, Pool) -> none | Index --spec old_string(string(), [string()]) -> 'none' | pos_integer(). - -old_string([C|Str]=Str0, [C|Pool]) -> - case lists:prefix(Str, Pool) of - true -> length(Pool)+1; - false -> old_string(Str0, Pool) - end; -old_string([_|_]=Str, [_|Pool]) -> - old_string(Str, Pool); -old_string([_|_], []) -> none. +-spec old_string(binary(), binary()) -> 'none' | pos_integer(). + +old_string(Str, Pool) -> + case binary:match(Pool, Str) of + nomatch -> none; + {Start,_Length} -> byte_size(Pool) - Start + end. diff --git a/lib/compiler/src/compile.erl b/lib/compiler/src/compile.erl index 4642fb68b3..26da3ecad2 100644 --- a/lib/compiler/src/compile.erl +++ b/lib/compiler/src/compile.erl @@ -41,8 +41,7 @@ -type option() :: atom() | {atom(), term()} | {'d', atom(), term()}. --type line() :: integer(). --type err_info() :: {line(), module(), term()}. %% ErrorDescriptor +-type err_info() :: {erl_scan:line(), module(), term()}. %% ErrorDescriptor -type errors() :: [{file:filename(), [err_info()]}]. -type warnings() :: [{file:filename(), [err_info()]}]. -type mod_ret() :: {'ok', module()} @@ -70,7 +69,7 @@ file(File) -> file(File, ?DEFAULT_OPTIONS). --spec file(module() | file:filename(), [option()]) -> comp_ret(). +-spec file(module() | file:filename(), [option()] | option()) -> comp_ret(). file(File, Opts) when is_list(Opts) -> do_compile({file,File}, Opts++env_default_opts()); @@ -88,6 +87,8 @@ forms(Forms, Opt) when is_atom(Opt) -> %% would have generated a Beam file, false otherwise (if only a binary or a %% listing file would have been generated). +-spec output_generated([option()]) -> boolean(). + output_generated(Opts) -> noenv_output_generated(Opts++env_default_opts()). @@ -96,6 +97,8 @@ output_generated(Opts) -> %% for default options. %% +-spec noenv_file(module() | file:filename(), [option()] | option()) -> comp_ret(). + noenv_file(File, Opts) when is_list(Opts) -> do_compile({file,File}, Opts); noenv_file(File, Opt) -> @@ -106,6 +109,8 @@ noenv_forms(Forms, Opts) when is_list(Opts) -> noenv_forms(Forms, Opt) when is_atom(Opt) -> noenv_forms(Forms, [Opt|?DEFAULT_OPTIONS]). +-spec noenv_output_generated([option()]) -> boolean(). + noenv_output_generated(Opts) -> any(fun ({save_binary,_F}) -> true; (_Other) -> false @@ -216,16 +221,16 @@ format_error({module_name,Mod,Filename}) -> [Mod,Filename]). %% The compile state record. --record(compile, {filename="", - dir="", - base="", - ifile="", - ofile="", +-record(compile, {filename="" :: file:filename(), + dir="" :: file:filename(), + base="" :: file:filename(), + ifile="" :: file:filename(), + ofile="" :: file:filename(), module=[], code=[], core_code=[], abstract_code=[], %Abstract code for debugger. - options=[], + options=[] :: [option()], errors=[], warnings=[]}). @@ -362,7 +367,7 @@ mpf(Ms) -> [{File,[M || {F,M} <- Ms, F =:= File]} || File <- lists:usort([F || {F,_} <- Ms])]. -%% passes(form|file, [Option]) -> [{Name,PassFun}] +%% passes(forms|file, [Option]) -> [{Name,PassFun}] %% Figure out which passes that need to be run. passes(forms, Opts) -> @@ -819,6 +824,10 @@ foldl_transform(St, [T|Ts]) -> {'EXIT',R} -> Es = [{St#compile.ifile,[{none,compile,{parse_transform,T,R}}]}], {error,St#compile{errors=St#compile.errors ++ Es}}; + {warning, Forms, Ws} -> + foldl_transform( + St#compile{code=Forms, + warnings=St#compile.warnings ++ Ws}, Ts); Forms -> foldl_transform(St#compile{code=Forms}, Ts) end; @@ -828,7 +837,6 @@ get_core_transforms(Opts) -> [M || {core_transform,M} <- Opts]. core_transforms(St) -> %% The options field holds the complete list of options at this - Ts = get_core_transforms(St#compile.options), foldl_core_transforms(St, Ts). @@ -1172,12 +1180,12 @@ write_binary(Name, Bin, St) -> %% report_errors(State) -> ok %% report_warnings(State) -> ok -report_errors(St) -> - case member(report_errors, St#compile.options) of +report_errors(#compile{options=Opts,errors=Errors}) -> + case member(report_errors, Opts) of true -> foreach(fun ({{F,_L},Eds}) -> list_errors(F, Eds); ({F,Eds}) -> list_errors(F, Eds) end, - St#compile.errors); + Errors); false -> ok end. diff --git a/lib/compiler/test/compilation_SUITE.erl b/lib/compiler/test/compilation_SUITE.erl index d4843c9eba..9c06740816 100644 --- a/lib/compiler/test/compilation_SUITE.erl +++ b/lib/compiler/test/compilation_SUITE.erl @@ -46,7 +46,7 @@ all(suite) -> trycatch_4, opt_crash, otp_5404,otp_5436,otp_5481,otp_5553,otp_5632, otp_5714,otp_5872,otp_6121,otp_6121a,otp_6121b, - otp_7202,otp_7345,on_load + otp_7202,otp_7345,on_load,string_table ]. -define(comp(N), @@ -596,4 +596,15 @@ otp_7345(ObjRef, _RdEnv, Args) -> 10}, id(LlUnitdataReq). +%% Check the generation of the string table. + +string_table(Config) when is_list(Config) -> + ?line DataDir = ?config(data_dir, Config), + ?line File = filename:join(DataDir, "string_table.erl"), + ?line {ok,string_table,Beam,[]} = compile:file(File, [return, binary]), + ?line {ok,{string_table,[StringTableChunk]}} = beam_lib:chunks(Beam, ["StrT"]), + ?line {"StrT", <<"stringabletringtable">>} = StringTableChunk, + ok. + + id(I) -> I. diff --git a/lib/compiler/test/compilation_SUITE_data/string_table.erl b/lib/compiler/test/compilation_SUITE_data/string_table.erl new file mode 100644 index 0000000000..1da1d015dd --- /dev/null +++ b/lib/compiler/test/compilation_SUITE_data/string_table.erl @@ -0,0 +1,8 @@ +-module(string_table). +-export([f/1, g/1]). + +f(<<"string">>) -> string; +f(<<"stringtable">>) -> stringtable. + +g(<<"stringtable">>) -> stringtable; +g(<<"table">>) -> table. diff --git a/lib/cosEvent/vsn.mk b/lib/cosEvent/vsn.mk index 9f326b39b6..9c00a17100 100644 --- a/lib/cosEvent/vsn.mk +++ b/lib/cosEvent/vsn.mk @@ -1,15 +1 @@ - COSEVENT_VSN = 2.1.9 - -TICKETS = OTP-8543 - -TICKETS_2.1.8 = OTP-8355 \ - OTP-8409 - -TICKETS_2.1.7 = OTP-8201 - -TICKETS_2.1.6 = OTP-7987 - -TICKETS_2.1.5 = OTP-7837 - -TICKETS_2.1.4 = OTP-7595 diff --git a/lib/cosEventDomain/vsn.mk b/lib/cosEventDomain/vsn.mk index dceee34181..bd21133fe5 100644 --- a/lib/cosEventDomain/vsn.mk +++ b/lib/cosEventDomain/vsn.mk @@ -1,15 +1 @@ - COSEVENTDOMAIN_VSN = 1.1.9 - -TICKETS = OTP-8543 - -TICKETS_1.1.8 = OTP-8353 \ - OTP-8355 - -TICKETS_1.1.7 = OTP-8201 - -TICKETS_1.1.6 = OTP-7987 - -TICKETS_1.1.5 = OTP-7837 - -TICKETS_1.1.4 = OTP-7595 diff --git a/lib/cosFileTransfer/vsn.mk b/lib/cosFileTransfer/vsn.mk index 2700ecb3e3..ef8ee53c5e 100644 --- a/lib/cosFileTransfer/vsn.mk +++ b/lib/cosFileTransfer/vsn.mk @@ -1,16 +1 @@ COSFILETRANSFER_VSN = 1.1.10 - -TICKETS = \ - OTP-8355 \ - OTP-8374 - - -TICKETS_1.1.9 = OTP-8201 - -TICKETS_1.1.8 = OTP-7987 - -TICKETS_1.1.7 = OTP-7837 - -TICKETS_1.1.6 = \ - OTP-7595 \ - OTP-7599
\ No newline at end of file diff --git a/lib/cosNotification/vsn.mk b/lib/cosNotification/vsn.mk index a19facffd5..c03f0ef161 100644 --- a/lib/cosNotification/vsn.mk +++ b/lib/cosNotification/vsn.mk @@ -1,18 +1 @@ COSNOTIFICATION_VSN = 1.1.14 - -TICKETS = OTP-8489 \ - OTP-8543 - -TICKETS_1.1.13 = OTP-8353 \ - OTP-8354 \ - OTP-8355 - -TICKETS_1.1.12 = OTP-8201 - -TICKETS_1.1.11 = OTP-7987 - -TICKETS_1.1.10 = OTP-7837 - -TICKETS_1.1.9 = OTP-7595 - -TICKETS_1.1.8 = OTP-7553 diff --git a/lib/cosProperty/vsn.mk b/lib/cosProperty/vsn.mk index 3d594a8329..ca9a7ca77e 100644 --- a/lib/cosProperty/vsn.mk +++ b/lib/cosProperty/vsn.mk @@ -1,13 +1 @@ COSPROPERTY_VSN = 1.1.12 - -TICKETS = OTP-8543 - -TICKETS_1.1.11 = OTP-8355 - -TICKETS_1.1.10 = OTP-8201 - -TICKETS_1.1.9 = OTP-7987 - -TICKETS_1.1.8 = OTP-7837 - -TICKETS_1.1.7 = OTP-7595 diff --git a/lib/cosTime/vsn.mk b/lib/cosTime/vsn.mk index 9d8057e8db..429613fb61 100644 --- a/lib/cosTime/vsn.mk +++ b/lib/cosTime/vsn.mk @@ -1,13 +1 @@ COSTIME_VSN = 1.1.9 - -TICKETS = OTP-8543 - -TICKETS_1.1.8 = OTP-8355 - -TICKETS_1.1.7 = OTP-8201 - -TICKETS_1.1.6 = OTP-7987 - -TICKETS_1.1.5 = OTP-7837 - -TICKETS_1.1.4 = OTP-7595 diff --git a/lib/cosTransactions/vsn.mk b/lib/cosTransactions/vsn.mk index 34775be7e4..82e46f51dd 100644 --- a/lib/cosTransactions/vsn.mk +++ b/lib/cosTransactions/vsn.mk @@ -1,14 +1 @@ COSTRANSACTIONS_VSN = 1.2.10 - -TICKETS = OTP-8489 \ - OTP-8543 - -TICKETS_1.2.9 = OTP-8355 - -TICKETS_1.2.8 = OTP-8201 - -TICKETS_1.2.7 = OTP-7987 - -TICKETS_1.2.6 = OTP-7837 - -TICKETS_1.2.5 = OTP-7595 diff --git a/lib/crypto/c_src/crypto.c b/lib/crypto/c_src/crypto.c index 68079f06c7..8823bba3b6 100644 --- a/lib/crypto/c_src/crypto.c +++ b/lib/crypto/c_src/crypto.c @@ -950,7 +950,7 @@ static ERL_NIF_TERM rc4_encrypt_with_state(ErlNifEnv* env, int argc, const ERL_N RC4(rc4_key, data.size, data.data, enif_make_new_binary(env, data.size, &new_data)); - return enif_make_tuple2(env,argv[0],new_data); + return enif_make_tuple2(env,new_state,new_data); } static ERL_NIF_TERM rc2_40_cbc_crypt(ErlNifEnv* env, int argc, const ERL_NIF_TERM argv[]) diff --git a/lib/crypto/src/crypto.erl b/lib/crypto/src/crypto.erl index 39512d27e1..19fa495b7d 100644 --- a/lib/crypto/src/crypto.erl +++ b/lib/crypto/src/crypto.erl @@ -195,8 +195,8 @@ sha_final(_Context) -> ?nif_stub. %% %% MD5_MAC %% --spec md5_mac(iodata(), iodata()) -> binary. --spec md5_mac_96(iodata(), iodata()) -> binary. +-spec md5_mac(iodata(), iodata()) -> binary(). +-spec md5_mac_96(iodata(), iodata()) -> binary(). md5_mac(Key, Data) -> md5_mac_n(Key,Data,16). @@ -209,8 +209,8 @@ md5_mac_n(_Key,_Data,_MacSz) -> ?nif_stub. %% %% SHA_MAC %% --spec sha_mac(iodata(), iodata()) -> binary. --spec sha_mac_96(iodata(), iodata()) -> binary. +-spec sha_mac(iodata(), iodata()) -> binary(). +-spec sha_mac_96(iodata(), iodata()) -> binary(). sha_mac(Key, Data) -> sha_mac_n(Key,Data,20). diff --git a/lib/crypto/test/crypto_SUITE.erl b/lib/crypto/test/crypto_SUITE.erl index 576949d38d..06b284d50d 100644 --- a/lib/crypto/test/crypto_SUITE.erl +++ b/lib/crypto/test/crypto_SUITE.erl @@ -54,6 +54,7 @@ dh/1, exor_test/1, rc4_test/1, + rc4_stream_test/1, blowfish_cfb64/1, smp/1, cleanup/1]). @@ -89,6 +90,7 @@ all(suite) -> dh, exor_test, rc4_test, + rc4_stream_test, mod_exp_test, blowfish_cfb64, smp], @@ -979,6 +981,21 @@ rc4_test(Config) when is_list(Config) -> CT2 = binary_to_list(crypto:rc4_encrypt(K, R2)), ok. +rc4_stream_test(doc) -> + ["Test rc4 stream encryption ."]; +rc4_stream_test(suite) -> + []; +rc4_stream_test(Config) when is_list(Config) -> + CT1 = <<"hej">>, + CT2 = <<" p� dig">>, + K = "apaapa", + State0 = crypto:rc4_set_key(K), + {State1, R1} = crypto:rc4_encrypt_with_state(State0, CT1), + {_State2, R2} = crypto:rc4_encrypt_with_state(State1, CT2), + R = list_to_binary([R1, R2]), + <<71,112,14,44,140,33,212,144,155,47>> = R, + ok. + blowfish_cfb64(doc) -> ["Test Blowfish encrypt/decrypt."]; blowfish_cfb64(suite) -> []; blowfish_cfb64(Config) when is_list(Config) -> @@ -1029,7 +1046,7 @@ worker_loop(0, _) -> worker_loop(N, Config) -> Funcs = { md5, md5_update, md5_mac, md5_mac_io, sha, sha_update, des_cbc, aes_cfb, aes_cbc, des_cbc_iter, rand_uniform_test, - rsa_verify_test, exor_test, rc4_test, mod_exp_test }, + rsa_verify_test, exor_test, rc4_test, rc4_stream_test, mod_exp_test }, F = element(random:uniform(size(Funcs)),Funcs), %%io:format("worker ~p calling ~p\n",[self(),F]), diff --git a/lib/debugger/src/dbg_icmd.erl b/lib/debugger/src/dbg_icmd.erl index 7ccb9793a3..a26b16c82d 100644 --- a/lib/debugger/src/dbg_icmd.erl +++ b/lib/debugger/src/dbg_icmd.erl @@ -94,7 +94,7 @@ break_p(Mod, Line, Le, Bs) -> Bool = case Cond of null -> true; {CM, CN} -> - try apply(CM, CN, [Bs]) of + try CM:CN(Bs) of true -> true; false -> false; _Term -> false @@ -245,7 +245,7 @@ handle_int_msg({attached, AttPid}, Status, _Bs, %% Tell attached process in which module evalution is located if - Le==1 -> + Le =:= 1 -> tell_attached({attached, undefined, -1, get(trace)}); true -> tell_attached({attached, M, Line, get(trace)}), @@ -269,7 +269,7 @@ handle_int_msg(detached, _Status, _Bs, _Ieval) -> handle_int_msg({old_code,Mod}, Status, Bs, #ieval{level=Le,module=M}=Ieval) -> if - Status==idle, Le==1 -> + Status =:= idle, Le =:= 1 -> erase([Mod|db]), put(cache, []); true -> @@ -352,9 +352,9 @@ set_stack_trace(true) -> set_stack_trace(all); set_stack_trace(Flag) -> if - Flag==false -> + Flag =:= false -> put(stack, []); - Flag==no_tail; Flag==all -> + Flag =:= no_tail; Flag =:= all -> ignore end, put(trace_stack, Flag), @@ -367,7 +367,7 @@ bindings(Bs, nostack) -> Bs; bindings(Bs, SP) -> case dbg_ieval:stack_level() of - Le when SP>Le -> + Le when SP > Le -> Bs; _ -> dbg_ieval:bindings(SP) @@ -377,7 +377,6 @@ messages() -> {messages, Msgs} = erlang:process_info(get(self), messages), Msgs. - %%==================================================================== %% Evaluating expressions within process context %%==================================================================== @@ -398,7 +397,7 @@ eval_restricted({From,_Mod,Cmd,SP}, Bs) -> From ! {self(), {eval_rsp, Rsp}} end. -eval_nonrestricted({From,Mod,Cmd,SP}, Bs, #ieval{level=Le}) when SP<Le-> +eval_nonrestricted({From,Mod,Cmd,SP}, Bs, #ieval{level=Le}) when SP < Le-> %% Evaluate in stack eval_restricted({From, Mod, Cmd, SP}, Bs), Bs; @@ -424,15 +423,15 @@ eval_nonrestricted({From, _Mod, Cmd, _SP}, Bs, eval_nonrestricted_1({match,_,{var,_,Var},Expr}, Bs, Ieval) -> {value,Res,Bs2} = dbg_ieval:eval_expr(Expr, Bs, Ieval#ieval{last_call=false}), - Bs3 = case lists:keysearch(Var, 1, Bs) of - {value, {Var,_Value}} -> + Bs3 = case lists:keyfind(Var, 1, Bs) of + {Var,_Value} -> lists:keyreplace(Var, 1, Bs2, {Var,Res}); false -> [{Var,Res} | Bs2] end, {Res,Bs3}; eval_nonrestricted_1({var,_,Var}, Bs, _Ieval) -> - Res = case lists:keysearch(Var, 1, Bs) of - {value, {Var, Value}} -> Value; + Res = case lists:keyfind(Var, 1, Bs) of + {Var, Value} -> Value; false -> unbound end, {Res,Bs}; @@ -458,7 +457,6 @@ parse_cmd(Cmd, LineNo) -> {ok,Forms} = erl_parse:parse_exprs(Tokens), Forms. - %%==================================================================== %% Library functions for attached process handling %%==================================================================== @@ -470,13 +468,12 @@ tell_attached(Msg) -> AttPid ! {self(), Msg} end. - %%==================================================================== %% get_binding/2 %%==================================================================== get_binding(Var, Bs) -> - case lists:keysearch(Var, 1, Bs) of - {value, {Var, Value}} -> {value, Value}; + case lists:keyfind(Var, 1, Bs) of + {Var, Value} -> {value, Value}; false -> unbound end. diff --git a/lib/debugger/src/dbg_ieval.erl b/lib/debugger/src/dbg_ieval.erl index c13fda7ac1..476dfd8796 100644 --- a/lib/debugger/src/dbg_ieval.erl +++ b/lib/debugger/src/dbg_ieval.erl @@ -120,9 +120,9 @@ check_exit_msg({'EXIT', Int, Reason}, _Bs, #ieval{level=Le}) -> %% This *must* be interpreter which has terminated, %% we are not linked to anyone else if - Le==1 -> + Le =:= 1 -> exit(Reason); - Le>1 -> + Le > 1 -> exit({Int, Reason}) end; check_exit_msg({'DOWN',_,_,_,Reason}, Bs, @@ -139,9 +139,9 @@ check_exit_msg({'DOWN',_,_,_,Reason}, Bs, %% importance in this case %% If we don't save them, however, post-mortem analysis %% of the process isn't possible - undefined when Le==1 -> % died outside interpreted code + undefined when Le =:= 1 -> % died outside interpreted code {}; - undefined when Le>1 -> + undefined when Le > 1 -> StackBin = term_to_binary(get(stack)), {{Mod, Li}, Bs, StackBin}; @@ -152,9 +152,9 @@ check_exit_msg({'DOWN',_,_,_,Reason}, Bs, dbg_iserver:cast(get(int), {set_exit_info,self(),ExitInfo}), if - Le==1 -> + Le =:= 1 -> exit(Reason); - Le>1 -> + Le > 1 -> exit({get(self), Reason}) end; check_exit_msg(_Msg, _Bs, _Ieval) -> @@ -271,7 +271,7 @@ meta_loop(Debugged, Bs, #ieval{level=Le} = Ieval) -> end; %% Re-entry to Meta from non-interpreted code - {re_entry, Debugged, {eval,{M,F,As}}} when Le==1 -> + {re_entry, Debugged, {eval,{M,F,As}}} when Le =:= 1 -> %% Reset process dictionary %% This is really only necessary if the process left %% interpreted code at a call level > 1 @@ -346,7 +346,7 @@ push(MFA, Bs, #ieval{level=Le,module=Cm,line=Li,last_call=Lc}) -> [] -> put(stack, [Entry]); [_Entry|Entries] -> put(stack, [Entry|Entries]) end; - _ -> % all | no_tail when Lc==false + _ -> % all | no_tail when Lc =:= false put(stack, [Entry|get(stack)]) end. @@ -413,10 +413,10 @@ sublist(L, Start, Length) -> lists:sublist(L, Start, Length). fix_stacktrace2([{_,{{M,F,As1},_,_}}, {_,{{M,F,As2},_,_}}|_]) - when length(As1)==length(As2) -> + when length(As1) =:= length(As2) -> [{M,F,As1}]; fix_stacktrace2([{_,{{Fun,As1},_,_}}, {_,{{Fun,As2},_,_}}|_]) - when length(As1)==length(As2) -> + when length(As1) =:= length(As2) -> [{Fun,As1}]; fix_stacktrace2([{_,{MFA,_,_}}|Entries]) -> [MFA|fix_stacktrace2(Entries)]; @@ -465,9 +465,9 @@ stack_frame(SP, Dir, [{SP, _}|Stack]) -> case Stack of [{Le, {_MFA,Where,Bs}}|_] -> {Le, Where, Bs}; - [] when Dir==up -> + [] when Dir =:= up -> top; - [] when Dir==down -> + [] when Dir =:= down -> bottom end; stack_frame(SP, Dir, [_Entry|Stack]) -> @@ -509,7 +509,7 @@ trace(What, Args, true) -> end, io_lib:format(" (~w) receive " ++ Tail, [Le]); - received when Args==null -> + received when Args =:= null -> io_lib:format("~n", []); received -> % Args=Msg io_lib:format("~n<== ~p~n", [Args]); @@ -586,8 +586,8 @@ eval_mfa(Debugged, M, F, As, Ieval) -> end. eval_function(Mod, Fun, As0, Bs0, _Called, Ieval) when is_function(Fun); - Mod==?MODULE, - Fun==eval_fun -> + Mod =:= ?MODULE, + Fun =:= eval_fun -> #ieval{level=Le, line=Li, last_call=Lc} = Ieval, case lambda(Fun, As0) of {Cs,Module,Name,As,Bs} -> @@ -657,7 +657,7 @@ eval_function(Mod, Name, As0, Bs0, Called, Ieval) -> lambda(eval_fun, [Cs,As,Bs,{Mod,Name}=F]) -> %% Fun defined in interpreted code, called from outside if - length(element(3,hd(Cs))) == length(As) -> + length(element(3,hd(Cs))) =:= length(As) -> db_ref(Mod), %% Adds ref between module and process {Cs,Mod,Name,As,Bs}; true -> @@ -672,7 +672,7 @@ lambda(Fun, As) when is_function(Fun) -> {env, [{Mod,Name},Bs,Cs]} = erlang:fun_info(Fun, env), {arity, Arity} = erlang:fun_info(Fun, arity), if - length(As) == Arity -> + length(As) =:= Arity -> db_ref(Mod), %% Adds ref between module and process {Cs,Mod,Name,As,Bs}; true -> @@ -731,7 +731,7 @@ db_ref(Mod) -> ModDb -> Node = node(get(int)), DbRef = if - Node/=node() -> {Node,ModDb}; + Node =/= node() -> {Node,ModDb}; true -> ModDb end, put([Mod|db], DbRef), @@ -741,13 +741,12 @@ db_ref(Mod) -> DbRef end. - cache(Key, Data) -> put(cache, lists:sublist([{Key,Data}|get(cache)], 5)). cached(Key) -> - case lists:keysearch(Key, 1, get(cache)) of - {value,{Key,Data}} -> Data; + case lists:keyfind(Key, 1, get(cache)) of + {Key,Data} -> Data; false -> false end. @@ -844,7 +843,7 @@ expr({'try',Line,Es,CaseCs,CatchCs,[]}, Bs0, Ieval0) -> case_clauses(Val, CaseCs, Bs, try_clause, Ieval) end catch - Class:Reason when CatchCs=/=[] -> + Class:Reason when CatchCs =/= [] -> catch_clauses({Class,Reason,[]}, CatchCs, Bs0, Ieval) end; expr({'try',Line,Es,CaseCs,CatchCs,As}, Bs0, Ieval0) -> @@ -1498,10 +1497,7 @@ guard(Gs, Bs) -> or_guard(Gs, Bs). or_guard([G|Gs], Bs) -> %% Short-circuit OR. - case and_guard(G, Bs) of - true -> true; - false -> or_guard(Gs, Bs) - end; + and_guard(G, Bs) orelse or_guard(Gs, Bs); or_guard([], _) -> false. and_guard([G|Gs], Bs) -> @@ -1598,8 +1594,7 @@ match1({bin,_,Fs}, B, Bs0, BBs0) when is_bitstring(B) -> try eval_bits:match_bits(Fs, B, Bs1, BBs, fun(L, R, Bs) -> match1(L, R, Bs, BBs) end, fun(E, Bs) -> expr(E, Bs, #ieval{}) end, - false) of - Match -> Match + false) catch _:_ -> throw(nomatch) end; @@ -1687,7 +1682,7 @@ merge_bindings([{Name,V}|B1s], B2s, Ieval) -> case binding(Name, B2s) of {value,V} -> % Already there, and the same merge_bindings(B1s, B2s, Ieval); - {value,_} when Name=='_' -> % Already there, but anonymous + {value,_} when Name =:= '_' -> % Already there, but anonymous B2s1 = lists:keydelete('_', 1, B2s), [{Name,V}|merge_bindings(B1s, B2s1, Ieval)]; {value,_} -> % Already there, but different => badmatch diff --git a/lib/debugger/src/dbg_iload.erl b/lib/debugger/src/dbg_iload.erl index ec54c646c8..2ae0c333da 100644 --- a/lib/debugger/src/dbg_iload.erl +++ b/lib/debugger/src/dbg_iload.erl @@ -26,7 +26,7 @@ %%-------------------------------------------------------------------- %% load_mod(Mod, File, Binary, Db) -> {ok, Mod} -%% Mod = atom() +%% Mod = module() %% File = string() Source file (including path) %% Binary = binary() %% Db = ETS identifier @@ -408,8 +408,7 @@ expr({call,Line,{remote,_,{atom,_,erlang},{atom,_,fault}},[_]=As}) -> {dbg,Line,fault,expr_list(As)}; expr({call,Line,{remote,_,{atom,_,erlang},{atom,_,exit}},[_]=As}) -> {dbg,Line,exit,expr_list(As)}; -expr({call,Line,{remote,_,{atom,_,erlang},{atom,_,apply}},As0}) - when length(As0) == 3 -> +expr({call,Line,{remote,_,{atom,_,erlang},{atom,_,apply}},[_,_,_]=As0}) -> As = expr_list(As0), {apply,Line,As}; expr({call,Line,{remote,_,{atom,_,Mod},{atom,_,Func}},As0}) -> @@ -517,15 +516,9 @@ expr(Other) -> %% here as sys_pre_expand has transformed source. is_guard_test({op,_,Op,L,R}) -> - case erl_internal:comp_op(Op, 2) of - true -> is_gexpr_list([L,R]); - false -> false - end; + erl_internal:comp_op(Op, 2) andalso is_gexpr_list([L,R]); is_guard_test({call,_,{remote,_,{atom,_,erlang},{atom,_,Test}},As}) -> - case erl_internal:type_test(Test, length(As)) of - true -> is_gexpr_list(As); - false -> false - end; + erl_internal:type_test(Test, length(As)) andalso is_gexpr_list(As); is_guard_test({atom,_,true}) -> true; is_guard_test(_) -> false. @@ -542,22 +535,12 @@ is_gexpr({call,_,{remote,_,{atom,_,erlang},{atom,_,F}},As}) -> Ar = length(As), case erl_internal:guard_bif(F, Ar) of true -> is_gexpr_list(As); - false -> - case erl_internal:arith_op(F, Ar) of - true -> is_gexpr_list(As); - false -> false - end + false -> erl_internal:arith_op(F, Ar) andalso is_gexpr_list(As) end; is_gexpr({op,_,Op,A}) -> - case erl_internal:arith_op(Op, 1) of - true -> is_gexpr(A); - false -> false - end; + erl_internal:arith_op(Op, 1) andalso is_gexpr(A); is_gexpr({op,_,Op,A1,A2}) -> - case erl_internal:arith_op(Op, 2) of - true -> is_gexpr_list([A1,A2]); - false -> false - end; + erl_internal:arith_op(Op, 2) andalso is_gexpr_list([A1,A2]); is_gexpr(_) -> false. is_gexpr_list(Es) -> lists:all(fun (E) -> is_gexpr(E) end, Es). diff --git a/lib/debugger/src/dbg_iserver.erl b/lib/debugger/src/dbg_iserver.erl index 4c1e9ccb7b..59188d83a2 100644 --- a/lib/debugger/src/dbg_iserver.erl +++ b/lib/debugger/src/dbg_iserver.erl @@ -155,11 +155,8 @@ handle_call(get_stack_trace, _From, State) -> %% Retrieving information handle_call(snapshot, _From, State) -> - Reply = lists:map(fun(Proc) -> - {Proc#proc.pid, Proc#proc.function, - Proc#proc.status, Proc#proc.info} - end, - State#state.procs), + Reply = [{Proc#proc.pid, Proc#proc.function, + Proc#proc.status, Proc#proc.info} || Proc <- State#state.procs], {reply, Reply, State}; handle_call({get_meta, Pid}, _From, State) -> Reply = case get_proc({pid, Pid}, State#state.procs) of @@ -181,21 +178,21 @@ handle_call({get_attpid, Pid}, _From, State) -> %% Breakpoint handling handle_call({new_break, Point, Options}, _From, State) -> - case lists:keysearch(Point, 1, State#state.breaks) of + case lists:keymember(Point, 1, State#state.breaks) of false -> Break = {Point, Options}, send_all([subscriber, meta, attached], {new_break, Break}, State), Breaks = keyinsert(Break, 1, State#state.breaks), {reply, ok, State#state{breaks=Breaks}}; - {value, _Break} -> + true -> {reply, {error, break_exists}, State} end; handle_call(all_breaks, _From, State) -> {reply, State#state.breaks, State}; handle_call({all_breaks, Mod}, _From, State) -> Reply = lists:filter(fun({{M,_L}, _Options}) -> - if M==Mod -> true; true -> false end + M =/= Mod end, State#state.breaks), {reply, Reply, State}; @@ -276,7 +273,7 @@ handle_call({contents, Mod, Pid}, _From, State) -> Db = State#state.db, [{{Mod, refs}, ModDbs}] = ets:lookup(Db, {Mod, refs}), ModDb = if - Pid==any -> hd(ModDbs); + Pid =:= any -> hd(ModDbs); true -> lists:foldl(fun(T, not_found) -> [{T, Pids}] = ets:lookup(Db, T), @@ -295,7 +292,7 @@ handle_call({raw_contents, Mod, Pid}, _From, State) -> Db = State#state.db, [{{Mod, refs}, ModDbs}] = ets:lookup(Db, {Mod, refs}), ModDb = if - Pid==any -> hd(ModDbs); + Pid =:= any -> hd(ModDbs); true -> lists:foldl(fun(T, not_found) -> [{T, Pids}] = ets:lookup(Db, T), @@ -360,15 +357,15 @@ handle_cast({set_stack_trace, Flag}, State) -> %% Retrieving information handle_cast(clear, State) -> Procs = lists:filter(fun(#proc{status=Status}) -> - if Status==exit -> false; true -> true end + Status =/= exit end, State#state.procs), {noreply, State#state{procs=Procs}}; %% Breakpoint handling handle_cast({delete_break, Point}, State) -> - case lists:keysearch(Point, 1, State#state.breaks) of - {value, _Break} -> + case lists:keymember(Point, 1, State#state.breaks) of + true -> send_all([subscriber, meta, attached], {delete_break, Point}, State), Breaks = lists:keydelete(Point, 1, State#state.breaks), @@ -377,8 +374,8 @@ handle_cast({delete_break, Point}, State) -> {noreply, State} end; handle_cast({break_option, Point, Option, Value}, State) -> - case lists:keysearch(Point, 1, State#state.breaks) of - {value, {Point, Options}} -> + case lists:keyfind(Point, 1, State#state.breaks) of + {Point, Options} -> N = case Option of status -> 1; action -> 2; @@ -399,7 +396,7 @@ handle_cast(no_break, State) -> handle_cast({no_break, Mod}, State) -> send_all([subscriber, meta, attached], {no_break, Mod}, State), Breaks = lists:filter(fun({{M, _L}, _O}) -> - if M==Mod -> false; true -> true end + M =/= Mod end, State#state.breaks), {noreply, State#state{breaks=Breaks}}; @@ -409,7 +406,7 @@ handle_cast({set_status, Meta, Status, Info}, State) -> {true, Proc} = get_proc({meta, Meta}, State#state.procs), send_all(subscriber, {new_status, Proc#proc.pid, Status, Info}, State), if - Status==break -> + Status =:= break -> auto_attach(break, State#state.auto, Proc); true -> ignore end, @@ -526,11 +523,10 @@ code_change(_OldVsn, State, _Extra) -> %% Internal functions %%==================================================================== -auto_attach(Why, Auto, Proc) when is_record(Proc, proc) -> - case Proc#proc.attpid of - AttPid when is_pid(AttPid) -> ignore; - undefined -> - auto_attach(Why, Auto, Proc#proc.pid) +auto_attach(Why, Auto, #proc{attpid = Attpid, pid = Pid}) -> + case Attpid of + undefined -> auto_attach(Why, Auto, Pid); + _ when is_pid(Attpid) -> ignore end; auto_attach(Why, Auto, Pid) when is_pid(Pid) -> case Auto of @@ -545,7 +541,7 @@ auto_attach(Why, Auto, Pid) when is_pid(Pid) -> keyinsert(Tuple1, N, [Tuple2|Tuples]) -> if - element(N, Tuple1)<element(N, Tuple2) -> + element(N, Tuple1) < element(N, Tuple2) -> [Tuple1, Tuple2|Tuples]; true -> [Tuple2 | keyinsert(Tuple1, N, Tuples)] @@ -576,7 +572,7 @@ send_all([], _Msg, _State) -> ok; send_all(subscriber, Msg, State) -> send_all(State#state.subs, Msg); send_all(meta, Msg, State) -> - Metas = lists:map(fun(Proc) -> Proc#proc.meta end, State#state.procs), + Metas = [Proc#proc.meta || Proc <- State#state.procs], send_all(Metas, Msg); send_all(attached, Msg, State) -> AttPids= mapfilter(fun(Proc) -> @@ -600,7 +596,7 @@ get_proc({Type, Pid}, Procs) -> meta -> #proc.meta; attpid -> #proc.attpid end, - case lists:keysearch(Pid, Index, Procs) of - {value, Proc} -> {true, Proc}; - false -> false + case lists:keyfind(Pid, Index, Procs) of + false -> false; + Proc -> {true, Proc} end. diff --git a/lib/debugger/src/dbg_ui_break_win.erl b/lib/debugger/src/dbg_ui_break_win.erl index a56fe36828..0c1e25e703 100644 --- a/lib/debugger/src/dbg_ui_break_win.erl +++ b/lib/debugger/src/dbg_ui_break_win.erl @@ -268,12 +268,7 @@ handle_event({gs, _Id, click, _Data, ["Ok"|_]}, WinInfo) -> IndexL -> Funcs = WinInfo#winInfo.funcs, Breaks = - lists:map(fun(Index) -> - Func = lists:nth(Index+1, - Funcs), - [Mod | Func] - end, - IndexL), + [[Mod|lists:nth(Index+1, Funcs)] || Index <- IndexL], {break, Breaks, enable} end end; diff --git a/lib/debugger/src/dbg_ui_filedialog_win.erl b/lib/debugger/src/dbg_ui_filedialog_win.erl index f7d76076a5..79ccf20946 100644 --- a/lib/debugger/src/dbg_ui_filedialog_win.erl +++ b/lib/debugger/src/dbg_ui_filedialog_win.erl @@ -202,8 +202,7 @@ handle_event({gs, 'Files', doubleclick, _Data, _Arg}, WinInfo) -> handle_event({gs, _Id, click, select, _Arg}, _WinInfo) -> {select, gs:read('Selection', text)}; handle_event({gs, _Id, click, multiselect, _Arg}, WinInfo) -> - Files = lists:map(fun(File) -> untag(File) end, - gs:read('Files', items)), + Files = [untag(File) || File <- gs:read('Files', items)], {multiselect, WinInfo#winInfo.cwd, Files}; handle_event({gs, _Id, click, filter, _Arg}, WinInfo) -> {Cwd, Pattern} = update_win(gs:read('Filter', text), @@ -286,7 +285,7 @@ max_existing([Name | Names]) -> max_existing(Dir, [Name | Names]) -> Dir2 = filename:join(Dir, Name), case filelib:is_file(Dir2, erl_prim_loader) of - true when Names==[] -> {Dir2, []}; + true when Names =:= [] -> {Dir2, []}; true -> max_existing(Dir2, Names); false -> {Dir, [Name | Names]} end. @@ -309,11 +308,8 @@ extra_filter([], _Dir, _Fun) -> []. get_subdirs(Dir) -> case erl_prim_loader:list_dir(Dir) of {ok, FileNames} -> - X = lists:filter(fun(FileName) -> - File = filename:join(Dir, FileName), - filelib:is_dir(File, erl_prim_loader) - end, - FileNames), + X = [FN || FN <- FileNames, + filelib:is_dir(filename:join(Dir, FN), erl_prim_loader)], lists:sort(X); _Error -> [] @@ -335,4 +331,3 @@ compare([], [$/|File]) -> File; compare(_, _) -> error. - diff --git a/lib/debugger/src/dbg_ui_mon.erl b/lib/debugger/src/dbg_ui_mon.erl index 8888075124..82fe210968 100644 --- a/lib/debugger/src/dbg_ui_mon.erl +++ b/lib/debugger/src/dbg_ui_mon.erl @@ -162,7 +162,7 @@ init2(CallingPid, Mode, SFile, GS) -> CallingPid ! {initialization_complete, self()}, if - SFile==default -> + SFile =:= default -> loop(State3); true -> loop(load_settings(SFile, State3)) @@ -226,7 +226,7 @@ loop(State) -> gui_cmd(stopped, State); %% From the GUI - GuiEvent when is_tuple(GuiEvent), element(1, GuiEvent)==gs -> + GuiEvent when is_tuple(GuiEvent), element(1, GuiEvent) =:= gs -> Cmd = dbg_ui_mon_win:handle_event(GuiEvent,State#state.win), State2 = gui_cmd(Cmd, State), loop(State2); @@ -269,7 +269,7 @@ gui_cmd(ignore, State) -> State; gui_cmd(stopped, State) -> if - State#state.starter==true -> int:stop(); + State#state.starter =:= true -> int:stop(); true -> int:auto_attach(false) end, exit(stop); @@ -413,9 +413,9 @@ gui_cmd({'Trace Window', TraceWin}, State) -> State2; gui_cmd({'Auto Attach', When}, State) -> if - When==[] -> int:auto_attach(false); + When =:= [] -> int:auto_attach(false); true -> - Flags = lists:map(fun(Name) -> map(Name) end, When), + Flags = [map(Name) || Name <- When], int:auto_attach(Flags, trace_function(State)) end, State; @@ -676,7 +676,7 @@ load_settings2(Settings, State) -> Break, int:break(Mod, Line), if - Status==inactive -> + Status =:= inactive -> int:disable_break(Mod, Line); true -> ignore end, @@ -700,12 +700,8 @@ save_settings(SFile, State) -> int:auto_attach(), int:stack_trace(), State#state.backtrace, - lists:map(fun(Mod) -> - int:file(Mod) - end, - int:interpreted()), + [int:file(Mod) || Mod <- int:interpreted()], int:all_breaks()}, - Binary = term_to_binary({debugger_settings, Settings}), case file:write_file(SFile, Binary) of ok -> @@ -720,13 +716,12 @@ save_settings(SFile, State) -> %%==================================================================== registered_name(Pid) -> - %% Yield in order to give Pid more time to register its name timer:sleep(200), Node = node(Pid), if - Node==node() -> + Node =:= node() -> case erlang:process_info(Pid, registered_name) of {registered_name, Name} -> Name; _ -> undefined diff --git a/lib/debugger/src/dbg_ui_mon_win.erl b/lib/debugger/src/dbg_ui_mon_win.erl index ba2f94c550..66e59a822a 100644 --- a/lib/debugger/src/dbg_ui_mon_win.erl +++ b/lib/debugger/src/dbg_ui_mon_win.erl @@ -224,8 +224,7 @@ select(MenuItem, Bool) -> %%-------------------------------------------------------------------- add_module(WinInfo, Menu, Mod) -> Modules = WinInfo#winInfo.modules, - case lists:keysearch(Mod, #moduleInfo.module, Modules) of - {value, _ModInfo} -> WinInfo; + case lists:keymember(Mod, #moduleInfo.module, Modules) of false -> %% Create a menu for the module Font = dbg_ui_win:font(normal), @@ -244,7 +243,8 @@ add_module(WinInfo, Menu, Mod) -> gs:config(WinInfo#winInfo.listbox, {add, Mod}), ModInfo = #moduleInfo{module=Mod, menubtn=MenuBtn}, - WinInfo#winInfo{modules=[ModInfo | Modules]} + WinInfo#winInfo{modules=[ModInfo | Modules]}; + true -> WinInfo end. %%-------------------------------------------------------------------- @@ -491,14 +491,13 @@ handle_event({gs, _Id, click, autoattach, _Arg}, WinInfo) -> %% Process grid handle_event({gs, _Id, keypress, _Data, [Key|_]}, WinInfo) when - Key=='Up'; Key=='Down' -> - Dir = if Key=='Up' -> up; Key=='Down' -> down end, + Key =:= 'Up'; Key =:= 'Down' -> + Dir = if Key =:= 'Up' -> up; Key =:= 'Down' -> down end, Row = move(WinInfo, Dir), - if Row>1 -> WinInfo2 = highlight(WinInfo, Row), - {value, #procInfo{pid=Pid}} = - lists:keysearch(Row, #procInfo.row, WinInfo#winInfo.processes), + #procInfo{pid=Pid} = + lists:keyfind(Row, #procInfo.row, WinInfo#winInfo.processes), {focus, Pid, WinInfo2}; true -> ignore @@ -515,10 +514,9 @@ handle_event(_GSEvent, _WinInfo) -> move(WinInfo, Dir) -> Row = WinInfo#winInfo.focus, Last = WinInfo#winInfo.row, - if - Dir==up, Row>1 -> Row-1; - Dir==down, Row<Last -> Row+1; + Dir =:= up, Row > 1 -> Row-1; + Dir =:= down, Row < Last -> Row+1; true -> Row end. @@ -533,7 +531,6 @@ highlight(WinInfo, Row) -> GridLine2 = gs:read(Grid, {obj_at_row, Row}), gs:config(GridLine2, {fg, white}), WinInfo#winInfo{focus=Row}. - %%==================================================================== %% Internal functions @@ -545,7 +542,7 @@ configure(WinInfo, {W, H}) -> Dx = NewW - gs:read(Grid, width), Dy = H-42 - gs:read(Grid, height), if - (Dx+Dy)=/=0 -> + (Dx+Dy) =/= 0 -> gs:config(Grid, [{width, NewW}, {height, H-30}]), Cols = calc_columnwidths(NewW), gs:config(Grid, Cols); @@ -555,10 +552,9 @@ configure(WinInfo, {W, H}) -> calc_columnwidths(Width) -> W = if - Width=<?Wg -> ?Wg; + Width =< ?Wg -> ?Wg; true -> Width end, - First = lists:map(fun (X) -> round(X) end, - [0.13*W, 0.27*W, 0.18*W, 0.18*W]), + First = [round(X) || X <- [0.13*W, 0.27*W, 0.18*W, 0.18*W]], Last = W - lists:sum(First) - 30, {columnwidths, First++[Last]}. diff --git a/lib/debugger/src/dbg_ui_trace_win.erl b/lib/debugger/src/dbg_ui_trace_win.erl index c6f041a63d..82d4199630 100644 --- a/lib/debugger/src/dbg_ui_trace_win.erl +++ b/lib/debugger/src/dbg_ui_trace_win.erl @@ -147,17 +147,17 @@ configure(WinInfo, TraceWin) -> H = gs:read(Win, height), H2 = if - Bu1==close, Bu2==open -> + Bu1 =:= close, Bu2 =:= open -> resize_button_area(open, width, W-4), gs:config('ButtonArea', {height, 30}), H+30; - Bu1==open, Bu2==close -> + Bu1 =:= open, Bu2 =:= close -> gs:config('ButtonArea', [{width, 0}, {height, 0}]), H-30; true -> H end, H3 = if - Ev1==close, Ev2==open, Bi1==open -> + Ev1 =:= close, Ev2 =:= open, Bi1 =:= open -> Wnew1 = round((W-10-4)/2), % W = window/2 - rb - pads Hbi1 = gs:read('BindArea', height), % H = bind area h resize_eval_area(open, width, Wnew1), @@ -167,25 +167,25 @@ configure(WinInfo, TraceWin) -> resize_bind_area(open, width, Wnew1-gs:read('BindArea', width)), H2; - Ev1==close, Ev2==open, Bi1==close -> + Ev1 =:= close, Ev2 =:= open, Bi1 =:= close -> resize_eval_area(open, width, W-4), resize_eval_area(open, height, 200), H2+200; - Ev1==open, Ev2==close, Bi1==open -> + Ev1 =:= open, Ev2 =:= close, Bi1 =:= open -> gs:config('EvalArea', [{width,0}, {height,0}]), gs:config('RB3', [{width, 0}, {height, 0}]), Wnew2 = W-4, resize_bind_area(open, width, Wnew2-gs:read('BindArea', width)), H2; - Ev1==open, Ev2==close, Bi1==close -> + Ev1 =:= open, Ev2 =:= close, Bi1 =:= close -> Hs1 = gs:read('EvalArea', height), gs:config('EvalArea', [{width, 0}, {height, 0}]), H2-Hs1; true -> H2 end, H4 = if - Bi1==close, Bi2==open, Ev2==open -> + Bi1 =:= close, Bi2 =:= open, Ev2 =:= open -> Wnew3 = round((W-10-4)/2), % W = window/2 - rb - pads Hs2 = gs:read('EvalArea', height), % H = eval area h resize_bind_area(open, width, Wnew3), @@ -194,29 +194,29 @@ configure(WinInfo, TraceWin) -> resize_eval_area(open, width, Wnew3-gs:read('EvalArea', width)), H3; - Bi1==close, Bi2==open, Ev2==close -> + Bi1 =:= close, Bi2 =:= open, Ev2 =:= close -> resize_bind_area(open, width, W-4), resize_bind_area(open, height, 200), H3+200; - Bi1==open, Bi2==close, Ev2==open -> + Bi1 =:= open, Bi2 =:= close, Ev2 =:= open -> gs:config('BindArea', [{width, 0}, {height, 0}]), gs:config('RB3', [{width, 0}, {height, 0}]), Wnew4 = W-4, resize_eval_area(open, width, Wnew4-gs:read('EvalArea', width)), H3; - Bi1==open, Bi2==close, Ev2==close -> + Bi1 =:= open, Bi2 =:= close, Ev2 =:= close -> Hbi2 = gs:read('BindArea', height), gs:config('BindArea', [{width, 0}, {height, 0}]), H3-Hbi2; true -> H3 end, H5 = if - Tr1==close, Tr2==open -> + Tr1 =:= close, Tr2 =:= open -> resize_trace_area(open, width, W-4), resize_trace_area(open, height, 200), H4+200; - Tr1==open, Tr2==close -> + Tr1 =:= open, Tr2 =:= close -> Hf = gs:read('TraceArea', height), gs:config('TraceArea', [{width, 0}, {height, 0}]), H4-Hf; @@ -226,10 +226,10 @@ configure(WinInfo, TraceWin) -> RB1old = rb1(OldFlags), RB1new = rb1(NewFlags), if - RB1old==close, RB1new==open -> + RB1old =:= close, RB1new =:= open -> gs:config('RB1', [{width, W-4}, {height, 10}]), gs:config(Win, {height, gs:read(Win, height)+10}); - RB1old==open, RB1new==close -> + RB1old =:= open, RB1new =:= close -> gs:config('RB1', [{width, 0}, {height, 0}, lower]), gs:config(Win, {height, gs:read(Win, height)-10}); true -> ignore @@ -237,10 +237,10 @@ configure(WinInfo, TraceWin) -> RB2old = rb2(OldFlags), RB2new = rb2(NewFlags), if - RB2old==close, RB2new==open -> + RB2old =:= close, RB2new =:= open -> gs:config('RB2', [{width, W-4}, {height, 10}]), gs:config(Win, {height,gs:read(Win, height)+10}); - RB2old==open, RB2new==close -> + RB2old =:= open, RB2new =:= close -> gs:config('RB2', [{width, 0}, {height, 0}, lower]), gs:config(Win, {height, gs:read(Win, height)-10}); true -> ignore @@ -301,15 +301,15 @@ select(MenuItem, Bool) -> %% Cond = null | {Mod, Func} %%-------------------------------------------------------------------- add_break(WinInfo, Menu, {{Mod,Line},[Status|_Options]}=Break) -> - case lists:keysearch(Mod, 1, WinInfo#winInfo.editors) of - {value, {Mod, Editor}} -> + case lists:keyfind(Mod, 1, WinInfo#winInfo.editors) of + {Mod, Editor} -> add_break_to_code(Editor, Line, Status); false -> ignore end, add_break_to_menu(WinInfo, Menu, Break). add_break_to_code(Editor, Line, Status) -> - Color = if Status==active -> red; Status==inactive -> blue end, + Color = if Status =:= active -> red; Status =:= inactive -> blue end, config_editor(Editor, [{overwrite,{{Line,0},"-@- "}}, {fg,{{{Line,0},{Line,lineend}}, Color}}]). @@ -330,8 +330,8 @@ add_break_to_menu(WinInfo, Menu, {Point, [Status|_Options]=Options}) -> %% Cond = null | {Mod, Func} %%-------------------------------------------------------------------- update_break(WinInfo, {{Mod,Line},[Status|_Options]}=Break) -> - case lists:keysearch(Mod, 1, WinInfo#winInfo.editors) of - {value, {Mod, Editor}} -> + case lists:keyfind(Mod, 1, WinInfo#winInfo.editors) of + {Mod, Editor} -> add_break_to_code(Editor, Line, Status); false -> ignore end, @@ -352,8 +352,8 @@ update_break_in_menu(WinInfo, {Point, [Status|_Options]=Options}) -> %% Point = {Mod, Line} %%-------------------------------------------------------------------- delete_break(WinInfo, {Mod,Line}=Point) -> - case lists:keysearch(Mod, 1, WinInfo#winInfo.editors) of - {value, {Mod, Editor}} -> delete_break_from_code(Editor, Line); + case lists:keyfind(Mod, 1, WinInfo#winInfo.editors) of + {Mod, Editor} -> delete_break_from_code(Editor, Line); false -> ignore end, delete_break_from_menu(WinInfo, Point). @@ -379,11 +379,11 @@ clear_breaks(WinInfo) -> clear_breaks(WinInfo, all). clear_breaks(WinInfo, Mod) -> Remove = if - Mod==all -> WinInfo#winInfo.breaks; + Mod =:= all -> WinInfo#winInfo.breaks; true -> lists:filter(fun(#breakInfo{point={Mod2,_L}}) -> if - Mod2==Mod -> true; + Mod2 =:= Mod -> true; true -> false end end, @@ -450,8 +450,8 @@ display(Arg) -> %% Note: remove_code/2 should not be used for currently shown module. %%-------------------------------------------------------------------- is_shown(WinInfo, Mod) -> - case lists:keysearch(Mod, 1, WinInfo#winInfo.editors) of - {value, {Mod, Editor}} -> + case lists:keyfind(Mod, 1, WinInfo#winInfo.editors) of + {Mod, Editor} -> gs:config(Editor, raise), {true, WinInfo#winInfo{editor={Mod, Editor}}}; false -> false @@ -459,24 +459,22 @@ is_shown(WinInfo, Mod) -> show_code(WinInfo, Mod, Contents) -> Editors = WinInfo#winInfo.editors, - {Flag, Editor} = case lists:keysearch(Mod, 1, Editors) of - {value, {Mod, Ed}} -> {existing, Ed}; + {Flag, Editor} = case lists:keyfind(Mod, 1, Editors) of + {Mod, Ed} -> {existing, Ed}; false -> {new, code_editor()} end, - %% Insert code and update breakpoints, if any config_editor(Editor, [raise, clear]), show_code(Editor, Contents), lists:foreach(fun(BreakInfo) -> case BreakInfo#breakInfo.point of - {Mod2, Line} when Mod2==Mod -> + {Mod2, Line} when Mod2 =:= Mod -> Status = BreakInfo#breakInfo.status, add_break_to_code(Editor, Line,Status); _Point -> ignore end end, WinInfo#winInfo.breaks), - case Flag of existing -> WinInfo#winInfo{editor={Mod, Editor}}; @@ -485,7 +483,7 @@ show_code(WinInfo, Mod, Contents) -> editors=[{Mod, Editor} | Editors]} end. -show_code(Editor, Text) when length(Text)>1500 -> +show_code(Editor, Text) when length(Text) > 1500 -> %% Add some text at a time so that other processes may get scheduled Str = string:sub_string(Text, 1, 1500), config_editor(Editor, {insert,{'end', Str}}), @@ -494,21 +492,19 @@ show_code(Editor, Text) -> config_editor(Editor, {insert,{'end',Text}}). show_no_code(WinInfo) -> - {value, {'$top', Editor}} = - lists:keysearch('$top', 1, WinInfo#winInfo.editors), + {'$top', Editor} = lists:keyfind('$top', 1, WinInfo#winInfo.editors), gs:config(Editor, raise), WinInfo#winInfo{editor={'$top', Editor}}. remove_code(WinInfo, Mod) -> Editors = WinInfo#winInfo.editors, - case lists:keysearch(Mod, 1, Editors) of - {value, {Mod, Editor}} -> + case lists:keyfind(Mod, 1, Editors) of + {Mod, Editor} -> gs:destroy(Editor), WinInfo#winInfo{editors=lists:keydelete(Mod, 1, Editors)}; false -> WinInfo end. - %%-------------------------------------------------------------------- %% mark_line(WinInfo, Line, How) -> WinInfo @@ -522,7 +518,7 @@ mark_line(WinInfo, Line, How) -> mark_line2(Editor, WinInfo#winInfo.marked_line, false), mark_line2(Editor, Line, How), if - Line/=0 -> config_editor(Editor, {vscrollpos, Line-5}); + Line =/= 0 -> config_editor(Editor, {vscrollpos, Line-5}); true -> ignore end, WinInfo#winInfo{marked_line=Line}. @@ -537,7 +533,7 @@ mark_line2(Editor, Line, How) -> false -> " " end, Font = if - How==false -> dbg_ui_win:font(normal); + How =:= false -> dbg_ui_win:font(normal); true -> dbg_ui_win:font(bold) end, config_editor(Editor, [{overwrite, {{Line,5}, Prefix}}, @@ -558,10 +554,10 @@ select_line(WinInfo, Line) -> %% help window, it must be checked that it is correct Size = gs:read(Editor, size), if - Line==0 -> + Line =:= 0 -> select_line(Editor, WinInfo#winInfo.selected_line, false), WinInfo#winInfo{selected_line=0}; - Line<Size -> + Line < Size -> select_line(Editor, Line, true), config_editor(Editor, {vscrollpos, Line-5}), WinInfo#winInfo{selected_line=Line}; @@ -712,10 +708,10 @@ handle_event({gs, Editor, buttonpress, code_editor, _Arg}, WinInfo) -> {Row, _} -> {Mod, _Editor} = WinInfo#winInfo.editor, Point = {Mod, Row}, - case lists:keysearch(Point, #breakInfo.point, + case lists:keymember(Point, #breakInfo.point, WinInfo#winInfo.breaks) of - {value, _BreakInfo} -> {break, Point, delete}; - false -> {break, Point, add} + false -> {break, Point, add}; + true -> {break, Point, delete} end; {Row2, _} -> select_line(Editor, Row2, true), @@ -776,7 +772,7 @@ code_editor() -> code_editor(Name, W, H) -> Editor = if - Name==null -> gs:editor('CodeArea', []); + Name =:= null -> gs:editor('CodeArea', []); true -> gs:editor(Name, 'CodeArea', []) end, gs:config(Editor, [{x,5}, {y,30}, {width,W}, {height,H}, @@ -814,8 +810,8 @@ buttons() -> {'Where','WhereButton'}, {'Up','UpButton'}, {'Down','DownButton'}]. is_button(Name) -> - case lists:keysearch(Name, 1, buttons()) of - {value, {Name, Button}} -> {true, Button}; + case lists:keyfind(Name, 1, buttons()) of + {Name, Button} -> {true, Button}; false -> false end. @@ -847,7 +843,7 @@ resize_button_area(open, width, Diff) -> eval_area({Ev,Bi}, X, Y, FrameOpts, Win) -> {W,H} = if - Ev==open -> {289,200}; + Ev =:= open -> {289,200}; true -> {0,0} end, Font = dbg_ui_win:font(normal), @@ -870,7 +866,7 @@ eval_area({Ev,Bi}, X, Y, FrameOpts, Win) -> {font_style,{{{1,0},'end'},Font}}]), gs:config('EvalEditor', {enable, false}), if - Ev==open, Bi==close -> resize_eval_area(Ev, width, 257); + Ev =:= open, Bi =:= close -> resize_eval_area(Ev, width, 257); true -> ignore end. @@ -891,7 +887,7 @@ resize_eval_area(open, Key, Diff) -> bind_area({Ev,Bi}, X, Y, FrameOpts, Win) -> {W,H} = if - Bi==open -> {249,200}; + Bi =:= open -> {249,200}; true -> {0,0} end, gs:frame('BindArea', Win, @@ -908,7 +904,7 @@ bind_area({Ev,Bi}, X, Y, FrameOpts, Win) -> {text,{1,"Name"}}, {text,{2,"Value"}}, {font,Font}]), gs:config('BindGrid', {rows,{1,1}}), if - Bi==open, Ev==close -> resize_bind_area(Bi, width, 297); + Bi =:= open, Ev =:= close -> resize_bind_area(Bi, width, 297); true -> ignore end. @@ -993,15 +989,15 @@ resizebar(Flag, Name, X, Y, W, H, Obj) -> rb1({_Bu,Ev,Bi,Tr}) -> if - Ev==close, Bi==close, Tr==close -> close; + Ev =:= close, Bi =:= close, Tr =:= close -> close; true -> open end. rb2({_Bu,Ev,Bi,Tr}) -> if - Tr==open -> + Tr =:= open -> if - Ev==close, Bi==close -> close; + Ev =:= close, Bi =:= close -> close; true -> open end; true -> close @@ -1009,7 +1005,7 @@ rb2({_Bu,Ev,Bi,Tr}) -> rb3({_Bu,Ev,Bi,_Tr}) -> if - Ev==open, Bi==open -> open; + Ev =:= open, Bi =:= open -> open; true -> close end. @@ -1067,7 +1063,7 @@ configure(WinInfo, NewW, NewH) -> %% Adjust width unless it is unchanged or less than minimum width if - OldW/=NewW -> + OldW =/= NewW -> {Dcode,Deval,Dbind} = configure_widths(OldW,NewW,Flags), resize_code_area(WinInfo, width, Dcode), case rb1(Flags) of @@ -1090,7 +1086,7 @@ configure(WinInfo, NewW, NewH) -> %% Adjust height unless it is unchanged or less than minimum height if - OldH/=NewH -> + OldH =/= NewH -> {Dcode2,Deval2,Dtrace} = configure_heights(OldH,NewH,Flags), resize_code_area(WinInfo, height, Dcode2), resize_eval_area(Ev, height, Deval2), @@ -1117,11 +1113,11 @@ configure_widths(OldW, NewW, Flags) -> %% Check how much the frames can be resized in reality Limits = if %% Window larger - NewW>OldW -> + NewW > OldW -> if - Ev==open,Bi==open -> {0,Diff,Diff}; - Ev==open -> {0,Diff,0}; - Bi==open -> {0,0,Diff}; + Ev =:= open, Bi =:= open -> {0,Diff,Diff}; + Ev =:= open -> {0,Diff,0}; + Bi =:= open -> {0,0,Diff}; true -> {Diff,0,0} end; @@ -1129,12 +1125,12 @@ configure_widths(OldW, NewW, Flags) -> %% and current size OldW>NewW -> if - Ev==open,Bi==open -> + Ev =:= open, Bi =:= open -> {0, gs:read('EvalArea',width)-204, gs:read('BindArea',width)-112}; - Ev==open -> {0,Diff,0}; - Bi==open -> {0,0,Diff}; + Ev =:= open -> {0,Diff,0}; + Bi =:= open -> {0,0,Diff}; true -> {Diff,0,0} end end, @@ -1142,13 +1138,13 @@ configure_widths(OldW, NewW, Flags) -> case Limits of %% No Shell or Bind frame, larger window - {T,0,0} when NewW>OldW -> {T,0,0}; + {T,0,0} when NewW > OldW -> {T,0,0}; %% No Shell or Bind frame, smaller window - {T,0,0} when OldW>NewW -> {-T,0,0}; + {T,0,0} when OldW > NewW -> {-T,0,0}; %% Window larger; divide Diff among the frames and return result - {_,Sf,B} when NewW>OldW -> + {_,Sf,B} when NewW > OldW -> {_,Sf2,B2} = divide([{0,0},{0,Sf},{0,B}],Diff), {Sf2+B2,Sf2,B2}; @@ -1171,33 +1167,33 @@ configure_heights(OldH, NewH, Flags) -> %% Check how much the frames can be resized in reality {T,Sf,Ff} = if %% Window larger - NewH>OldH -> + NewH > OldH -> {Diff, if - Ev==close, Bi==close -> 0; + Ev =:= close, Bi =:= close -> 0; true -> Diff end, if - Tr==open -> Diff; + Tr =:= open -> Diff; true -> 0 end}; %% Window smaller; get difference between min size %% and current size - OldH>NewH -> + OldH > NewH -> {gs:read('CodeArea',height)-100, if - Ev==close, Bi==close -> 0; + Ev =:= close, Bi =:= close -> 0; true -> if - Ev==open -> + Ev =:= open -> gs:read('EvalArea',height)-100; - Bi==open -> + Bi =:= open -> gs:read('BindArea',height)-100 end end, if - Tr==open -> gs:read('TraceArea',height)-100; + Tr =:= open -> gs:read('TraceArea',height)-100; true -> 0 end} end, @@ -1251,10 +1247,8 @@ divide(L, Diff) -> if %% All of Diff has been distributed - D==0 -> {T,S,F}; - + D =:= 0 -> {T,S,F}; true -> - %% For each element, try to add as much as possible of D {NewT,Dt} = divide2(D,T,Tmax), {NewS,Ds} = divide2(D,S,Smax), @@ -1296,25 +1290,25 @@ resize(WinInfo, ResizeBar) -> rblimits('RB2',W,H), rblimits('RB3',W,H)). -resizeloop(WI, RB, Prev, {Min1,Max1},{Min2,Max2},{Min3,Max3}) -> +resizeloop(WI, RB, Prev, {Min1,Max1}, {Min2,Max2}, {Min3,Max3}) -> receive - {gs,_,motion,_,[_,Y]} when RB=='RB1', Y>Min1,Y<Max1 -> + {gs,_,motion,_,[_,Y]} when RB =:= 'RB1', Y > Min1, Y < Max1 -> gs:config('RB1', {y,Y}), - resizeloop(WI, RB, Y, {Min1,Max1},{Min2,Max2},{Min3,Max3}); - {gs,_,motion,_,_} when RB=='RB1' -> - resizeloop(WI, RB, Prev,{Min1,Max1},{Min2,Max2},{Min3,Max3}); + resizeloop(WI, RB, Y, {Min1,Max1}, {Min2,Max2}, {Min3,Max3}); + {gs,_,motion,_,_} when RB =:= 'RB1' -> + resizeloop(WI, RB, Prev, {Min1,Max1}, {Min2,Max2}, {Min3,Max3}); - {gs,_,motion,_,[_,Y]} when RB=='RB2', Y>Min2,Y<Max2 -> + {gs,_,motion,_,[_,Y]} when RB =:= 'RB2', Y > Min2, Y < Max2 -> gs:config('RB2', {y,Y}), - resizeloop(WI, RB, Y, {Min1,Max1},{Min2,Max2},{Min3,Max3}); - {gs,_,motion,_,_} when RB=='RB2' -> - resizeloop(WI, RB, Prev,{Min1,Max1},{Min2,Max2},{Min3,Max3}); + resizeloop(WI, RB, Y, {Min1,Max1}, {Min2,Max2}, {Min3,Max3}); + {gs,_,motion,_,_} when RB =:= 'RB2' -> + resizeloop(WI, RB, Prev, {Min1,Max1}, {Min2,Max2}, {Min3,Max3}); - {gs,_,motion,_,[X,_]} when RB=='RB3', X>Min3,X<Max3 -> + {gs,_,motion,_,[X,_]} when RB =:= 'RB3', X > Min3, X < Max3 -> gs:config('RB3', {x,X}), - resizeloop(WI, RB, X, {Min1,Max1},{Min2,Max2},{Min3,Max3}); - {gs,_,motion,_,_} when RB=='RB3' -> - resizeloop(WI, RB, Prev,{Min1,Max1},{Min2,Max2},{Min3,Max3}); + resizeloop(WI, RB, X, {Min1,Max1}, {Min2,Max2}, {Min3,Max3}); + {gs,_,motion,_,_} when RB =:= 'RB3' -> + resizeloop(WI, RB, Prev, {Min1,Max1}, {Min2,Max2}, {Min3,Max3}); {gs,_,buttonrelease,_,_} -> resize_win(WI, RB, Prev) @@ -1329,7 +1323,7 @@ resize_win(WinInfo, 'RB1', Y) -> %% Resize Code, Evaluator and Binding areas resize_code_area(WinInfo, height, -Diff), if - S==close, Bi==close, F==open -> + S =:= close, Bi =:= close, F =:= open -> resize_trace_area(open, height, Diff); true -> resize_eval_area(S, height, Diff), @@ -1388,7 +1382,7 @@ rblimits('RB1',_W,H) -> RB2 = gs:read('RB2',height), FF = gs:read('TraceArea',height), Max = case RB2 of - 0 when FF/=0 -> + 0 when FF =/= 0 -> H-112; _ -> Y = gs:read('RB2',y), @@ -1397,18 +1391,14 @@ rblimits('RB1',_W,H) -> {Min,Max}; rblimits('RB2',_W,H) -> - - %% TraceFrame should not have height <100 + %% TraceFrame should not have height < 100 Max = H-112, - %% Min is decided by a minimum distance to 'RB1' Y = gs:read('RB1',y), Min = erlang:min(Max,Y+140), - {Min,Max}; rblimits('RB3',W,_H) -> - %% Neither CodeArea nor BindArea should occupy %% less than 1/3 of the total window width and EvalFrame should %% be at least 289 pixels wide @@ -1484,7 +1474,7 @@ helpwin_action(gotoline, default, AttPid, _Editor, Data, Win) -> end, Data; helpwin_action(search, case_sensitive, _AttPid, _Ed, {Pos, CS}, _Win) -> - Bool = if CS==true -> false; CS==false -> true end, + Bool = if CS =:= true -> false; CS =:= false -> true end, {Pos, Bool}; helpwin_action(search, default, _AttPid, Editor, {Pos, CS}, Win) -> gs:config(lbl(Win), {label, {text, ""}}), @@ -1517,13 +1507,9 @@ search(Str, Editor, Max, {Row, Col}, CS) -> lowercase(true, Str) -> Str; lowercase(false, Str) -> - lists:map(fun(Char) -> - if - Char>=$A, Char=<$Z -> Char+32; - true -> Char - end - end, - Str). + [if Char >= $A, Char =< $Z -> Char+32; + true -> Char + end || Char <- Str]. mark_string(Editor, {Row, Col}, Str) -> Between = {{Row,Col}, {Row,Col+length(Str)}}, @@ -1540,10 +1526,9 @@ unmark_string(Editor, {Row, Col}) -> {fg, {Between, black}}]). helpwin(Type, GS, {X, Y}) -> - W = 200, Pad=10, Wbtn = 50, + W = 200, Pad = 10, Wbtn = 50, - Title = - case Type of search -> "Search"; gotoline -> "Go To Line" end, + Title = case Type of search -> "Search"; gotoline -> "Go To Line" end, Win = gs:window(GS, [{title, Title}, {x, X}, {y, Y}, {width, W}, {destroy, true}]), diff --git a/lib/debugger/src/dbg_ui_view.erl b/lib/debugger/src/dbg_ui_view.erl index 075275f196..7350a830a8 100644 --- a/lib/debugger/src/dbg_ui_view.erl +++ b/lib/debugger/src/dbg_ui_view.erl @@ -21,9 +21,6 @@ %% External exports -export([start/2]). -%% Internal exports --export([init/3]). - -record(state, {gs, % term() Graphics system id win, % term() Attach process window data coords, % {X,Y} Mouse point position @@ -42,7 +39,7 @@ start(GS, Mod) -> Title = "View Module " ++ atom_to_list(Mod), case dbg_ui_winman:is_started(Title) of true -> ignore; - false -> spawn(?MODULE, init, [GS, Mod, Title]) + false -> spawn(fun () -> init(GS, Mod, Title) end) end. @@ -51,7 +48,6 @@ start(GS, Mod) -> %%==================================================================== init(GS, Mod, Title) -> - %% Subscribe to messages from the interpreter int:subscribe(), diff --git a/lib/debugger/src/dbg_ui_win.erl b/lib/debugger/src/dbg_ui_win.erl index 74ff2503ab..9bed6a1ec5 100644 --- a/lib/debugger/src/dbg_ui_win.erl +++ b/lib/debugger/src/dbg_ui_win.erl @@ -24,7 +24,6 @@ create_menus/2, select/2, selected/1, add_break/2, update_break/2, delete_break/1, motion/2 - ]). -record(break, {mb, smi, emi, dimi, demi}). @@ -49,11 +48,11 @@ init() -> font(Style) -> GS = init(), Style2 = if - Style==normal -> []; + Style =:= normal -> []; true -> [Style] end, case gs:read(GS, {choose_font, {screen,Style2,12}}) of - Font when element(1, Font)==screen -> + Font when element(1, Font) =:= screen -> Font; _ -> gs:read(GS, {choose_font, {courier,Style2,12}}) @@ -168,8 +167,7 @@ select(MenuItem, Bool) -> %%-------------------------------------------------------------------- selected(Menu) -> Children = gs:read(Menu, children), - Selected = lists:filter(fun(Child) -> gs:read(Child, select) end, - Children), + Selected = [gs:read(Child, select) || Child <- Children], lists:map(fun(Child) -> {text, Name} = gs:read(Child, label), list_to_atom(Name) diff --git a/lib/debugger/src/dbg_ui_winman.erl b/lib/debugger/src/dbg_ui_winman.erl index 71023cd0d6..398735a7ca 100644 --- a/lib/debugger/src/dbg_ui_winman.erl +++ b/lib/debugger/src/dbg_ui_winman.erl @@ -120,9 +120,9 @@ init(_Arg) -> {ok, #state{}}. handle_call({is_started, Title}, _From, State) -> - Reply = case lists:keysearch(Title, #win.title, State#state.wins) of - {value, Win} -> {true, Win#win.win}; - false -> false + Reply = case lists:keyfind(Title, #win.title, State#state.wins) of + false -> false; + Win -> {true, Win#win.win} end, {reply, Reply, State}. @@ -134,8 +134,8 @@ handle_cast({insert, Pid, Title, Win}, State) -> handle_cast({clear_process, Title}, State) -> OldWins = State#state.wins, - Wins = case lists:keysearch(Title, #win.title, OldWins) of - {value, #win{owner=Pid}} -> + Wins = case lists:keyfind(Title, #win.title, OldWins) of + #win{owner=Pid} -> Msg = {dbg_ui_winman, destroy}, Pid ! Msg, lists:keydelete(Title, #win.title, OldWins); @@ -147,7 +147,7 @@ handle_cast({clear_process, Title}, State) -> handle_info({'EXIT', Pid, _Reason}, State) -> [Mon | _Wins] = State#state.wins, if - Pid==Mon#win.owner -> {stop, normal, State}; + Pid =:= Mon#win.owner -> {stop, normal, State}; true -> Wins2 = lists:keydelete(Pid, #win.owner, State#state.wins), inform_all(Wins2), diff --git a/lib/debugger/src/dbg_wx_break_win.erl b/lib/debugger/src/dbg_wx_break_win.erl index 5dafb0fbe6..78733c98c8 100644 --- a/lib/debugger/src/dbg_wx_break_win.erl +++ b/lib/debugger/src/dbg_wx_break_win.erl @@ -206,11 +206,7 @@ handle_event(#wx{id=OKorListBox, event=#wxCommand{type=OkorDoubleClick}}, OkorDoubleClick =:= command_listbox_doubleclicked -> Mod = wxComboBox:getValue(Text), {_, IndexL} = wxListBox:getSelections(LB), - Breaks = lists:map(fun(Index) -> - Func = lists:nth(Index+1, Funcs), - [list_to_atom(Mod) | Func] - end, - IndexL), + Breaks = [[list_to_atom(Mod)|lists:nth(Index+1, Funcs)] || Index <- IndexL], wxDialog:destroy(Win), {break, Breaks, enable}; handle_event(#wx{id=?wxID_OK},#winInfo{win=Win,text=Text, entries=Es, trigger=Trigger}) -> diff --git a/lib/debugger/src/dbg_wx_interpret.erl b/lib/debugger/src/dbg_wx_interpret.erl index f711ba679d..ffcfbcf36b 100644 --- a/lib/debugger/src/dbg_wx_interpret.erl +++ b/lib/debugger/src/dbg_wx_interpret.erl @@ -115,11 +115,11 @@ interpret_all(Dir, [File0|Files], Mode, Window, Errors) -> interpret_all(_Dir, [], _Mode, _Window, []) -> true; interpret_all(Dir, [], _Mode, Window, Errors) -> - Msg = lists:map(fun(Name) -> - File = filename:join(Dir, Name), - Error = format_error(int:interpretable(File)), - ["\n ",Name,": ",Error] - end, Errors), + Msg = [begin + File = filename:join(Dir, Name), + Error = format_error(int:interpretable(File)), + ["\n ",Name,": ",Error] + end || Name <- Errors], All = ["Error when interpreting: ", Msg], dbg_wx_win:confirm(Window, lists:flatten(All)), true. diff --git a/lib/debugger/src/dbg_wx_mon.erl b/lib/debugger/src/dbg_wx_mon.erl index 3f55c38d35..6bdec994b1 100644 --- a/lib/debugger/src/dbg_wx_mon.erl +++ b/lib/debugger/src/dbg_wx_mon.erl @@ -170,7 +170,7 @@ init2(CallingPid, Mode, SFile, GS) -> CallingPid ! {initialization_complete, self()}, if - SFile==default -> + SFile =:= default -> loop(State3); true -> loop(load_settings(SFile, State3)) @@ -268,7 +268,7 @@ gui_cmd(ignore, State) -> State; gui_cmd(stopped, State) -> if - State#state.starter==true -> int:stop(); + State#state.starter =:= true -> int:stop(); true -> int:auto_attach(false) end, exit(stop); @@ -420,9 +420,9 @@ gui_cmd({'Trace Window', TraceWin}, State) -> State2; gui_cmd({'Auto Attach', When}, State) -> if - When==[] -> int:auto_attach(false); + When =:= [] -> int:auto_attach(false); true -> - Flags = lists:map(fun(Name) -> map(Name) end, When), + Flags = [map(Name) || Name <- When], int:auto_attach(Flags, trace_function(State)) end, State; @@ -691,12 +691,12 @@ load_settings2(Settings, State) -> Break, int:break(Mod, Line), if - Status==inactive -> + Status =:= inactive -> int:disable_break(Mod, Line); true -> ignore end, if - Action/=enable -> + Action =/= enable -> int:action_at_break(Mod,Line,Action); true -> ignore end, @@ -715,10 +715,7 @@ save_settings(SFile, State) -> int:auto_attach(), int:stack_trace(), State#state.backtrace, - lists:map(fun(Mod) -> - int:file(Mod) - end, - int:interpreted()), + [int:file(Mod) || Mod <- int:interpreted()], int:all_breaks()}, Binary = term_to_binary({debugger_settings, Settings}), @@ -741,7 +738,7 @@ registered_name(Pid) -> Node = node(Pid), if - Node==node() -> + Node =:= node() -> case erlang:process_info(Pid, registered_name) of {registered_name, Name} -> Name; _ -> undefined diff --git a/lib/debugger/src/dbg_wx_mon_win.erl b/lib/debugger/src/dbg_wx_mon_win.erl index 8ad4f4213f..04c3501b8c 100644 --- a/lib/debugger/src/dbg_wx_mon_win.erl +++ b/lib/debugger/src/dbg_wx_mon_win.erl @@ -266,8 +266,7 @@ select(MenuItem, Bool) -> add_module(WinInfo, MenuName, Mod) -> Win = WinInfo#winInfo.window, Modules = WinInfo#winInfo.modules, - case lists:keysearch(Mod, #moduleInfo.module, Modules) of - {value, _ModInfo} -> WinInfo; + case lists:keymember(Mod, #moduleInfo.module, Modules) of false -> %% Create a menu for the module Menu = get(MenuName), @@ -284,8 +283,9 @@ add_module(WinInfo, MenuName, Mod) -> wxListBox:append(WinInfo#winInfo.listbox, atom_to_list(Mod)), ModInfo = #moduleInfo{module=Mod, menubtn={Menu,MenuBtn}}, - WinInfo#winInfo{modules=[ModInfo | Modules]} - end. + WinInfo#winInfo{modules=[ModInfo | Modules]}; + true -> WinInfo + end. %%-------------------------------------------------------------------- %% delete_module(WinInfo, Mod) -> WinInfo @@ -559,8 +559,7 @@ handle_event(#wx{event=#wxCommand{type=command_checkbox_clicked}}, handle_event(#wx{event=#wxList{type=command_list_item_selected, itemIndex=Row}}, WinInfo) -> #winInfo{processes=Pids} = WinInfo, - {value, #procInfo{pid=Pid}} = - lists:keysearch(Row, #procInfo.row, Pids), + #procInfo{pid=Pid} = lists:keyfind(Row, #procInfo.row, Pids), {focus, Pid, WinInfo#winInfo{focus=Row}}; handle_event(#wx{event=#wxList{type=command_list_item_activated}}, _WinInfo) -> diff --git a/lib/debugger/src/dbg_wx_trace.erl b/lib/debugger/src/dbg_wx_trace.erl index f9fdf593c4..6675ea33e7 100644 --- a/lib/debugger/src/dbg_wx_trace.erl +++ b/lib/debugger/src/dbg_wx_trace.erl @@ -180,12 +180,12 @@ init_contents(Breaks, State) -> State#state{win=Win}. -loop(#state{meta=Meta} = State) -> +loop(#state{meta=Meta, win=Win} = State) -> receive %% From the GUI main window - GuiEvent when element(1, GuiEvent)==wx -> + GuiEvent when element(1, GuiEvent) =:= wx -> Cmd = wx:batch(fun() -> - dbg_wx_trace_win:handle_event(GuiEvent,State#state.win) + dbg_wx_trace_win:handle_event(GuiEvent,Win) end), State2 = gui_cmd(Cmd, State), loop(State2); @@ -211,11 +211,11 @@ loop(#state{meta=Meta} = State) -> %% From the dbg_wx_winman process (Debugger window manager) {dbg_ui_winman, update_windows_menu, Data} -> - Window = dbg_wx_trace_win:get_window(State#state.win), + Window = dbg_wx_trace_win:get_window(Win), dbg_wx_winman:update_windows_menu(Window,Data), loop(State); {dbg_ui_winman, destroy} -> - dbg_wx_trace_win:stop(State#state.win), + dbg_wx_trace_win:stop(Win), exit(stop) end. @@ -269,7 +269,7 @@ gui_cmd('Continue', State) -> int:meta(State#state.meta, continue), {Status, Mod, Line} = State#state.status, if - Status==wait_break -> + Status =:= wait_break -> Win = dbg_wx_trace_win:unmark_line(State#state.win), gui_enable_functions(wait_running), State#state{win=Win, status={wait_running,Mod,Line}}; @@ -291,7 +291,7 @@ gui_cmd('Stop', State) -> int:meta(State#state.meta, stop), {Status, Mod, Line} = State#state.status, if - Status==wait_running -> + Status =:= wait_running -> Win = dbg_wx_trace_win:mark_line(State#state.win, Line, break), gui_enable_functions(wait_break), @@ -421,7 +421,7 @@ gui_cmd('Function Break...', State) -> gui_cmd('Enable All', State) -> Breaks = int:all_breaks(), ThisMod = State#state.cm, - lists:foreach(fun ({{Mod, Line}, _Options}) when Mod==ThisMod -> + lists:foreach(fun ({{Mod, Line}, _Options}) when Mod =:= ThisMod -> int:enable_break(Mod, Line); (_Break) -> ignore @@ -431,7 +431,7 @@ gui_cmd('Enable All', State) -> gui_cmd('Disable All', State) -> Breaks = int:all_breaks(), ThisMod = State#state.cm, - lists:foreach(fun ({{Mod, Line}, _Options}) when Mod==ThisMod -> + lists:foreach(fun ({{Mod, Line}, _Options}) when Mod =:= ThisMod -> int:disable_break(Mod, Line); (_Break) -> ignore @@ -458,7 +458,7 @@ gui_cmd({'Trace Window', TraceWin}, State) -> Win = dbg_wx_trace_win:configure(State#state.win, TraceWin), {Status,_,_} = State#state.status, if - Status==break; Status==wait_break -> + Status =:= break; Status =:= wait_break -> gui_enable_btrace(Trace, State#state.stack_trace); true -> ignore end, @@ -467,7 +467,7 @@ gui_cmd({'Stack Trace', [Name]}, State) -> int:meta(State#state.meta, stack_trace, map(Name)), {Status,_,_} = State#state.status, if - Status==break; Status==wait_break -> + Status =:= break; Status =:= wait_break -> gui_enable_btrace(State#state.trace, map(Name)); true -> ignore end, @@ -490,9 +490,9 @@ gui_cmd('Debugger', State) -> gui_cmd({user_command, Cmd}, State) -> {Status, _Mod, _Line} = State#state.status, if - Status==break; - Status==wait_break; - Status==wait_running -> + Status =:= break; + Status =:= wait_break; + Status =:= wait_running -> Cm = State#state.cm, Arg = case State#state.stack of {Cur, Max} when Cur<Max -> {Cm, Cmd, Cur}; @@ -531,14 +531,14 @@ add_break(WI, Coords, Type, Mod, Line) -> int_cmd({interpret, Mod}, State) -> if - Mod==State#state.cm -> + Mod =:= State#state.cm -> State#state{cm_obsolete=true}; true -> State end; int_cmd({no_interpret, Mod}, State) -> if - Mod==State#state.cm -> + Mod =:= State#state.cm -> State#state{cm_obsolete=true}; true -> Win = dbg_wx_trace_win:remove_code(State#state.win, Mod), @@ -584,7 +584,7 @@ meta_cmd({re_entry, dbg_ieval, eval_fun}, State) -> meta_cmd({re_entry, Mod, _Func}, State) -> Obs = State#state.cm_obsolete, case State#state.cm of - Mod when Obs==true -> + Mod when Obs =:= true -> Win = gui_load_module(State#state.win, Mod,State#state.pid), State#state{win=Win, cm_obsolete=false}; Mod -> State; @@ -630,11 +630,11 @@ meta_cmd({func_at, Mod, Line, Cur}, State) -> gui_enable_functions(idle), dbg_wx_trace_win:display(State#state.win, idle), State#state{win=Win, cm=Mod, status={idle,Mod,Line}, stack=Stack}; -meta_cmd({wait_at, Mod, Line, Cur}, #state{status={Status,_,_}}=State) - when Status/=init, Status/=break -> +meta_cmd({wait_at, Mod, Line, Cur}, #state{status={Status,_,_}, win=Win}=State) + when Status =/= init, Status =/= break -> Stack = {Cur,Cur}, gui_enable_functions(wait_running), - dbg_wx_trace_win:display(State#state.win, {wait,Mod,Line}), + dbg_wx_trace_win:display(Win, {wait,Mod,Line}), State#state{status={wait_running,Mod,Line}, stack=Stack}; meta_cmd({wait_at, Mod, Line, Cur}, State) -> Stack = {Cur,Cur}, @@ -675,7 +675,7 @@ meta_cmd({stack_trace, Flag}, State) -> gui_enable_updown(Flag, State#state.stack), {Status,_,_} = State#state.status, if - Status==break; Status==wait_break -> + Status =:= break; Status =:= wait_break -> gui_enable_btrace(State#state.trace, Flag); true -> ignore end, @@ -813,7 +813,7 @@ gui_enable_functions(Status) -> gui_enable_updown(Flag, Stack) -> {Enable, Disable} = if - Flag==false -> {[], ['Up', 'Down']}; + Flag =:= false -> {[], ['Up', 'Down']}; true -> case Stack of {1,1} -> {[], ['Up', 'Down']}; @@ -826,14 +826,14 @@ gui_enable_updown(Flag, Stack) -> dbg_wx_trace_win:enable(Enable, true), dbg_wx_trace_win:enable(Disable, false), if - Enable==[] -> dbg_wx_trace_win:enable(['Where'], false); + Enable =:= [] -> dbg_wx_trace_win:enable(['Where'], false); true -> dbg_wx_trace_win:enable(['Where'], true) end. gui_enable_btrace(Trace, StackTrace) -> Bool = if - Trace==false -> false; - StackTrace==false -> false; + Trace =:= false -> false; + StackTrace =:= false -> false; true -> true end, dbg_wx_trace_win:enable(['Back Trace'], Bool). diff --git a/lib/debugger/src/dbg_wx_trace_win.erl b/lib/debugger/src/dbg_wx_trace_win.erl index 2b4a1164ad..720b913024 100755 --- a/lib/debugger/src/dbg_wx_trace_win.erl +++ b/lib/debugger/src/dbg_wx_trace_win.erl @@ -410,11 +410,11 @@ clear_breaks(WinInfo) -> clear_breaks(WinInfo, all). clear_breaks(WinInfo, Mod) -> Remove = if - Mod==all -> WinInfo#winInfo.breaks; + Mod =:= all -> WinInfo#winInfo.breaks; true -> lists:filter(fun(#breakInfo{point={Mod2,_L}}) -> if - Mod2==Mod -> true; + Mod2 =:= Mod -> true; true -> false end end, @@ -481,8 +481,8 @@ display(#winInfo{window=Win, sb=Sb},Arg) -> %% Note: remove_code/2 should not be used for currently shown module. %%-------------------------------------------------------------------- is_shown(WinInfo, Mod) -> - case lists:keysearch(Mod, 1, WinInfo#winInfo.editors) of - {value, {Mod, Editor}} -> + case lists:keyfind(Mod, 1, WinInfo#winInfo.editors) of + {Mod, Editor} -> gs:config(Editor, raise), %% BUGBUG {true, WinInfo#winInfo{editor={Mod, Editor}}}; false -> false @@ -494,7 +494,7 @@ show_code(WinInfo = #winInfo{editor={_, Ed}}, Mod, Contents) -> lists:foreach(fun(BreakInfo) -> case BreakInfo#breakInfo.point of - {Mod2, Line} when Mod2==Mod -> + {Mod2, Line} when Mod2 =:= Mod -> Status = BreakInfo#breakInfo.status, dbg_wx_code:add_break_to_code(Ed, Line,Status); _Point -> ignore @@ -540,10 +540,10 @@ select_line(WinInfo, Line) -> %% help window, it must be checked that it is correct Size = dbg_wx_code:get_no_lines(Ed), if - Line==0 -> + Line =:= 0 -> dbg_wx_code:goto_line(Ed,1), WinInfo#winInfo{selected_line=0}; - Line<Size -> + Line < Size -> dbg_wx_code:goto_line(Ed,Line), WinInfo#winInfo{selected_line=Line}; true -> @@ -764,8 +764,8 @@ handle_event(#wx{event=#wxStyledText{type=stc_doubleclick}}, WinInfo = #winInfo{editor={Mod,Ed}}) -> Line = wxStyledTextCtrl:getCurrentLine(Ed), Point = {Mod, Line+1}, - case lists:keysearch(Point, #breakInfo.point,WinInfo#winInfo.breaks) of - {value, _BreakInfo} -> {break, Point, delete}; + case lists:keymember(Point, #breakInfo.point, WinInfo#winInfo.breaks) of + true -> {break, Point, delete}; false -> {break, Point, add} end; @@ -837,7 +837,7 @@ handle_event(#wx{id=?SEARCH_ENTRY, event=#wxCommand{cmdString=Str}}, %% Button area handle_event(#wx{id=ID, event=#wxCommand{type=command_button_clicked}},_Wi) -> - {value, {Button, _}} = lists:keysearch(ID, 2, buttons()), + {Button, _} = lists:keyfind(ID, 2, buttons()), Button; %% Evaluator area @@ -908,8 +908,8 @@ buttons() -> {'Where',?WhereButton}, {'Up',?UpButton}, {'Down',?DownButton}]. is_button(Name) -> - case lists:keysearch(Name, 1, buttons()) of - {value, {Name, Button}} -> {true, Button}; + case lists:keyfind(Name, 1, buttons()) of + {Name, Button} -> {true, Button}; false -> false end. diff --git a/lib/debugger/src/dbg_wx_view.erl b/lib/debugger/src/dbg_wx_view.erl index 6d34e5650c..8ff89a4847 100644 --- a/lib/debugger/src/dbg_wx_view.erl +++ b/lib/debugger/src/dbg_wx_view.erl @@ -23,9 +23,6 @@ %% External exports -export([start/2]). -%% Internal exports --export([init/4]). - -record(state, {gs, % term() Graphics system id win, % term() Attach process window data coords, % {X,Y} Mouse point position @@ -46,7 +43,7 @@ start(GS, Mod) -> true -> ignore; false -> Env = wx:get_env(), - spawn_link(?MODULE, init, [GS, Env, Mod, Title]) + spawn_link(fun () -> init(GS, Env, Mod, Title) end) end. @@ -84,7 +81,7 @@ loop(State) -> receive %% From the GUI main window - GuiEvent when element(1, GuiEvent)==wx -> + GuiEvent when element(1, GuiEvent) =:= wx -> Cmd = wx:batch(fun() -> dbg_wx_trace_win:handle_event(GuiEvent, State#state.win) end), @@ -167,7 +164,7 @@ gui_cmd('Function Break...', State) -> gui_cmd('Enable All', State) -> Breaks = int:all_breaks(), ThisMod = State#state.mod, - lists:foreach(fun ({{Mod, Line}, _Options}) when Mod==ThisMod -> + lists:foreach(fun ({{Mod, Line}, _Options}) when Mod =:= ThisMod -> int:enable_break(Mod, Line); (_Break) -> ignore @@ -177,7 +174,7 @@ gui_cmd('Enable All', State) -> gui_cmd('Disable All', State) -> Breaks = int:all_breaks(), ThisMod = State#state.mod, - lists:foreach(fun ({{Mod, Line}, _Options}) when Mod==ThisMod -> + lists:foreach(fun ({{Mod, Line}, _Options}) when Mod =:= ThisMod -> int:disable_break(Mod, Line); (_Break) -> ignore @@ -214,21 +211,19 @@ add_break(GS, Coords, Type, Mod, Line) -> %%--Commands from the interpreter------------------------------------- -int_cmd({new_break, {{Mod,_Line},_Options}=Break}, #state{mod=Mod}=State) -> - Win = dbg_wx_trace_win:add_break(State#state.win, 'Break', Break), - State#state{win=Win}; -int_cmd({delete_break, {Mod,_Line}=Point}, #state{mod=Mod}=State) -> - Win = dbg_wx_trace_win:delete_break(State#state.win, Point), - State#state{win=Win}; -int_cmd({break_options, {{Mod,_Line},_Options}=Break}, #state{mod=Mod}=State) -> - Win = dbg_wx_trace_win:update_break(State#state.win, Break), - State#state{win=Win}; -int_cmd(no_break, State) -> - Win = dbg_wx_trace_win:clear_breaks(State#state.win), - State#state{win=Win}; -int_cmd({no_break, _Mod}, State) -> - Win = dbg_wx_trace_win:clear_breaks(State#state.win), - State#state{win=Win}; +int_cmd({new_break, {{Mod,_Line},_Options}=Break}, + #state{mod = Mod, win = Win}=State) -> + State#state{win = dbg_wx_trace_win:add_break(Win, 'Break', Break)}; +int_cmd({delete_break, {Mod,_Line}=Point}, + #state{mod = Mod, win = Win}=State) -> + State#state{win = dbg_wx_trace_win:delete_break(Win, Point)}; +int_cmd({break_options, {{Mod,_Line},_Options}=Break}, + #state{mod = Mod, win = Win}=State) -> + State#state{win = dbg_wx_trace_win:update_break(Win, Break)}; +int_cmd(no_break, #state{win = Win}=State) -> + State#state{win = dbg_wx_trace_win:clear_breaks(Win)}; +int_cmd({no_break, _Mod}, #state{win = Win}=State) -> + State#state{win = dbg_wx_trace_win:clear_breaks(Win)}; int_cmd(_, State) -> State. diff --git a/lib/debugger/src/dbg_wx_winman.erl b/lib/debugger/src/dbg_wx_winman.erl index 1daabe3435..d0ddfeb51a 100755 --- a/lib/debugger/src/dbg_wx_winman.erl +++ b/lib/debugger/src/dbg_wx_winman.erl @@ -118,9 +118,9 @@ init([]) -> {ok, #state{}}. handle_call({is_started, Title}, _From, State) -> - Reply = case lists:keysearch(Title, #win.title, State#state.wins) of - {value, Win} -> {true, Win#win.win}; - false -> false + Reply = case lists:keyfind(Title, #win.title, State#state.wins) of + false -> false; + Win -> {true, Win#win.win} end, {reply, Reply, State}. @@ -132,8 +132,8 @@ handle_cast({insert, Pid, Title, Win}, State) -> handle_cast({clear_process, Title}, State) -> OldWins = State#state.wins, - Wins = case lists:keysearch(Title, #win.title, OldWins) of - {value, #win{owner=Pid}} -> + Wins = case lists:keyfind(Title, #win.title, OldWins) of + #win{owner=Pid} -> Msg = {dbg_ui_winman, destroy}, Pid ! Msg, lists:keydelete(Title, #win.title, OldWins); @@ -145,7 +145,7 @@ handle_cast({clear_process, Title}, State) -> handle_info({'EXIT', Pid, _Reason}, State) -> [Mon | _Wins] = State#state.wins, if - Pid==Mon#win.owner -> {stop, normal, State}; + Pid =:= Mon#win.owner -> {stop, normal, State}; true -> Wins2 = lists:keydelete(Pid, #win.owner, State#state.wins), inform_all(Wins2), diff --git a/lib/debugger/src/i.erl b/lib/debugger/src/i.erl index 7c2fb22946..476a53482e 100644 --- a/lib/debugger/src/i.erl +++ b/lib/debugger/src/i.erl @@ -31,7 +31,6 @@ iv() -> Vsn = string:substr(filename:basename(code:lib_dir(debugger)), 10), list_to_atom(Vsn). - %% ------------------------------------------- %% Start a new graphical monitor. @@ -288,10 +287,9 @@ ia(X,Y,Z) -> %% ------------------------------------------- ia(Pid,Fnk) -> - case lists:keysearch(Pid, 1, int:snapshot()) of - {value, _PidTuple} -> - int:attach(Pid,Fnk); - false -> no_proc + case lists:keymember(Pid, 1, int:snapshot()) of + false -> no_proc; + true -> int:attach(Pid,Fnk) end. ia(X,Y,Z,Fnk) -> diff --git a/lib/debugger/src/int.erl b/lib/debugger/src/int.erl index eeb4df4a8e..9ee2102a19 100644 --- a/lib/debugger/src/int.erl +++ b/lib/debugger/src/int.erl @@ -261,7 +261,7 @@ del_break_in(Mod, Func, Arity) when is_atom(Mod), is_atom(Func), is_integer(Arit end. first_lines(Clauses) -> - lists:map(fun(Clause) -> first_line(Clause) end, Clauses). + [first_line(Clause) || Clause <- Clauses]. first_line({clause,_L,_Vars,_,Exprs}) -> first_line(Exprs); @@ -469,10 +469,10 @@ contents(Mod, Pid) -> %% Arity = integer() %%-------------------------------------------------------------------- functions(Mod) -> - lists:filter(fun([module_info, _Arity]) -> false; - (_Func) -> true - end, - dbg_iserver:call({functions, Mod})). + [F || F <- dbg_iserver:call({functions, Mod}), functions_1(F)]. + +functions_1([module_info, _Arity]) -> false; +functions_1(_Func) -> true. %%==================================================================== diff --git a/lib/docbuilder/src/docb_edoc_xml_cb.erl b/lib/docbuilder/src/docb_edoc_xml_cb.erl index 4dba843341..90491bc007 100644 --- a/lib/docbuilder/src/docb_edoc_xml_cb.erl +++ b/lib/docbuilder/src/docb_edoc_xml_cb.erl @@ -340,9 +340,7 @@ otp_xmlify_e(#xmlElement{name=code} = E) -> % 4) [E#xmlElement{content=Content}] end; otp_xmlify_e(#xmlElement{name=Tag} = E) % 5a - when Tag==h1; Tag==h2; Tag==h3; Tag==h4; Tag==h5; - Tag==center; - Tag==font -> + when Tag==h1; Tag==h2; Tag==h3; Tag==h4; Tag==h5 -> Content = text_only(E#xmlElement.content), [E#xmlElement{name=b, content=Content}]; otp_xmlify_e(#xmlElement{name=Tag} = E) % 5b-c) @@ -354,21 +352,16 @@ otp_xmlify_e(#xmlElement{name=table} = E) -> % 6) module -> otp_xmlify_table(E#xmlElement.content); overview -> - case get_attrval(border, E) of - "" -> % implies border="0" - [{p, otp_xmlify_table(E#xmlElement.content)}]; - "0" -> - [{p, otp_xmlify_table(E#xmlElement.content)}]; - _Val -> - Content0 = otp_xmlify_e(E#xmlElement.content), - Summary = #xmlText{value=get_attrval(summary, E)}, - TCaption = E#xmlElement{name=tcaption, - attributes=[], - content=[Summary]}, - Content = Content0 ++ [TCaption], - [E#xmlElement{attributes=[], content=Content}] - end + Content0 = otp_xmlify_e(E#xmlElement.content), + Summary = #xmlText{value=get_attrval(summary, E)}, + TCaption = E#xmlElement{name=tcaption, + attributes=[], + content=[Summary]}, + Content = Content0 ++ [TCaption], + [E#xmlElement{attributes=[], content=Content}] end; +otp_xmlify_e(#xmlElement{name=tbody} = E) -> + otp_xmlify_e(E#xmlElement.content); otp_xmlify_e(#xmlElement{name=sup} = E) -> % 7) Text = get_text(E), [#xmlText{parents = E#xmlElement.parents, @@ -478,31 +471,29 @@ otp_xmlify_a_href("#"++_ = Marker, Es0) -> % <seealso marker="#what"> otp_xmlify_a_href("http:"++_ = URL, Es0) -> % external URL {URL, Es0}; otp_xmlify_a_href("OTPROOT"++AppRef, Es0) -> % <.. marker="App:FileRef - case split(AppRef, "/") of - [AppS, "doc", FileRef1] -> - FileRef = AppS++":"++otp_xmlify_a_fileref(FileRef1, AppS), - [#xmlText{value=Str0} = T] = Es0, - Str = case split(Str0, "/") of - %% //Application - [AppS2] -> - %% AppS2 can differ from AppS - %% Example: xmerl/XMerL - AppS2; - [_AppS,ModRef] -> - case split(ModRef, ":") of - %% //Application/Module - [Module] -> - Module++"(3)"; - %% //Application/Module:Type() - [_Module,_Type] -> - ModRef - end; - %% //Application/Module:Function/Arity - [_AppS,ModFunc,Arity] -> - ModFunc++"/"++Arity - end, - {FileRef, [T#xmlText{value=Str}]} - end; + [AppS, "doc", FileRef1] = split(AppRef, "/"), + FileRef = AppS++":"++otp_xmlify_a_fileref(FileRef1, AppS), + [#xmlText{value=Str0} = T] = Es0, + Str = case split(Str0, "/") of + %% //Application + [AppS2] -> + %% AppS2 can differ from AppS + %% Example: xmerl/XMerL + AppS2; + [_AppS,ModRef] -> + case split(ModRef, ":") of + %% //Application/Module + [Module] -> + Module++"(3)"; + %% //Application/Module:Type() + [_Module,_Type] -> + ModRef + end; + %% //Application/Module:Function/Arity + [_AppS,ModFunc,Arity] -> + ModFunc++"/"++Arity + end, + {FileRef, [T#xmlText{value=Str}]}; otp_xmlify_a_href("../"++File, Es0) -> %% Special case: This kind of relative path is used on some %% places within i.e. EDoc and refers to a file within the same @@ -639,13 +630,13 @@ otp_xmlify_table([#xmlText{} = E|Es]) -> [E | otp_xmlify_table(Es)]; otp_xmlify_table([#xmlElement{name=tbody} = E|Es]) -> otp_xmlify_table(E#xmlElement.content)++otp_xmlify_table(Es); -otp_xmlify_table([#xmlElement{name=tr} = E|Es]) -> +otp_xmlify_table([#xmlElement{name=tr, content=Content}|Es]) -> %% Insert newlines between table rows - otp_xmlify_table(E#xmlElement.content)++[{br,[]}]++otp_xmlify_table(Es); -otp_xmlify_table([#xmlElement{name=th} = E|Es]) -> - [{em, E#xmlElement.content} | otp_xmlify_table(Es)]; -otp_xmlify_table([#xmlElement{name=td} = E|Es]) -> - otp_xmlify_e(E#xmlElement.content) ++ otp_xmlify_table(Es); + otp_xmlify_table(Content)++[{br,[]}]++otp_xmlify_table(Es); +otp_xmlify_table([#xmlElement{name=th, content=Content}|Es]) -> + [{em, Content} | otp_xmlify_table(Es)]; +otp_xmlify_table([#xmlElement{name=td, content=Content}|Es]) -> + otp_xmlify_e(Content) ++ otp_xmlify_table(Es); otp_xmlify_table([]) -> []. @@ -1155,8 +1146,8 @@ get_text(#xmlElement{content=[E]}) -> %% text_only(Es) -> Ts %% Takes a list of xmlElement and xmlText and return a lists of xmlText. -text_only([#xmlElement{} = E |Es]) -> - text_only(E#xmlElement.content) ++ text_only(Es); +text_only([#xmlElement{content = Content}|Es]) -> + text_only(Content) ++ text_only(Es); text_only([#xmlText{} = E |Es]) -> [E | text_only(Es)]; text_only([]) -> diff --git a/lib/docbuilder/src/docb_html.erl b/lib/docbuilder/src/docb_html.erl index 9aea4c8a66..bdfc5ea876 100644 --- a/lib/docbuilder/src/docb_html.erl +++ b/lib/docbuilder/src/docb_html.erl @@ -283,16 +283,16 @@ rule([term|_], {_, [ID], _}, Opts) -> ID, "</strong></em> "]}, Opts}; TermList -> - case lists:keysearch(ID, 1, TermList) of + case lists:keyfind(ID, 1, TermList) of false -> {{drop, ["<em><strong>", ID, "</strong></em> "]}, Opts}; - {value, {ID, Name, _Description, _Resp}} -> + {ID, Name, _Description, _Resp} -> {{drop, ["<em><strong>", Name, "</strong></em> "]}, Opts}; - {value, {ID, Name, _Description}} -> + {ID, Name, _Description} -> {{drop, [ "<em><strong>", Name, "</strong></em> "]}, Opts} @@ -306,16 +306,16 @@ rule([term|_], {_, [ID], _}, Opts) -> TermList -> PartApplication = docb_util:lookup_option(part_application, Opts), - case lists:keysearch(ID, 1, TermList) of + case lists:keyfind(ID, 1, TermList) of false -> {{drop, ["<a href=\"", PartApplication, "_term.html#", ID, "\">", ID, "</a> "]}, Opts}; - {value, {ID, Name, _Description, _Resp}} -> + {ID, Name, _Description, _Resp} -> {{drop, ["<a href=\"", PartApplication, "_term.html#", ID, "\">", Name, "</a> "]}, Opts}; - {value, {ID, Name, _Description}} -> + {ID, Name, _Description} -> {{drop, ["<a href=\"", PartApplication, "_term.html#", ID, "\">", Name, "</a> "]}, Opts} @@ -331,17 +331,16 @@ rule([cite|_], {_, [ID], _}, Opts) -> {{drop, ["<em><strong>", ID, "</strong></em> "]}, Opts}; CiteList -> - case lists:keysearch(ID, 1, CiteList) of + case lists:keyfind(ID, 1, CiteList) of false -> {{drop, ["<em><strong>", ID, "</strong></em> "]}, Opts}; - - {value, {ID, Name, _Description, _Resp}} -> + {ID, Name, _Description, _Resp} -> {{drop, ["<em><strong>", Name, "</strong></em> "]}, Opts}; - {value, {ID, Name, _Description}} -> + {ID, Name, _Description} -> {{drop, ["<em><strong>", Name, "</strong></em> "]}, Opts} @@ -355,18 +354,18 @@ rule([cite|_], {_, [ID], _}, Opts) -> CiteList -> PartApp = docb_util:lookup_option(part_application, Opts), - case lists:keysearch(ID, 1, CiteList) of + case lists:keyfind(ID, 1, CiteList) of false -> {{drop, ["<a href=\"", PartApp, "_cite.html#", ID, "\">", ID, "</a> "]}, Opts}; - {value, {ID, Name, _Description, _Resp}} -> + {ID, Name, _Description, _Resp} -> {{drop, ["<a href=\"", PartApp, "_cite.html#", ID, "\">", Name, "</a> "]}, Opts}; - {value, {ID, Name, _Description}} -> + {ID, Name, _Description} -> {{drop, ["<a href=\"", PartApp, "_cite.html#", ID, "\">", Name, "</a> "]}, @@ -376,7 +375,7 @@ rule([cite|_], {_, [ID], _}, Opts) -> end; rule([code|_], {_, [Type], [{pcdata, _, Code}]}, Opts) -> - case lists:member(Type,["ERL","C","NONE"]) of + case lists:member(Type, ["ERL","C","NONE"]) of true -> {{drop, ["\n<div class=\"example\"><pre>\n", docb_html_util:element_cdata_to_html(Code), "\n</pre></div>\n"]}, Opts}; diff --git a/lib/docbuilder/src/docb_html_util.erl b/lib/docbuilder/src/docb_html_util.erl index b2951706ea..02ce8b52a7 100644 --- a/lib/docbuilder/src/docb_html_util.erl +++ b/lib/docbuilder/src/docb_html_util.erl @@ -136,7 +136,6 @@ copy_pics(Src, Dest, Opts) -> Dir = code:lib_dir(docbuilder), InFile = filename:join([Dir, "etc", Src]), OutFile = docb_util:outfile(Dest, "", Opts), - case filelib:last_modified(OutFile) of 0 -> % File doesn't exist file:copy(InFile, OutFile); @@ -156,10 +155,10 @@ copy_pics(Src, Dest, Opts) -> %%--Resolve header data------------------------------------------------- extract_header_data(Key, {header, [], List}) -> - case lists:keysearch(Key, 1, List) of - {value, {Key, [], []}} -> + case lists:keyfind(Key, 1, List) of + {Key, [], []} -> ""; - {value, {Key, [], [{pcdata, [], Value}]}} -> + {Key, [], [{pcdata, [], Value}]} -> pcdata_to_html(Value); false -> "" @@ -253,7 +252,7 @@ make_anchor_href(HRef) -> {ok, [HRef]} -> %% No `#' in HRef, i.e. only path make_anchor_href(HRef, ""); - {ok, [Path, Fragment]}-> + {ok, [Path, Fragment]} -> make_anchor_href(Path, Fragment) end. @@ -398,10 +397,10 @@ count_sections([]) -> %%--Make a ToC---------------------------------------------------------- format_toc(Toc) -> - lists:map(fun({Number, Title}) -> - [Number, " <a href = \"#", Number, - "\">", Title, "</a><br/>\n"] - end, Toc). + [format_toc1(T) || T <- Toc]. + +format_toc1({Number, Title}) -> + [Number, " <a href = \"#", Number, "\">", Title, "</a><br/>\n"]. %%--Convert HTML ISO Latin 1 characters to ordinary characters---------- diff --git a/lib/docbuilder/src/docb_main.erl b/lib/docbuilder/src/docb_main.erl index ef21f65557..87a1401a02 100644 --- a/lib/docbuilder/src/docb_main.erl +++ b/lib/docbuilder/src/docb_main.erl @@ -55,7 +55,7 @@ process(File, Opts) -> %% If no target format is specified, assume HTML: Tos = if - Tos0==[] -> [html]; + Tos0 =:= [] -> [html]; true -> Tos0 end, @@ -327,12 +327,8 @@ verify(Tree) -> verify(Tree, [], 1). verify({pcdata, Optional, _}, Path, Level) -> verify_optional(Optional, Path, Level); verify({Tag, Optional, Args}, Path, Level) when is_list(Args) -> - case verify_optional(Optional, Path, Level) of - true -> - verify_list(Args, [Tag|Path], Level); - false -> - false - end; + verify_optional(Optional, Path, Level) + andalso verify_list(Args, [Tag|Path], Level); verify(Other, Path, Level) -> verify_error(Other, Path, Level). @@ -342,12 +338,7 @@ verify_error(X, Path, Level) -> false. verify_list([H|T], Path, Level) -> - case verify(H, Path, Level) of - true -> - verify_list(T, Path, Level +1); - false -> - false - end; + verify(H, Path, Level) andalso verify_list(T, Path, Level + 1); verify_list([], _, _) -> true. @@ -419,7 +410,7 @@ edit1_list(_Tag, [], _Op) -> %% Actual transformation of tree structure to desired format. transform(From, To, Opts, File, Tree) -> Filter = if - To==html; To==kwic -> + To =:= html; To =:= kwic -> list_to_atom("docb_tr_" ++ atom_to_list(From) ++ [$2|atom_to_list(To)]); true -> @@ -427,7 +418,7 @@ transform(From, To, Opts, File, Tree) -> [$2|atom_to_list(To)]) end, - case catch apply(Filter, transform, [File, Tree, Opts]) of + case catch Filter:transform(File, Tree, Opts) of %% R5C {'EXIT', {undef, [{Filter, transform, [File, Tree, Opts]}|_]}}-> @@ -459,9 +450,9 @@ transform(From, To, Opts, File, Tree) -> finish_transform(Tree, File, Opts, Filter) -> {Str, NewOpts} = pp(Tree, [], 1, Filter, Opts), Extension = - case catch apply(Filter, extension, [NewOpts]) of + case catch Filter:extension(NewOpts) of {'EXIT', _} -> - apply(Filter, extension, []); + Filter:extension(); Others -> Others end, @@ -606,7 +597,7 @@ include_all(Fd) -> eof -> []; ListOfChars -> - lists:append(ListOfChars, include_all(Fd)) + ListOfChars ++ include_all(Fd) end. extract(File, Fd, StartTag, StopTag, State) -> diff --git a/lib/docbuilder/src/docb_pretty_format.erl b/lib/docbuilder/src/docb_pretty_format.erl index 0c4fb0507b..25dcd8987b 100644 --- a/lib/docbuilder/src/docb_pretty_format.erl +++ b/lib/docbuilder/src/docb_pretty_format.erl @@ -47,7 +47,7 @@ term(Term) -> %% the next line to need an "extra" indent!). term([], Indent) -> {Indent, [$[,$]]}; -term(L, Indent) when list(L) -> +term(L, Indent) when is_list(L) -> case is_string(L) of true -> {Indent, io_lib:write_string(L)}; @@ -59,7 +59,7 @@ term(L, Indent) when list(L) -> write_simple_list(L, Indent) end end; -term(T, Indent) when tuple(T) -> +term(T, Indent) when is_tuple(T) -> case complex_tuple(T) of true -> write_complex_tuple(T, Indent); diff --git a/lib/docbuilder/src/docb_tr_application2html.erl b/lib/docbuilder/src/docb_tr_application2html.erl index 4084cfe6ba..d8cb214d0a 100644 --- a/lib/docbuilder/src/docb_tr_application2html.erl +++ b/lib/docbuilder/src/docb_tr_application2html.erl @@ -119,8 +119,8 @@ transform(File, {application, _Attrs, [Header|Rest]}, Opts0) -> case docb_main:parse1("fascicules", Opts0) of {ok, Parse} -> FascData = get_fasc_data(Parse), - case lists:keysearch(File, 1, FascData) of - {value, {_, _, "YES", _}} -> + case lists:keyfind(File, 1, FascData) of + {_, _, "YES", _} -> OrigFile = docb_util:outfile(File++"_frame", ".html", Opts0), @@ -167,7 +167,7 @@ concat_files([File|Rest], Body, Opts) -> %% Remove the reference manual header [{Ref, [], [_Hdr| NewBody]}] = NewParse, RefParse = [{Ref, [], NewBody}], - lists:append(Body, concat_files(Rest, RefParse, Opts)); + Body ++ concat_files(Rest, RefParse, Opts); errors -> errors end; @@ -216,7 +216,7 @@ make_toc([{lib, Attrs, More}|Rest]) -> make_toc([{com, Attrs, More}|Rest]) -> [{com, Attrs, More}|make_toc(Rest)]; make_toc([{_Tag, _Attrs, More}|Rest]) -> - lists:append(make_toc(More), make_toc(Rest)). + make_toc(More) ++ make_toc(Rest). rule([module|_], {_, [File], _}) -> {"<small><a target=\"document\" href=\"" ++ @@ -280,9 +280,7 @@ get_fasc_data({fascicules, _, Fascs}) -> Fascs). get_avals(Atts) -> - lists:map(fun(Tuple) -> - element(3, Tuple) end, - Atts). + [element(3, Tuple) || Tuple <- Atts]. get_pc_text([{pcdata, _, Text}]) -> Text. diff --git a/lib/docbuilder/src/docb_tr_cite2html.erl b/lib/docbuilder/src/docb_tr_cite2html.erl index 4ecbfa4e91..77f1c4e636 100644 --- a/lib/docbuilder/src/docb_tr_cite2html.erl +++ b/lib/docbuilder/src/docb_tr_cite2html.erl @@ -39,24 +39,22 @@ purge_body([], _) -> purge_body([{pcdata,_Attrs,_More}|Rest], CiteList) -> purge_body(Rest, CiteList); purge_body([{cite,[{"ID","CDATA",ID}],More}|Rest], CiteList) -> - case lists:keysearch(ID, 1, CiteList) of + case lists:keyfind(ID, 1, CiteList) of false -> [{cite, [{"NAME","CDATA",ID}, {"ID","CDATA",ID}], More}| purge_body(Rest, CiteList)]; - {value, {ID, Name, _Description, _Responsible}} -> + {ID, Name, _Description, _Responsible} -> [{cite, [{"NAME","CDATA",Name}, {"ID","CDATA",ID}], More}| purge_body(Rest, CiteList)]; - {value, {ID, Name, _Description}} -> + {ID, Name, _Description} -> [{cite, [{"NAME","CDATA",Name}, {"ID","CDATA",ID}], More}| purge_body(Rest, CiteList)] end; purge_body([{_Tag,_Attrs,More}|Rest], CiteList) -> - lists:append(purge_body(More, CiteList), - purge_body(Rest, CiteList)). + purge_body(More, CiteList) ++ purge_body(Rest, CiteList). rule([header|_], _) -> {drop, ""}; - rule(_, _) -> {drop, ""}. @@ -91,19 +89,19 @@ rule([cite|_], {_,[Name,ID], [{citedef,[],[{pcdata,[],Def}]}]}, Opts) -> false -> []; Value -> Value end, - case lists:keysearch(ID, 1, CiteList) of + case lists:keyfind(ID, 1, CiteList) of false -> {{drop,"\n<dt><a name=\"" ++ ID ++ "\">" ++ "<strong>" ++ ID ++ "</strong></a></dt>\n<dd>" ++ docb_html_util:pcdata_to_html(Def) ++ "\n</dd>\n"}, Opts}; - {value, {ID, Name, Description, _Responsible}} -> + {ID, Name, Description, _Responsible} -> docb_util:message(warning, "Global cite ~s overriding local", [ID]), {{drop,"\n<dt><a name=\"" ++ ID ++ "\">" ++ "<strong>" ++ Name ++ "</strong></a></dt>\n<dd>" ++ docb_html_util:pcdata_to_html(Description) ++ "\n</dd>\n"}, Opts}; - {value, {ID, Name, Description}} -> + {ID, Name, Description} -> docb_util:message(warning, "Global cite ~s overriding local", [ID]), {{drop,"\n<dt><a name=\"" ++ ID ++ "\">" ++ @@ -117,19 +115,19 @@ rule([cite|_], {_,[Name,ID],_}, Opts) -> false -> []; Value -> Value end, - case lists:keysearch(ID, 1, CiteList) of + case lists:keyfind(ID, 1, CiteList) of false -> docb_util:message(error, "The cite ~s has no definition", [ID]), {{drop,"\n<dt><a name=\"" ++ ID ++ "\">" ++ "<strong>" ++ ID ++ "</strong></a></dt>\n<dd>" ++ "??" ++ "\n</dd>\n"}, Opts}; - {value, {ID, Name, Description, _Responsible}} -> + {ID, Name, Description, _Responsible} -> {{drop,"\n<dt><a name=\"" ++ ID ++ "\">" ++ "<strong>" ++ Name ++ "</strong></a></dt>\n<dd>" ++ docb_html_util:pcdata_to_html(Description) ++ "\n</dd>\n"}, Opts}; - {value, {ID, Name, Description}} -> + {ID, Name, Description} -> {{drop,"\n<dt><a name=\"" ++ ID ++ "\">" ++ "<strong>" ++ Name ++ "</strong></a></dt>\n<dd>" ++ docb_html_util:pcdata_to_html(Description) ++ "\n</dd>\n"}, Opts} diff --git a/lib/docbuilder/src/docb_tr_index2html.erl b/lib/docbuilder/src/docb_tr_index2html.erl index bbf419f3ef..312342add2 100644 --- a/lib/docbuilder/src/docb_tr_index2html.erl +++ b/lib/docbuilder/src/docb_tr_index2html.erl @@ -73,9 +73,7 @@ prune_flat([], _) -> []. keep_pcdata(Trees) -> - lists:filter(fun({pcdata, _, _}) -> true; - (_) -> false - end, Trees). + [T || T = {pcdata, _, _} <- Trees]. new_trees(FileFuncs) -> Files0 = [{File, RefType} || {File, RefType, _} <- FileFuncs], diff --git a/lib/docbuilder/src/docb_tr_part2html.erl b/lib/docbuilder/src/docb_tr_part2html.erl index dd44c4a8df..30befe8432 100644 --- a/lib/docbuilder/src/docb_tr_part2html.erl +++ b/lib/docbuilder/src/docb_tr_part2html.erl @@ -93,8 +93,8 @@ transform(File, {part, _Attrs, [Header| Rest]}, Opts0) -> case docb_main:parse1("fascicules", Opts0) of {ok, Parse} -> FascData = get_fasc_data(Parse), - case lists:keysearch(File, 1, FascData) of - {value, {_, _, "YES", _}} -> + case lists:keyfind(File, 1, FascData) of + {_, _, "YES", _} -> OrigFile = docb_util:outfile(File++"_frame", ".html", Opts0), @@ -137,7 +137,7 @@ concat_files([File | Rest], Body, ChLevel, Opts, TP, TOpts, Ext) -> case docb_main:parse1(File, Opts) of {ok, Parse} -> {TopTag, Attrs, [Header = {header, _, HeaderContents} | More]} = Parse, - {value,{title,_,Title}} = lists:keysearch(title,1,HeaderContents), + {title,_,Title} = lists:keyfind(title,1,HeaderContents), NewMore = [{section, [], [{title, [], Title}| More]}], NewParse = {TopTag, Attrs, [Header| NewMore]}, if @@ -156,9 +156,8 @@ concat_files([File | Rest], Body, ChLevel, Opts, TP, TOpts, Ext) -> docb_html_util:number(NewParse, integer_to_list(ChLevel), File), {_, [], [_| NewBody]} = NumberTree, - lists:append(Body, - concat_files(Rest, NewBody, ChLevel+1, Opts, - TP, TOpts, Ext)); + Body ++ concat_files(Rest, NewBody, ChLevel+1, Opts, + TP, TOpts, Ext); errors -> throw({error,"Parse error when building chapter "++File}) end; @@ -232,9 +231,7 @@ get_fasc_data({fascicules, _, Fascs}) -> Fascs). get_avals(Atts) -> - lists:map(fun(Tuple) -> - element(3, Tuple) end, - Atts). + [element(3, Tuple) || Tuple <- Atts]. get_pc_text([{pcdata, _, Text}]) -> Text. diff --git a/lib/docbuilder/src/docb_tr_term2html.erl b/lib/docbuilder/src/docb_tr_term2html.erl index 0a993cebb1..a3c4a5312a 100644 --- a/lib/docbuilder/src/docb_tr_term2html.erl +++ b/lib/docbuilder/src/docb_tr_term2html.erl @@ -39,24 +39,22 @@ purge_body([], _) -> purge_body([{pcdata,_Attrs,_More}|Rest], TermList) -> purge_body(Rest, TermList); purge_body([{term,[{"ID","CDATA",ID}],More}|Rest], TermList) -> - case lists:keysearch(ID, 1, TermList) of + case lists:keyfind(ID, 1, TermList) of false -> [{term,[{"NAME","CDATA",ID},{"ID","CDATA",ID}],More}| purge_body(Rest, TermList)]; - {value, {ID, Name, _Description, _Responsible}} -> + {ID, Name, _Description, _Responsible} -> [{term,[{"NAME","CDATA",Name},{"ID","CDATA",ID}],More}| purge_body(Rest, TermList)]; - {value, {ID, Name, _Description}} -> + {ID, Name, _Description} -> [{term,[{"NAME","CDATA",Name},{"ID","CDATA",ID}],More}| purge_body(Rest, TermList)] end; purge_body([{_Tag,_Attrs,More}|Rest], TermList) -> - lists:append(purge_body(More, TermList), - purge_body(Rest, TermList)). + purge_body(More, TermList) ++ purge_body(Rest, TermList). rule([header|_], _) -> {drop, ""}; - rule(_, _) -> {drop, ""}. @@ -82,19 +80,19 @@ rule([term|_], {_,[Name,ID],[{termdef,[],[{pcdata,[],Def}]}]}, Opts) -> false -> []; Value -> Value end, - case lists:keysearch(ID, 1, TermList) of + case lists:keyfind(ID, 1, TermList) of false -> {{drop,"\n<dt><a name=\"" ++ ID ++ "\">" ++ "<strong>" ++ ID ++ "</strong></a>\n</dt>\n<dd>" ++ docb_html_util:pcdata_to_html(Def) ++ "\n</dd>\n"}, Opts}; - {value, {ID, Name, Description, _Responsible}} -> + {ID, Name, Description, _Responsible} -> docb_util:message(warning, "Global term ~s overriding local", [ID]), {{drop,"\n<dt><a name=\"" ++ ID ++ "\">" ++ "<strong>" ++ Name ++ "</strong></a></dt>\n<dd>" ++ docb_html_util:pcdata_to_html(Description) ++ "\n</dd>\n"}, Opts}; - {value, {ID, Name, Description}} -> + {ID, Name, Description} -> docb_util:message(warning, "Global term ~s overriding local", [ID]), {{drop, "\n<dt><a name=\"" ++ ID ++ "\">" ++ @@ -107,19 +105,19 @@ rule([term|_], {_,[Name,ID],_}, Opts) -> false -> []; Value -> Value end, - case lists:keysearch(ID, 1, TermList) of + case lists:keyfind(ID, 1, TermList) of false -> docb_util:message(error, "The term ~s has no definition", [ID]), {{drop, "\n<dt><a name=\"" ++ ID ++ "\">" ++ "<strong>" ++ ID ++ "</strong></a></dt>\n<dd>" ++ "??" ++ "\n</dd>\n"}, Opts}; - {value, {ID, Name, Description, _Responsible}} -> + {ID, Name, Description, _Responsible} -> {{drop, "\n<dt><a name=\"" ++ ID ++ "\">" ++ "<strong>" ++ Name ++ "</strong></a></dt>\n<dd>" ++ docb_html_util:pcdata_to_html(Description) ++ "\n</dd>\n"}, Opts}; - {value, {ID, Name, Description}} -> + {ID, Name, Description} -> {{drop, "\n<dt><a name=\"" ++ ID ++ "\">" ++ "<strong>" ++ Name ++ "</strong></a></dt>\n<dd>" ++ docb_html_util:pcdata_to_html(Description) ++ "\n</dd>\n"}, Opts} diff --git a/lib/docbuilder/src/docb_transform.erl b/lib/docbuilder/src/docb_transform.erl index a432038adf..9c7561b07b 100644 --- a/lib/docbuilder/src/docb_transform.erl +++ b/lib/docbuilder/src/docb_transform.erl @@ -135,8 +135,8 @@ parse([Opt | _RawOpts], _Opts) -> get_defs(Type, File, Opts) -> Key = {defs,Type}, {PrevDefs, Opts2} = - case lists:keysearch(Key, 1, Opts) of - {value, {_, Defs0}} -> + case lists:keyfind(Key, 1, Opts) of + {_, Defs0} -> {Defs0, lists:keydelete(Key, 1, Opts)}; false -> {[], Opts} diff --git a/lib/docbuilder/src/docb_util.erl b/lib/docbuilder/src/docb_util.erl index 59673ef3a4..9b2eec7733 100644 --- a/lib/docbuilder/src/docb_util.erl +++ b/lib/docbuilder/src/docb_util.erl @@ -61,7 +61,7 @@ html_snippet(What, Opts) -> case lookup_option(html_mod, Opts) of false -> ""; Module -> - case catch apply(Module, What, []) of + case catch Module:What() of HTML when is_list(HTML) -> HTML; {'EXIT', {undef, _}} -> @@ -82,7 +82,7 @@ html_snippet(What, Arg, Opts) -> case lookup_option(html_mod, Opts) of false -> ""; Module -> - case catch apply(Module, What, [Arg]) of + case catch Module:What(Arg) of HTML when is_list(HTML) -> HTML; {'EXIT', {undef, _}} -> @@ -106,8 +106,8 @@ html_snippet(What, Arg, Opts) -> %% lookup_option(Opt, Opts) -> Value | false lookup_option(Opt, Opts) -> - case lists:keysearch(Opt, 1, Opts) of - {value, {Opt,Value}} -> Value; + case lists:keyfind(Opt, 1, Opts) of + {Opt,Value} -> Value; false -> false end. diff --git a/lib/docbuilder/src/docb_xmerl_tree_cb.erl b/lib/docbuilder/src/docb_xmerl_tree_cb.erl index d57f55bff8..bc62069230 100644 --- a/lib/docbuilder/src/docb_xmerl_tree_cb.erl +++ b/lib/docbuilder/src/docb_xmerl_tree_cb.erl @@ -188,8 +188,8 @@ attrs(DTD, Tag, GivenAttrs) -> merge_attrs(Tag, default_attrs(DTD, Tag), GivenAttrs). merge_attrs(Tag, [{NameA, Type, DefVal}|Default], GivenAttrs) -> - Val = case lists:keysearch(NameA, #xmlAttribute.name, GivenAttrs) of - {value, #xmlAttribute{value=Val0}} -> Val0; + Val = case lists:keyfind(NameA, #xmlAttribute.name, GivenAttrs) of + #xmlAttribute{value=Val0} -> Val0; false -> DefVal end, Attr = {attr_name(NameA), Type, attr_val(Type, Val)}, diff --git a/lib/docbuilder/vsn.mk b/lib/docbuilder/vsn.mk index 2852ebcc8b..5bb92fd209 100644 --- a/lib/docbuilder/vsn.mk +++ b/lib/docbuilder/vsn.mk @@ -1,14 +1 @@ DOCB_VSN = 0.9.8.7 - -TICKETS = OTP-8343 - -TICKETS_0.9.8.6 = OTP-8201 - -TICKETS_0.9.8.5 = OTP-7851 - -TICKETS_0.9.8.4 = OTP-7236 - -TICKETS_0.9.8.1 = OTP-7236 - - - diff --git a/lib/edoc/src/edoc_lib.erl b/lib/edoc/src/edoc_lib.erl index 47e61f7932..5b7fb1e0d2 100644 --- a/lib/edoc/src/edoc_lib.erl +++ b/lib/edoc/src/edoc_lib.erl @@ -472,7 +472,7 @@ uri_get_file(File0) -> uri_get_http(URI) -> %% Try using option full_result=false - case catch {ok, http:request(get, {URI,[]}, [], + case catch {ok, httpc:request(get, {URI,[]}, [], [{full_result, false}])} of {'EXIT', _} -> uri_get_http_r10(URI); @@ -482,7 +482,7 @@ uri_get_http(URI) -> uri_get_http_r10(URI) -> %% Try most general form of request - Result = (catch {ok, http:request(get, {URI,[]}, [], [])}), + Result = (catch {ok, httpc:request(get, {URI,[]}, [], [])}), uri_get_http_1(Result, URI). uri_get_http_1(Result, URI) -> diff --git a/lib/erl_docgen/priv/xsl/db_html.xsl b/lib/erl_docgen/priv/xsl/db_html.xsl index 5614b02bb7..bba0f97645 100644 --- a/lib/erl_docgen/priv/xsl/db_html.xsl +++ b/lib/erl_docgen/priv/xsl/db_html.xsl @@ -1157,6 +1157,7 @@ </xsl:template> + <xsl:template match="name"> <xsl:variable name="tmpstring"> @@ -1208,6 +1209,9 @@ </xsl:variable> <a name="{$fname}-{$arity}"><span class="bold_code"><xsl:value-of select="."/></span></a><br/> </xsl:when> + <xsl:otherwise> + <span class="bold_code"><xsl:value-of select="."/></span> + </xsl:otherwise> </xsl:choose> </xsl:template> diff --git a/lib/erl_docgen/vsn.mk b/lib/erl_docgen/vsn.mk index 5b14051034..33d8c1f708 100644 --- a/lib/erl_docgen/vsn.mk +++ b/lib/erl_docgen/vsn.mk @@ -1,22 +1 @@ -# -# %CopyrightBegin% -# -# Copyright Ericsson AB 2009-2010. All Rights Reserved. -# -# The contents of this file are subject to the Erlang Public License, -# Version 1.1, (the "License"); you may not use this file except in -# compliance with the License. You should have received a copy of the -# Erlang Public License along with this software. If not, it can be -# retrieved online at http://www.erlang.org/. -# -# Software distributed under the License is distributed on an "AS IS" -# basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See -# the License for the specific language governing rights and limitations -# under the License. -# -# %CopyrightEnd% -# - ERL_DOCGEN_VSN = 0.2.1 - -TICKETS = diff --git a/lib/erl_interface/doc/src/ei_connect.xml b/lib/erl_interface/doc/src/ei_connect.xml index abf705f9e2..927395d1bf 100644 --- a/lib/erl_interface/doc/src/ei_connect.xml +++ b/lib/erl_interface/doc/src/ei_connect.xml @@ -54,7 +54,7 @@ the operation, if the primitive does not complete within the time specified, the function will return an error and <c><![CDATA[erl_errno]]></c> will be set to <c><![CDATA[ETIMEDOUT]]></c>. With - communication primitive is ment an operation on the socket, like + communication primitive is meant an operation on the socket, like <c><![CDATA[connect]]></c>, <c><![CDATA[accept]]></c>, <c><![CDATA[recv]]></c> or <c><![CDATA[send]]></c>.</p> <p>Obviously the timeouts are for implementing fault tolerance, not to keep hard realtime promises. The <c><![CDATA[_tmo]]></c> functions diff --git a/lib/erl_interface/src/legacy/erl_marshal.c b/lib/erl_interface/src/legacy/erl_marshal.c index c57c552b90..18315bfbd3 100644 --- a/lib/erl_interface/src/legacy/erl_marshal.c +++ b/lib/erl_interface/src/legacy/erl_marshal.c @@ -26,6 +26,7 @@ #include <ctype.h> #include <sys/types.h> #include <string.h> +#include <limits.h> #include "erl_interface.h" #include "erl_marshal.h" @@ -178,26 +179,14 @@ int erl_encode_it(ETERM *ep, unsigned char **ext, int dist) return 0; case ERL_INTEGER: - i = ep->uval.ival.i; - /* ERL_SMALL_BIG */ - if ((i > ERL_MAX) || (i < ERL_MIN)) { - *(*ext)++ = ERL_SMALL_BIG_EXT; - *(*ext)++ = 4; /* four bytes */ - if ((*(*ext)++ = ((i>>31) & 0x01))) /* sign byte */ - i = -i; - *(*ext)++ = i & 0xff; /* LSB first */ - *(*ext)++ = (i >> 8) & 0xff; - *(*ext)++ = (i >> 16) & 0xff; - *(*ext)++ = (i >> 24) & 0x7f; /* Don't include the sign bit */ - return 0; - } + i = ep->uval.ival.i; /* SMALL_INTEGER */ if ((i < 256) && (i >= 0)) { *(*ext)++ = ERL_SMALL_INTEGER_EXT; *(*ext)++ = i & 0xff; return 0; } - /* INTEGER */ + /* R14B: Use all 32 bits of INTEGER_EXT */ *(*ext)++ = ERL_INTEGER_EXT; *(*ext)++ = (i >> 24) & 0xff; *(*ext)++ = (i >> 16) & 0xff; @@ -208,23 +197,23 @@ int erl_encode_it(ETERM *ep, unsigned char **ext, int dist) case ERL_U_INTEGER: u = ep->uval.uival.u; /* ERL_U_SMALL_BIG */ - if (u > ERL_MAX) { - *(*ext)++ = ERL_SMALL_BIG_EXT; - *(*ext)++ = 4; /* four bytes */ - *(*ext)++ = 0; /* sign byte */ - *(*ext)++ = u & 0xff; /* LSB first */ - *(*ext)++ = (u >> 8) & 0xff; - *(*ext)++ = (u >> 16) & 0xff; - *(*ext)++ = (u >> 24) & 0xff; - return 0; + if ((int)u < 0) { + *(*ext)++ = ERL_SMALL_BIG_EXT; + *(*ext)++ = 4; /* four bytes */ + *(*ext)++ = 0; /* sign byte */ + *(*ext)++ = u & 0xff; /* LSB first */ + *(*ext)++ = (u >> 8) & 0xff; + *(*ext)++ = (u >> 16) & 0xff; + *(*ext)++ = (u >> 24) & 0xff; + return 0; } /* SMALL_INTEGER */ - if ((u < 256) && (u >= 0)) { + if (u < 256) { *(*ext)++ = ERL_SMALL_INTEGER_EXT; *(*ext)++ = u & 0xff; return 0; } - /* INTEGER */ + /* R14B: Use all 32 bits of INTEGER_EXT */ *(*ext)++ = ERL_INTEGER_EXT; *(*ext)++ = (u >> 24) & 0xff; *(*ext)++ = (u >> 16) & 0xff; @@ -234,29 +223,28 @@ int erl_encode_it(ETERM *ep, unsigned char **ext, int dist) case ERL_LONGLONG: l = ep->uval.llval.i; /* ERL_SMALL_BIG */ - if ((l > ((long long) ERL_MAX)) || - (l < ((long long) ERL_MIN))) { - *(*ext)++ = ERL_SMALL_BIG_EXT; - *(*ext)++ = 8; /* eight bytes */ - if ((*(*ext)++ = ((l>>63) & 0x01))) /* sign byte */ + if (l > ((long long) INT_MAX) || l < ((long long) INT_MIN)) { + *(*ext)++ = ERL_SMALL_BIG_EXT; + *(*ext)++ = 8; + if ((*(*ext)++ = (l<0))) /* sign byte */ l = -l; - *(*ext)++ = l & 0xff; /* LSB first */ + *(*ext)++ = l & 0xff; /* LSB first */ *(*ext)++ = (l >> 8) & 0xff; *(*ext)++ = (l >> 16) & 0xff; - *(*ext)++ = (l >> 24) & 0xff; - *(*ext)++ = (l >> 32) & 0xff; - *(*ext)++ = (l >> 40) & 0xff; - *(*ext)++ = (l >> 48) & 0xff; - *(*ext)++ = (l >> 56) & 0x7f; /* Don't include the sign bit */ + *(*ext)++ = (l >> 24) & 0xff; + *(*ext)++ = (l >> 32) & 0xff; + *(*ext)++ = (l >> 40) & 0xff; + *(*ext)++ = (l >> 48) & 0xff; + *(*ext)++ = (l >> 56) & 0xff; return 0; } /* SMALL_INTEGER */ if ((l < 256) && (l >= 0)) { - *(*ext)++ = ERL_SMALL_INTEGER_EXT; - *(*ext)++ = l & 0xff; - return 0; + *(*ext)++ = ERL_SMALL_INTEGER_EXT; + *(*ext)++ = l & 0xff; + return 0; } - /* INTEGER */ + /* R14B: Use all 32 bits of INTEGER_EXT */ *(*ext)++ = ERL_INTEGER_EXT; *(*ext)++ = (l >> 24) & 0xff; *(*ext)++ = (l >> 16) & 0xff; @@ -267,7 +255,7 @@ int erl_encode_it(ETERM *ep, unsigned char **ext, int dist) case ERL_U_LONGLONG: ul = ep->uval.ullval.u; /* ERL_U_SMALL_BIG */ - if (ul > ((unsigned long long) ERL_MAX)) { + if (ul > ((unsigned long long) INT_MAX)) { *(*ext)++ = ERL_SMALL_BIG_EXT; *(*ext)++ = 8; /* eight bytes */ *(*ext)++ = 0; /* sign byte */ @@ -287,7 +275,7 @@ int erl_encode_it(ETERM *ep, unsigned char **ext, int dist) *(*ext)++ = ul & 0xff; return 0; } - /* INTEGER */ + /* R14B: Use all 32 bits of INTEGER_EXT */ *(*ext)++ = ERL_INTEGER_EXT; *(*ext)++ = (ul >> 24) & 0xff; *(*ext)++ = (ul >> 16) & 0xff; @@ -732,11 +720,6 @@ static ETERM *erl_decode_it(unsigned char **ext) if (arity > 8) goto big_truncate; - if (arity == 8 && ((*ext)[7] & 0x80) && sign) { - /* MSB already occupied ! */ - goto big_truncate; - } - if (arity == 4 && ((*ext)[3] & 0x80) && !sign) { /* It will fit into an unsigned int !! */ u = (((*ext)[3] << 24)|((*ext)[2])<< 16|((*ext)[1]) << 8 |(**ext)); @@ -747,14 +730,10 @@ static ETERM *erl_decode_it(unsigned char **ext) return ep; } else if (arity == 4 && !((*ext)[3] & 0x80)) { /* It will fit into an int !! - * Note: It comes in "one's-complement notation" */ - if (sign) - i = (int) (~(((*ext)[3] << 24) | ((*ext)[2])<< 16 | - ((*ext)[1]) << 8 | (**ext)) | (unsigned int) sign); - else - i = (int) (((*ext)[3] << 24) | ((*ext)[2])<< 16 | - ((*ext)[1]) << 8 | (**ext)); + i = (int) (((*ext)[3] << 24) | ((*ext)[2])<< 16 | + ((*ext)[1]) << 8 | (**ext)); + if (sign) i = -i; ERL_TYPE(ep) = ERL_INTEGER; ep->uval.ival.i = i; *ext += arity; @@ -780,8 +759,10 @@ static ETERM *erl_decode_it(unsigned char **ext) for(x = 0 ; x < arity ; x++) { l |= ((long long)(*ext)[x]) << ((long long)(8*x)); } - - if (sign) l = (long long) (~l | (unsigned long long) sign); + if (sign) { + l = -l; + if (l > 0) goto big_truncate; + } ERL_TYPE(ep) = ERL_LONGLONG; ep->uval.llval.i = l; diff --git a/lib/erl_interface/src/misc/ei_decode_term.c b/lib/erl_interface/src/misc/ei_decode_term.c index ddcbfa5a9a..75c5dc9460 100644 --- a/lib/erl_interface/src/misc/ei_decode_term.c +++ b/lib/erl_interface/src/misc/ei_decode_term.c @@ -34,7 +34,6 @@ int ei_decode_ei_term(const char* buf, int* index, ei_term* term) const char* s = buf + *index, * s0 = s; int len, i, n, sign; char c; - double f; if (term == NULL) return -1; c = term->ei_type = get8(s); diff --git a/lib/erl_interface/src/prog/erl_call.c b/lib/erl_interface/src/prog/erl_call.c index f0d638324d..93b84cbb36 100644 --- a/lib/erl_interface/src/prog/erl_call.c +++ b/lib/erl_interface/src/prog/erl_call.c @@ -812,7 +812,8 @@ static int get_module(char **mbuf, char **mname) *mname = (char *) calloc(i+1, sizeof(char)); memcpy(*mname, start, i); } - free(mbuf); /* Allocated in read_stdin() */ + if (*mbuf) + free(*mbuf); /* Allocated in read_stdin() */ return len; diff --git a/lib/erl_interface/test/ei_decode_SUITE.erl b/lib/erl_interface/test/ei_decode_SUITE.erl index c6858b45ad..09a37409f2 100644 --- a/lib/erl_interface/test/ei_decode_SUITE.erl +++ b/lib/erl_interface/test/ei_decode_SUITE.erl @@ -222,14 +222,16 @@ send_integers(P) -> ?line send_term_as_binary(P,256), % INTEGER_EXT smallest pos (*) ?line send_term_as_binary(P,-1), % INTEGER_EXT largest neg - ?line send_term_as_binary(P, 16#07ffffff), % INTEGER_EXT largest (28 bits) - ?line send_term_as_binary(P,-16#08000000), % INTEGER_EXT smallest - ?line send_term_as_binary(P, 16#08000000), % SMALL_BIG_EXT smallest pos(*) - ?line send_term_as_binary(P,-16#08000001), % SMALL_BIG_EXT largest neg (*) - - ?line send_term_as_binary(P, 16#7fffffff), % SMALL_BIG_EXT largest i32 - ?line send_term_as_binary(P,-16#80000000), % SMALL_BIG_EXT smallest i32 - + ?line send_term_as_binary(P, 16#07ffffff), % INTEGER_EXT old largest (28 bits) + ?line send_term_as_binary(P,-16#08000000), % INTEGER_EXT old smallest + ?line send_term_as_binary(P, 16#08000000), % SMALL_BIG_EXT old smallest pos(*) + ?line send_term_as_binary(P,-16#08000001), % SMALL_BIG_EXT old largest neg (*) + + ?line send_term_as_binary(P, 16#7fffffff), % INTEGER_EXT new largest (32 bits) + ?line send_term_as_binary(P,-16#80000000), % INTEGER_EXT new smallest (32 bis) + ?line send_term_as_binary(P, 16#80000000), % SMALL_BIG_EXT new smallest pos(*) + ?line send_term_as_binary(P,-16#80000001), % SMALL_BIG_EXT new largest neg (*) + case erlang:system_info(wordsize) of 4 -> ?line send_term_as_binary(P, 16#80000000),% SMALL_BIG_EXT u32 @@ -266,15 +268,17 @@ send_integers2(P) -> ?line send_term_as_binary(P,255), % SMALL_INTEGER_EXT largest ?line send_term_as_binary(P,256), % INTEGER_EXT smallest pos (*) ?line send_term_as_binary(P,-1), % INTEGER_EXT largest neg + + ?line send_term_as_binary(P, 16#07ffffff), % INTEGER_EXT old largest (28 bits) + ?line send_term_as_binary(P,-16#08000000), % INTEGER_EXT old smallest + ?line send_term_as_binary(P, 16#08000000), % SMALL_BIG_EXT old smallest pos(*) + ?line send_term_as_binary(P,-16#08000001), % SMALL_BIG_EXT old largest neg (*) - ?line send_term_as_binary(P, 16#07ffffff), % INTEGER_EXT largest (28 bits) - ?line send_term_as_binary(P,-16#08000000), % INTEGER_EXT smallest - ?line send_term_as_binary(P, 16#08000000), % SMALL_BIG_EXT smallest pos(*) - ?line send_term_as_binary(P,-16#08000001), % SMALL_BIG_EXT largest neg (*) + ?line send_term_as_binary(P, 16#7fffffff), % INTEGER_EXT new largest (32 bits) + ?line send_term_as_binary(P,-16#80000000), % INTEGER_EXT new smallest + ?line send_term_as_binary(P, 16#80000000), % SMALL_BIG_EXT new smallest pos(*) + ?line send_term_as_binary(P,-16#80000001), % SMALL_BIG_EXT new largest neg (*) - ?line send_term_as_binary(P, 16#7fffffff), % SMALL_BIG_EXT largest i32 - ?line send_term_as_binary(P,-16#80000000), % SMALL_BIG_EXT smallest i32 - ?line send_term_as_binary(P, 16#80000000),% SMALL_BIG_EXT u32 ?line send_term_as_binary(P, 16#ffffffff),% SMALL_BIG_EXT largest u32 ?line send_term_as_binary(P, 16#7fffffffffff), % largest i48 diff --git a/lib/erl_interface/test/ei_decode_SUITE_data/ei_decode_test.c b/lib/erl_interface/test/ei_decode_SUITE_data/ei_decode_test.c index 5447e2deb3..b349138ae9 100644 --- a/lib/erl_interface/test/ei_decode_SUITE_data/ei_decode_test.c +++ b/lib/erl_interface/test/ei_decode_SUITE_data/ei_decode_test.c @@ -246,13 +246,23 @@ TESTCASE(test_ei_decode_long) EI_DECODE_2 (decode_long, 5, long, 256); EI_DECODE_2 (decode_long, 5, long, -1); + /* Old 28 bit limits for INTEGER_EXT */ EI_DECODE_2 (decode_long, 5, long, 0x07ffffff); EI_DECODE_2 (decode_long, 5, long, -0x08000000); - EI_DECODE_2 (decode_long, 7, long, 0x08000000); - EI_DECODE_2 (decode_long, 7, long, -0x08000001); + EI_DECODE_2 (decode_long, 5, long, 0x08000000); + EI_DECODE_2 (decode_long, 5, long, -0x08000001); - EI_DECODE_2 (decode_long, 7, long, 0x7fffffff); - EI_DECODE_2 (decode_long, 7, long, -ll(0x80000000)); /* Strange :-( */ + /* New 32 bit limits for INTEGER_EXT */ + EI_DECODE_2 (decode_long, 5, long, 0x7fffffff); + EI_DECODE_2 (decode_long, 5, long, -ll(0x80000000)); /* Strange :-( */ + if (sizeof(long) > 4) { + EI_DECODE_2(decode_long, 7, long, 0x80000000); + EI_DECODE_2(decode_long, 7, long, -ll(0x80000001)); + } + else { + EI_DECODE_2_FAIL(decode_long, 7, long, 0x80000000); + EI_DECODE_2_FAIL(decode_long, 7, long, -ll(0x80000001)); + } EI_DECODE_2_FAIL(decode_long, 7, long, 0x80000000); EI_DECODE_2_FAIL(decode_long, 7, long, 0xffffffff); @@ -280,11 +290,13 @@ TESTCASE(test_ei_decode_ulong) EI_DECODE_2 (decode_ulong, 5, unsigned long, 0x07ffffff); EI_DECODE_2_FAIL(decode_ulong, 5, unsigned long, -0x08000000); - EI_DECODE_2 (decode_ulong, 7, unsigned long, 0x08000000); - EI_DECODE_2_FAIL(decode_ulong, 7, unsigned long, -0x08000001); + EI_DECODE_2 (decode_ulong, 5, unsigned long, 0x08000000); + EI_DECODE_2_FAIL(decode_ulong, 5, unsigned long, -0x08000001); - EI_DECODE_2 (decode_ulong, 7, unsigned long, 0x7fffffff); - EI_DECODE_2_FAIL(decode_ulong, 7, unsigned long, -ll(0x80000000)); + EI_DECODE_2 (decode_ulong, 5, unsigned long, 0x7fffffff); + EI_DECODE_2_FAIL(decode_ulong, 5, unsigned long, -ll(0x80000000)); + EI_DECODE_2 (decode_ulong, 7, unsigned long, 0x80000000); + EI_DECODE_2_FAIL(decode_ulong, 7, unsigned long, -ll(0x80000001)); if (sizeof(long) > 4) { EI_DECODE_2 (decode_ulong, 11, unsigned long, ll(0x8000000000000000)); @@ -319,13 +331,14 @@ TESTCASE(test_ei_decode_longlong) EI_DECODE_2 (decode_longlong, 5, EI_LONGLONG, 0x07ffffff); EI_DECODE_2 (decode_longlong, 5, EI_LONGLONG, -0x08000000); - EI_DECODE_2 (decode_longlong, 7, EI_LONGLONG, 0x08000000); - EI_DECODE_2 (decode_longlong, 7, EI_LONGLONG, -0x08000001); - - EI_DECODE_2 (decode_longlong, 7, EI_LONGLONG, 0x7fffffff); - EI_DECODE_2 (decode_longlong, 7, EI_LONGLONG, -ll(0x80000000)); + EI_DECODE_2 (decode_longlong, 5, EI_LONGLONG, 0x08000000); + EI_DECODE_2 (decode_longlong, 5, EI_LONGLONG, -0x08000001); + EI_DECODE_2 (decode_longlong, 5, EI_LONGLONG, 0x7fffffff); + EI_DECODE_2 (decode_longlong, 5, EI_LONGLONG, -ll(0x80000000)); EI_DECODE_2 (decode_longlong, 7, EI_LONGLONG, 0x80000000); + EI_DECODE_2 (decode_longlong, 7, EI_LONGLONG, -ll(0x80000001)); + EI_DECODE_2 (decode_longlong, 7, EI_LONGLONG, 0xffffffff); EI_DECODE_2 (decode_longlong, 9, EI_LONGLONG, ll(0x7fffffffffff)); @@ -352,13 +365,14 @@ TESTCASE(test_ei_decode_ulonglong) EI_DECODE_2 (decode_ulonglong, 5, EI_ULONGLONG, 0x07ffffff); EI_DECODE_2_FAIL(decode_ulonglong, 5, EI_ULONGLONG, -0x08000000); - EI_DECODE_2 (decode_ulonglong, 7, EI_ULONGLONG, 0x08000000); - EI_DECODE_2_FAIL(decode_ulonglong, 7, EI_ULONGLONG, -0x08000001); - - EI_DECODE_2 (decode_ulonglong, 7, EI_ULONGLONG, 0x7fffffff); - EI_DECODE_2_FAIL(decode_ulonglong, 7, EI_ULONGLONG, -ll(0x80000000)); + EI_DECODE_2 (decode_ulonglong, 5, EI_ULONGLONG, 0x08000000); + EI_DECODE_2_FAIL(decode_ulonglong, 5, EI_ULONGLONG, -0x08000001); + EI_DECODE_2 (decode_ulonglong, 5, EI_ULONGLONG, 0x7fffffff); + EI_DECODE_2_FAIL(decode_ulonglong, 5, EI_ULONGLONG, -ll(0x80000000)); EI_DECODE_2 (decode_ulonglong, 7, EI_ULONGLONG, 0x80000000); + EI_DECODE_2_FAIL(decode_ulonglong, 7, EI_ULONGLONG, -0x80000001); + EI_DECODE_2 (decode_ulonglong, 7, EI_ULONGLONG, 0xffffffff); EI_DECODE_2 (decode_ulonglong, 9, EI_ULONGLONG, ll(0x7fffffffffff)); diff --git a/lib/erl_interface/test/erl_eterm_SUITE_data/eterm_test.c b/lib/erl_interface/test/erl_eterm_SUITE_data/eterm_test.c index 6b2ec8f766..f273efd532 100644 --- a/lib/erl_interface/test/erl_eterm_SUITE_data/eterm_test.c +++ b/lib/erl_interface/test/erl_eterm_SUITE_data/eterm_test.c @@ -63,32 +63,108 @@ TESTCASE(build_terms) report(1); } +static int abs_and_sign(ETERM* v, unsigned long long* av, int* sign) +{ + long long sv; + switch (ERL_TYPE(v)) { + case ERL_INTEGER: sv = ERL_INT_VALUE(v); break; + case ERL_U_INTEGER: *av = ERL_INT_UVALUE(v); *sign = 0; return 1; + case ERL_LONGLONG: sv = ERL_LL_VALUE(v); break; + case ERL_U_LONGLONG: *av = ERL_LL_UVALUE(v); *sign = 0; return 1; + default: return 0; + } + if (sv < 0) { + *av = -sv; + *sign = 1; + } + else { + *av = sv; + *sign = 0; + } + return 1; +} + +/* Shouldn't erl_match() cope with this? +*/ +static int eq_ints(ETERM* a, ETERM* b) +{ + unsigned long long a_abs, b_abs; + int a_sign, b_sign; + return abs_and_sign(a, &a_abs, &a_sign) && abs_and_sign(b, &b_abs, &b_sign) + && (a_abs == b_abs) && (a_sign == b_sign); +} + +static void encode_decode(ETERM* original, const char* text) +{ + static unsigned char encoded[16*1024]; + ETERM* new_terms; + int bytes = erl_encode(original, encoded); + + if (bytes == 0) { + fail("failed to encode terms"); + } + else if (bytes > sizeof(encoded)) { + fail("encoded terms buffer overflow"); + } + else if ((new_terms = erl_decode(encoded)) == NULL) { + fail("failed to decode terms"); + } + else if (!erl_match(original, new_terms) && !eq_ints(original, new_terms)) { + erl_print_term(stderr, original); + fprintf(stderr, "(%i) != (%i)", ERL_TYPE(original), ERL_TYPE(new_terms)); + erl_print_term(stderr, new_terms); + fprintf(stderr, " [%s]\r\n", text); + fail("decoded terms didn't match original"); + } + erl_free_term(original); + erl_free_term(new_terms); +} /* * Converts an Erlang term to the external term format and back again. */ TESTCASE(round_trip_conversion) { - ETERM* original; - ETERM* new_terms; - char encoded[16*1024]; - int n; + int n, i; erl_init(NULL, 0); - original = all_types(); - if (erl_encode(original, encoded) == 0) + encode_decode(all_types(), "ALL"); + { - fail("failed to encode terms"); - } else if ((new_terms = erl_decode(encoded)) == NULL) + int v; + for (v = 8; v; v <<= 1) { + for (i=-4; i<4; i++) { + encode_decode(erl_mk_int(v+i), "INT"); + encode_decode(erl_mk_int(-(v+i)), "NEG INT"); + } + } + } { - fail("failed to decode terms"); - } else if (!erl_match(original, new_terms)) + unsigned int v; + for (v = 8; v; v <<= 1) { + for (i=-4; i<4; i++) { + encode_decode(erl_mk_uint(v+i), "UINT"); + } + } + } { - fail("decoded terms didn't match original"); + long long v; + for (v = 8; v; v <<= 1) { + for (i=-4; i<4; i++) { + encode_decode(erl_mk_longlong(v+i), "LONGLONG"); + encode_decode(erl_mk_longlong(-(v+i)), "NEG LONGLONG"); + } + } + } + { + unsigned long long v; + for (v = 8; v; v <<= 1) { + for (i=-4; i<4; i++) { + encode_decode(erl_mk_ulonglong(v+i), "ULONGLONG"); + } + } } - erl_free_term(original); - erl_free_term(new_terms); report(1); } diff --git a/lib/et/vsn.mk b/lib/et/vsn.mk index b7d65b12a2..04ecb8c82e 100644 --- a/lib/et/vsn.mk +++ b/lib/et/vsn.mk @@ -1,24 +1 @@ -# This is an -*-makefile-*- file. -# %CopyrightBegin% -# -# Copyright Ericsson AB 2002-2010. All Rights Reserved. -# -# The contents of this file are subject to the Erlang Public License, -# Version 1.1, (the "License"); you may not use this file except in -# compliance with the License. You should have received a copy of the -# Erlang Public License along with this software. If not, it can be -# retrieved online at http://www.erlang.org/. -# -# Software distributed under the License is distributed on an "AS IS" -# basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See -# the License for the specific language governing rights and limitations -# under the License. -# -# %CopyrightEnd% - ET_VSN = 1.4 -TICKETS = OTP-8058 - -TICKETS_1_3_3 = OTP-8201 -TICKETS_1_3_2 = OTP-8078 -TICKETS_1_3_1 = OTP-7830 diff --git a/lib/eunit/doc/overview.edoc b/lib/eunit/doc/overview.edoc index 2583f0be25..be05a13fba 100644 --- a/lib/eunit/doc/overview.edoc +++ b/lib/eunit/doc/overview.edoc @@ -913,7 +913,7 @@ To make the descriptions simpler, we first list some definitions: <td>`CleanupX'</td><td>`(X::any(), R::any()) -> any()'</td> </tr> <tr> -<td>`Instantiator'</td><td>`((R::any()) -> Tests) | {with, [AbstractTestFun::((any()) -> any())]}'</td> +<td>`Instantiator'</td><td>`((R::any()) -> Tests | {with, [AbstractTestFun::((any()) -> any())]}'</td> </tr> <tr> <td>`Where'</td><td>`local | spawn | {spawn, Node::atom()}'</td> diff --git a/lib/hipe/cerl/erl_bif_types.erl b/lib/hipe/cerl/erl_bif_types.erl index 9df3dedb45..6eeeab3610 100644 --- a/lib/hipe/cerl/erl_bif_types.erl +++ b/lib/hipe/cerl/erl_bif_types.erl @@ -1638,7 +1638,6 @@ type(erlang, system_info, 1, Xs) -> t_non_neg_integer()])])); ['allocator'] -> t_tuple([t_sup([t_atom('undefined'), - t_atom('elib_malloc'), t_atom('glibc')]), t_list(t_integer()), t_list(t_atom()), @@ -1659,9 +1658,8 @@ type(erlang, system_info, 1, Xs) -> t_binary(); ['dist_ctrl'] -> t_list(t_tuple([t_atom(), t_sup([t_pid(), t_port])])); - ['elib_malloc'] -> - t_sup([t_atom('false'), - t_list(t_tuple([t_atom(), t_any()]))]); + %% elib_malloc is intentionally not included, + %% because it scheduled for removal in R15. ['endian'] -> t_endian(); ['fullsweep_after'] -> @@ -2337,8 +2335,7 @@ type(lists, flatten, 1, Xs) -> t_list(); false -> X2 = type(lists, flatten, 1, [t_inf(X1, t_list())]), - t_sup(t_list(t_subtract(X1, t_list())), - X2) + t_sup(t_list(t_subtract(X1, t_list())), X2) end end end); @@ -2349,10 +2346,20 @@ type(lists, flatmap, 2, Xs) -> true -> t_nil(); false -> case check_fun_application(F, [t_list_elements(List)]) of - ok -> - case t_is_cons(List) of - true -> t_nonempty_list(t_list_elements(t_fun_range(F))); - false -> t_list(t_list_elements(t_fun_range(F))) + ok -> + R = t_fun_range(F), + case t_is_nil(R) of + true -> t_nil(); + false -> + Elems = t_list_elements(R), + case t_is_cons(List) of + true -> + case t_is_subtype(t_nil(), R) of + true -> t_list(Elems); + false -> t_nonempty_list(Elems) + end; + false -> t_list(Elems) + end end; error -> case t_is_cons(List) of diff --git a/lib/hipe/icode/hipe_icode_exceptions.erl b/lib/hipe/icode/hipe_icode_exceptions.erl index 787fb05415..3c8f7b5712 100644 --- a/lib/hipe/icode/hipe_icode_exceptions.erl +++ b/lib/hipe/icode/hipe_icode_exceptions.erl @@ -344,6 +344,16 @@ pop_catch(Cs) -> pop_catch_1([[_|C] | Cs]) -> [C | pop_catch_1(Cs)]; +pop_catch_1([[] | Cs]) -> + %% The elements in the list represent different possible incoming + %% stacks of catch handlers to this BB. Before the fixpoint has + %% been found these elements are underapproximations of the true + %% stacks, therefore it's possible for these elements to be too + %% short for the number of pops implied by the code in the BB. + %% We must not fail in that case, so we set pop([]) = []. + %% This fixes find_catches_crash.erl and compiler_tests in the + %% HiPE test suite. + [[] | pop_catch_1(Cs)]; pop_catch_1([]) -> []. diff --git a/lib/hipe/rtl/hipe_rtl_primops.erl b/lib/hipe/rtl/hipe_rtl_primops.erl index 560e0259f8..0361053676 100644 --- a/lib/hipe/rtl/hipe_rtl_primops.erl +++ b/lib/hipe/rtl/hipe_rtl_primops.erl @@ -701,9 +701,9 @@ gen_cons(Dst, [Arg1, Arg2]) -> %% Increase refcount %% fe->refc++; %% -%% Link to the process off_heap.funs list -%% funp->next = p->off_heap.funs; -%% p->off_heap.funs = funp; +%% Link to the process off_heap list +%% funp->next = p->off_heap.first; +%% p->off_heap.first = funp; %% %% Tag the thing %% return make_fun(funp); @@ -729,9 +729,9 @@ gen_mkfun([Dst], {_Mod, _FunId, _Arity} = MFidA, MagicNr, Index, FreeVars) -> %% fe->refc++; SkeletonCode = gen_fun_thing_skeleton(HP, MFidA, NumFree, MagicNr, Index), - %% Link to the process off_heap.funs list - %% funp->next = p->off_heap.funs; - %% p->off_heap.funs = funp; + %% Link to the process off_heap list + %% funp->next = p->off_heap.first; + %% p->off_heap.first = funp; LinkCode = gen_link_closure(HP), %% Tag the thing and increase the heap_pointer. @@ -797,14 +797,14 @@ gen_link_closure(FUNP) -> end. gen_link_closure_private(FUNP) -> - %% Link to the process off_heap.funs list - %% funp->next = p->off_heap.funs; - %% p->off_heap.funs = funp; + %% Link fun to the process off_heap list + %% funp->next = p->off_heap.first; + %% p->off_heap.first = funp; FunsVar = hipe_rtl:mk_new_reg(), - [load_p_field(FunsVar,?P_OFF_HEAP_FUNS), + [load_p_field(FunsVar,?P_OFF_HEAP_FIRST), hipe_rtl:mk_store(FUNP, hipe_rtl:mk_imm(?EFT_NEXT), FunsVar), - store_p_field(FUNP,?P_OFF_HEAP_FUNS)]. + store_p_field(FUNP,?P_OFF_HEAP_FIRST)]. gen_link_closure_non_private(_FUNP) -> []. diff --git a/lib/hipe/rtl/hipe_tagscheme.erl b/lib/hipe/rtl/hipe_tagscheme.erl index dc44b803a1..c0b6dfad8a 100644 --- a/lib/hipe/rtl/hipe_tagscheme.erl +++ b/lib/hipe/rtl/hipe_tagscheme.erl @@ -849,9 +849,9 @@ create_refc_binary(Base, Size, Flags, Dst) -> heap_arch_spec(HP) -> Tmp1 = hipe_rtl:mk_new_reg(), % MSO state - [hipe_rtl_arch:pcb_load(Tmp1, ?P_OFF_HEAP_MSO), + [hipe_rtl_arch:pcb_load(Tmp1, ?P_OFF_HEAP_FIRST), set_field_from_pointer({proc_bin, next}, HP, Tmp1), - hipe_rtl_arch:pcb_store(?P_OFF_HEAP_MSO, HP)]. + hipe_rtl_arch:pcb_store(?P_OFF_HEAP_FIRST, HP)]. test_heap_binary(Binary, TrueLblName, FalseLblName) -> Tmp1 = hipe_rtl:mk_new_reg_gcsafe(), diff --git a/lib/ic/vsn.mk b/lib/ic/vsn.mk index 4aa2a04b60..074d0b3d39 100644 --- a/lib/ic/vsn.mk +++ b/lib/ic/vsn.mk @@ -1,20 +1 @@ IC_VSN = 4.2.25 - -TICKETS = OTP-8639 - -TICKETS_4.2.24 = OTP-8307 \ - OTP-8353 \ - OTP-8354 \ - OTP-8355 - -TICKETS_4.2.23 = OTP-8201 - -TICKETS_4.2.22 = OTP-8088 - -TICKETS_4.2.21 = OTP-7982 - -TICKETS_4.2.20 = OTP-7837 - -TICKETS_4.2.19 = OTP-7595 - -TICKETS_4.2.18 = OTP-7313 diff --git a/lib/inets/doc/src/http_client.xml b/lib/inets/doc/src/http_client.xml index 510c30eb35..ea8053cafa 100644 --- a/lib/inets/doc/src/http_client.xml +++ b/lib/inets/doc/src/http_client.xml @@ -4,7 +4,7 @@ <chapter> <header> <copyright> - <year>2004</year><year>2009</year> + <year>2004</year><year>2010</year> <holder>Ericsson AB. All Rights Reserved.</holder> </copyright> <legalnotice> @@ -56,8 +56,8 @@ <pre> [{inets, [{services, [{httpc, PropertyList}]}]}] </pre> - <p>For valid properties see <seealso - marker="http">http(3)</seealso></p> + <p>For valid properties see + <seealso marker="http">httpc(3)</seealso>. </p> </section> <section> @@ -71,67 +71,66 @@ but not for requests to localhost. This will apply to all subsequent requests</p> <code type="erl"> - 2 > http:set_options([{proxy, {{"www-proxy.mycompany.com", 8000}, + 2 > httpc:set_options([{proxy, {{"www-proxy.mycompany.com", 8000}, ["localhost"]}}]). ok </code> <p>An ordinary synchronous request. </p> <code type="erl"> 3 > {ok, {{Version, 200, ReasonPhrase}, Headers, Body}} = - http:request(get, {"http://www.erlang.org", []}, [], []). + httpc:request(get, {"http://www.erlang.org", []}, [], []). </code> <p>With all default values, as above, a get request can also be written like this.</p> <code type="erl"> 4 > {ok, {{Version, 200, ReasonPhrase}, Headers, Body}} = - http:request("http://www.erlang.org"). + httpc:request("http://www.erlang.org"). </code> <p>An ordinary asynchronous request. The result will be sent to the calling process on the form {http, {ReqestId, Result}}</p> <code type="erl"> 5 > {ok, RequestId} = - http:request(get, {"http://www.erlang.org", []}, [], [{sync, false}]). + httpc:request(get, {"http://www.erlang.org", []}, [], [{sync, false}]). </code> <p>In this case the calling process is the shell, so we receive the result.</p> <code type="erl"> - 6 > receive {http, {RequestId, Result}} -> ok after 500 -> error end. + 6 > receive {http, {RequestId, Result}} -> ok after 500 -> error end. ok </code> <p>Send a request with a specified connection header. </p> <code type="erl"> 7 > {ok, {{NewVersion, 200, NewReasonPhrase}, NewHeaders, NewBody}} = - http:request(get, {"http://www.erlang.org", [{"connection", "close"}]}, + httpc:request(get, {"http://www.erlang.org", [{"connection", "close"}]}, [], []). </code> <p>Start a HTTP client profile. </p> <code><![CDATA[ - 8 > {ok, Pid} = inets:start(httpc, [{profile, foo}]). + 8 > {ok, Pid} = inets:start(httpc, [{profile, foo}]). {ok, <0.45.0>} ]]></code> <p>The new profile has no proxy settings so the connection will be refused</p> <code type="erl"> - 9 > http:request("http://www.erlang.org", foo). - {error,econnrefused} + 9 > httpc:request("http://www.erlang.org", foo). + {error, econnrefused} </code> <p>Stop a HTTP client profile. </p> <code type="erl"> - 10 > inets:stop(httpc, foo). + 10 > inets:stop(httpc, foo). ok </code> <p>Alternatively:</p> <code type="erl"> - 10 > inets:stop(httpc, Pid). + 10 > inets:stop(httpc, Pid). ok </code> - </section> </chapter> diff --git a/lib/inets/doc/src/inets.xml b/lib/inets/doc/src/inets.xml index 81dfe7e944..c367d7fa77 100644 --- a/lib/inets/doc/src/inets.xml +++ b/lib/inets/doc/src/inets.xml @@ -13,12 +13,12 @@ compliance with the License. You should have received a copy of the Erlang Public License along with this software. If not, it can be retrieved online at http://www.erlang.org/. - + Software distributed under the License is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for the specific language governing rights and limitations under the License. - + </legalnotice> <title>inets</title> @@ -40,13 +40,13 @@ <title>COMMON DATA TYPES </title> <p>Type definitions that are used more than once in this module: </p> - <p><c> service() = ftpc | tfptd | httpc | httpd</c></p> + <p><c> service() = ftpc | tftp | httpc | httpd</c></p> <p><c> property() = atom() </c></p> </section> <funcs> <func> <name>services() -> [{Service, Pid}]</name> - <fsummary>Returns a list of currently running services. </fsummary> + <fsummary>Returns a list of currently running services. </fsummary> <type> <v>Service = service()</v> <v>Pid = pid()</v> @@ -97,7 +97,7 @@ <name>start(Type) -> ok | {error, Reason}</name> <fsummary>Starts the Inets application. </fsummary> <type> - <v>Type = permanent | transient | temporary</v> + <v>Type = permanent | transient | temporary</v> </type> <desc> <p>Starts the Inets application. Default type @@ -115,11 +115,9 @@ </func> <func> <name>start(Service, ServiceConfig) -> {ok, Pid} | {error, Reason}</name> - <name>start(Service, ServiceConfig, How) -> {ok, Pid} | - {error, Reason}</name> + <name>start(Service, ServiceConfig, How) -> {ok, Pid} | {error, Reason}</name> <fsummary>Dynamically starts an inets - service after the inets application has been - started. </fsummary> + service after the inets application has been started. </fsummary> <type> <v>Service = service()</v> <v>ServiceConfig = [{Option, Value}]</v> @@ -153,9 +151,9 @@ <fsummary>Stops a started service of the inets application or takes down a "stand_alone-service" gracefully.</fsummary> <type> - <v>Service = service() | stand_alone</v> + <v>Service = service() | stand_alone</v> <v>Reference = pid() | term() - service specified reference</v> - <v>Reason = term()</v> + <v>Reason = term()</v> </type> <desc> <p>Stops a started service of the inets application or takes @@ -169,7 +167,7 @@ <section> <title>SEE ALSO</title> <p><seealso marker="ftp">ftp(3)</seealso>, - <seealso marker="http">http(3)</seealso>, + <seealso marker="httpc">httpc(3)</seealso>, <seealso marker="httpd">httpd(3)</seealso>, <seealso marker="tftp">tftp(3)</seealso></p> </section> diff --git a/lib/inets/src/http_client/httpc_handler.erl b/lib/inets/src/http_client/httpc_handler.erl index c34b641b7b..8af6613fa2 100644 --- a/lib/inets/src/http_client/httpc_handler.erl +++ b/lib/inets/src/http_client/httpc_handler.erl @@ -1,19 +1,19 @@ %% %% %CopyrightBegin% -%% +%% %% Copyright Ericsson AB 2002-2010. All Rights Reserved. -%% +%% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in %% compliance with the License. You should have received a copy of the %% Erlang Public License along with this software. If not, it can be %% retrieved online at http://www.erlang.org/. -%% +%% %% Software distributed under the License is distributed on an "AS IS" %% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See %% the License for the specific language governing rights and limitations %% under the License. -%% +%% %% %CopyrightEnd% %% %% @@ -605,24 +605,29 @@ handle_info({ssl_error, _, _} = Reason, State) -> %% Internally, to a request handling process, a request timeout is %% seen as a canceled request. handle_info({timeout, RequestId}, - #state{request = #request{id = RequestId} = Request, - canceled = Canceled} = State) -> + #state{request = #request{id = RequestId} = Request, + canceled = Canceled, + profile_name = ProfileName} = State) -> ?hcri("timeout of current request", [{id, RequestId}]), httpc_response:send(Request#request.from, httpc_response:error(Request, timeout)), + httpc_manager:request_done(RequestId, ProfileName), ?hcrv("response (timeout) sent - now terminate", []), {stop, normal, State#state{request = Request#request{from = answer_sent}, canceled = [RequestId | Canceled]}}; -handle_info({timeout, RequestId}, #state{canceled = Canceled} = State) -> +handle_info({timeout, RequestId}, + #state{canceled = Canceled, + profile_name = ProfileName} = State) -> ?hcri("timeout", [{id, RequestId}]), Filter = fun(#request{id = Id, from = From} = Request) when Id =:= RequestId -> ?hcrv("found request", [{id, Id}, {from, From}]), %% Notify the owner - Response = httpc_response:error(Request, timeout), - httpc_response:send(From, Response), + httpc_response:send(From, + httpc_response:error(Request, timeout)), + httpc_manager:request_done(RequestId, ProfileName), ?hcrv("response (timeout) sent", []), [Request#request{from = answer_sent}]; (_) -> diff --git a/lib/inets/src/http_client/httpc_manager.erl b/lib/inets/src/http_client/httpc_manager.erl index d5d6376369..1e1bde220b 100644 --- a/lib/inets/src/http_client/httpc_manager.erl +++ b/lib/inets/src/http_client/httpc_manager.erl @@ -1,19 +1,19 @@ %% %% %CopyrightBegin% -%% +%% %% Copyright Ericsson AB 2002-2010. All Rights Reserved. -%% +%% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in %% compliance with the License. You should have received a copy of the %% Erlang Public License along with this software. If not, it can be %% retrieved online at http://www.erlang.org/. -%% +%% %% Software distributed under the License is distributed on an "AS IS" %% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See %% the License for the specific language governing rights and limitations %% under the License. -%% +%% %% %CopyrightEnd% %% %% @@ -66,15 +66,6 @@ state % State of the handler: initiating | started | operational | canceled }). -%% Entries in the handler / request cross-ref table -%% -record(request_info, -%% { -%% id, % Id of the request -%% handler, % Pid of the handler process -%% from, % The From value for the caller -%% mref % Monitor ref for the caller -%% }). - %%==================================================================== %% Internal Application API @@ -577,7 +568,9 @@ handle_info({'EXIT', Pid, Reason}, #state{handler_db = HandlerDb} = State) -> handle_info({'DOWN', _, _, Pid, _}, State) -> %% - %% Check what happens to waiting requests! Chall we not send a reply? + %% Normally this should have been cleaned up already + %% (when receiving {request_done, PequestId}), but + %% just in case there is a glitch, cleanup anyway. %% Pattern = #handler_info{handler = Pid, _ = '_'}, @@ -649,7 +642,16 @@ get_handler_info(Tab) -> Acc end, Handlers2 = lists:foldl(F, [], Handlers1), - Handlers3 = [{Pid, State, httpc_handler:info(Pid)} || + Handlers3 = [{Pid, State, + case (catch httpc_handler:info(Pid)) of + {'EXIT', _} -> + %% Why would this crash? + %% Only if the process has died, but we don't + %% know about it? + []; + Else -> + Else + end} || {Pid, State} <- Handlers2], Handlers3. @@ -666,6 +668,10 @@ handle_started(StarterPid, ReqId, HandlerPid, case ets:lookup(HandlerDb, ReqId) of [#handler_info{state = initiating} = HandlerInfo] -> ?hcri("received started ack for initiating handler", []), + %% As a last resort, make sure we know when it exits, + %% in case it forgets to notify us. + %% We dont need to know the ref id? + erlang:monitor(process, HandlerPid), HandlerInfo2 = HandlerInfo#handler_info{handler = HandlerPid, state = started}, ets:insert(HandlerDb, HandlerInfo2), diff --git a/lib/inets/src/inets_app/inets.erl b/lib/inets/src/inets_app/inets.erl index f1fa5fd997..054468e445 100644 --- a/lib/inets/src/inets_app/inets.erl +++ b/lib/inets/src/inets_app/inets.erl @@ -1,19 +1,19 @@ %% %% %CopyrightBegin% -%% +%% %% Copyright Ericsson AB 2006-2010. All Rights Reserved. -%% +%% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in %% compliance with the License. You should have received a copy of the %% Erlang Public License along with this software. If not, it can be %% retrieved online at http://www.erlang.org/. -%% +%% %% Software distributed under the License is distributed on an "AS IS" %% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See %% the License for the specific language governing rights and limitations %% under the License. -%% +%% %% %CopyrightEnd% %% %% @@ -57,7 +57,7 @@ start(Type) -> %% Function: start(Service, ServiceConfig [, How]) -> {ok, Pid} | %% {error, Reason} %% -%% Service = - ftpc | tftpd | httpc | httpd +%% Service = - ftpc | tftpd | tftpc | tftp | httpc | httpd %% ServiceConfig = ConfPropList | ConfFile %% ConfPropList = [{Property, Value}] according to service %% ConfFile = Path - when service is httpd @@ -100,7 +100,7 @@ stop() -> %%-------------------------------------------------------------------- %% Function: stop(Service, Pid) -> ok %% -%% Service - ftp | tftpd | http | httpd | stand_alone +%% Service - ftpc | ftp | tftpd | tftpc | tftp | httpc | httpd | stand_alone %% %% Description: Stops a started service of the inets application or takes %% down a stand alone "service" gracefully. @@ -382,7 +382,7 @@ key1search(Key, Vals, Def) -> %% Description: Returns a list of supported services %%------------------------------------------------------------------- service_names() -> - [ftpc, tftpd, httpc, httpd]. + [ftpc, tftp, httpc, httpd]. %%----------------------------------------------------------------- @@ -725,8 +725,8 @@ call_service(Service, Call, Args) -> service_module(tftpd) -> tftp; -service_module(httpc) -> - httpc; +service_module(tftpc) -> + tftp; service_module(ftpc) -> ftp; service_module(Service) -> diff --git a/lib/inets/test/ftp_macosx_x86_test.erl b/lib/inets/test/ftp_macosx_x86_test.erl index c59a992421..5566d4feaa 100644 --- a/lib/inets/test/ftp_macosx_x86_test.erl +++ b/lib/inets/test/ftp_macosx_x86_test.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2005-2009. All Rights Reserved. +%% Copyright Ericsson AB 2005-2010. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in @@ -108,7 +108,7 @@ passive_pwd(X) -> ?LIB_MOD:passive_pwd(X). passive_cd(X) -> ?LIB_MOD:passive_cd(X). passive_lcd(X) -> ?LIB_MOD:passive_lcd(X). passive_ls(X) -> ?LIB_MOD:passive_ls(X). -passive_nlist(X) -> ?LIB_MOD:passive_nlist(X). +passive_nlist(X) -> ?LIB_MOD:passive_nlist([{wildcard_support, false} | X]). passive_rename(X) -> ?LIB_MOD:passive_rename(X). passive_delete(X) -> ?LIB_MOD:passive_delete(X). passive_mkdir(X) -> ?LIB_MOD:passive_mkdir(X). @@ -129,7 +129,7 @@ active_pwd(X) -> ?LIB_MOD:active_pwd(X). active_cd(X) -> ?LIB_MOD:active_cd(X). active_lcd(X) -> ?LIB_MOD:active_lcd(X). active_ls(X) -> ?LIB_MOD:active_ls(X). -active_nlist(X) -> ?LIB_MOD:active_nlist(X). +active_nlist(X) -> ?LIB_MOD:active_nlist([{wildcard_support, false} | X]). active_rename(X) -> ?LIB_MOD:active_rename(X). active_delete(X) -> ?LIB_MOD:active_delete(X). active_mkdir(X) -> ?LIB_MOD:active_mkdir(X). diff --git a/lib/inets/test/ftp_suite_lib.erl b/lib/inets/test/ftp_suite_lib.erl index 5e27bc3a86..c539b7c17c 100644 --- a/lib/inets/test/ftp_suite_lib.erl +++ b/lib/inets/test/ftp_suite_lib.erl @@ -1,19 +1,19 @@ %% %% %CopyrightBegin% -%% +%% %% Copyright Ericsson AB 2005-2010. All Rights Reserved. -%% +%% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in %% compliance with the License. You should have received a copy of the %% Erlang Public License along with this software. If not, it can be %% retrieved online at http://www.erlang.org/. -%% +%% %% Software distributed under the License is distributed on an "AS IS" %% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See %% the License for the specific language governing rights and limitations %% under the License. -%% +%% %% %CopyrightEnd% %% %% @@ -508,7 +508,8 @@ passive_nlist(suite) -> []; passive_nlist(Config) when is_list(Config) -> Pid = ?config(ftp, Config), - do_nlist(Pid). + WildcardSupport = ?config(wildcard_support, Config), + do_nlist(Pid, WildcardSupport). %%------------------------------------------------------------------------- @@ -768,7 +769,8 @@ active_nlist(suite) -> []; active_nlist(Config) when is_list(Config) -> Pid = ?config(ftp, Config), - do_nlist(Pid). + WildcardSupport = ?config(wildcard_support, Config), + do_nlist(Pid, WildcardSupport). %%------------------------------------------------------------------------- @@ -1242,16 +1244,20 @@ do_ls(Pid) -> {ok, _} = ftp:ls(Pid, "incom*"), ok. -do_nlist(Pid) -> +do_nlist(Pid, WildcardSupport) -> {ok, _} = ftp:nlist(Pid), {ok, _} = ftp:nlist(Pid, "incoming"), %% neither nlist nor ls operates on a directory %% they operate on a pathname, which *can* be a %% directory, but can also be a filename or a group %% of files (including wildcards). - {ok, _} = ftp:nlist(Pid, "incom*"), -%% {error, epath} = ftp:nlist(Pid, ?BAD_DIR), - ok. + case WildcardSupport of + true -> + {ok, _} = ftp:nlist(Pid, "incom*"), + ok; + _ -> + ok + end. do_rename(Pid, Config) -> PrivDir = ?config(priv_dir, Config), diff --git a/lib/inets/test/httpc_SUITE.erl b/lib/inets/test/httpc_SUITE.erl index b5fd896001..902e440c80 100644 --- a/lib/inets/test/httpc_SUITE.erl +++ b/lib/inets/test/httpc_SUITE.erl @@ -1,19 +1,19 @@ %% %% %CopyrightBegin% -%% +%% %% Copyright Ericsson AB 2004-2010. All Rights Reserved. -%% +%% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in %% compliance with the License. You should have received a copy of the %% Erlang Public License along with this software. If not, it can be %% retrieved online at http://www.erlang.org/. -%% +%% %% Software distributed under the License is distributed on an "AS IS" %% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See %% the License for the specific language governing rights and limitations %% under the License. -%% +%% %% %CopyrightEnd% %% %% @@ -306,7 +306,8 @@ tickets(suite) -> otp_8106, otp_8056, otp_8352, - otp_8371 + otp_8371, + otp_8739 ]. @@ -2561,7 +2562,78 @@ otp_8371(Config) when is_list(Config) -> ok. +%%------------------------------------------------------------------------- +otp_8739(doc) -> + ["OTP-8739"]; +otp_8739(suite) -> + []; +otp_8739(Config) when is_list(Config) -> + {_DummyServerPid, Port} = otp_8739_dummy_server(), + URL = ?URL_START ++ integer_to_list(Port) ++ "/dummy.html", + Method = get, + Request = {URL, []}, + HttpOptions = [{connect_timeout, 500}, {timeout, 1}], + Options = [{sync, true}], + case http:request(Method, Request, HttpOptions, Options) of + {error, timeout} -> + %% And now we check the size of the handler db + Info = httpc:info(), + tsp("Info: ~p", [Info]), + {value, {handlers, Handlers}} = + lists:keysearch(handlers, 1, Info), + case Handlers of + [] -> + ok; + _ -> + tsf({unexpected_handlers, Handlers}) + end; + Unexpected -> + tsf({unexpected, Unexpected}) + end. + + +otp_8739_dummy_server() -> + Parent = self(), + Pid = spawn_link(fun() -> otp_8739_dummy_server_init(Parent) end), + receive + {port, Port} -> + {Pid, Port} + end. + +otp_8739_dummy_server_init(Parent) -> + {ok, ListenSocket} = + gen_tcp:listen(0, [binary, inet, {packet, 0}, + {reuseaddr,true}, + {active, false}]), + {ok, Port} = inet:port(ListenSocket), + Parent ! {port, Port}, + otp_8739_dummy_server_main(Parent, ListenSocket). + +otp_8739_dummy_server_main(Parent, ListenSocket) -> + case gen_tcp:accept(ListenSocket) of + {ok, Sock} -> + %% Ignore the request, and simply wait for the socket to close + receive + {tcp_closed, Sock} -> + (catch gen_tcp:close(ListenSocket)), + exit(normal); + {tcp_error, Sock, Reason} -> + tsp("socket error: ~p", [Reason]), + (catch gen_tcp:close(ListenSocket)), + exit(normal) + after 10000 -> + %% Just in case + (catch gen_tcp:close(Sock)), + (catch gen_tcp:close(ListenSocket)), + exit(timeout) + end; + Error -> + exit(Error) + end. + + + %%-------------------------------------------------------------------- %% Internal functions %%-------------------------------------------------------------------- diff --git a/lib/inets/vsn.mk b/lib/inets/vsn.mk index 57c87e7036..b53d47d99c 100644 --- a/lib/inets/vsn.mk +++ b/lib/inets/vsn.mk @@ -1,118 +1,4 @@ -#-*-makefile-*- ; force emacs to enter makefile-mode - -# %CopyrightBegin% -# -# Copyright Ericsson AB 1997-2010. All Rights Reserved. -# -# The contents of this file are subject to the Erlang Public License, -# Version 1.1, (the "License"); you may not use this file except in -# compliance with the License. You should have received a copy of the -# Erlang Public License along with this software. If not, it can be -# retrieved online at http://www.erlang.org/. -# -# Software distributed under the License is distributed on an "AS IS" -# basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See -# the License for the specific language governing rights and limitations -# under the License. -# -# %CopyrightEnd% - APPLICATION = inets INETS_VSN = 5.4 PRE_VSN = APP_VSN = "$(APPLICATION)-$(INETS_VSN)$(PRE_VSN)" - -TICKETS = OTP-7907 OTP-8564 OTP-8573 - -TICKETS_5_3_3 = \ - OTP-8609 \ - OTP-8610 \ - OTP-8624 - -TICKETS_5_3_2 = \ - OTP-8542 \ - OTP-8607 - -TICKETS_5_3_1 = \ - OTP-8508 \ - OTP-8509 - -TICKETS_5_3 = \ - OTP-8016 \ - OTP-8056 \ - OTP-8103 \ - OTP-8106 \ - OTP-8312 \ - OTP-8315 \ - OTP-8327 \ - OTP-8349 \ - OTP-8351 \ - OTP-8352 \ - OTP-8359 \ - OTP-8371 - -TICKETS_5_2 = \ - OTP-8204 \ - OTP-8206 \ - OTP-8247 \ - OTP-8248 \ - OTP-8249 \ - OTP-8258 \ - OTP-8280 - -TICKETS_5_1_3 = OTP-8154 - -TICKETS_5_1_2 = OTP-7298 OTP-8101 OTP-8118 - -TICKETS_5_1_1 = OTP-8052 OTP-8069 - -TICKETS_5_1 = OTP-7994 OTP-7998 OTP-8001 OTP-8004 OTP-8005 - -TICKETS_5_0_14 = OTP-7882 OTP-7883 OTP-7888 OTP-7950 OTP-7976 - -TICKETS_5.0.13 = \ - OTP-7723 \ - OTP-7724 \ - OTP-7726 \ - OTP-7463 \ - OTP-7815 \ - OTP-7857 - -# TICKETS_5.0.12 = \ -# OTP-7636 -# -# TICKETS_5.0.11 = \ -# OTP-7574 \ -# OTP-7597 \ -# OTP-7598 \ -# OTP-7605 -# -# TICKETS_5.0.10 = \ -# OTP-7450 \ -# OTP-7454 \ -# OTP-7490 \ -# OTP-7512 -# -# TICKETS_5.0.9 = \ -# OTP-7257 \ -# OTP-7323 \ -# OTP-7341 -# -# TICKETS_5.0.8 = \ -# OTP-7315 \ -# OTP-7321 -# -# TICKETS_5.0.7 = \ -# OTP-7304 -# -# TICKETS_5.0.6 = \ -# OTP-7266 -# -# TICKETS_5.0.5 = \ -# OTP-7220 \ -# OTP-7221 -# -# TICKETS_5.0.4 = \ -# OTP-7173 -# - diff --git a/lib/inviso/src/inviso.erl b/lib/inviso/src/inviso.erl index de42926ffe..0eda06a5c2 100644 --- a/lib/inviso/src/inviso.erl +++ b/lib/inviso/src/inviso.erl @@ -129,7 +129,7 @@ start(Options) -> add_node(Reference) ->
gen_server:call(?CONTROLLER,{add_nodes,[node()],[],Reference,any_ref},?CALL_TIMEOUT).
-add_node(Reference,Options) when list(Options) ->
+add_node(Reference,Options) when is_list(Options) -> gen_server:call(?CONTROLLER,{add_nodes,[node()],Options,Reference,any_ref},?CALL_TIMEOUT).
%% -----------------------------------------------------------------------------
@@ -142,7 +142,7 @@ add_node(Reference,Options) when list(Options) -> add_node_if_ref(Reference) ->
gen_server:call(?CONTROLLER,{add_nodes,[node()],[],Reference,if_ref},?CALL_TIMEOUT).
-add_node_if_ref(Reference,Options) when list(Options) ->
+add_node_if_ref(Reference,Options) when is_list(Options) -> gen_server:call(?CONTROLLER,{add_nodes,[node()],Options,Reference,if_ref},?CALL_TIMEOUT).
%% -----------------------------------------------------------------------------
@@ -156,10 +156,10 @@ add_node_if_ref(Reference,Options) when list(Options) -> %% system. By speicifying node() as the node where the runtime component shall
%% be started. The return value will then follow the rules of non distributed
%% returnvalues and not have a node indicator.
-add_nodes(Nodes,Reference) when list(Nodes) ->
+add_nodes(Nodes,Reference) when is_list(Nodes) -> gen_server:call(?CONTROLLER,{add_nodes,Nodes,[],Reference,any_ref},?CALL_TIMEOUT).
-add_nodes(Nodes,Reference,Options) when list(Nodes),list(Options) ->
+add_nodes(Nodes,Reference,Options) when is_list(Nodes),is_list(Options) -> gen_server:call(?CONTROLLER,{add_nodes,Nodes,Options,Reference,any_ref},?CALL_TIMEOUT).
%% -----------------------------------------------------------------------------
@@ -168,10 +168,10 @@ add_nodes(Nodes,Reference,Options) when list(Nodes),list(Options) -> %%
%% As add_nodes/2,/3 but will only connect to an already existing runtime component
%% if its reference is the same as the one given as argument.
-add_nodes_if_ref(Nodes,Reference) when list(Nodes) ->
+add_nodes_if_ref(Nodes,Reference) when is_list(Nodes) -> gen_server:call(?CONTROLLER,{add_nodes,Nodes,[],Reference,if_ref},?CALL_TIMEOUT).
-add_nodes_if_ref(Nodes,Reference,Options) when list(Nodes),list(Options) ->
+add_nodes_if_ref(Nodes,Reference,Options) when is_list(Nodes),is_list(Options) -> gen_server:call(?CONTROLLER,{add_nodes,Nodes,Options,Reference,if_ref},?CALL_TIMEOUT).
%% -----------------------------------------------------------------------------
@@ -182,9 +182,9 @@ add_nodes_if_ref(Nodes,Reference,Options) when list(Nodes),list(Options) -> %%
%% Change options on all or specified Nodes. This may result in for instance
%% reinitialization of overloadcheck.
-change_options(Options) when list(Options) ->
+change_options(Options) when is_list(Options) -> gen_server:call(?CONTROLLER,{change_options,all,Options},?CALL_TIMEOUT).
-change_options(Nodes,Options) when list(Nodes),list(Options) ->
+change_options(Nodes,Options) when is_list(Nodes),is_list(Options) -> gen_server:call(?CONTROLLER,{change_options,Nodes,Options},?CALL_TIMEOUT).
%% -----------------------------------------------------------------------------
@@ -234,7 +234,7 @@ change_options(Nodes,Options) when list(Nodes),list(Options) -> init_tracing(TracerDataList) ->
gen_server:call(?CONTROLLER,{init_tracing,TracerDataList},?CALL_TIMEOUT).
-init_tracing(Nodes,TracerData) when list(Nodes) ->
+init_tracing(Nodes,TracerData) when is_list(Nodes) -> gen_server:call(?CONTROLLER,{init_tracing,Nodes,TracerData},?CALL_TIMEOUT).
%% -----------------------------------------------------------------------------
@@ -270,10 +270,10 @@ stop_tracing(Nodes) when is_list(Nodes) -> clear() ->
gen_server:call(?CONTROLLER,{clear,all,[]},?CALL_TIMEOUT).
-clear(Nodes) when list(Nodes) ->
+clear(Nodes) when is_list(Nodes) -> gen_server:call(?CONTROLLER,{clear,Nodes,[]},?CALL_TIMEOUT).
-clear(Nodes,Options) when list(Nodes),list(Options) ->
+clear(Nodes,Options) when is_list(Nodes),is_list(Options) -> gen_server:call(?CONTROLLER,{clear,Nodes,Options},?CALL_TIMEOUT).
%% -----------------------------------------------------------------------------
@@ -355,9 +355,9 @@ stop_all() -> tp(Nodes,Module,Function,Arity,MatchSpec,Opts) ->
trace_pattern(Nodes,[{Module,Function,Arity,MatchSpec,Opts}],[global]).
-tp(Nodes,Module,Function,Arity,MatchSpec) when list(Nodes) ->
+tp(Nodes,Module,Function,Arity,MatchSpec) when is_list(Nodes) -> trace_pattern(Nodes,[{Module,Function,Arity,MatchSpec,[]}],[global]);
-tp(Module,Function,Arity,MatchSpec,Opts) when atom(Module) ->
+tp(Module,Function,Arity,MatchSpec,Opts) when is_atom(Module) -> trace_pattern(all,[{Module,Function,Arity,MatchSpec,Opts}],[global]).
tp(Module,Function,Arity,MatchSpec) ->
@@ -384,9 +384,9 @@ tp(PatternList) -> tpl(Nodes,Module,Function,Arity,MatchSpec,Opts) ->
trace_pattern(Nodes,[{Module,Function,Arity,MatchSpec,Opts}],[local]).
-tpl(Nodes,Module,Function,Arity,MatchSpec) when list(Nodes) ->
+tpl(Nodes,Module,Function,Arity,MatchSpec) when is_list(Nodes) -> trace_pattern(Nodes,[{Module,Function,Arity,MatchSpec,[]}],[local]);
-tpl(Module,Function,Arity,MatchSpec,Opts) when atom(Module) ->
+tpl(Module,Function,Arity,MatchSpec,Opts) when is_atom(Module) -> trace_pattern(all,[{Module,Function,Arity,MatchSpec,Opts}],[local]).
tpl(Module,Function,Arity,MatchSpec) ->
@@ -417,12 +417,12 @@ ctp(Nodes,Module,Function,Arity) -> ctp(Module,Function,Arity) ->
trace_pattern(all,[{Module,Function,Arity,false,[only_loaded]}],[global]).
-ctp(Nodes,PatternList) when list(PatternList) ->
+ctp(Nodes,PatternList) when is_list(PatternList) -> trace_pattern(Nodes,
lists:map(fun({M,F,A})->{M,F,A,false,[only_loaded]} end,PatternList),
[global]).
-ctp(PatternList) when list(PatternList) ->
+ctp(PatternList) when is_list(PatternList) -> trace_pattern(all,
lists:map(fun({M,F,A})->{M,F,A,false,[only_loaded]} end,PatternList),
[global]).
@@ -445,12 +445,12 @@ ctpl(Nodes,Module,Function,Arity) -> ctpl(Module,Function,Arity) ->
trace_pattern(all,[{Module,Function,Arity,false,[only_loaded]}],[local]).
-ctpl(Nodes,PatternList) when list(PatternList) ->
+ctpl(Nodes,PatternList) when is_list(PatternList) -> trace_pattern(Nodes,
lists:map(fun({M,F,A})->{M,F,A,false,[only_loaded]} end,PatternList),
[local]).
-ctpl(PatternList) when list(PatternList) ->
+ctpl(PatternList) when is_list(PatternList) -> trace_pattern(all,
lists:map(fun({M,F,A})->{M,F,A,false,[only_loaded]} end,PatternList),
[local]).
@@ -485,19 +485,19 @@ trace_pattern(Nodes,Patterns,FlagList) -> %% specifying a certain pid at all nodes. Or an empty TraceConfList for all
%% nodes.
%% When calling several nodes, the nodes are called in parallel.
-tf(Nodes,PidSpec,FlagList) when list(Nodes),list(FlagList) ->
+tf(Nodes,PidSpec,FlagList) when is_list(Nodes),is_list(FlagList) -> trace_flags(Nodes,[{PidSpec, FlagList}],true).
-tf(Nodes,TraceConfList) when list(Nodes),list(TraceConfList) ->
+tf(Nodes,TraceConfList) when is_list(Nodes),is_list(TraceConfList) -> trace_flags(Nodes,TraceConfList,true);
-tf(PidSpec,FlagList) when list(FlagList) ->
+tf(PidSpec,FlagList) when is_list(FlagList) -> trace_flags(all,[{PidSpec,FlagList}],true).
-tf(ArgList) when list(ArgList) -> % This one has triple functionality!
+tf(ArgList) when is_list(ArgList) -> % This one has triple functionality! case ArgList of
- [{_Process,Flags}|_] when list(Flags),atom(hd(Flags))-> % A call to all nodes.
+ [{_Process,Flags}|_] when is_list(Flags),is_atom(hd(Flags))-> % A call to all nodes. trace_flags(all,ArgList,true);
- [{_Node,TraceConfList}|_] when list(TraceConfList),tuple(hd(TraceConfList)) ->
+ [{_Node,TraceConfList}|_] when is_list(TraceConfList),is_tuple(hd(TraceConfList)) -> trace_flags(ArgList,true);
[{_Node,_TraceConfList,_How}|_] ->
trace_flags(ArgList);
@@ -517,15 +517,15 @@ tf(ArgList) when list(ArgList) -> % This one has triple functionality %% The functions without a Nodes argument means all nodes, in a non-distributed
%% environment it means the local node.
%% When calling several nodes, the nodes are called in parallel.
-ctf(Nodes,PidSpec,FlagList) when list(Nodes),list(FlagList) ->
+ctf(Nodes,PidSpec,FlagList) when is_list(Nodes),is_list(FlagList) -> trace_flags(Nodes,[{PidSpec,FlagList}],false).
-ctf(Nodes,TraceConfList) when list(Nodes),list(TraceConfList) ->
+ctf(Nodes,TraceConfList) when is_list(Nodes),is_list(TraceConfList) -> trace_flags(Nodes,TraceConfList,false);
-ctf(PidSpec,FlagList) when list(FlagList) ->
+ctf(PidSpec,FlagList) when is_list(FlagList) -> trace_flags(all,[{PidSpec,FlagList}],false).
-ctf(TraceConfList) when list(TraceConfList) ->
+ctf(TraceConfList) when is_list(TraceConfList) -> trace_flags(all,TraceConfList,false).
%% -----------------------------------------------------------------------------
@@ -668,10 +668,10 @@ init_tpm(Nodes,Mod,Func,Arity,InitFunc,CallFunc,ReturnFunc,RemoveFunc) -> tpm(Mod,Func,Arity,MS) ->
tpm(all,Mod,Func,Arity,MS).
-tpm(Nodes,Mod,Func,Arity,MS) when integer(Arity) ->
+tpm(Nodes,Mod,Func,Arity,MS) when is_integer(Arity) -> gen_server:call(?CONTROLLER,
{meta_pattern,Nodes,{tpm,[Mod,Func,Arity,MS]}});
-tpm(Mod,Func,Arity,MS,CallFunc) when integer(Arity) ->
+tpm(Mod,Func,Arity,MS,CallFunc) when is_integer(Arity) -> tpm(all,Mod,Func,Arity,MS,CallFunc).
tpm(Nodes,Mod,Func,Arity,MS,CallFunc) ->
@@ -695,11 +695,11 @@ tpm(Nodes,Mod,Func,Arity,MS,InitFunc,CallFunc,ReturnFunc,RemoveFunc) -> tpm_tracer(Mod,Func,Arity,MS) ->
tpm_tracer(all,Mod,Func,Arity,MS).
-tpm_tracer(Nodes,Mod,Func,Arity,MS) when integer(Arity) ->
+tpm_tracer(Nodes,Mod,Func,Arity,MS) when is_integer(Arity) -> gen_server:call(?CONTROLLER,
{meta_pattern,Nodes,{tpm_tracer,[Mod,Func,Arity,MS]}},
?CALL_TIMEOUT);
-tpm_tracer(Mod,Func,Arity,MS,CallFunc) when integer(Arity) ->
+tpm_tracer(Mod,Func,Arity,MS,CallFunc) when is_integer(Arity) -> tpm_tracer(all,Mod,Func,Arity,MS,CallFunc).
tpm_tracer(Nodes,Mod,Func,Arity,MS,CallFunc) ->
@@ -878,7 +878,7 @@ cancel_suspension() -> %% Status=running|{suspended,SReason}
%%
%% Get Status form all or specified runtime components.
-get_status(Nodes) when list(Nodes) ->
+get_status(Nodes) when is_list(Nodes) -> gen_server:call(?CONTROLLER,{get_status,Nodes},?CALL_TIMEOUT).
get_status() ->
@@ -918,7 +918,7 @@ get_tracerdata(Nodes) when is_list(Nodes) -> list_logs() ->
gen_server:call(?CONTROLLER,list_logs,?CALL_TIMEOUT).
-list_logs(TracerDataOrNodesList) when list(TracerDataOrNodesList) ->
+list_logs(TracerDataOrNodesList) when is_list(TracerDataOrNodesList) -> gen_server:call(?CONTROLLER,{list_logs,TracerDataOrNodesList},?CALL_TIMEOUT).
%% ------------------------------------------------------------------------------
@@ -960,17 +960,17 @@ list_logs(TracerDataOrNodesList) when list(TracerDataOrNodesList) -> %% Note that the client process using this function will wait until all files
%% are moved. The job can be cancelled, causing any already copied files to be
%% removed, by simply terminating the waiting client process.
-fetch_log(DestDir,Prefix) when list(DestDir),list(Prefix) ->
+fetch_log(DestDir,Prefix) when is_list(DestDir),is_list(Prefix) -> gen_server:call(?CONTROLLER,{fetch_log,node(),all,DestDir,Prefix},infinity).
-fetch_log(ToNode,DestDir,Prefix) when atom(ToNode),list(DestDir),list(Prefix) ->
+fetch_log(ToNode,DestDir,Prefix) when is_atom(ToNode),is_list(DestDir),is_list(Prefix) -> gen_server:call(?CONTROLLER,{fetch_log,ToNode,all,DestDir,Prefix},infinity);
-fetch_log(LogSpecList,DestDir,Prefix) when list(LogSpecList),list(DestDir),list(Prefix) ->
+fetch_log(LogSpecList,DestDir,Prefix) when is_list(LogSpecList),is_list(DestDir),is_list(Prefix) -> gen_server:call(?CONTROLLER,{fetch_log,node(),LogSpecList,DestDir,Prefix},infinity).
fetch_log(ToNode,LogSpecList,DestDir,Prefix)
- when atom(ToNode),list(LogSpecList),list(DestDir),list(Prefix) ->
+ when is_atom(ToNode),is_list(LogSpecList),is_list(DestDir),is_list(Prefix) -> gen_server:call(?CONTROLLER,{fetch_log,ToNode,LogSpecList,DestDir,Prefix},infinity).
%% ------------------------------------------------------------------------------
diff --git a/lib/inviso/src/inviso_c.erl b/lib/inviso/src/inviso_c.erl index ecbd5b0778..b1597a7f35 100644 --- a/lib/inviso/src/inviso_c.erl +++ b/lib/inviso/src/inviso_c.erl @@ -100,7 +100,7 @@ init({_Parent,Options}) -> end. %% ------------------------------------------------------------------------------ -handle_call({subscribe,Pid},_From,LD) when pid(Pid) -> +handle_call({subscribe,Pid},_From,LD) when is_pid(Pid) -> MRef=erlang:monitor(process,Pid), {reply,ok,LD#state{subscribers=[{Pid,MRef}|LD#state.subscribers]}}; handle_call({subscribe,Faulty},_From,LD) -> @@ -131,7 +131,7 @@ handle_call({change_options,Nodes,Opts},_From,LD) -> end; handle_call({init_tracing,TracerDataList},_From,LD) -> {reply,adapt_reply(LD,do_init_tracing(TracerDataList,LD)),LD}; -handle_call({init_tracing,Nodes,TracerData},_From,LD) when list(Nodes) -> +handle_call({init_tracing,Nodes,TracerData},_From,LD) when is_list(Nodes) -> TracerDataList= lists:map(fun(N)->{N,TracerData} end,started_trace_nodes(Nodes,LD)), {reply,adapt_reply(LD,do_init_tracing(TracerDataList,LD)),LD}; @@ -173,7 +173,7 @@ handle_call({fetch_log,ToNode,Spec,Dest,Prefix},From,LD) -> end; handle_call({delete_log,NodesOrNodeSpecs},_From,LD) -> {reply,adapt_reply(LD,do_delete_log(NodesOrNodeSpecs,LD)),LD}; -handle_call({delete_log,Nodes,Specs},_From,LD) when list(Nodes) -> +handle_call({delete_log,Nodes,Specs},_From,LD) when is_list(Nodes) -> Reply=do_delete_log(lists:map(fun(N)->{N,Specs} end,Nodes),LD), {reply,adapt_reply(LD,Reply),LD}; handle_call({delete_log,FaultyNodes,_Specs},_From,LD) -> @@ -283,7 +283,7 @@ do_change_option(Nodes,Options,LD) -> do_change_option_2([Node|Tail],Options,LD,Replies) -> case get_node_rec(Node,LD) of - Rec when record(Rec,node) -> + Rec when is_record(Rec,node) -> Answer=?RUNTIME:change_options(Rec#node.pid,Options), do_change_option_2(Tail,Options,LD,[{Node,Answer}|Replies]); Error -> @@ -333,7 +333,7 @@ do_init_tracing_2(What,_LD,_) -> %% Returns {ok,Reply} or {error,Reason}. distribute_tp(all,Patterns,FlagList,LD) -> distribute_tp(started_trace_nodes(all,LD),Patterns,FlagList,LD); -distribute_tp(Nodes,Patterns,FlagList,LD) when list(Nodes) -> +distribute_tp(Nodes,Patterns,FlagList,LD) when is_list(Nodes) -> RTpids=lists:map(fun(N)->case get_node_rec(N,LD) of #node{pid=Pid} -> {Pid,N}; @@ -354,7 +354,7 @@ distribute_tp(Faulty,_,_,_) -> %% Returns {ok,Reply} or {error,Reason}. distribute_tf(all,Args,How,LD) -> distribute_tf(started_trace_nodes(all,LD),Args,How,LD); -distribute_tf(Nodes,Args,How,LD) when list(Nodes) -> +distribute_tf(Nodes,Args,How,LD) when is_list(Nodes) -> RTpids=lists:map(fun(Node)-> case get_node_rec(Node,LD) of #node{pid=Pid} -> @@ -369,7 +369,7 @@ distribute_tf(Faulty,_,_,_) -> {error,{badarg,Faulty}}. %% As above but specific args for each node. -distribute_tf(NodeArgs,How,LD) when list(NodeArgs) -> +distribute_tf(NodeArgs,How,LD) when is_list(NodeArgs) -> RTpidArgs=lists:map(fun({Node,Args})-> case get_node_rec(Node,LD) of #node{pid=Pid} -> @@ -384,7 +384,7 @@ distribute_tf(Faulty,_,_) -> {error,{badarg,Faulty}}. %% As above but both specific args for each node and How (set or remove flag). -distribute_tf(NodeArgHows,LD) when list(NodeArgHows) -> +distribute_tf(NodeArgHows,LD) when is_list(NodeArgHows) -> RTpidArgHows= lists:map(fun({Node,Args,How}) -> case get_node_rec(Node,LD) of @@ -405,7 +405,7 @@ distribute_tf(Faulty,_) -> %% Returns {ok,Reply} or {error,Reason}. distribute_metapattern(all,Args,LD) -> distribute_metapattern(started_trace_nodes(all,LD),Args,LD); -distribute_metapattern(Nodes,Args,LD) when list(Nodes) -> +distribute_metapattern(Nodes,Args,LD) when is_list(Nodes) -> RTpids=lists:map(fun(N)->case get_node_rec(N,LD) of #node{pid=Pid} -> {Pid,N}; @@ -480,7 +480,7 @@ do_cancel_suspension_2(Faulty,_,_) -> %% Return {ok,Reply} or {error,Reason}. do_stop_tracing(all,LD) -> do_stop_tracing(started_trace_nodes(all,LD),LD); -do_stop_tracing(Nodes,LD) when list(Nodes) -> +do_stop_tracing(Nodes,LD) when is_list(Nodes) -> RTpids=lists:map(fun(N)->case get_node_rec(N,LD) of #node{pid=Pid} -> {Pid,N}; @@ -580,7 +580,7 @@ do_list_logs_2(Other,_LD,_Replies) -> %% proper strings. do_fetch_log(ToNode,all,Dest,Prefix,From,LD) -> do_fetch_log(ToNode,started_trace_nodes(all,LD),Dest,Prefix,From,LD); -do_fetch_log(ToNode,Specs,Dest,Prefix,From,LD) when list(Dest),list(Prefix) -> +do_fetch_log(ToNode,Specs,Dest,Prefix,From,LD) when is_list(Dest),is_list(Prefix) -> CollectPid=spawn_link(ToNode,?MODULE,log_rec_init,[self(),Dest,Prefix,From]), do_fetch_log_2(Specs,LD,CollectPid,[],[]); do_fetch_log(_ToNode,_Specs,Dest,Prefix,From,_LD) -> @@ -639,7 +639,7 @@ do_delete_log(NodeSpecs,LD) -> LD,[]); false -> if - list(NodeSpecs),list(hd(NodeSpecs)) -> % A list of files. + is_list(NodeSpecs),is_list(hd(NodeSpecs)) -> % A list of files. do_delete_log_2(lists:map(fun(N)->{N,NodeSpecs} end, started_trace_nodes(all,LD)), LD,[]); @@ -785,9 +785,9 @@ check_options(Options, Context) -> check_options_2([],_Context,Result) -> {ok,Result}; -check_options_2([{subscribe,Pid}|OptionsTail],start,Result) when pid(Pid) -> +check_options_2([{subscribe,Pid}|OptionsTail],start,Result) when is_pid(Pid) -> check_options_2(OptionsTail,start,[{subscribe,Pid}|Result]); -check_options_2([{unsubscribe,Pid}|OptionsTail],start,Result) when pid(Pid) -> +check_options_2([{unsubscribe,Pid}|OptionsTail],start,Result) when is_pid(Pid) -> check_options_2(OptionsTail,start,[{unsubscribe,Pid}|Result]); check_options_2([{dependency,How}|OptionsTail],Context,Result) -> check_options_2(OptionsTail,Context,[{dependency,How}|Result]); @@ -819,12 +819,12 @@ initiate_state(Options) -> LD1#state{distributed=true} end. -initiate_state_2([{subscribe,Proc}|Tail],LD) when pid(Proc);atom(Proc)-> +initiate_state_2([{subscribe,Proc}|Tail],LD) when is_pid(Proc);is_atom(Proc)-> MRef=erlang:monitor(process,Proc), initiate_state_2(Tail,LD#state{subscribers=[{Proc,MRef}|LD#state.subscribers]}); -initiate_state_2([Opt|Tail],LD) when tuple(Opt),size(Opt)>=1 -> +initiate_state_2([Opt|Tail],LD) when is_tuple(Opt),size(Opt)>=1 -> initiate_state_2(Tail,initiate_state_3(element(1,Opt),Opt,LD)); -initiate_state_2([Opt|Tail],LD) when atom(Opt) -> +initiate_state_2([Opt|Tail],LD) when is_atom(Opt) -> initiate_state_2(Tail,initiate_state_3(Opt,Opt,LD)); initiate_state_2([_|Tail],LD) -> initiate_state_2(Tail,LD); @@ -853,9 +853,9 @@ initiate_state_is_rt_option(_) -> false. %% or more values associated with the Parameter, or just an atom. merge_options([], Options) -> Options; -merge_options([T|DefaultTail],Options) when tuple(T),size(T)>=1 -> +merge_options([T|DefaultTail],Options) when is_tuple(T),size(T)>=1 -> merge_options(DefaultTail,merge_options_2(element(1,T),T,Options)); -merge_options([Param|DefaultTail],Options) when atom(Param) -> +merge_options([Param|DefaultTail],Options) when is_atom(Param) -> merge_options(DefaultTail,merge_options_2(Param,Param,Options)); merge_options([_|DefaultTail],Options) -> % Strange, bad default option! merge_options(DefaultTail,Options). @@ -868,7 +868,7 @@ merge_options_2(Param,Opt,Options) -> [Opt|Options] end. -merge_options_find(Param,[T|_]) when tuple(T),element(1,T)==Param -> +merge_options_find(Param,[T|_]) when is_tuple(T),element(1,T)==Param -> true; merge_options_find(Param,[Param|_]) -> true; @@ -883,7 +883,7 @@ merge_options_find(_,[]) -> %% It also checks the formatting of the tracerdata since runtime components %% does not accept too badly formatted tracerdata. %% Returns {ok,NewTraceData} or {error,Reason}. -check_modify_tracerdata(TracerData,LoopData) when list(TracerData) -> +check_modify_tracerdata(TracerData,LoopData) when is_list(TracerData) -> case lists:keysearch(trace,1,TracerData) of {value,{_,TraceTD}} -> % Examine the trace part. case check_modify_tracerdata(TraceTD,LoopData) of @@ -908,7 +908,7 @@ check_modify_tracerdata({relayer,Collector},LoopData) when is_atom(Collector) -> end; check_modify_tracerdata({Type,Data},_LoopData) when Type==ip;Type==file -> {ok,{Type,Data}}; -check_modify_tracerdata({Handler,Data},_LoopData) when function(Handler) -> +check_modify_tracerdata({Handler,Data},_LoopData) when is_function(Handler) -> {ok,{Handler,Data}}; check_modify_tracerdata(Data,_LoopData) -> {error,{bad_tracerdata,Data}}. @@ -999,7 +999,7 @@ set_node_rec_2(Rec,[NodeRec|Tail]) -> %% Help function finding a node record for Node in a list of #node or in loopdata. %% Returns the #node in question or {error,not_an_added_node}. -get_node_rec(Node,NodeList) when list(NodeList) -> +get_node_rec(Node,NodeList) when is_list(NodeList) -> get_node_rec_2(Node,NodeList); get_node_rec(Node,#state{nodes=NodeList}) -> get_node_rec_2(Node,NodeList). @@ -1016,7 +1016,7 @@ get_node_rec_2(Node,[_NodeRec|Tail]) -> %% structure. Returns a new list of #node or a new loopdata structure. delete_node_rec(Node,LD=#state{nodes=NodeList}) -> LD#state{nodes=delete_node_rec_2(Node,NodeList)}; -delete_node_rec(Node,NodeList) when list(NodeList) -> +delete_node_rec(Node,NodeList) when is_list(NodeList) -> delete_node_rec_2(Node,NodeList). delete_node_rec_2(_,[]) -> @@ -1059,7 +1059,7 @@ log_rec_init(Parent,Dest,Prefix,From={ClientPid,_}) -> Fetchers), CMRef=erlang:monitor(process,ClientPid), % Monitor the client. case log_rec_loop(Dest,Prefix,RTs,InitialReplies,CMRef) of - Reply when list(Reply) -> % It is an ok value. + Reply when is_list(Reply) -> % It is an ok value. gen_server:reply(From,{ok,Reply}); {error,Reason} -> gen_server:reply(From,{error,Reason}); diff --git a/lib/inviso/src/inviso_lfm.erl b/lib/inviso/src/inviso_lfm.erl index 362176c776..085048518c 100644 --- a/lib/inviso/src/inviso_lfm.erl +++ b/lib/inviso/src/inviso_lfm.erl @@ -87,13 +87,13 @@ %% close the outfile.
%%
%% Using merge/2 assumes you want to use default handlers writing to a file.
-merge(Files,OutputFile) when list(OutputFile) ->
+merge(Files,OutputFile) when is_list(OutputFile) -> merge(Files,fun outfile_opener/1,fun outfile_writer/4,fun outfile_closer/1,OutputFile,off).
-merge(Files,WorkHandlerFun,HandlerData) when function(WorkHandlerFun) ->
+merge(Files,WorkHandlerFun,HandlerData) when is_function(WorkHandlerFun) -> merge(Files,void,WorkHandlerFun,void,HandlerData,off);
-merge(Files,OutputFile,Dbg) when list(OutputFile) ->
+merge(Files,OutputFile,Dbg) when is_list(OutputFile) -> merge(Files,fun outfile_opener/1,fun outfile_writer/4,fun outfile_closer/1,OutputFile,Dbg).
-merge(Files,WorkHandlerFun,HandlerData,Dbg) when function(WorkHandlerFun) ->
+merge(Files,WorkHandlerFun,HandlerData,Dbg) when is_function(WorkHandlerFun) -> merge(Files,void,WorkHandlerFun,void,HandlerData,Dbg).
merge(Files,BeginHandlerFun,WorkHandlerFun,EndHandlerFun,HandlerData) ->
merge(Files,BeginHandlerFun,WorkHandlerFun,EndHandlerFun,HandlerData,off).
@@ -123,7 +123,7 @@ init_receiver(From,Files,BeginHandlerFun,WorkHandlerFun,EndHandlerFun,HandlerDat {ok,Readers} ->
process_flag(trap_exit,true),
if
- function(BeginHandlerFun) ->
+ is_function(BeginHandlerFun) -> case catch BeginHandlerFun(HandlerData) of
{ok,NewHandlerData} ->
init_receiver_2(From,WorkHandlerFun,EndHandlerFun,
@@ -145,7 +145,7 @@ init_receiver_2(From,WorkHandlerFun,EndHandlerFun,HandlerData,Dbg,Readers) -> {Reply,NewHandlerData}=
loop(From,WorkHandlerFun,HandlerData,NewReaders,EntryStruct,Dbg,0),
if
- function(EndHandlerFun) ->
+ is_function(EndHandlerFun) -> case EndHandlerFun(NewHandlerData) of
ok ->
From ! {reply,self(),Reply};
@@ -207,7 +207,7 @@ find_oldest_entry(EntryStruct) -> case list_all_entries(EntryStruct) of
[] -> % The we are done!
done;
- EntryList when list(EntryList) -> % Find smallest timestamp in here then.
+ EntryList when is_list(EntryList) -> % Find smallest timestamp in here then. {Pid,Node,PidMappings,_TS,Term}=
lists:foldl(fun({P,N,PMap,TS1,T},{_P,_N,_PMap,TS0,_T}) when TS1<TS0 ->
{P,N,PMap,TS1,T};
diff --git a/lib/inviso/src/inviso_lfm_tpfreader.erl b/lib/inviso/src/inviso_lfm_tpfreader.erl index d0db4b6d02..6de4d11fe0 100644 --- a/lib/inviso/src/inviso_lfm_tpfreader.erl +++ b/lib/inviso/src/inviso_lfm_tpfreader.erl @@ -60,9 +60,9 @@ %% File=string()
%% Spawn on this function to start a reader process for trace-port generated
%% logfiles, possibly with inviso-generated ti-files.
-init(RecPid,LogFiles=[Tuple|_]) when tuple(Tuple) -> % Only one LogFiles.
+init(RecPid,LogFiles=[Tuple|_]) when is_tuple(Tuple) -> % Only one LogFiles. init(RecPid,[LogFiles]);
-init(RecPid,FileStruct) when list(FileStruct) ->
+init(RecPid,FileStruct) when is_list(FileStruct) -> logfiles_loop(RecPid,FileStruct).
%% -----------------------------------------------------------------------------
@@ -135,7 +135,7 @@ read_traceport_file(FileName,FD) -> case file:read(FD,5) of % Trace-port file entries start with 5 bytes.
{ok,<<0,Size:32>>} -> % Each entry in a traceport file begins.
case file:read(FD,Size) of
- {ok,Bin} when binary(Bin),size(Bin)=:=Size ->
+ {ok,Bin} when is_binary(Bin),size(Bin)=:=Size -> try binary_to_term(Bin) of
Term -> % Bin was a properly formatted term!
{ok,Term}
@@ -244,7 +244,7 @@ find_timestamp_in_term(_) -> % Don't know if there is a timestamp %% (1) plain straight raw binary files.
handle_ti_file(FileStruct) ->
case lists:keysearch(ti_log,1,FileStruct) of
- {value,{_,[FileName]}} when list(FileName) -> % There is one ti-file in this set.
+ {value,{_,[FileName]}} when is_list(FileName) -> % There is one ti-file in this set. case file:open(FileName,[read,raw,binary]) of
{ok,FD} ->
TIdAlias=ets:new(list_to_atom("inviso_ti_atab_"++pid_to_list(self())),
@@ -308,9 +308,9 @@ handle_ti_file_2(FD,TIdAlias,TIdUnalias) -> handle_logfiles(FileStruct) ->
handle_logfiles_2(lists:keysearch(trace_log,1,FileStruct)).
-handle_logfiles_2({value,{_,[FileName]}}) when list(FileName)-> % One single plain file.
+handle_logfiles_2({value,{_,[FileName]}}) when is_list(FileName)-> % One single plain file. [FileName];
-handle_logfiles_2({value,{_,Files}}) when list(Files) -> % A wrap-set.
+handle_logfiles_2({value,{_,Files}}) when is_list(Files) -> % A wrap-set. handle_logfile_sort_wrapset(Files);
handle_logfiles_2(_) ->
[]. % Pretend there were no files otherwise.
diff --git a/lib/inviso/src/inviso_tool.erl b/lib/inviso/src/inviso_tool.erl index 7126ba4387..05158f58fe 100644 --- a/lib/inviso/src/inviso_tool.erl +++ b/lib/inviso/src/inviso_tool.erl @@ -267,9 +267,9 @@ stop(UntouchedNodes) -> %% tracing.
reconnect_nodes() ->
gen_server:call(?MODULE,{reconnect_nodes,local_runtime},?CALL_TIMEOUT).
-reconnect_nodes(Node) when atom(Node) ->
+reconnect_nodes(Node) when is_atom(Node) -> reconnect_nodes([Node]);
-reconnect_nodes(Nodes) when list(Nodes) ->
+reconnect_nodes(Nodes) when is_list(Nodes) -> gen_server:call(?MODULE,{reconnect_nodes,Nodes},?CALL_TIMEOUT).
%% -----------------------------------------------------------------------------
@@ -572,7 +572,7 @@ reactivator_reply(TPid,Counter) -> init(Config) ->
case fetch_configuration(Config) of % From conf-file and Config.
- {ok,LD} when record(LD,ld) ->
+ {ok,LD} when is_record(LD,ld) -> case start_inviso_at_c_node(LD) of
{ok,CPid} ->
LD2=start_runtime_components(LD),
@@ -650,7 +650,7 @@ start_runtime_components_2([],_,LD) -> start_runtime_components_mk_opts(Node,{M,F,Args}) ->
case catch apply(M,F,[Node|Args]) of
- {ok,Opts} when list(Opts) ->
+ {ok,Opts} when is_list(Opts) -> start_runtime_component_mk_opts_add_dependency(Opts);
_ ->
[?DEFAULT_DEPENDENCY]
@@ -698,7 +698,7 @@ handle_call({reconnect_nodes,Nodes},_From,LD) -> {reply,
build_reconnect_nodes_reply(Nodes,Nodes2,NodesErr,NewLD#ld.nodes),
NewLD};
- list(Nodes) ->
+ is_list(Nodes) -> {reply,
{ok,build_reconnect_nodes_reply(Nodes,Nodes2,NodesErr,NewLD#ld.nodes)},
NewLD}
@@ -711,7 +711,7 @@ handle_call({start_session,MoreTDGargs},_From,LD=#ld{session_state=SState}) -> case is_tracing(SState) of
false -> % No session running.
if
- list(MoreTDGargs) ->
+ is_list(MoreTDGargs) -> DateTime=calendar:universal_time(),
{M,F,Args}=LD#ld.tdg,
TDGargs=inviso_tool_lib:mk_tdg_args(DateTime,MoreTDGargs++Args),
@@ -757,15 +757,15 @@ handle_call({reinitiate_session,Nodes},_From,LD=#ld{session_state=SState}) -> end;
handle_call({restore_session,{FileName,MoreTDGargs}},_From,LD=#ld{chl=OldCHL})
- when list(MoreTDGargs) ->
+ when is_list(MoreTDGargs) -> case is_tracing(LD#ld.session_state) of
false ->
case catch make_absolute_path(FileName,LD#ld.dir) of
- AbsFileName when list(AbsFileName) ->
+ AbsFileName when is_list(AbsFileName) -> case file:read_file(AbsFileName) of
{ok,Bin} ->
if
- list(MoreTDGargs) ->
+ is_list(MoreTDGargs) -> case catch replace_history_chl(OldCHL,
binary_to_term(Bin)) of
{ok,CHL} -> % The file was well formatted.
@@ -803,7 +803,7 @@ handle_call({restore_session,MoreTDGargs},_From,LD=#ld{chl=CHL}) -> case history_exists_chl(CHL) of
true -> % There is a history to redo.
if
- list(MoreTDGargs) ->
+ is_list(MoreTDGargs) -> case h_restore_session(MoreTDGargs,LD) of
{ok,{SessionNr,ReturnVal,NewLD}} ->
{reply,
@@ -879,7 +879,7 @@ handle_call({sync_atc,{TC,Id,Vars,TimeOut}},_From,LD=#ld{session_state=SState}) case is_tracing(SState) of
true ->
if
- integer(TimeOut);TimeOut==infinity ->
+ is_integer(TimeOut);TimeOut==infinity -> case h_sync_atc(TC,Id,Vars,TimeOut,LD) of
{ok,NewLD,Result} ->
{reply,Result,NewLD};
@@ -897,7 +897,7 @@ handle_call({sync_rtc,{TC,Vars,TimeOut}},_From,LD=#ld{session_state=SState}) -> case is_tracing(SState) of
true ->
if
- integer(TimeOut);TimeOut==infinity ->
+ is_integer(TimeOut);TimeOut==infinity -> case h_sync_rtc(TC,Vars,TimeOut,LD) of
{ok,NewLD,Result} ->
{reply,Result,NewLD};
@@ -929,7 +929,7 @@ handle_call({sync_dtc,{TC,Id,TimeOut}},_From,LD=#ld{session_state=SState}) -> case is_tracing(SState) of % Check that we are tracing now.
true ->
if
- integer(TimeOut);TimeOut==infinity ->
+ is_integer(TimeOut);TimeOut==infinity -> case h_sync_dtc(TC,Id,TimeOut,LD) of
{ok,NewLD,Result} ->
{reply,Result,NewLD};
@@ -947,7 +947,7 @@ handle_call({inviso,{Cmd,Args}},_From,LD=#ld{session_state=SState}) -> case is_tracing(SState) of
true ->
if
- list(Args) ->
+ is_list(Args) -> case h_inviso(Cmd,Args,LD) of
{ok,{Reply,NewLD}} ->
{reply,Reply,NewLD};
@@ -1156,7 +1156,7 @@ h_reconnect_nodes(local_runtime,LD=#ld{nodes=NodesD}) -> % Non-distributed. _ -> % Allready connected!
{ok,{[],{error,already_connected},LD}}
end;
-h_reconnect_nodes(Nodes,LD=#ld{nodes=NodesD}) when list(Nodes) ->
+h_reconnect_nodes(Nodes,LD=#ld{nodes=NodesD}) when is_list(Nodes) -> {Nodes2,NodesErr}=
lists:foldl(fun(N,{Nodes2,NodesErr})->
case get_state_nodes(N,NodesD) of
@@ -1246,7 +1246,7 @@ h_start_session_ctp_all_2([],Errors,Nodes) -> %% Help function doing the actual init_tracing.
h_start_session_2(undefined,TracerData,_Errors) -> % Non distributed case.
case inviso:init_tracing(TracerData) of
- {ok,LogResult} when list(LogResult) ->
+ {ok,LogResult} when is_list(LogResult) -> {ok,{ok,LogResult}};
{error,already_initated} -> % Perhaps adopted!?
{ok,{error,already_initiated}}; % Not necessarily wrong.
@@ -1360,7 +1360,7 @@ h_reinitiate_session_2(local_runtime,NodesD,undefined) -> % Non distributed case _ ->
{ok,{[],{error,already_in_session}}}
end;
-h_reinitiate_session_2(Nodes,NodesD,CNode) when list(Nodes) ->
+h_reinitiate_session_2(Nodes,NodesD,CNode) when is_list(Nodes) -> {ok,lists:foldl(fun(N,{Nodes2,NodesErr})->
case get_state_nodes(N,NodesD) of
{inactive,running} -> % Only ok case.
@@ -1515,7 +1515,7 @@ h_atc(TC,Id,Vars,LD=#ld{c_node=CNode,tc_dict=TCdict,chl=CHL},Nodes) -> case check_bindings(Vars,TraceCase) of
{ok,Bindings} -> % Necessary vars exists in Vars.
if
- list(Nodes) -> % Nodes predefined.
+ is_list(Nodes) -> % Nodes predefined. h_atc_2(TC,Id,CNode,CHL,LD,TraceCase,Bindings,Nodes);
true -> % Use all tracing and running nodes.
Nodes1=get_nodenames_running_nodes(LD#ld.nodes),
@@ -1769,13 +1769,13 @@ h_reactivate(Node,CNode) -> h_save_history(HDir,Dir,FileName,SortedLog) ->
Dir0=
if
- list(HDir) -> % There is a history dir specified.
+ is_list(HDir) -> % There is a history dir specified. HDir; % Use it then.
true ->
Dir % Else use the tool dir.
end,
case catch make_absolute_path(FileName,Dir0) of
- AbsFileName when list(AbsFileName) ->
+ AbsFileName when is_list(AbsFileName) -> Log2=build_saved_history_data(SortedLog), % Remove stopped tracecases.
case file:write_file(AbsFileName,term_to_binary(Log2)) of
ok ->
@@ -1801,7 +1801,7 @@ h_get_autostart_data(local_runtime,_,Dependency,ASD,M,F,TDGargs,OptsG) -> Opts=[Dependency|lists:keydelete(dependency,1,Opts0)],
{ok,{ASD,{ok,{Opts,{tdg,{M,F,CompleteTDGargs}}}}}};
-h_get_autostart_data(Nodes,CNode,Dependency,ASD,M,F,TDGargs,OptsG) when list(Nodes) ->
+h_get_autostart_data(Nodes,CNode,Dependency,ASD,M,F,TDGargs,OptsG) when is_list(Nodes) -> {ok,{ASD,h_get_autostart_data_2(Nodes,CNode,Dependency,M,F,TDGargs,OptsG)}};
h_get_autostart_data(Nodes,_CNode,_Dependency,_ASD,_M,_F,_TDGargs,_OptsG) ->
{error,{badarg,Nodes}}.
@@ -2144,14 +2144,14 @@ expand_module_regexps(Args,_RegExpNode,_Nodes,false) -> {ok,Args};
expand_module_regexps([PatternList],RegExpNode,Nodes,{tp,1,1}) ->
case catch expand_module_regexps_tp(PatternList,RegExpNode,Nodes) of
- NewPatternList when list(NewPatternList) ->
+ NewPatternList when is_list(NewPatternList) -> {ok,[NewPatternList]};
{error,Reason} ->
{error,Reason}
end;
expand_module_regexps([PatternList],RegExpNode,Nodes,{ctp,1,1}) ->
case catch expand_module_regexps_ctp(PatternList,RegExpNode,Nodes) of
- NewPatternList when list(NewPatternList) ->
+ NewPatternList when is_list(NewPatternList) -> {ok,[NewPatternList]};
{error,Reason} ->
{error,Reason}
@@ -2164,9 +2164,9 @@ expand_module_regexps([M,F,Arity],RegExpNode,Nodes,{ctp,3,1}) -> expand_module_regexps([[{M,F,Arity}]],RegExpNode,Nodes,{ctp,1,1}).
-expand_module_regexps_tp([E={M,_,_,_,_}|Rest],RegExpNode,Nodes) when atom(M) ->
+expand_module_regexps_tp([E={M,_,_,_,_}|Rest],RegExpNode,Nodes) when is_atom(M) -> [E|expand_module_regexps_tp(Rest,RegExpNode,Nodes)];
-expand_module_regexps_tp([{M,F,Arity,MS,Opts}|Rest],RegExpNode,Nodes) when list(M);tuple(M) ->
+expand_module_regexps_tp([{M,F,Arity,MS,Opts}|Rest],RegExpNode,Nodes) when is_list(M);is_tuple(M) -> case inviso_tool_lib:expand_module_names([RegExpNode],
M,
[{expand_only_at,RegExpNode}]) of
@@ -2193,9 +2193,9 @@ expand_module_regexps_tp_2([M|MRest],F,Arity,MS,Opts,Rest,RegExpNode,Nodes) -> expand_module_regexps_tp_2([],_,_,_,_,Rest,RegExpNode,Nodes) ->
expand_module_regexps_tp(Rest,RegExpNode,Nodes).
-expand_module_regexps_ctp([E={M,_,_}|Rest],RegExpNode,Nodes) when atom(M) ->
+expand_module_regexps_ctp([E={M,_,_}|Rest],RegExpNode,Nodes) when is_atom(M) -> [E|expand_module_regexps_ctp(Rest,RegExpNode,Nodes)];
-expand_module_regexps_ctp([{M,F,Arity}|Rest],RegExpNode,Nodes) when list(M);tuple(M) ->
+expand_module_regexps_ctp([{M,F,Arity}|Rest],RegExpNode,Nodes) when is_list(M);is_tuple(M) -> case inviso_tool_lib:expand_module_names([RegExpNode],
M,
[{expand_only_at,RegExpNode}]) of
@@ -2450,7 +2450,7 @@ fetch_configuration(Config) -> %% Returns {ok,FileName} or 'false'. The latter if no name could be determined.
fetch_config_filename(Config) ->
case catch lists:keysearch(config_file,1,Config) of
- {value,{_,FName}} when list(FName) ->
+ {value,{_,FName}} when is_list(FName) -> {ok,FName};
_ -> % No filename in the start argument.
fetch_config_filename_2()
@@ -2458,7 +2458,7 @@ fetch_config_filename(Config) -> fetch_config_filename_2() ->
case application:get_env(inviso_tool_config_file) of
- {ok,FName} when list(FName) ->
+ {ok,FName} when is_list(FName) -> {ok,FName};
_ -> % Application parameter not specified.
false % Means no config file will be used.
@@ -2499,14 +2499,14 @@ read_config_list_2(LD,Terms,Tag) -> %% Function updating a named field in a record. Returns a new record. Note that
%% this function must be maintained due the fact that field names are removed
%% at compile time.
-update_ld_record(LD,nodes,Value) when record(LD,ld) ->
+update_ld_record(LD,nodes,Value) when is_record(LD,ld) -> case mk_nodes(Value) of
{ok,NodesD} ->
LD#ld{nodes=NodesD};
error ->
LD
end;
-update_ld_record(LD,Tag,Value) when record(LD,ld) ->
+update_ld_record(LD,Tag,Value) when is_record(LD,ld) -> Index=
case Tag of
c_node -> % atom()
@@ -2546,7 +2546,7 @@ update_ld_record(LD,Tag,Value) when record(LD,ld) -> %% ActivationFileName=DeactivationFileName=string()
read_trace_case_definitions(LD) ->
case LD#ld.tc_def_file of
- TCfileName when list(TCfileName) ->
+ TCfileName when is_list(TCfileName) -> case catch file:consult(TCfileName) of
{ok,Terms} ->
Dir=LD#ld.dir, % The working directory of the tool.
@@ -2636,8 +2636,8 @@ get_status(CNode,Nodes) -> %% We can end up here if a session is stopped with this node suspended.
%% Returns a nodes database structure filled with the nodes Nodes.
-mk_nodes(Nodes) when list(Nodes) ->
- {ok,lists:map(fun(N) when atom(N)->{N,down} end,Nodes)};
+mk_nodes(Nodes) when is_list(Nodes) -> + {ok,lists:map(fun(N) when is_atom(N)->{N,down} end,Nodes)}; mk_nodes(local_runtime) -> % The non-distributed case.
down;
mk_nodes(_Nodes) ->
@@ -2783,7 +2783,7 @@ set_suspended_nodes(_,{up,{State,_}}) -> %% This function is called when reactivation is completed. Hence it moves the
%% node to no longer suspended. Note this can mean that the node is either
%% tracing or inactive. Reactivation is not allowed for a node have trace_failure.
-set_running_nodes(Node,NodesD) when list(NodesD) ->
+set_running_nodes(Node,NodesD) when is_list(NodesD) -> case lists:keysearch(Node,1,NodesD) of
{value,{_,AvailableStatus}} ->
lists:keyreplace(Node,1,NodesD,{Node,set_running_nodes_2(AvailableStatus)});
@@ -2902,7 +2902,7 @@ get_available_nodes([]) -> %% suspended or not.
%% Returns {State,Status} | reactivating | down
%% where
-get_state_nodes(Node,NodesD) when list(NodesD) ->
+get_state_nodes(Node,NodesD) when is_list(NodesD) -> case lists:keysearch(Node,1,NodesD) of
{value,{_,AvailableStatus}} ->
get_state_nodes_2(AvailableStatus);
diff --git a/lib/inviso/src/inviso_tool_lib.erl b/lib/inviso/src/inviso_tool_lib.erl index 20a8b509ae..7953acedd6 100644 --- a/lib/inviso/src/inviso_tool_lib.erl +++ b/lib/inviso/src/inviso_tool_lib.erl @@ -83,7 +83,7 @@ inviso_cmd(NodeName,Func,Args) -> %% In the non-distributed case the singlenode_expansion will be returned.
expand_module_names(_Nodes,Mod={_,'_'},_) ->
{error,{faulty_regexp_combination,Mod}};
-expand_module_names(Nodes,{DirStr,ModStr},Opts) when list(DirStr), list(ModStr) ->
+expand_module_names(Nodes,{DirStr,ModStr},Opts) when is_list(DirStr), is_list(ModStr) -> case expand_module_names_special_regexp(DirStr) of
{ok,NewDirStr} ->
case expand_module_names_special_regexp(ModStr) of
@@ -97,11 +97,11 @@ expand_module_names(Nodes,{DirStr,ModStr},Opts) when list(DirStr), list(ModStr) end;
expand_module_names(_,'_',_Opts) -> % If we want to trace all modules
wildcard; % we shall not expand it.
-expand_module_names(_Nodes,Mod,_Opts) when atom(Mod) ->
+expand_module_names(_Nodes,Mod,_Opts) when is_atom(Mod) -> module; % If it is an atom, no expansion.
expand_module_names(Nodes,"*",Opts) -> % Treat this as a reg.exp.
expand_module_names(Nodes,".*",Opts);
-expand_module_names(Nodes,ModStr,Opts) when list(ModStr) ->
+expand_module_names(Nodes,ModStr,Opts) when is_list(ModStr) -> case expand_module_names_special_regexp(ModStr) of
{ok,NewModStr} ->
expand_module_names_2(Nodes,NewModStr,Opts);
@@ -115,7 +115,7 @@ expand_module_names_2(Nodes,ModStr,Opts) -> case get_expand_regexp_at_opts(Opts) of
{ok,Node} -> % Expansion only at this node.
case inviso_rt_lib:expand_regexp([Node],ModStr,Opts) of
- [{Node,Modules}] when list(Modules) ->
+ [{Node,Modules}] when is_list(Modules) -> {singlenode_expansion,Modules};
[{Node,_}] -> % Most likely badrpc.
{error,{faulty_node,Node}}
@@ -130,7 +130,7 @@ expand_module_names_2(Nodes,DirStr,ModStr,Opts) -> case get_expand_regexp_at_opts(Opts) of
{ok,Node} -> % Expansion only at this node.
case inviso_rt_lib:expand_regexp([Node],DirStr,ModStr,Opts) of
- [{Node,Modules}] when list(Modules) ->
+ [{Node,Modules}] when is_list(Modules) -> {singlenode_expansion,Modules};
[{Node,_}] -> % Most likely badrpc.
{error,{faulty_node,Node}}
@@ -186,12 +186,12 @@ make_patterns(Catches,Opts,Dbg,NodeModsOrMods,F,A,MS) -> make_patterns_2(Catches,OwnArg,Dbg,NodeModsOrMods,F,A,MS)
end.
-make_patterns_2(Catches,OwnArg,Dbg,[{Node,Mods}|Rest],F,A,MS) when list(Mods) ->
+make_patterns_2(Catches,OwnArg,Dbg,[{Node,Mods}|Rest],F,A,MS) when is_list(Mods) -> TPs=make_patterns_3(Catches,OwnArg,Dbg,Mods,F,A,MS,[]),
[{Node,join_patterns(TPs)}|make_patterns_2(Catches,OwnArg,Dbg,Rest,F,A,MS)];
make_patterns_2(Catches,OwnArg,Dbg,[{_Node,_}|Rest],F,A,MS) -> % badrpc!?
make_patterns_2(Catches,OwnArg,Dbg,Rest,F,A,MS);
-make_patterns_2(Catches,OwnArg,Dbg,Modules,F,A,MS) when list(Modules) ->
+make_patterns_2(Catches,OwnArg,Dbg,Modules,F,A,MS) when is_list(Modules) -> TPs=make_patterns_3(Catches,OwnArg,Dbg,Modules,F,A,MS,[]),
join_patterns(TPs);
make_patterns_2(_,_,_,[],_,_,_) ->
@@ -330,7 +330,7 @@ get_datetime_from_tdg_args([DateTime|_]) -> %% Returns a list.
get_ownarg_opts(Opts) ->
case lists:keysearch(arg,1,Opts) of
- {value,{_,OwnArg}} when list(OwnArg) ->
+ {value,{_,OwnArg}} when is_list(OwnArg) -> OwnArg;
{value,{_,OwnArg}} ->
[OwnArg];
@@ -350,7 +350,7 @@ get_disable_safety_opts(Opts) -> get_expand_regexp_at_opts(Opts) ->
case lists:keysearch(expand_only_at,1,Opts) of
- {value,{_,Node}} when atom(Node) ->
+ {value,{_,Node}} when is_atom(Node) -> {ok,Node};
_ ->
false
diff --git a/lib/jinterface/java_src/Makefile b/lib/jinterface/java_src/Makefile index 37a57352ad..22c55328b8 100644 --- a/lib/jinterface/java_src/Makefile +++ b/lib/jinterface/java_src/Makefile @@ -35,7 +35,21 @@ VSN=$(JINTERFACE_VSN) SPECIAL_TARGETS = +TARGET_FILES= $(POM_TARGET) +SPECIAL_TARGETS = + +POM_FILE= pom.xml + +POM_TARGET= ../$(POM_FILE) +POM_SRC= $(POM_FILE).src + +# ---------------------------------------------------- +# Special Build Targets +# ---------------------------------------------------- + +$(POM_TARGET): $(POM_SRC) ../vsn.mk + sed -e 's;%VSN%;$(VSN);' $< > $@ # ---------------------------------------------------- # Default Subdir Targets @@ -43,7 +57,7 @@ SPECIAL_TARGETS = .PHONY: debug opt instr release docs release_docs tests release_tests clean depend -debug opt instr release docs release_docs tests release_tests clean depend: +debug opt instr release docs release_docs tests release_tests clean depend: $(TARGET_FILES) set -e; set -x; \ case "$(MAKE)" in *clearmake*) tflag="-T";; *) tflag="";; esac; \ if test -f com/ericsson/otp/erlang/ignore_config_record.inf; then xflag=$$tflag; fi; \ diff --git a/lib/jinterface/java_src/pom.xml.src b/lib/jinterface/java_src/pom.xml.src new file mode 100644 index 0000000000..cef49b735a --- /dev/null +++ b/lib/jinterface/java_src/pom.xml.src @@ -0,0 +1,106 @@ +<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> + <modelVersion>4.0.0</modelVersion> + <groupId>org.erlang.otp</groupId> + <artifactId>jinterface</artifactId> + <packaging>jar</packaging> + <version>%VSN%</version> + <name>jinterface</name> + <description> + Jinterface Java package contains java classes, which help you integrate programs written in Java with Erlang. + Erlang is a programming language designed at the Ericsson Computer Science Laboratory. + </description> + <url>http://erlang.org/</url> + <licenses> + <license> + <name>ERLANG PUBLIC LICENSE 1.1</name> + <url>http://www.erlang.org/EPLICENSE</url> + <distribution>repo</distribution> + </license> + </licenses> + <scm> + <connection>git://github.com/erlang/otp.git</connection> + <developerConnection>git://github.com/erlang/otp.git</developerConnection> + <url>http://github.com/erlang/otp</url> + </scm> + <developers> + <developer> + <email>[email protected]</email> + </developer> + </developers> + <organization> + <name>Open Source Erlang</name> + <url>http://www.erlang.org/</url> + </organization> + <build> + <plugins> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-compiler-plugin</artifactId> + <configuration> + <source>1.5</source> + <target>1.5</target> + </configuration> + </plugin> + <plugin> + <groupId>org.codehaus.mojo</groupId> + <artifactId>build-helper-maven-plugin</artifactId> + <executions> + <execution> + <phase>generate-sources</phase> + <goals> + <goal>add-source</goal> + </goals> + <configuration> + <sources> + <source>java_src</source> + </sources> + </configuration> + </execution> + </executions> + </plugin> + </plugins> + </build> + <distributionManagement> + <repository> + <id>ossrh</id> + <url>http://oss.sonatype.org/service/local/staging/deploy/maven2</url> + </repository> + <snapshotRepository> + <id>ossrh</id> + <url>http://oss.sonatype.org/content/repositories/snapshots</url> + </snapshotRepository> + </distributionManagement> + <profiles> + <profile> + <id>release-sign-artifacts</id> + <activation> + <property> + <name>performRelease</name> + <value>true</value> + </property> + </activation> + <build> + <plugins> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-gpg-plugin</artifactId> + <version>1.0-alpha-4</version> + <executions> + <execution> + <id>sign-artifacts</id> + <phase>verify</phase> + <goals> + <goal>sign</goal> + </goals> + </execution> + </executions> + </plugin> + </plugins> + </build> + </profile> + </profiles> + <properties> + <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> + </properties> +</project> diff --git a/lib/jinterface/test/Makefile b/lib/jinterface/test/Makefile new file mode 100644 index 0000000000..36955d1e91 --- /dev/null +++ b/lib/jinterface/test/Makefile @@ -0,0 +1,84 @@ +# +# %CopyrightBegin% +# +# Copyright Ericsson AB 2004-2010. All Rights Reserved. +# +# The contents of this file are subject to the Erlang Public License, +# Version 1.1, (the "License"); you may not use this file except in +# compliance with the License. You should have received a copy of the +# Erlang Public License along with this software. If not, it can be +# retrieved online at http://www.erlang.org/. +# +# Software distributed under the License is distributed on an "AS IS" +# basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See +# the License for the specific language governing rights and limitations +# under the License. +# +# %CopyrightEnd% +# +include $(ERL_TOP)/make/target.mk +include $(ERL_TOP)/make/$(TARGET)/otp.mk + +# ---------------------------------------------------- +# Application version +# ---------------------------------------------------- +include ../vsn.mk + +# ---------------------------------------------------- +# Release directory specification +# ---------------------------------------------------- +RELSYSDIR = $(RELEASE_PATH)/jinterface_test + +# ---------------------------------------------------- +# Target Specs +# ---------------------------------------------------- +TEST_SPEC_FILE = jinterface.dynspec + +MODULES = nc_SUITE \ + jinterface_SUITE + +GEN_MODULES = jitu + +ERL_FILES = $(MODULES:%=%.erl) $(GEN_MODULES:%=%.erl) + +GEN_TARGET_FILES = $(GEN_MODULES:%=%.$(EMULATOR)) + +SUITE_TARGET_FILES = $(MODULES:%=%.$(EMULATOR)) + +TARGET_FILES = \ + $(GEN_TARGET_FILES) \ + $(SUITE_TARGET_FILES) + +# ---------------------------------------------------- +# PROGRAMS +# ---------------------------------------------------- + +# ---------------------------------------------------- +# Targets +# ---------------------------------------------------- +tests debug opt: + +clean: + rm -f $(TARGET_FILES) + rm -f errs core *~ + +docs: + +# ---------------------------------------------------- +# Special Targets +# ---------------------------------------------------- + + +# ---------------------------------------------------- +# Release Targets +# ---------------------------------------------------- +include $(ERL_TOP)/make/otp_release_targets.mk + +release_spec: + +release_docs_spec: + +release_tests_spec: tests + $(INSTALL_DIR) $(RELSYSDIR) + $(INSTALL_DATA) $(TEST_SPEC_FILE) $(ERL_FILES) $(RELSYSDIR) + @tar cf - *_SUITE_data | (cd $(RELSYSDIR); tar xf -) diff --git a/lib/jinterface/test/jinterface.dynspec b/lib/jinterface/test/jinterface.dynspec new file mode 100644 index 0000000000..44712521df --- /dev/null +++ b/lib/jinterface/test/jinterface.dynspec @@ -0,0 +1,32 @@ +%% -*- erlang -*- +%% +%% %CopyrightBegin% +%% +%% Copyright Ericsson AB 2006-2010. All Rights Reserved. +%% +%% The contents of this file are subject to the Erlang Public License, +%% Version 1.1, (the "License"); you may not use this file except in +%% compliance with the License. You should have received a copy of the +%% Erlang Public License along with this software. If not, it can be +%% retrieved online at http://www.erlang.org/. +%% +%% Software distributed under the License is distributed on an "AS IS" +%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See +%% the License for the specific language governing rights and limitations +%% under the License. +%% +%% %CopyrightEnd% +%% +%% You can test this file using this command. +%% file:script("jinterface.dynspec", [{'Os',"Unix"}]). + +case case code:priv_dir(jinterface) of + {error,bad_name} -> false; + P -> filelib:is_dir(P) end of + true -> + []; + false -> + NoApp = "No jinterface application", + [{skip,{nc_SUITE,NoApp}}, + {skip,{jinterface_SUITE,NoApp}}] +end. diff --git a/lib/jinterface/test/jinterface_SUITE.erl b/lib/jinterface/test/jinterface_SUITE.erl new file mode 100644 index 0000000000..ea097680dd --- /dev/null +++ b/lib/jinterface/test/jinterface_SUITE.erl @@ -0,0 +1,761 @@ +%% +%% %CopyrightBegin% +%% +%% Copyright Ericsson AB 2004-2010. All Rights Reserved. +%% +%% The contents of this file are subject to the Erlang Public License, +%% Version 1.1, (the "License"); you may not use this file except in +%% compliance with the License. You should have received a copy of the +%% Erlang Public License along with this software. If not, it can be +%% retrieved online at http://www.erlang.org/. +%% +%% Software distributed under the License is distributed on an "AS IS" +%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See +%% the License for the specific language governing rights and limitations +%% under the License. +%% +%% %CopyrightEnd% +%% +-module(jinterface_SUITE). + +-export([all/1, init_per_suite/1, end_per_suite/1, + init_per_testcase/2, end_per_testcase/2]). + +-export([nodename/1, register_and_whereis/1, get_names/1, boolean_atom/1, + node_ping/1, mbox_ping/1, + java_erlang_send_receive/1, + java_internal_send_receive_same_node/1, + java_internal_send_receive_different_nodes/1, + java_internal_send_receive_self/1, + java_link_and_exit/1, erl_link_and_exit/1, + erl_link_java_exit/1, java_link_erl_exit/1, + internal_link_linking_exits/1, internal_link_linked_exits/1, + internal_unlink_linking_exits/1, internal_unlink_linked_exits/1, + normal_exit/1, kill_mbox/1, kill_erl_proc_from_java/1, + kill_mbox_from_erlang/1, erl_exit_with_reason_any_term/1, + java_exit_with_reason_any_term/1, + status_handler_localStatus/1, status_handler_remoteStatus/1, + status_handler_connAttempt/1]). + +-include("test_server.hrl"). +-include("test_server_line.hrl"). + +-define(debug,true). +-ifdef(debug). +-define(dbg(Str,Args), io:format(Str,Args)). +-else. +-define(dbg(Str,Args), ok). +-endif. + +-define(link_test_reason,link_test_reason). + +%% Test cases in MboxSendReceive.java +-define(java_erlang_send_receive,1). +-define(java_internal_send_receive_same_node,2). +-define(java_internal_send_receive_different_nodes,3). +-define(java_internal_send_receive_self,4). + +%% Test cases in MboxLinkUnlink.java +-define(java_link_and_exit, 1). +-define(erl_link_and_exit, 2). +-define(erl_link_java_exit, 3). +-define(java_link_erl_exit, 4). +-define(internal_link_linking_exits, 5). +-define(internal_link_linked_exits, 6). +-define(internal_unlink_linking_exits,7). +-define(internal_unlink_linked_exits,8). +-define(normal_exit,9). +-define(kill_mbox,10). +-define(kill_erl_proc_from_java,11). +-define(kill_mbox_from_erlang,12). +-define(erl_exit_with_reason_any_term,13). +-define(java_exit_with_reason_any_term,14). + + +%% Test cases in NodeStatusHandler.java +-define(status_handler_localStatus,1). +-define(status_handler_remoteStatus,2). +-define(status_handler_connAttempt,3). + +%%%----------------------------------------------------------------- +%%% INIT/END +%%%----------------------------------------------------------------- +all(suite) -> + lists:append([ + fundamental(), + ping(), + send_receive(), + link_unlink(), + status_handler() + ]). + +fundamental() -> + [ + nodename, % Nodename.java + register_and_whereis, % RegisterAndWhereis.java + get_names, % GetNames.java + boolean_atom % BooleanAtom.java + ]. + +ping() -> + [ + %% Implemented in NodePing.java + node_ping, + + %% Implemented in MboxPing.java + mbox_ping + ]. + + +send_receive() -> + [ + %% Implemented in MboxSendReceive.java + java_erlang_send_receive, + java_internal_send_receive_same_node, + java_internal_send_receive_different_nodes, + java_internal_send_receive_self + ]. + +%% Note: +%% +%% The test cases in MboxLinkUnlink.java and in +%% NodePing.java, all uses default cookie, and if there +%% is a problem with having the same default cookie in +%% erlang vs jinterface, e.g because the home directory +%% does not get the same in some cases on Windows +%% - they will all fail. + +link_unlink() -> + [ + %% Implemented in MboxLinkUnlink.java + java_link_and_exit, + erl_link_and_exit, + erl_link_java_exit, + java_link_erl_exit, + internal_link_linking_exits, + internal_link_linked_exits, + internal_unlink_linking_exits, + internal_unlink_linked_exits, + normal_exit, + kill_mbox, + kill_erl_proc_from_java, + kill_mbox_from_erlang, + erl_exit_with_reason_any_term, + java_exit_with_reason_any_term + ]. + +status_handler() -> + [ + %% Implemented in NodeStatusHandler.java + status_handler_localStatus, + status_handler_remoteStatus, + status_handler_connAttempt + ]. + + +init_per_suite(Config) when is_list(Config) -> + jitu:init_all(Config). + +end_per_suite(Config) when is_list(Config) -> + jitu:finish_all(Config). + +init_per_testcase(_Case,Config) -> + Dog = ?t:timetrap({seconds,10}), + [{watch_dog,Dog}|Config]. + +end_per_testcase(_Case,Config) -> + ?t:timetrap_cancel(?config(watch_dog,Config)), + ok. + + +%%%----------------------------------------------------------------- +%%% TEST CASES +%%%----------------------------------------------------------------- +nodename(doc) -> + ["Nodename.java: " + "Test OtpNode.node(), OtpNode.alive() and OtpNode.host()"]; +nodename(suite) -> + []; +nodename(Config) when is_list(Config) -> + [_,Host] = string:tokens(atom_to_list(node()),"@"), + ok = jitu:java(?config(java, Config), + ?config(data_dir, Config), + "Nodename", + [list_to_atom(Host)]). + +%%%----------------------------------------------------------------- +register_and_whereis(doc) -> + ["RegisterAndWhereis.java: " + "Test OtpNode.registerName(...), OtpMbox.registerName(...) and " + "OtpNode.whereis(...)"]; +register_and_whereis(suite) -> + []; +register_and_whereis(Config) when is_list(Config) -> + ok = jitu:java(?config(java, Config), + ?config(data_dir, Config), + "RegisterAndWhereis", + []). + +%%%----------------------------------------------------------------- +get_names(doc) -> + ["GetNames.java: " + "Test OtpNode.getNames()"]; +get_names(suite) -> + []; +get_names(Config) when is_list(Config) -> + ok = jitu:java(?config(java, Config), + ?config(data_dir, Config), + "GetNames", + []). + +%%%----------------------------------------------------------------- +boolean_atom(doc) -> + ["BooleanAtom.java: " + "Test OtpErlangAtom.booleanValue()"]; +boolean_atom(suite) -> + []; +boolean_atom(Config) when is_list(Config) -> + ok = jitu:java(?config(java, Config), + ?config(data_dir, Config), + "BooleanAtom", + []). + +%%%----------------------------------------------------------------- +node_ping(doc) -> + ["NodePing.java: " + "Test OtpNode.ping(java.lang.String node, long timeout)"]; +node_ping(suite) -> + []; +node_ping(Config) when is_list(Config) -> + ok = jitu:java(?config(java, Config), + ?config(data_dir, Config), + "NodePing", + [erlang:get_cookie(),node()]). + +%%%----------------------------------------------------------------- +mbox_ping(doc) -> + ["MboxPing.java: " + "Test OtpNode.createMbox(...) and OtpMbox.ping(...)"]; +mbox_ping(suite) -> + []; +mbox_ping(Config) when is_list(Config) -> + ok = jitu:java(?config(java, Config), + ?config(data_dir, Config), + "MboxPing", + [erlang:get_cookie(),node()]). + +%%%----------------------------------------------------------------- +java_erlang_send_receive(doc) -> + ["Test sending/receiving of erlang messages between erlang and java"]; +java_erlang_send_receive(suite) -> + []; +java_erlang_send_receive(Config) when is_list(Config) -> + send_receive(?java_erlang_send_receive, fun echo_loop/0, Config). + +echo_loop() -> + receive + {From,Msg} -> + ?dbg("erl_send_receive_server received ~p",[{From,Msg}]), + ?dbg("erl_send_receive_server sending ~p",[Msg]), + From ! Msg, + echo_loop(); + done -> + ok + end. + + +%%%----------------------------------------------------------------- +java_internal_send_receive_same_node(doc) -> + ["MboxSendReceive.java: " + "Test sending/receiving of erlang messages between mboxes " + "on the same java node."]; +java_internal_send_receive_same_node(suite) -> + []; +java_internal_send_receive_same_node(Config) when is_list(Config) -> + send_receive(?java_internal_send_receive_same_node, + fun() -> receive done -> ok end end, + Config). + +%%%----------------------------------------------------------------- +java_internal_send_receive_different_nodes(doc) -> + ["MboxSendReceive.java: " + "Test sending/receiving of erlang messages between mboxes " + "on different java nodes."]; +java_internal_send_receive_different_nodes(suite) -> + []; +java_internal_send_receive_different_nodes(Config) when is_list(Config) -> + send_receive(?java_internal_send_receive_different_nodes, + fun() -> receive done -> ok end end, + Config). + +%%%----------------------------------------------------------------- +java_internal_send_receive_self(doc) -> + ["MboxSendReceive.java: " + "Test sending/receiving of erlang messages from an mbox to itself"]; +java_internal_send_receive_self(suite) -> + []; +java_internal_send_receive_self(Config) when is_list(Config) -> + send_receive(?java_internal_send_receive_self, + fun() -> receive done -> ok end end, + Config). + +%%%----------------------------------------------------------------- +java_link_and_exit(doc) -> + ["MboxLinkUnlink.java: " + "Test link between erlang process and java mailbox." + "Java mailbox links and exits"]; +java_link_and_exit(suite) -> + []; +java_link_and_exit(Config) when is_list(Config) -> + LinkFun = + fun(Mbox) -> + Mbox ! {?java_link_and_exit,self(),?link_test_reason}, + receive after infinity -> ok end + end, + erl_java_link(LinkFun,java_link_and_exit,Config). + + +%%%----------------------------------------------------------------- +erl_link_and_exit(doc) -> + ["MboxLinkUnlink.java: " + "Test link between erlang process and java mailbox." + "Erlang process links and exits"]; +erl_link_and_exit(suite) -> + []; +erl_link_and_exit(Config) when is_list(Config) -> + LinkFun = fun(Mbox) -> + link(Mbox), + Mbox ! {?erl_link_and_exit,self(),?link_test_reason}, + receive ok -> ok end, + exit(?link_test_reason) + end, + erl_java_link(LinkFun,erl_link_and_exit,Config). + +%%%----------------------------------------------------------------- +erl_link_java_exit(doc) -> + ["MboxLinkUnlink.java: " + "Test link between erlang process and java mailbox." + "Erlang process links and java mailbox exits"]; +erl_link_java_exit(suite) -> + []; +erl_link_java_exit(Config) when is_list(Config) -> + LinkFun = fun(Mbox) -> + link(Mbox), + Mbox ! {?erl_link_java_exit,self(),?link_test_reason}, + receive after infinity -> ok end + end, + erl_java_link(LinkFun,erl_link_java_exit,Config). + + +%%%----------------------------------------------------------------- +java_link_erl_exit(doc) -> + ["MboxLinkUnlink.java: " + "Test link between erlang process and java mailbox." + "Java mailbox links and erlang process exits"]; +java_link_erl_exit(suite) -> + []; +java_link_erl_exit(Config) when is_list(Config) -> + LinkFun = + fun(Mbox) -> + Mbox ! {?java_link_erl_exit,self(),?link_test_reason}, + receive ok -> ok end, + exit(?link_test_reason) + end, + erl_java_link(LinkFun,java_link_erl_exit,Config). + +%%%----------------------------------------------------------------- +internal_link_linking_exits(doc) -> + ["MboxLinkUnlink.java: " + "Test link between two java mailboxes." + "The mailbox which creates the link is the one exiting"]; +internal_link_linking_exits(suite) -> + []; +internal_link_linking_exits(Config) when is_list(Config) -> + internal_link_unlink(?internal_link_linking_exits, + internal_link_linking_exits, + Config). + +%%%----------------------------------------------------------------- +internal_link_linked_exits(doc) -> + ["MboxLinkUnlink.java: " + "Test link between two java mailboxes." + "The mailbox which dies not create the link is the one exiting"]; +internal_link_linked_exits(suite) -> + []; +internal_link_linked_exits(Config) when is_list(Config) -> + internal_link_unlink(?internal_link_linked_exits, + internal_link_linked_exits, + Config). + +%%%----------------------------------------------------------------- +internal_unlink_linking_exits(doc) -> + ["MboxLinkUnlink.java: " + "Test link and unlink between two java mailboxes. " + "Mailbox1 creates a link to mailbox2 and removes it. " + "Then it creates another link and mailbox2 removes is. " + "Finally mailbox1 exits - mailbox2 must survive"]; +internal_unlink_linking_exits(suite) -> + []; +internal_unlink_linking_exits(Config) when is_list(Config) -> + internal_link_unlink(?internal_unlink_linking_exits, + internal_unlink_linking_exits, + Config). + +%%%----------------------------------------------------------------- +internal_unlink_linked_exits(doc) -> + ["MboxLinkUnlink.java: " + "Test link and unlink between two java mailboxes. " + "Mailbox1 creates a link to mailbox2 and removes it. " + "Then it creates another link and mailbox2 removes is. " + "Finally mailbox2 exits - mailbox1 must survive"]; +internal_unlink_linked_exits(suite) -> + []; +internal_unlink_linked_exits(Config) when is_list(Config) -> + internal_link_unlink(?internal_unlink_linked_exits, + internal_unlink_linked_exits, + Config). + +%%%----------------------------------------------------------------- +normal_exit(doc) -> + ["MboxLinkUnlink.java: " + "Test that mbox.close() uses exit reason 'normal', i.e. " + "that linked processes are not terminated."]; +normal_exit(suite) -> + []; +normal_exit(Config) when is_list(Config) -> + Fun = + fun() -> + register(erl_link_server,self()), + process_flag(trap_exit,true), + receive + {Main,Mbox} when is_pid(Main), is_pid(Mbox) -> + ?dbg("Erlang sending \"~p\"",[normal_exit]), + link(Mbox), + Pid = spawn_link(fun() -> + link(Mbox), + Mbox ! {?normal_exit}, + receive after infinity -> ok end + end), + receive + {'EXIT',Mbox,normal} -> + %% Make sure that we don't get the + %% exit signal from Pid, and Pid + %% should still be alive. + receive + {'EXIT',Pid,Reason} -> + ?dbg("Got unexpected exit signal: ~p", + [{'EXIT',Pid,Reason}]), + exit({unexpected,{'EXIT',Pid,Reason}}) + after 500 -> + true = erlang:is_process_alive(Pid), + exit(Pid,kill) + end, + receive done -> Main ! done end + after 1000 -> + receive + Other -> + ?dbg("Got garbage when waiting for exit:" + " ~p", [Other]), + Main ! done, + exit({got_unexpected,Other}) + after 0 -> + ok + end + end; + Other -> + ?dbg("Got garbage: ~p",[Other]), + exit(Other) + end + end, + + spawn_link(Fun), + ok = jitu:java(?config(java, Config), + ?config(data_dir, Config), + "MboxLinkUnlink", + [erlang:get_cookie(),node()]). + + +%%%----------------------------------------------------------------- +kill_mbox(doc) -> + ["MboxLinkUnlink.java: " + "Test that mbox.exit(new OtpErlangAtom(\"kill\") causes linked " + "processes to exit with reason 'killed', which can be trapped."]; +kill_mbox(suite) -> + {skip, "Not yet implemented"}; +kill_mbox(Config) when is_list(Config) -> + Fun = + fun() -> + register(erl_link_server,self()), + process_flag(trap_exit,true), + receive + {Main,Mbox} when is_pid(Main), is_pid(Mbox) -> + ?dbg("Erlang sending \"~p\"",[kill_mbox]), + Pid = spawn_link(fun() -> + process_flag(trap_exit,true), + link(Mbox), + Mbox ! {?kill_mbox}, + receive + {'EXIT',Mbox,killed} -> + exit(correct_reason); + {'EXIT',Mbox,R} -> + exit({faulty_reason,R}) + end + end), + receive + {'EXIT',Pid,{faulty_reason,Reason}} -> + receive done -> Main ! done end, + exit({faulty_reason,Reason}); + {'EXIT',Pid,im_killed} -> + receive done -> Main ! done end + after 1000 -> + receive + Other -> + ?dbg("Got garbage when waiting for exit:" + " ~p", [Other]), + Main ! done, + exit({got_unexpected,Other}) + after 0 -> + ok + end + end; + Other -> + ?dbg("Got garbage: ~p",[Other]), + exit(Other) + end + end, + + spawn_link(Fun), + ok = jitu:java(?config(java, Config), + ?config(data_dir, Config), + "MboxLinkUnlink", + [erlang:get_cookie(),node()]). + +%%%----------------------------------------------------------------- +kill_erl_proc_from_java(doc) -> + ["MboxLinkUnlink.java: " + "Test that mbox.exit(pid, new OtpErlangAtom(\"kill\") causes erlang " + "processes <pid> to be killed, even if trapping exits"]; +kill_erl_proc_from_java(suite) -> + []; +kill_erl_proc_from_java(Config) when is_list(Config) -> + LinkFun = fun(Mbox) -> + process_flag(trap_exit,true), + link(Mbox), + Mbox ! {?kill_erl_proc_from_java, self()}, + receive after infinity -> ok end + end, + erl_java_link(LinkFun,kill_erl_proc_from_java,killed,Config). + +%%%----------------------------------------------------------------- +kill_mbox_from_erlang(doc) -> + ["MboxLinkUnlink.java: " + "Test that exit(Mbox,kill) causes linked the Mbox to be killed, and" + "linked processes to exit with reason 'killed', even if trapping exits"]; +kill_mbox_from_erlang(suite) -> + {skip, "Not yet implemented"}; +kill_mbox_from_erlang(Config) when is_list(Config) -> + LinkFun = fun(Mbox) -> + link(Mbox), + Mbox ! {?kill_mbox_from_erlang}, + exit(Mbox,kill), + receive after infinity -> ok end + end, + erl_java_link(LinkFun,kill_mbox_from_erlang,killed,Config). + +%%%----------------------------------------------------------------- +erl_exit_with_reason_any_term(doc) -> + ["MboxLinkUnlink.java: " + "Test that any erlang term can be used as exit reason when erlang " + "process exits and is linked to an mbox."]; +erl_exit_with_reason_any_term(suite) -> + []; +erl_exit_with_reason_any_term(Config) when is_list(Config) -> + Reason = [hei,self(),{this,is,"a",[different,"reason"]}], + LinkFun = fun(Mbox) -> + link(Mbox), + Mbox ! {?erl_exit_with_reason_any_term,self(),Reason}, + receive ok -> ok end, + exit(Reason) + end, + erl_java_link(LinkFun,erl_exit_with_reason_any_term,Reason,Config). + +%%%----------------------------------------------------------------- +java_exit_with_reason_any_term(doc) -> + ["MboxLinkUnlink.java: " + "Test that any erlang term can be used as exit reason when mbox " + "exits and is linked to an erlang process."]; +java_exit_with_reason_any_term(suite) -> + []; +java_exit_with_reason_any_term(Config) when is_list(Config) -> + Reason = [hei,self(),{this,is,"a",[different,"reason"]}], + LinkFun = + fun(Mbox) -> + Mbox ! {?java_exit_with_reason_any_term,self(),Reason}, + receive after infinity -> ok end + end, + erl_java_link(LinkFun,java_exit_with_reason_any_term,Reason,Config). + + +%%%----------------------------------------------------------------- +status_handler_localStatus(doc) -> + ["NodeStatusHandler.java: " + "Test OtpNode.registerStatusHandler(...) and the callback " + "OtpNodeStatus.localStatus(...)"]; +status_handler_localStatus(suite) -> + []; +status_handler_localStatus(Config) when is_list(Config) -> + spawn_link(fun() -> + erl_status_server([{opt,{localStatus,"javanode1",true}}, + {localStatus,"javanode1",false}]) + end), + ok = jitu:java(?config(java, Config), + ?config(data_dir, Config), + "NodeStatusHandler", + [erlang:get_cookie(),node(),?status_handler_localStatus]). + +%%%----------------------------------------------------------------- +status_handler_remoteStatus(doc) -> + ["NodeStatusHandler.java: " + "Test OtpNode.registerStatusHandler(...) and the callback " + "OtpNodeStatus.remoteStatus(...)"]; +status_handler_remoteStatus(suite) -> + []; +status_handler_remoteStatus(Config) when is_list(Config) -> + spawn_link(fun() -> + erl_status_server([{opt,{localStatus,"javanode1",true}}, + {remoteStatus,"javanode2",true}, + {remoteStatus,"javanode2",false}]) + end), + ok = jitu:java(?config(java, Config), + ?config(data_dir, Config), + "NodeStatusHandler", + [erlang:get_cookie(),node(),?status_handler_remoteStatus]). + + +%%%----------------------------------------------------------------- +status_handler_connAttempt(doc) -> + ["NodeStatusHandler.java: " + "Test OtpNode.registerStatusHandler(...) and the callback " + "OtpNodeStatus.connAttempt(...)"]; +status_handler_connAttempt(suite) -> + []; +status_handler_connAttempt(Config) when is_list(Config) -> + spawn_link(fun() -> + erl_status_server([{opt,{localStatus,"javanode1",true}}, + {connAttempt,"unknown",true}, + {connAttempt,"javanode3",false}]) + end), + ok = jitu:java(?config(java, Config), + ?config(data_dir, Config), + "NodeStatusHandler", + [erlang:get_cookie(),node(),?status_handler_connAttempt]). + + +%%%----------------------------------------------------------------- +%%% INTERNAL FUNCTIONS +%%%----------------------------------------------------------------- +send_receive(TestCaseTag,Fun,Config) -> + spawn(fun() -> + register(erl_send_receive_server,self()), + receive + From when is_pid(From) -> + JavaNode = node(From), + [JavaNode] = nodes(hidden), + From ! {TestCaseTag,self()}, + Fun(), + unregister(erl_send_receive_server) + end + end), + ok = jitu:java(?config(java, Config), + ?config(data_dir, Config), + "MboxSendReceive", + [erlang:get_cookie(),node()]). + + +internal_link_unlink(Tag,Msg,Config) -> + Fun = + fun() -> + register(erl_link_server,self()), + process_flag(trap_exit,true), + receive + {Main,Mbox} when is_pid(Main), is_pid(Mbox) -> + ?dbg("Erlang sending \"~p\"",[Msg]), + Mbox ! {Tag,self(),?link_test_reason}, + receive done -> Main ! done end; + Other -> + ?dbg("Got garbage: ~p",[Other]), + exit(Other) + end + end, + + spawn_link(Fun), + ok = jitu:java(?config(java, Config), + ?config(data_dir, Config), + "MboxLinkUnlink", + [erlang:get_cookie(),node()]). + + +erl_java_link(LinkFun,Msg,Config) -> + erl_java_link(LinkFun,Msg,?link_test_reason,Config). + +erl_java_link(LinkFun,Msg,Reason,Config) -> + Fun = + fun() -> + register(erl_link_server,self()), + process_flag(trap_exit,true), + receive + {Main,Mbox} when is_pid(Mbox), is_pid(Mbox) -> + ?dbg("Erlang sending \"~p\"",[Msg]), + Pid = spawn_link(fun() -> LinkFun(Mbox) end), + receive + {'EXIT',Pid,Reason} -> + receive done -> Main ! done end + after 1000 -> + receive + Other -> + ?dbg("Got garbage when waiting for exit:" + " ~p", [Other]), + Main ! done, + exit({got_unexpected,Other}) + after 0 -> + ok + end + end; + Other -> + ?dbg("Got garbage: ~p",[Other]), + exit(Other) + end + end, + + spawn_link(Fun), + ok = jitu:java(?config(java, Config), + ?config(data_dir, Config), + "MboxLinkUnlink", + [erlang:get_cookie(),node()]). + +erl_status_server(List) -> + register(erl_status_server,self()), + erl_status_server(List,undefined). +erl_status_server([{opt,{Tag,NodeName,Up}},{Tag2,NodeName2,Up2}|Rest],_) -> + receive + {Tag,Node,Up,From} = M -> + ?dbg("erl_status_server got: ~p",[M]), + true = lists:prefix(NodeName,Node), + erl_status_server([{Tag2,NodeName2,Up2}|Rest],From); + {Tag2,Node2,Up2,From2} = M2 -> + ?dbg("erl_status_server got: ~p",[M2]), + true = lists:prefix(NodeName2,Node2), + erl_status_server(Rest,From2) + end; +erl_status_server([{Tag,NodeName,Up}|Rest],_) -> + receive + {Tag,Node,Up,From} = M -> + ?dbg("erl_status_server got: ~p",[M]), + true = lists:prefix(NodeName,Node), + erl_status_server(Rest,From); + Other -> + ?dbg("erl_status_server got garbage: ~p",[Other]), + exit(Other) + end; +erl_status_server([],From) -> + From ! done. diff --git a/lib/jinterface/test/jinterface_SUITE_data/BooleanAtom.java b/lib/jinterface/test/jinterface_SUITE_data/BooleanAtom.java new file mode 100644 index 0000000000..9554d50c9f --- /dev/null +++ b/lib/jinterface/test/jinterface_SUITE_data/BooleanAtom.java @@ -0,0 +1,46 @@ +/* + * %CopyrightBegin% + * + * Copyright Ericsson AB 2004-2010. All Rights Reserved. + * + * The contents of this file are subject to the Erlang Public License, + * Version 1.1, (the "License"); you may not use this file except in + * compliance with the License. You should have received a copy of the + * Erlang Public License along with this software. If not, it can be + * retrieved online at http://www.erlang.org/. + * + * Software distributed under the License is distributed on an "AS IS" + * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See + * the License for the specific language governing rights and limitations + * under the License. + * + * %CopyrightEnd% + */ + +import com.ericsson.otp.erlang.*; + +class BooleanAtom { + + /* + Implements test case jinterface_SUITE:boolean_atom/1 + + Test the function OtpErlangAtom.booleanValue() + */ + + public static void main(String argv[]) { + + OtpErlangAtom atom = new OtpErlangAtom("true"); + if (!atom.booleanValue()) fail(1); + + atom = new OtpErlangAtom("false"); + if (atom.booleanValue()) fail(2); + + atom = new OtpErlangAtom("somethingelse"); + if (atom.booleanValue()) fail(3); + + } + + private static void fail(int reason) { + System.exit(reason); + } +} diff --git a/lib/jinterface/test/jinterface_SUITE_data/GetNames.java b/lib/jinterface/test/jinterface_SUITE_data/GetNames.java new file mode 100644 index 0000000000..3d2bc4ac84 --- /dev/null +++ b/lib/jinterface/test/jinterface_SUITE_data/GetNames.java @@ -0,0 +1,68 @@ +/* + * %CopyrightBegin% + * + * Copyright Ericsson AB 2004-2010. All Rights Reserved. + * + * The contents of this file are subject to the Erlang Public License, + * Version 1.1, (the "License"); you may not use this file except in + * compliance with the License. You should have received a copy of the + * Erlang Public License along with this software. If not, it can be + * retrieved online at http://www.erlang.org/. + * + * Software distributed under the License is distributed on an "AS IS" + * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See + * the License for the specific language governing rights and limitations + * under the License. + * + * %CopyrightEnd% + */ + +import java.util.ArrayList; +import com.ericsson.otp.erlang.*; + +class GetNames { + + /* + Implements test case jinterface_SUITE:get_names/1 + + */ + + public static void main(String argv[]) { + + try { + OtpNode node = new OtpNode("javanode"); + OtpMbox mbox1 = node.createMbox(); + mbox1.registerName("mbox1"); + node.createMbox("mbox2"); + OtpMbox mbox3 = node.createMbox(); + node.registerName("mbox3",mbox3); + + ArrayList existing_names = new ArrayList(); + existing_names.add("mbox3"); + existing_names.add("mbox2"); + existing_names.add("mbox1"); + + String[] names = node.getNames(); + if (names.length != existing_names.size()) fail(1); + + for(int i=0; i<names.length; i++) { + System.out.println("" + names[i]); + existing_names.remove(names[i]); + } + + if (!existing_names.isEmpty()) fail(2); + } + catch (Exception e) { + fail("" + e, 3); + } + } + + private static void fail(int reason) { + System.exit(reason); + } + + private static void fail(String str, int reason) { + System.out.println(str); + System.exit(reason); + } +} diff --git a/lib/jinterface/test/jinterface_SUITE_data/Makefile.src b/lib/jinterface/test/jinterface_SUITE_data/Makefile.src new file mode 100644 index 0000000000..2a3dca463b --- /dev/null +++ b/lib/jinterface/test/jinterface_SUITE_data/Makefile.src @@ -0,0 +1,62 @@ +# +# %CopyrightBegin% +# +# Copyright Ericsson AB 2004-2010. All Rights Reserved. +# +# The contents of this file are subject to the Erlang Public License, +# Version 1.1, (the "License"); you may not use this file except in +# compliance with the License. You should have received a copy of the +# Erlang Public License along with this software. If not, it can be +# retrieved online at http://www.erlang.org/. +# +# Software distributed under the License is distributed on an "AS IS" +# basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See +# the License for the specific language governing rights and limitations +# under the License. +# +# %CopyrightEnd% +# + +# Note: This file *must* work for both Unix and Windows +# +# We use both `rm' (Unix) and `del' (Windows) for removing files, but +# with a `-' in front so that the error in not finding `rm' (`del') on +# Windows (Unix) is ignored. +# +# VxWorks? XXX +# + +.SUFFIXES: +.SUFFIXES: .java + + +JAVAC = @JAVAC@ +ERLC = erlc + +JINTERFACE_CLASSPATH = @jinterface_classpath@ + +CLASSPATH = .@PS@$(JINTERFACE_CLASSPATH)@PS@ + +JAVA_FILES = \ + Nodename.java \ + RegisterAndWhereis.java \ + GetNames.java \ + BooleanAtom.java \ + NodePing.java \ + MboxPing.java \ + MboxSendReceive.java \ + MboxLinkUnlink.java \ + NodeStatusHandler.java + +CLASS_FILES = $(JAVA_FILES:.java=.class) + +all: $(CLASS_FILES) + +clean: + -rm -f $(CLASS_FILES) + -del /F /Q $(CLASS_FILES) + +$(CLASS_FILES) : $(JAVA_FILES) + $(JAVAC) -classpath $(CLASSPATH) $(JAVA_FILES) + +# diff --git a/lib/jinterface/test/jinterface_SUITE_data/MboxLinkUnlink.java b/lib/jinterface/test/jinterface_SUITE_data/MboxLinkUnlink.java new file mode 100644 index 0000000000..5d1d097cc8 --- /dev/null +++ b/lib/jinterface/test/jinterface_SUITE_data/MboxLinkUnlink.java @@ -0,0 +1,201 @@ +/* + * %CopyrightBegin% + * + * Copyright Ericsson AB 2004-2010. All Rights Reserved. + * + * The contents of this file are subject to the Erlang Public License, + * Version 1.1, (the "License"); you may not use this file except in + * compliance with the License. You should have received a copy of the + * Erlang Public License along with this software. If not, it can be + * retrieved online at http://www.erlang.org/. + * + * Software distributed under the License is distributed on an "AS IS" + * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See + * the License for the specific language governing rights and limitations + * under the License. + * + * %CopyrightEnd% + */ + +import com.ericsson.otp.erlang.*; + +class MboxLinkUnlink { + + /* + Implements test case jinterface_SUITE:mbox_link_unlink/1 + + + + */ + + private static final int java_link_and_exit = 1; + private static final int erl_link_and_exit = 2; + private static final int erl_link_java_exit = 3; + private static final int java_link_erl_exit = 4; + private static final int internal_link_linking_exits = 5; + private static final int internal_link_linked_exits = 6; + private static final int internal_unlink_linking_exits = 7; + private static final int internal_unlink_linked_exits = 8; + private static final int normal_exit = 9; + private static final int kill_mbox = 10; + private static final int kill_erl_proc_from_java = 11; + private static final int kill_mbox_from_erlang = 12; + private static final int erl_exit_with_reason_any_term = 13; + private static final int java_exit_with_reason_any_term = 14; + + private static boolean dbg = true; + + + public static void main(String argv[]) { + + + //String cookie = argv[0]; + String erlNode = argv[1]; + OtpErlangObject expected = null; + boolean waiting = false; + + try { // + OtpNode node = new OtpNode("javanode"); + OtpMbox mainMbox = node.createMbox(); + + try { + // Initiate and set up connection to erlang process + OtpMbox mbox = node.createMbox(); + OtpMbox mbox2; + + OtpErlangObject[] msg = {mainMbox.self(),mbox.self()}; + mbox.send("erl_link_server", erlNode, new OtpErlangTuple(msg)); + OtpErlangObject o = mbox.receive(1000); + if (o == null) System.exit(1); + OtpErlangTuple tuple = (OtpErlangTuple)o; + int tag = (int)((OtpErlangLong)tuple.elementAt(0)).longValue(); + + switch (tag) { + + case java_exit_with_reason_any_term: + case java_link_and_exit: + dbg("Java got \"java_link_and_exit\" or " + + "\"java_exit_with_reason_any_term\""); + mbox.link((OtpErlangPid)tuple.elementAt(1)); + mbox.send((OtpErlangPid)tuple.elementAt(1), + new OtpErlangAtom("ok")); + mbox.exit(tuple.elementAt(2)); + break; + case erl_exit_with_reason_any_term: + case erl_link_and_exit: + dbg("Java got \"erl_link_and_exit\" or " + + "\"erl_exit_with_reason_any_term\""); + mbox.send((OtpErlangPid)tuple.elementAt(1), + new OtpErlangAtom("ok")); + waiting = true; + expected = tuple.elementAt(2); + mbox.receive(1000); + System.exit(2); + case erl_link_java_exit: + dbg("Java got \"erl_link_java_exit\""); + mbox.exit(tuple.elementAt(2)); + break; + case java_link_erl_exit: + dbg("Java got \"java_link_erl_exit\""); + mbox.link((OtpErlangPid)tuple.elementAt(1)); + mbox.send((OtpErlangPid)tuple.elementAt(1), + new OtpErlangAtom("ok")); + waiting = true; + expected = tuple.elementAt(2); + mbox.receive(1000); + System.exit(3); + case internal_link_linking_exits: + dbg("Java got \"internal_link_linking_exits\""); + mbox2 = node.createMbox(); + mbox.link(mbox2.self()); + mbox.exit(tuple.elementAt(2)); + waiting = true; + expected = tuple.elementAt(2); + mbox2.receive(1000); // hanging waiting for exit + System.exit(4); // got someting other than exit + case internal_link_linked_exits: + dbg("Java got \"internal_link_linked_exits\""); + mbox2 = node.createMbox(); + mbox.link(mbox2.self()); + mbox2.exit(tuple.elementAt(2)); + waiting = true; + expected = tuple.elementAt(2); + mbox.receive(1000); // hanging waiting for exit + System.exit(5); // got someting other than exit + case internal_unlink_linking_exits: + dbg("Java got \"internal_unlink_linking_exits\""); + mbox2 = node.createMbox(); + mbox.link(mbox2.self()); + mbox.unlink(mbox2.self()); + mbox.link(mbox2.self()); + mbox2.unlink(mbox.self()); + mbox2.exit(tuple.elementAt(2)); + if (mbox.receive(500)!=null) System.exit(6); + break; + case internal_unlink_linked_exits: + dbg("Java got \"internal_unlink_linked_exits\""); + mbox2 = node.createMbox(); + mbox.link(mbox2.self()); + mbox.unlink(mbox2.self()); + mbox.link(mbox2.self()); + mbox2.unlink(mbox.self()); + mbox.exit(tuple.elementAt(2)); + if (mbox2.receive(500)!=null) System.exit(7); + break; + case normal_exit: + dbg("Java got \"normal_exit\""); + mbox.close(); + break; + case kill_mbox: + dbg("Java got \"kill_mbox\""); + mbox.exit("kill"); + break; + case kill_erl_proc_from_java: + dbg("Java got \"kill_erl_proc_from_java\""); + mbox.exit((OtpErlangPid)tuple.elementAt(1),"kill"); + break; + case kill_mbox_from_erlang: + dbg("Java got \"kill_mbox_from_erlang\""); + /* This will make the testcase successful, but it is + not the correct way to do it... + Mbox should probably just die when the kill signal is + received from erlang (or other mbox). + + try { + mbox.receive(1000); + System.exit(8); + } + catch (OtpErlangExit exit) { + if(!(exit.reason().equals(new OtpErlangAtom("kill")))) + System.exit(9); + mbox.exit("killed"); + } + */ + break; + } + } + catch (OtpErlangExit exit) { + dbg("Java got exit: " + exit.reason()); + if(!(waiting && exit.reason().equals(expected))) + System.exit(10); + } + + OtpErlangAtom done = new OtpErlangAtom("done"); + mainMbox.send("erl_link_server", erlNode, done); + OtpErlangObject o = mainMbox.receive(1000); + if (o == null) System.exit(11); + else if (!((OtpErlangAtom)o).equals(done)) + System.exit(12); + + } + catch (Exception e) { + System.out.println("EXCEPTION: " + e); + System.exit(13); + } + } + + private static void dbg(String str) { + if (dbg) System.out.println(str); + } + +} diff --git a/lib/jinterface/test/jinterface_SUITE_data/MboxPing.java b/lib/jinterface/test/jinterface_SUITE_data/MboxPing.java new file mode 100644 index 0000000000..3a8497028e --- /dev/null +++ b/lib/jinterface/test/jinterface_SUITE_data/MboxPing.java @@ -0,0 +1,50 @@ +/* + * %CopyrightBegin% + * + * Copyright Ericsson AB 2004-2010. All Rights Reserved. + * + * The contents of this file are subject to the Erlang Public License, + * Version 1.1, (the "License"); you may not use this file except in + * compliance with the License. You should have received a copy of the + * Erlang Public License along with this software. If not, it can be + * retrieved online at http://www.erlang.org/. + * + * Software distributed under the License is distributed on an "AS IS" + * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See + * the License for the specific language governing rights and limitations + * under the License. + * + * %CopyrightEnd% + */ + +import com.ericsson.otp.erlang.*; + +class MboxPing { + + /* + Implements test case jinterface_SUITE:mbox_ping/1 + + Creates an OtpNode object with an OtpMbox object. The test_server + node is pinged from the OtpMbox. + */ + + public static void main(String argv[]) { + + try { + OtpNode node = new OtpNode("javanode",argv[0]); + OtpMbox mbox = node.createMbox(); + if (mbox.ping(argv[1],2000)) { + System.out.println("OtpMbox.ping(" + argv[1] + ") -> true"); + } + else { + System.out.println("ERROR: OtpMbox.ping(" + argv[1] + + ") -> false"); + System.exit(1); + } + } + catch (Exception e) { + System.out.println("" + e); + System.exit(2); + } + } +} diff --git a/lib/jinterface/test/jinterface_SUITE_data/MboxSendReceive.java b/lib/jinterface/test/jinterface_SUITE_data/MboxSendReceive.java new file mode 100644 index 0000000000..2db71bb5cd --- /dev/null +++ b/lib/jinterface/test/jinterface_SUITE_data/MboxSendReceive.java @@ -0,0 +1,229 @@ +/* + * %CopyrightBegin% + * + * Copyright Ericsson AB 2004-2010. All Rights Reserved. + * + * The contents of this file are subject to the Erlang Public License, + * Version 1.1, (the "License"); you may not use this file except in + * compliance with the License. You should have received a copy of the + * Erlang Public License along with this software. If not, it can be + * retrieved online at http://www.erlang.org/. + * + * Software distributed under the License is distributed on an "AS IS" + * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See + * the License for the specific language governing rights and limitations + * under the License. + * + * %CopyrightEnd% + */ + +import com.ericsson.otp.erlang.*; + +class MboxSendReceive { + + /* + Implements test case jinterface_SUITE:mbox_send_receive/1 + + Test OtpMbox.send(...) and OtpMbox.receive(...) + */ + + private static final boolean dbg = true; + private static final int recTime = 2000; + + private static final int java_erlang_send_receive = 1; + private static final int java_internal_send_receive_same_node = 2; + private static final int java_internal_send_receive_different_nodes = 3; + private static final int java_internal_send_receive_self = 4; + + public static void main(String argv[]) { + + String cookie = argv[0]; + String erlNode = argv[1]; + + OtpErlangObject[] msgArray = new OtpErlangObject[2]; + msgArray[1] = new OtpErlangAtom("hello world"); + OtpErlangTuple msg = null; + + try { + // Initiate: create javanode and mboxes + OtpNode node = new OtpNode("javanode",cookie); + OtpMbox mbox = node.createMbox(); + OtpMbox mbox2 = node.createMbox("java_echo_server2"); + + // Send the pid of mbox to erlang and wait for test case + // instruction: {TestCaseTag, Pid} + mbox.send("erl_send_receive_server", erlNode, mbox.self()); + OtpErlangObject o = mbox.receive(recTime); + if (o == null) System.exit(1); + OtpErlangTuple testCase = (OtpErlangTuple)o; + dbg("mbox received " + testCase); + int tag = (int)((OtpErlangLong)testCase.elementAt(0)).longValue(); + OtpErlangPid erlangPid = (OtpErlangPid)testCase.elementAt(1); + + switch (tag) { + + case java_erlang_send_receive: + + // Test1 (happened during initiation): + // Send mbox pid to erlang process with registered name. + // Erlang process sent back its pid to the mbox pid. + + // Test2: Register name and sent it to the erlang pid. Erlang + // process shall send message back to my registered name. + + mbox.registerName("java_echo_server"); + msgArray[0] = getNameNode("java_echo_server",node); + msg = new OtpErlangTuple(msgArray); + + dbg("java_echo_server sending " + msg); + mbox.send(erlangPid,msg); + + o = mbox.receive(recTime); + dbg("java_echo_server received " + o); + if (o == null) System.exit(2); + if (!((OtpErlangAtom)o).equals(msgArray[1])) System.exit(3); + + // Test3: Same as Test2, but using a new mbox2 which + // got its name already when it is created - i.e. not + // using mbox.registerName + msgArray[0] = getNameNode("java_echo_server2",node); + msg = new OtpErlangTuple(msgArray); + + dbg("java_echo_server2 sending " + msg); + mbox2.send(erlangPid,msg); + + o = mbox2.receive(recTime); + dbg("java_echo_server received " + o); + if (o == null) System.exit(4); + if (!((OtpErlangAtom)o).equals(msgArray[1])) System.exit(5); + + break; + + case java_internal_send_receive_same_node: + + // Test1: Sending message between mboxes on same node + // given registered name and node without host. + mbox.send("java_echo_server2","javanode",msgArray[1]); + o = mbox2.receive(recTime); + dbg("Mbox at same node: " + o); + if (o == null) System.exit(6); + if(!((OtpErlangAtom)o).equals(msgArray[1])) System.exit(7); + + // Test2: Sending message between mboxes on same node + // given registered name and node with host. + mbox.send("java_echo_server2",mbox2.self().node(),msgArray[1]); + o = mbox2.receive(recTime); + dbg("Mbox at same node: " + o); + if (o == null) System.exit(8); + if(!((OtpErlangAtom)o).equals(msgArray[1])) System.exit(9); + + // Test3: Sending message between mboxes on same node + // given registered name but not node. + mbox.send("java_echo_server2",msgArray[1]); + o = mbox2.receive(recTime); + dbg("Mbox at same node: " + o); + if (o == null) System.exit(10); + if(!((OtpErlangAtom)o).equals(msgArray[1])) System.exit(11); + + // Test4: Sending message between mboxes on same node + // given pid. + mbox.send(mbox2.self(),msgArray[1]); + o = mbox2.receive(recTime); + dbg("Mbox at same node: " + o); + if (o == null) System.exit(12); + if(!((OtpErlangAtom)o).equals(msgArray[1])) System.exit(13); + + break; + + case java_internal_send_receive_different_nodes: + + OtpNode node2 = new OtpNode("javanode2", cookie); + OtpMbox mboxOtherNode = node2.createMbox("mboxOtherNode"); + + // Test1: Sending message between mboxes on different + // nodes given registered name and node without host. + mbox.send("mboxOtherNode","javanode2",msgArray[1]); + o = mboxOtherNode.receive(recTime); + dbg("Mbox at same node: " + o); + if (o == null) System.exit(14); + if(!((OtpErlangAtom)o).equals(msgArray[1])) System.exit(15); + + // Test2: Sending message between mboxes on different + // nodes given registered name and node with host. + mbox.send("mboxOtherNode",mboxOtherNode.self().node(), + msgArray[1]); + o = mboxOtherNode.receive(recTime); + dbg("Mbox at same node: " + o); + if (o == null) System.exit(16); + if(!((OtpErlangAtom)o).equals(msgArray[1])) System.exit(17); + + // Test3: Sending message between mboxes on different + // nodes given pid. + mbox.send(mboxOtherNode.self(),msgArray[1]); + o = mboxOtherNode.receive(recTime); + dbg("Mbox at same node: " + o); + if (o == null) System.exit(18); + if(!((OtpErlangAtom)o).equals(msgArray[1])) System.exit(19); + + break; + + + case java_internal_send_receive_self: + + // Test1: Sending message to myself given registered + // name and node without host. + mbox2.send("java_echo_server2","javanode",msgArray[1]); + o = mbox2.receive(recTime); + dbg("Self: " + o); + if (o == null) System.exit(18); + if(!((OtpErlangAtom)o).equals(msgArray[1])) System.exit(19); + + // Test2: Sending message to myself given registered + // name and node with host. + mbox2.send("java_echo_server2",mbox2.self().node(),msgArray[1]); + o = mbox2.receive(recTime); + dbg("Self: " + o); + if (o == null) System.exit(20); + if(!((OtpErlangAtom)o).equals(msgArray[1])) System.exit(21); + + // Test3: Sending message to myself given registered + // name but not host. + mbox2.send("java_echo_server2",msgArray[1]); + o = mbox2.receive(recTime); + dbg("Self: " + o); + if (o == null) System.exit(22); + if(!((OtpErlangAtom)o).equals(msgArray[1])) System.exit(23); + + // Test4: Sending message to myself given pid. + mbox2.send(mbox2.self(),msgArray[1]); + o = mbox2.receive(recTime); + dbg("Self: " + o); + if (o == null) System.exit(24); + if(!((OtpErlangAtom)o).equals(msgArray[1])) System.exit(25); + + break; + + } + + // Closing erl_send_receive_server by sending the atom 'done' to it. + mbox.send(erlangPid,new OtpErlangAtom("done")); + } + catch (Exception e) { + System.out.println("" + e); + System.exit(26); + } + } + + private static OtpErlangTuple getNameNode(String mboxName,OtpNode node) { + OtpErlangObject[] array = {new OtpErlangAtom(mboxName), + new OtpErlangAtom(node.node())}; + return new OtpErlangTuple(array); + + } + + private static void dbg(String str) { + if (dbg) System.out.println(str); + } + + +} diff --git a/lib/jinterface/test/jinterface_SUITE_data/NodePing.java b/lib/jinterface/test/jinterface_SUITE_data/NodePing.java new file mode 100644 index 0000000000..d0df5c46b5 --- /dev/null +++ b/lib/jinterface/test/jinterface_SUITE_data/NodePing.java @@ -0,0 +1,83 @@ +/* + * %CopyrightBegin% + * + * Copyright Ericsson AB 2004-2010. All Rights Reserved. + * + * The contents of this file are subject to the Erlang Public License, + * Version 1.1, (the "License"); you may not use this file except in + * compliance with the License. You should have received a copy of the + * Erlang Public License along with this software. If not, it can be + * retrieved online at http://www.erlang.org/. + * + * Software distributed under the License is distributed on an "AS IS" + * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See + * the License for the specific language governing rights and limitations + * under the License. + * + * %CopyrightEnd% + */ + +import com.ericsson.otp.erlang.*; + +class NodePing { + + /* + Implements test case jinterface_SUITE:node_ping/1 + + Creates three OtpNode objects. One with default cookie, one with + specified same cookie as the node running the test case and one + with a faulty cookie. From each OtpNode object the test_server + node is pinged. + + Also the default cookie node pings itself, and the node with the + specified cookie pings the node with default cookie. + */ + + public static void main(String argv[]) { + + String cookie = argv[0]; + String erlNode = argv[1]; + + try { + OtpNode node1 = new OtpNode("javanode1"); + ping(node1,erlNode,"Default cookie:",true,1); + ping(node1,node1.node(),"Self:",true,2); + ping(node1,"javanode1","Self:",true,3); + + OtpNode node2 = new OtpNode("javanode2",cookie); + ping(node2,erlNode,"Specified cookie:",true,4); + ping(node2,"javanode1","Javanode (no host):",true,5); + ping(node2,node1.node(),"Javanode:",true,6); + + OtpNode node3 = new OtpNode("javanode3","faultycookie"); + ping(node3,erlNode,"Faulty cookie:",false,7); + + // Test OtpNode.cookie() and OtpNode.setCookie(cookie) as well + if (!node3.cookie().equals("faultycookie")) + fail("Testing OtpNode.cookie()",8); + String old = node3.setCookie(cookie); + if (!old.equals("faultycookie")) + fail("Checking return of OtpNode.setCookie(cookie)",9); + ping(node3,erlNode,"setCookie:",true,10); + } + catch (Exception e) { + fail("" + e, 11); + } + } + + private static void ping(OtpNode node, String remote, String descr, + boolean expected, int reason) { + if ( node.ping(remote,2000) == expected ) { + System.out.println(descr + " ping(" + remote + ") -> " + expected); + } + else { + fail("ERROR: " + descr + " ping(" + remote +") -> " + !expected, + reason); + } + } + + private static void fail(String str, int reason) { + System.out.println(str); + System.exit(reason); + } +} diff --git a/lib/jinterface/test/jinterface_SUITE_data/NodeStatusHandler.java b/lib/jinterface/test/jinterface_SUITE_data/NodeStatusHandler.java new file mode 100644 index 0000000000..51ea15b5ef --- /dev/null +++ b/lib/jinterface/test/jinterface_SUITE_data/NodeStatusHandler.java @@ -0,0 +1,168 @@ +/* + * %CopyrightBegin% + * + * Copyright Ericsson AB 2004-2010. All Rights Reserved. + * + * The contents of this file are subject to the Erlang Public License, + * Version 1.1, (the "License"); you may not use this file except in + * compliance with the License. You should have received a copy of the + * Erlang Public License along with this software. If not, it can be + * retrieved online at http://www.erlang.org/. + * + * Software distributed under the License is distributed on an "AS IS" + * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See + * the License for the specific language governing rights and limitations + * under the License. + * + * %CopyrightEnd% + */ + +import com.ericsson.otp.erlang.*; + +public class NodeStatusHandler extends OtpNodeStatus { + /* + Implements java side of test cases in jinterface_SUITE.erl + + Test OtpNode.registerStatusHandler(...) and class OtpNodeStatus. + */ + + private static final boolean dbg = true; + private static final int recTime = 2000; + + private static String erlNode = null; + private static String cookie = null; + private static OtpMbox mbox = null; + + private static final int status_handler_localStatus = 1; + private static final int status_handler_remoteStatus = 2; + private static final int status_handler_connAttempt = 3; + + public static void main(String argv[]) { + + cookie = argv[0]; + erlNode = argv[1]; + + try { + OtpNode javaNode = new OtpNode("javanode", cookie); + mbox = javaNode.createMbox(); + } + catch (Exception e) { + dbg("EXCEPTION when creating javanode: " + e); + System.exit(1); + } + + try { + OtpNode node1 = new OtpNode("javanode1", cookie); + node1.registerStatusHandler(new NodeStatusHandler()); + + switch (Integer.parseInt(argv[2])) { + + case status_handler_localStatus: + dbg("java running test case \"status_handler_localStatus\""); + + Thread.sleep(200); // Give 'nodeup' message a chance + // before closing + node1.close(); + Thread.sleep(500); + break; + + case status_handler_remoteStatus: + dbg("java running test case \"status_handler_remoteStatus\""); + + OtpNode node2 = new OtpNode("javanode2", cookie); + node2.ping(node1.node(),2000); + node2.close(); + Thread.sleep(500); + break; + + case status_handler_connAttempt: + dbg("java running test case \"status_handler_connAttempt\""); + + OtpNode node3 = new OtpNode("javanode3","othercookie"); + node3.ping(node1.node(),2000); + node1.ping(node3.node(),2000); + break; + + } + + OtpErlangObject o = mbox.receive(recTime); + if (o == null) System.exit(2); + if (! ((OtpErlangAtom)o).atomValue().equals("done")) + System.exit(3); + + } + catch (Exception e) { + dbg("EXCEPTION: " + e); + System.exit(4); + } + + } + + + + public void remoteStatus(String node, boolean up, Object info) { + try { + dbg("Got remoteStatus: " + node + " " + up + " " + info); + OtpErlangObject[] msgArray = new OtpErlangObject[4]; + msgArray[0] = new OtpErlangAtom("remoteStatus"); + msgArray[1] = new OtpErlangString(node); + msgArray[2] = new OtpErlangBoolean(up); + msgArray[3] = mbox.self(); + OtpErlangTuple msg = new OtpErlangTuple(msgArray); + mbox.send("erl_status_server", erlNode, msg); + + } + catch (Exception e) { + dbg("EXCEPTION in remoteStatus: " + e + "\nArgs: " + + node + " " + up + " " + info); + System.exit(5); + } + } + + + public void localStatus(String node, boolean up, Object info) { + try { + dbg("Got localStatus: " + node + " " + up + " " + info); + OtpErlangObject[] msgArray = new OtpErlangObject[4]; + msgArray[0] = new OtpErlangAtom("localStatus"); + msgArray[1] = new OtpErlangString(node); + msgArray[2] = new OtpErlangBoolean(up); + msgArray[3] = mbox.self(); + OtpErlangTuple msg = new OtpErlangTuple(msgArray); + mbox.send("erl_status_server", erlNode, msg); + + } + catch (Exception e) { + dbg("EXCEPTION in localStatus: " + e + "\nArgs: " + + node + " " + up + " " + info); + System.exit(6); + } + } + + + + public void connAttempt(String node, boolean incoming, Object info) { + try { + dbg("Got connAttempt: " + node + " " + incoming + " " + info); + OtpErlangObject[] msgArray = new OtpErlangObject[4]; + msgArray[0] = new OtpErlangAtom("connAttempt"); + msgArray[1] = new OtpErlangString(node); + msgArray[2] = new OtpErlangBoolean(incoming); + msgArray[3] = mbox.self(); + OtpErlangTuple msg = new OtpErlangTuple(msgArray); + mbox.send("erl_status_server", erlNode, msg); + + } + catch (Exception e) { + dbg("EXCEPTION in connAttempt: " + e + "\nArgs: " + + node + " " + incoming + " " + info); + System.exit(7); + } + } + + + private static void dbg(String str) { + if (dbg) System.out.println(str); + } + +} diff --git a/lib/jinterface/test/jinterface_SUITE_data/Nodename.java b/lib/jinterface/test/jinterface_SUITE_data/Nodename.java new file mode 100644 index 0000000000..dc8cb9c49f --- /dev/null +++ b/lib/jinterface/test/jinterface_SUITE_data/Nodename.java @@ -0,0 +1,54 @@ +/* + * %CopyrightBegin% + * + * Copyright Ericsson AB 2004-2010. All Rights Reserved. + * + * The contents of this file are subject to the Erlang Public License, + * Version 1.1, (the "License"); you may not use this file except in + * compliance with the License. You should have received a copy of the + * Erlang Public License along with this software. If not, it can be + * retrieved online at http://www.erlang.org/. + * + * Software distributed under the License is distributed on an "AS IS" + * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See + * the License for the specific language governing rights and limitations + * under the License. + * + * %CopyrightEnd% + */ + +import com.ericsson.otp.erlang.*; + +class Nodename { + + /* + Implements test case jinterface_SUITE:nodename/1 + + */ + + public static void main(String argv[]) { + + String host = argv[0]; + + try { + OtpNode node = new OtpNode("javanode"); + System.out.println("Given host: " + host + + " Host: " + node.host() + + " Alive: " + node.alive() + + " Node: " + node.node()); + + if (!node.host().equals(host)) fail(1); + if (!node.alive().equals("javanode")) fail(2); + if (!node.node().equals("javanode@" + host)) fail(3); + } + catch (Exception e) { + System.out.println("" + e); + fail(4); + } + } + + private static void fail(int reason) { + System.exit(reason); + } + +} diff --git a/lib/jinterface/test/jinterface_SUITE_data/RegisterAndWhereis.java b/lib/jinterface/test/jinterface_SUITE_data/RegisterAndWhereis.java new file mode 100644 index 0000000000..9df01981b2 --- /dev/null +++ b/lib/jinterface/test/jinterface_SUITE_data/RegisterAndWhereis.java @@ -0,0 +1,79 @@ +/* + * %CopyrightBegin% + * + * Copyright Ericsson AB 2004-2010. All Rights Reserved. + * + * The contents of this file are subject to the Erlang Public License, + * Version 1.1, (the "License"); you may not use this file except in + * compliance with the License. You should have received a copy of the + * Erlang Public License along with this software. If not, it can be + * retrieved online at http://www.erlang.org/. + * + * Software distributed under the License is distributed on an "AS IS" + * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See + * the License for the specific language governing rights and limitations + * under the License. + * + * %CopyrightEnd% + */ + +import com.ericsson.otp.erlang.*; + +class RegisterAndWhereis { + + /* + Implements test case jinterface_SUITE:register_and_whereis/1 + + */ + + public static void main(String argv[]) { + + try { + OtpNode node = new OtpNode("javanode"); + OtpMbox mbox1 = node.createMbox(); + mbox1.registerName("mbox1"); + OtpMbox mbox2 = node.createMbox("mbox2"); + OtpMbox mbox3 = node.createMbox(); + node.registerName("mbox3",mbox3); + + OtpErlangPid pid1 = mbox1.self(); + OtpErlangPid pid2 = mbox2.self(); + OtpErlangPid pid3 = mbox3.self(); + + if (!pid1.equals(node.whereis("mbox1"))) fail(1); + if (!pid1.equals(mbox1.whereis("mbox1"))) fail(2); + if (!pid1.equals(mbox2.whereis("mbox1"))) fail(3); + if (!pid1.equals(mbox3.whereis("mbox1"))) fail(4); + if (!pid2.equals(node.whereis("mbox2"))) fail(5); + if (!pid2.equals(mbox2.whereis("mbox2"))) fail(6); + if (!pid3.equals(node.whereis("mbox3"))) fail(7); + if (!pid3.equals(mbox3.whereis("mbox3"))) fail(8); + + node.closeMbox(mbox1); + mbox2.close(); + + if (node.whereis("mbox1") != null) fail(9); + if (node.whereis("mbox2") != null) fail(10); + if (mbox3.whereis("mbox1") != null) fail(11); + if (mbox3.whereis("mbox2") != null) fail(12); + + mbox3.close(); + if (mbox2.whereis("mbox3") != null) fail(13); + + + + } + catch (Exception e) { + fail("" + e, 14); + } + } + + private static void fail(int reason) { + System.exit(reason); + } + + private static void fail(String str, int reason) { + System.out.println(str); + System.exit(reason); + } +} diff --git a/lib/jinterface/test/jitu.erl b/lib/jinterface/test/jitu.erl new file mode 100644 index 0000000000..c57fb9bfad --- /dev/null +++ b/lib/jinterface/test/jitu.erl @@ -0,0 +1,156 @@ +%% +%% %CopyrightBegin% +%% +%% Copyright Ericsson AB 2004-2010. All Rights Reserved. +%% +%% The contents of this file are subject to the Erlang Public License, +%% Version 1.1, (the "License"); you may not use this file except in +%% compliance with the License. You should have received a copy of the +%% Erlang Public License along with this software. If not, it can be +%% retrieved online at http://www.erlang.org/. +%% +%% Software distributed under the License is distributed on an "AS IS" +%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See +%% the License for the specific language governing rights and limitations +%% under the License. +%% +%% %CopyrightEnd% +%% + +%%---------------------------------------------------------------------- +%% JInterface Test Utils +%%---------------------------------------------------------------------- +-module(jitu). + + +-export([java/3, + java/4, + java/5, + init_all/1, + finish_all/1]). + +%% +%% Lots of stuff here are originating from java_client_erl_server_SUITE.erl +%% (ic) ... +%% + + + +java(Java, Dir, ClassAndArgs) -> + cmd(Java++" -classpath "++classpath(Dir)++" "++ClassAndArgs). + +java(Java, Dir, Class, Args) -> + java(Java, Dir, Class++" "++to_string(Args)). + +java(Java, Dir, Class, Args, Props) -> + java(Java, Dir, Props++" "++Class, Args). + + + + +init_all(Config) when list(Config) -> + case find_executable(["java"]) of + false -> {skip,"Found no Java VM"}; + Path -> [{java,Path}|Config] + end. + +finish_all(Config) -> Config. + +%% +%% Internal stuff... +%% + + +find_executable([]) -> + false; +find_executable([E|T]) -> + case os:find_executable(E) of + false -> find_executable(T); + Path -> Path + end. + +to_string([H|T]) when integer(H) -> + integer_to_list(H)++" "++to_string(T); +to_string([H|T]) when atom(H) -> + atom_to_list(H)++" "++to_string(T); +to_string([H|T]) when pid(H) -> + pid_to_list(H)++" "++to_string(T); +to_string([H|T]) when list(H) -> + lists:flatten(H)++" "++to_string(T); +to_string([]) -> []. + +% javac(Dir, File) -> +% cmd("javac -d "++Dir++" -classpath "++classpath(Dir)++" "++ +% filename:join(Dir, File)). + +classpath(Dir) -> + PS = + case os:type() of + {win32, _} -> ";"; + _ -> ":" + end, + Dir++PS++ + filename:join([code:lib_dir(jinterface),"priv","OtpErlang.jar"])++PS++ + case os:getenv("CLASSPATH") of + false -> ""; + Classpath -> Classpath + end. + + +cmd(Cmd) -> + PortOpts = [{line,80},eof,exit_status,stderr_to_stdout], + io:format("cmd: ~s~n", [Cmd]), + case catch open_port({spawn,Cmd}, PortOpts) of + Port when port(Port) -> + Result = cmd_loop(Port, []), + io:format("cmd res: ~w~n", [Result]), + case Result of + 0 -> ok; + ExitCode when integer(ExitCode) -> {error,ExitCode}; + Error -> Error + end; + {'EXIT',Reason} -> + {error,Reason} + end. + +cmd_loop(Port, Line) -> + receive + {Port,eof} -> + receive + {Port,{exit_status,ExitStatus}} -> + ExitStatus + after 1 -> + undefined + end; + {Port,{exit_status,ExitStatus}} -> + receive + {Port,eof} -> + ok after 1 -> ok end, + ExitStatus; + {Port,{data,{Tag,Data}}} -> + case Tag of + eol -> + io:put_chars([Line|cr_to_nl(Data)]), + io:nl(), + cmd_loop(Port, []); + noeol -> + cmd_loop(Port, [Line|cr_to_nl(Data)]) + end; + {'EXIT',Port,Reason} -> + {error,Reason}; + Other -> + io:format("WARNING: Unexpected at ~s:~p: ~p~n", + [?MODULE_STRING,?LINE,Other]), + cmd_loop(Port, Line) + end. + +%% Convert lonely CR to NL, and CRLF to NL +%% +cr_to_nl([$\r,$\n|T]) -> + [$\n|cr_to_nl(T)]; +cr_to_nl([$\r|T]) -> + [$\n|cr_to_nl(T)]; +cr_to_nl([C|T]) -> + [C|cr_to_nl(T)]; +cr_to_nl([]) -> + []. diff --git a/lib/jinterface/test/nc_SUITE.erl b/lib/jinterface/test/nc_SUITE.erl new file mode 100644 index 0000000000..82dd3c2535 --- /dev/null +++ b/lib/jinterface/test/nc_SUITE.erl @@ -0,0 +1,736 @@ +%% +%% %CopyrightBegin% +%% +%% Copyright Ericsson AB 2004-2010. All Rights Reserved. +%% +%% The contents of this file are subject to the Erlang Public License, +%% Version 1.1, (the "License"); you may not use this file except in +%% compliance with the License. You should have received a copy of the +%% Erlang Public License along with this software. If not, it can be +%% retrieved online at http://www.erlang.org/. +%% +%% Software distributed under the License is distributed on an "AS IS" +%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See +%% the License for the specific language governing rights and limitations +%% under the License. +%% +%% %CopyrightEnd% +%% +-module(nc_SUITE). + + +-include("test_server.hrl"). +-include("test_server_line.hrl"). + + +-export([all/1, + init_per_suite/1, + end_per_suite/1, + init_per_testcase/2, + end_per_testcase/2]). + +-export([pid_roundtrip/1, + port_roundtrip/1, + ref_roundtrip/1, + new_float/1, + old_stuff/1, + binary_roundtrip/1, + decompress_roundtrip/1, + compress_roundtrip/1, + integer_roundtrip/1, + fun_roundtrip/1, + lists_roundtrip/1, + lists_roundtrip_2/1, + lists_iterator/1, + unicode/1, + unicode_list_to_string/1, + unicode_string_to_list/1, + connect/1]). + + +%% Top of cases + +all(doc) -> []; +all(suite) -> [pid_roundtrip, + port_roundtrip, + ref_roundtrip, + new_float, + old_stuff, + binary_roundtrip, + decompress_roundtrip, + compress_roundtrip, + integer_roundtrip, + fun_roundtrip, + lists_roundtrip, + lists_roundtrip_2, + lists_iterator, + unicode, + unicode_list_to_string, + unicode_string_to_list, + connect]. + + + + +init_per_suite(Config) when is_list(Config) -> + jitu:init_all(Config). + +end_per_suite(Config) -> + jitu:finish_all(Config). + + + +%% Add/remove watchdog before/after each test case. +%% +init_per_testcase(Case, Config) -> + T = case atom_to_list(Case) of + "unicode"++_ -> 240; + _ -> 20 + end, + WatchDog = test_server:timetrap(test_server:seconds(T)), + [{watchdog, WatchDog}| Config]. + +end_per_testcase(_Case, Config) -> + WatchDog = ?config(watchdog, Config), + test_server:timetrap_cancel(WatchDog). + + +%% +%% Test cases +%% + +pid_roundtrip(doc) -> []; +pid_roundtrip(suite) -> []; +pid_roundtrip(Config) when is_list(Config)-> + ThisNode = {node(), erlang:system_info(creation)}, + RemNode = {gurka@sallad, 2}, + do_echo([self(), + mk_pid(ThisNode, 4711, 4711), + mk_pid(ThisNode, 32767, 8191), + mk_pid(RemNode, 4711, 4711), + mk_pid(RemNode, 32767, 8191)], + Config). + +fun_roundtrip(doc) -> []; +fun_roundtrip(suite) -> []; +fun_roundtrip(Config) when is_list(Config)-> + do_echo([fun(A, B) -> A + B end, + fun(A) -> lists:reverse(A) end, + fun() -> ok end, + fun fun_roundtrip/1], + Config). + +port_roundtrip(doc) -> []; +port_roundtrip(suite) -> []; +port_roundtrip(Config) when is_list(Config)-> + ThisNode = {node(), erlang:system_info(creation)}, + RemNode = {gurka@sallad, 2}, + do_echo([hd(erlang:ports()), + mk_port(ThisNode, 4711), + mk_port(ThisNode, 268435455), + mk_port(RemNode, 4711), + mk_port(RemNode, 268435455)], + Config). + +ref_roundtrip(doc) -> []; +ref_roundtrip(suite) -> []; +ref_roundtrip(Config) when is_list(Config)-> + ThisNode = {node(), erlang:system_info(creation)}, + RemNode = {gurka@sallad, 2}, + do_echo([make_ref(), + mk_ref(ThisNode, [4711]), + mk_ref(ThisNode, [4711, 4711, 4711]), + mk_ref(ThisNode, [262143, 4294967295, 4294967295]), + mk_ref(RemNode, [4711]), + mk_ref(RemNode, [4711, 4711, 4711]), + mk_ref(RemNode, [262143, 4294967295, 4294967295])], + Config). + +new_float(doc) -> []; +new_float(suite) -> []; +new_float(Config) when is_list(Config)-> + Two16 = float(1 bsl 16), + X = math:sqrt(2), + Floats = lists:reverse(seq(1/X, 63, fun(Y) -> Y / Two16 end), + [0.0|seq(X, 63, fun(Y) -> Y * Two16 end)]), + io:format("~w", [Floats]), + do_echo(Floats, Config). + +old_stuff(doc) -> []; +old_stuff(suite) -> []; +old_stuff(Config) when is_list(Config)-> + Terms = [0.0,math:sqrt(2)], + OutTrans = + fun (D) -> + {self(),term_to_binary(D, [{minor_version,0}]),binary} + end, + InTrans = + fun (Echoer, D, {Echoer,D,binary}) -> + ok + end, + do_echo(Terms, Config, OutTrans, InTrans). + +binary_roundtrip(doc) -> []; +binary_roundtrip(suite) -> []; +binary_roundtrip(Config) when is_list(Config) -> + do_echo([<<17>>, + <<1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17>>, + <<3:2>>, + <<3,7:3>>, + <<>>], + Config). + +decompress_roundtrip(doc) -> []; +decompress_roundtrip(suite) -> []; +decompress_roundtrip(Config) when is_list(Config) -> + Terms = + [0.0, + math:sqrt(2), + <<1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,31:5>>, + make_ref()], + OutTrans = + fun (D) -> + {self(),term_to_binary(D, [compressed]),binary} + end, + InTrans = + fun (Echoer, D, {Echoer,D,binary}) -> + ok + end, + do_echo(Terms, Config, OutTrans, InTrans). + +compress_roundtrip(doc) -> []; +compress_roundtrip(suite) -> []; +compress_roundtrip(Config) when is_list(Config) -> + Terms = + [0.0, + math:sqrt(2), + <<1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,31:5>>, + make_ref()], + OutTrans = + fun (D) -> + {self(),D,compress} + end, + InTrans = + fun (Echoer, D, {Echoer,B,compress}) -> + D = binary_to_term(B) + end, + do_echo(Terms, Config, OutTrans, InTrans). + + + +integer_roundtrip(doc) -> []; +integer_roundtrip(suite) -> []; +integer_roundtrip(Config) when is_list(Config) -> + Xs = [1 bsl X || X <- [26,27,28,29,30,31,32,33, + 62,63,64,65, + 126,127,128,129]], + Terms = [0,1,-1,-2] + ++lists:flatmap(fun (X) -> [X-2,X-1,X,-X+1,-X,-X-1] end, + Xs), + io:format("~w", [Terms]), + OutTrans = + fun (V) -> + {self(),V,bigint} + end, + InTrans = + fun (Echoer, V, {Echoer,{V,W,X,L,U},bigint}) -> + Bitlength = bitlength(V), + {w,W} = {w,signum(V) * Bitlength}, + Y = V band 16#FFFFffffFFFFffff, + {y,Y} = {y,X band 16#FFFFffffFFFFffff}, + {l,L} = {l,if V =:= X, Bitlength < 64 -> 1; + true -> 0 end}, + {u,U} = {u,if V =:= Y, V >= 0, Bitlength =< 64 -> 1; + true -> 0 end} + end, + do_echo(Terms, Config, OutTrans, InTrans). + +signum(V) when is_integer(V), V > 0 -> 1; +signum(V) when is_integer(V), V < 0 -> -1; +signum(0) -> 0. + +bitlength(0) -> + 0; +bitlength(-1) -> + 0; +bitlength(V) when is_integer(V) -> + 1 + bitlength(V bsr 1). + + + +lists_roundtrip(doc) -> []; +lists_roundtrip(suite) -> []; +lists_roundtrip(Config) when is_list(Config) -> + Ls = [lists:seq(1,10), + lists:seq(11,17)++last_tail, + [{default}], + [car|cdr], + [[]], + []], + do_echo(Ls, Config). + + + +lists_roundtrip_2(doc) -> []; +lists_roundtrip_2(suite) -> []; +lists_roundtrip_2(Config) when is_list(Config) -> + Ls = [{[a,b],tail}, + {[c,d,e],tail}, + {[],tail}, + {[f],tail}, + {[g,h|i],tail}, + {[j,k,l|m],tail}, + {[n|o],tail}, + {[z,1,2,3,4],tail3}, + {[z,5,6,7],tail3}, + {[z,8,9],tail3}, + {[z,10],tail3}, + {[],tail3}, + {[z,11,12,13,14|15],tail3}, + {[z,16,17,18|19],tail3}, + {[z,20,21|22],tail3}, + {[z,23|24],tail3}, + {[z|25],tail3}, + {"abc123",sub3atom}, + {"abc",sub3atom} + ], + Trans = + fun ([_|T], tail) -> + T; + (L, tail) when is_list(L) -> + null; + ([_,_,_|T], tail3) -> + T; + (L, tail3) when is_list(L) -> + null; + ([_,_,_|L], sub3atom) -> + list_to_atom(L) + end, + OutTrans = + fun ({L,Twist}) -> + {self(),L,Twist} + end, + InTrans = + fun (Echoer, {L,Twist}, {Echoer,X,Twist}) -> + Y = Trans(L, Twist), + io:format("## ~w ~w ~w ~w~n", [L,Twist,X,Y]), + X = Y + end, + do_echo(Ls, Config, OutTrans, InTrans). + + + + +lists_iterator(doc) -> []; +lists_iterator(suite) -> []; +lists_iterator(Config) when is_list(Config) -> + Ls = [["able ","was ","I ","ere ","I ","saw ","elba"]], + do_echo(Ls, Config, + fun (L) -> {self(),L,strcat} end, + fun (Echoer, L, {Echoer,X,strcat}) -> + io:format("## ~p ~p~n", [L,X]), + X = lists:flatten(L) + end). + + + +unicode(doc) -> []; +unicode(suite) -> []; +unicode(Config) when is_list(Config) -> + S1 = "plain ascii", + S2 = "iso-latin ��� �", + S3 = "Codepoints... ��� \x{1000}", + S4 = [0,1,31,32,63,64,127,128,255], + S5 = [0,1,127,128,255,256,16#d7ff, + 16#e000,16#fffd,16#10000,16#10ffff], + Ss = [S1,S2,S3,S4,S5], + do_echo(unicode_cp_gen([{S,valid} || S <- Ss] ++ cp_gen(71)), Config, + fun ({L,invalid}) -> {self(),L,utf8}; + ({L,Tag}) -> {self(),L,Tag}; + ({L}) -> {self(),L} + end, + fun (Echoer, {L,invalid}=Out, {Echoer,X,utf8}=In) -> + case L of + X -> ok; + _ -> + ?t:fail({mismatch,Out,In}) + end; + (Echoer, {L,Tag}=Out, {Echoer,X,Tag}=In) -> + case unicode:characters_to_binary(L, utf8) of + X -> ok; + _ -> + ?t:fail({mismatch,Out,In}) + end; + (Echoer, {L}=Out, {Echoer,X}=In) -> + case L of + X -> ok; + _ -> + ?t:fail({mismatch,Out,In}) + end + end, ["unicode"]). + +%% Lazy wrapper to lazy list +unicode_cp_gen([{S,valid}|Ss]) -> + [{S,utf8},{S}|unicode_cp_gen(Ss)]; +unicode_cp_gen([{S,invalid}=St|Ss]) -> + [St,{S}|unicode_cp_gen(Ss)]; +unicode_cp_gen([]) -> + []; +unicode_cp_gen(Cont) when is_function(Cont, 0) -> + fun () -> + unicode_cp_gen(Cont()) + end. + + + +unicode_list_to_string(doc) -> []; +unicode_list_to_string(suite) -> []; +unicode_list_to_string(Config) when is_list(Config) -> + do_echo(cp_gen(73), Config, + fun ({L,_}) -> {self(),L,to_string_neg_int_list} end, + fun (Echoer, {L,invalid}=Out, {Echoer,X,_}=In) -> + case L of + X -> ok; + _ -> + ?t:fail({mismatch,Out,In}) + end; + (Echoer, {L,valid}=Out, {Echoer,X,_}=In) -> + B = unicode:characters_to_binary(L, unicode, {utf16,big}), + case [-D || <<D:16/big>> <= B] of + X -> ok; + _ -> + ?t:fail({mismatch,Out,In}) + end + end). + + + +unicode_string_to_list(doc) -> []; +unicode_string_to_list(suite) -> []; +unicode_string_to_list(Config) when is_list(Config) -> + do_echo(cp_gen(79), Config, + fun ({L,_}) -> {self(),L,to_neg_int_list} end, + fun (Echoer, {L,invalid}=Out, {Echoer,X,_}=In) -> + case L of + X -> ok; + _ -> + ?t:fail({mismatch,Out,In}) + end; + (Echoer, {L,valid}=Out, {Echoer,X,_}=In) -> + case [-C || C <- L] of + X -> ok; + _ -> + ?t:fail({mismatch,Out,In}) + end + end, ["unicode"]). + + +%% Lazy list +cp_gen(N) -> + cp_gen(N, -1, 16#110000). + +cp_gen(N, Start, End) -> + cp_gen(N, Start, End, cp_validity(Start), [], 0, [], 0). + +cp_gen(N, U, End, PrevValidity, Acc, Len, Ss, Ls) when Len >= N -> + cp_gen(N, U, End, PrevValidity, [], 0, [{Acc,PrevValidity}|Ss], Ls+1); +cp_gen(N, U, End, PrevValidity, Acc, Len, Ss, Ls) when Ls >= N -> + Ss ++ fun () -> + cp_gen(N, U, End, PrevValidity, Acc, Len, [], 0) + end; +cp_gen(_, U, End, _, Acc, _, Ss, _) when U > End -> + [{Acc,valid}|Ss]; +cp_gen(N, U, End, PrevValidity, Acc, Len, Ss, Ls) -> + Validity = cp_validity(U), + NextU = U+1, + {NextAcc,NextLen} = case Validity of + valid -> {[U|Acc],Len+1}; + invalid -> {Acc,Len} + end, + {NextSs,NextLs} = case Validity of + PrevValidity -> {Ss,Ls}; + valid -> {[{[U-1],PrevValidity}|Ss],Ls+1}; + invalid -> {[{[U],Validity}|Ss],Ls+1} + end, + cp_gen(N, NextU, End, Validity, NextAcc, NextLen, NextSs, NextLs). + +cp_validity(UnicodeCP) -> + try <<UnicodeCP/big-utf32>> of + _ -> valid + catch + error:_ -> invalid + end. + + + +connect(doc) -> []; +connect(suite) -> []; +connect(Config) when is_list(Config) -> + WD = filename:dirname(code:which(?MODULE)), + {ok,Other} = ?t:start_node(make_name(), slave, [{args,"-pa "++WD}]), + Action = + fun (Pid) -> + JName = node(Pid), + Hidden = [JName], + Pid ! {self(),Other}, + receive + {Pid,Other,true} -> + ok; + Unexpected1 -> + ?t:fail({result,Unexpected1}) + end, + Hidden = erlang:nodes(hidden), + Hidden = rpc:call(Other, erlang, nodes, [hidden]), + true = + rpc:call(Other, erlang, disconnect_node, [JName]), + [] = + rpc:call(Other, erlang, nodes, [hidden]), + Hidden = erlang:nodes(hidden), + %% Again + receive after 2000 -> ok end, + %% We have no way of knowing when the Java node + %% detects the nodedown. + Pid ! {self(),Other}, + receive + {Pid,Other,true} -> + ok; + Unexpected2-> + ?t:fail({result,Unexpected2}) + end, + Hidden = rpc:call(Other, erlang, nodes, [hidden]) + end, + run_server(connection_server, Config, Action, []). + + + +seq(_, 0, _) -> + []; +seq(X, N, Fun) -> + [X|seq(Fun(X), N-1, Fun)]. + +do_echo(DataList, Config) -> + do_echo(DataList, Config, + fun (D) -> % OutTrans + {self(),D} + end, + fun (Echoer, D, {Echoer,D}) -> % InTrans + ok + end, []). + +do_echo(DataList, Config, OutTrans, InTrans) -> + do_echo(DataList, Config, OutTrans, InTrans, []). + +do_echo(DataList, Config, OutTrans, InTrans, ExtraArgs) + when is_list(DataList), is_list(Config) -> + run_server(echo_server, Config, + fun (Echoer) -> + echo_loop(DataList, Echoer, OutTrans, InTrans, []) + end, + ExtraArgs). + +echo_loop([D|Ds], Echoer, OutTrans, InTrans, TermAcc) -> + OutMsg = OutTrans(D), + Echoer ! OutMsg, + io:format("echo_server ~p: ~p ! ~P~n", [self(),Echoer,OutMsg,10]), + receive + Reply -> + io:format("echo_server ~p: receive ~P~n", + [self(),Reply,10]), + InTrans(Echoer, D, Reply) + end, + Term = case OutMsg of + {_, T, _} -> T; + {_, T} -> T + end, + echo_loop(Ds, Echoer, OutTrans, InTrans, [Term | TermAcc]); +echo_loop([], Echoer, _, _, TermAcc) -> + check_terms(Echoer, TermAcc); +%% Lazy list +echo_loop(Cont, Echoer, OutTrans, InTrans, TermAcc) + when is_function(Cont, 0) -> + check_terms(Echoer, TermAcc), + OutMsg = Echoer ! {self(),undefined,hash_clear}, + io:format("echo_server ~p: ~p ! ~P~n", [self(),Echoer,OutMsg,10]), + receive + {Echoer,hash_cleared,hash_clear}=Reply -> + io:format("echo_server ~p: receive ~P~n", + [self(),Reply,10]), + ok; + Other -> + io:format("echo_server_terms unexpected ~p: receive ~P~n", + [self(),Other,10]), + ?t:fail({unexpected, Other}) + end, + echo_loop(Cont(), Echoer, OutTrans, InTrans, []). + +check_terms(Echoer, [Term | Rest]) -> + OutMsg = {self(),Term,hash_lookup}, + Echoer ! OutMsg, + io:format("check_terms ~p: ~p ! ~P~n", [self(),Echoer,OutMsg,10]), + receive + {Echoer,true,hash_lookup} = ReplyMsg -> + io:format("check_terms ~p: receive ~P~n", + [self(),ReplyMsg,10]), + check_terms(Echoer, Rest); + Other -> + io:format("check_terms unexpected ~p: receive ~P~n", + [self(),Other,10]), + ?t:fail({unexpected, Other}) + end; +check_terms(_, []) -> + ok. + +run_server(Server, Config, Action, ExtraArgs) -> + Name = make_name(), + true = register(Name, self()), + JName = make_name(), + spawn_link(fun () -> + ok = jitu:java(?config(java, Config), + ?config(data_dir, Config), + atom_to_list(Server), + [JName, + erlang:get_cookie(), + node(), + Name]++ExtraArgs + ), + %,"-DOtpConnection.trace=3"), + Name ! {done, JName} + end), + receive + {Server, JName, Pid} -> + ?t:format("~w: ~p (~p)~n", + [Server, Pid, node(Pid)]), + ?t:format("nodes(hidden): ~p~n", + [nodes(hidden)]), + Action(Pid), + Pid ! bye, + receive + {done, JName} -> + ok + end; + Other -> + ?t:fail({unexpected,Other}) + end. + +%% +%% Utils... +%% + +make_name() -> + {A, B, C} = now(), + list_to_atom(atom_to_list(?MODULE) + ++ "-" ++ integer_to_list(A) + ++ "-" ++ integer_to_list(B) + ++ "-" ++ integer_to_list(C)). + + + +-define(VERSION_MAGIC, 131). + +-define(ATOM_EXT, 100). +-define(REFERENCE_EXT, 101). +-define(PORT_EXT, 102). +-define(PID_EXT, 103). +-define(NEW_REFERENCE_EXT, 114). + +uint32_be(Uint) when is_integer(Uint), 0 =< Uint, Uint < 1 bsl 32 -> + [(Uint bsr 24) band 16#ff, + (Uint bsr 16) band 16#ff, + (Uint bsr 8) band 16#ff, + Uint band 16#ff]; +uint32_be(Uint) -> + exit({badarg, uint32_be, [Uint]}). + + +uint16_be(Uint) when is_integer(Uint), 0 =< Uint, Uint < 1 bsl 16 -> + [(Uint bsr 8) band 16#ff, + Uint band 16#ff]; +uint16_be(Uint) -> + exit({badarg, uint16_be, [Uint]}). + +uint8(Uint) when is_integer(Uint), 0 =< Uint, Uint < 1 bsl 8 -> + Uint band 16#ff; +uint8(Uint) -> + exit({badarg, uint8, [Uint]}). + + + +mk_pid({NodeName, Creation}, Number, Serial) when is_atom(NodeName) -> + mk_pid({atom_to_list(NodeName), Creation}, Number, Serial); +mk_pid({NodeName, Creation}, Number, Serial) -> + case catch binary_to_term(list_to_binary([?VERSION_MAGIC, + ?PID_EXT, + ?ATOM_EXT, + uint16_be(length(NodeName)), + NodeName, + uint32_be(Number), + uint32_be(Serial), + uint8(Creation)])) of + Pid when is_pid(Pid) -> + Pid; + {'EXIT', {badarg, _}} -> + exit({badarg, mk_pid, [{NodeName, Creation}, Number, Serial]}); + Other -> + exit({unexpected_binary_to_term_result, Other}) + end. + +mk_port({NodeName, Creation}, Number) when is_atom(NodeName) -> + mk_port({atom_to_list(NodeName), Creation}, Number); +mk_port({NodeName, Creation}, Number) -> + case catch binary_to_term(list_to_binary([?VERSION_MAGIC, + ?PORT_EXT, + ?ATOM_EXT, + uint16_be(length(NodeName)), + NodeName, + uint32_be(Number), + uint8(Creation)])) of + Port when is_port(Port) -> + Port; + {'EXIT', {badarg, _}} -> + exit({badarg, mk_port, [{NodeName, Creation}, Number]}); + Other -> + exit({unexpected_binary_to_term_result, Other}) + end. + +mk_ref({NodeName, Creation}, Numbers) when is_atom(NodeName), + is_integer(Creation), + is_list(Numbers) -> + mk_ref({atom_to_list(NodeName), Creation}, Numbers); +mk_ref({NodeName, Creation}, [Number]) when is_list(NodeName), + is_integer(Creation), + is_integer(Number) -> + case catch binary_to_term(list_to_binary([?VERSION_MAGIC, + ?REFERENCE_EXT, + ?ATOM_EXT, + uint16_be(length(NodeName)), + NodeName, + uint32_be(Number), + uint8(Creation)])) of + Ref when is_reference(Ref) -> + Ref; + {'EXIT', {badarg, _}} -> + exit({badarg, mk_ref, [{NodeName, Creation}, [Number]]}); + Other -> + exit({unexpected_binary_to_term_result, Other}) + end; +mk_ref({NodeName, Creation}, Numbers) when is_list(NodeName), + is_integer(Creation), + is_list(Numbers) -> + case catch binary_to_term(list_to_binary([?VERSION_MAGIC, + ?NEW_REFERENCE_EXT, + uint16_be(length(Numbers)), + ?ATOM_EXT, + uint16_be(length(NodeName)), + NodeName, + uint8(Creation), + lists:map(fun (N) -> + uint32_be(N) + end, + Numbers)])) of + Ref when is_reference(Ref) -> + Ref; + {'EXIT', {badarg, _}} -> + exit({badarg, mk_ref, [{NodeName, Creation}, Numbers]}); + Other -> + exit({unexpected_binary_to_term_result, Other}) + end. diff --git a/lib/jinterface/test/nc_SUITE_data/Makefile.src b/lib/jinterface/test/nc_SUITE_data/Makefile.src new file mode 100644 index 0000000000..3d131250be --- /dev/null +++ b/lib/jinterface/test/nc_SUITE_data/Makefile.src @@ -0,0 +1,53 @@ +# +# %CopyrightBegin% +# +# Copyright Ericsson AB 2004-2010. All Rights Reserved. +# +# The contents of this file are subject to the Erlang Public License, +# Version 1.1, (the "License"); you may not use this file except in +# compliance with the License. You should have received a copy of the +# Erlang Public License along with this software. If not, it can be +# retrieved online at http://www.erlang.org/. +# +# Software distributed under the License is distributed on an "AS IS" +# basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See +# the License for the specific language governing rights and limitations +# under the License. +# +# %CopyrightEnd% +# + +# Makefile.src for java_client_erl_server test +# Note: This file *must* work for both Unix and Windows +# +# We use both `rm' (Unix) and `del' (Windows) for removing files, but +# with a `-' in front so that the error in not finding `rm' (`del') on +# Windows (Unix) is ignored. +# +# VxWorks? XXX +# + +.SUFFIXES: +.SUFFIXES: .java + + +JAVAC = @JAVAC@ +ERLC = erlc + +JINTERFACE_CLASSPATH = @jinterface_classpath@ + +CLASSPATH = .@PS@$(JINTERFACE_CLASSPATH)@PS@ + +JAVA_FILES = echo_server.java connection_server.java +CLASS_FILES = $(JAVA_FILES:.java=.class) + +all: $(CLASS_FILES) + +clean: + -rm -f $(CLASS_FILES) + -del /F /Q $(CLASS_FILES) + +$(CLASS_FILES) : $(JAVA_FILES) + $(JAVAC) -classpath $(CLASSPATH) $(JAVA_FILES) + +# diff --git a/lib/jinterface/test/nc_SUITE_data/connection_server.java b/lib/jinterface/test/nc_SUITE_data/connection_server.java new file mode 100644 index 0000000000..19ed1c7d5c --- /dev/null +++ b/lib/jinterface/test/nc_SUITE_data/connection_server.java @@ -0,0 +1,96 @@ +/* + * %CopyrightBegin% + * + * Copyright Ericsson AB 2004-2010. All Rights Reserved. + * + * The contents of this file are subject to the Erlang Public License, + * Version 1.1, (the "License"); you may not use this file except in + * compliance with the License. You should have received a copy of the + * Erlang Public License along with this software. If not, it can be + * retrieved online at http://www.erlang.org/. + * + * Software distributed under the License is distributed on an "AS IS" + * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See + * the License for the specific language governing rights and limitations + * under the License. + * + * %CopyrightEnd% + */ + +import com.ericsson.otp.erlang.*; + +public class connection_server { + static java.lang.String Name = "connection_server"; + + public static void main(String[] argv) { + try { + System.out.println("connection_server booting..."); + + for (int j = 0; j < argv.length; j++) + System.out.println("argv[" + j + "] = \"" + argv[j] + "\""); + + if (argv.length != 4) { + System.out.println("Wrong number of arguments!"); + System.exit(1); + } + + // Start node and mbox + OtpNode node = new OtpNode(argv[0], argv[1]); + OtpMbox mbox = node.createMbox(); + if (! mbox.registerName(Name)) { + System.out.println("Could not register name " + Name); + System.exit(3); + } + + // Announce our presence + OtpErlangObject[] amsg = new OtpErlangObject[3]; + amsg[0] = new OtpErlangAtom(Name); + amsg[1] = new OtpErlangAtom(argv[0]); + amsg[2] = mbox.self(); + OtpErlangTuple atuple = new OtpErlangTuple(amsg); + mbox.send(argv[3], argv[2], atuple); + + // Do connects ... + while (true) { + OtpErlangObject o = mbox.receive(); + if (o == null) + continue; + if (o instanceof OtpErlangTuple) { + OtpErlangTuple msg = (OtpErlangTuple) o; + OtpErlangPid from = (OtpErlangPid)(msg.elementAt(0)); + OtpErlangAtom conn_node = (OtpErlangAtom) msg.elementAt(1); + + System.out.println("Got request to connect to: " + + conn_node); + OtpErlangObject[] rmsg = new OtpErlangObject[3]; + rmsg[0] = mbox.self(); + rmsg[1] = conn_node; + if (node.ping(conn_node.atomValue(), 1000)) { + System.out.println("Successfully connected to " + + conn_node.toString()); + rmsg[2] = new OtpErlangAtom("true"); + } + else { + System.out.println("Failed to connect to " + + conn_node.toString()); + rmsg[2] = new OtpErlangAtom("false"); + } + + OtpErlangTuple rtuple = new OtpErlangTuple(rmsg); + + mbox.send(from, rtuple); + } + else { // probably 'bye' + System.out.println("connection_server halting..."); + System.exit(0); + } + } + } + catch (Exception e) { + System.out.println("" + e); + System.exit(2); + } + + } + +} diff --git a/lib/jinterface/test/nc_SUITE_data/echo_server.java b/lib/jinterface/test/nc_SUITE_data/echo_server.java new file mode 100644 index 0000000000..0550e4beb1 --- /dev/null +++ b/lib/jinterface/test/nc_SUITE_data/echo_server.java @@ -0,0 +1,261 @@ +/* + * %CopyrightBegin% + * + * Copyright Ericsson AB 2004-2010. All Rights Reserved. + * + * The contents of this file are subject to the Erlang Public License, + * Version 1.1, (the "License"); you may not use this file except in + * compliance with the License. You should have received a copy of the + * Erlang Public License along with this software. If not, it can be + * retrieved online at http://www.erlang.org/. + * + * Software distributed under the License is distributed on an "AS IS" + * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See + * the License for the specific language governing rights and limitations + * under the License. + * + * %CopyrightEnd% + */ + +import java.io.UnsupportedEncodingException; +import java.util.HashSet; + +import com.ericsson.otp.erlang.OtpErlangAtom; +import com.ericsson.otp.erlang.OtpErlangBinary; +import com.ericsson.otp.erlang.OtpErlangBoolean; +import com.ericsson.otp.erlang.OtpErlangException; +import com.ericsson.otp.erlang.OtpErlangInt; +import com.ericsson.otp.erlang.OtpErlangList; +import com.ericsson.otp.erlang.OtpErlangLong; +import com.ericsson.otp.erlang.OtpErlangObject; +import com.ericsson.otp.erlang.OtpErlangPid; +import com.ericsson.otp.erlang.OtpErlangString; +import com.ericsson.otp.erlang.OtpErlangTuple; +import com.ericsson.otp.erlang.OtpExternal; +import com.ericsson.otp.erlang.OtpInputStream; +import com.ericsson.otp.erlang.OtpMbox; +import com.ericsson.otp.erlang.OtpNode; +import com.ericsson.otp.erlang.OtpOutputStream; + +public class echo_server { + private static boolean debug = false; + + public static void main(final String[] argv) { + try { + System.out.println("echo_server booting..."); + + for (int j = 0; j < argv.length; j++) { + System.out.println("argv[" + j + "] = \"" + argv[j] + "\""); + } + + if (argv.length != 4 && argv.length != 5) { + System.out.println("Wrong number of arguments!"); + System.exit(1); + } + + // Start node and mbox + final OtpNode node = new OtpNode(argv[0], argv[1]); + if (argv.length == 5 && argv[4].equals("unicode")) { + System.out.println("Setting unicode string mode."); + node.setFlags(OtpInputStream.DECODE_INT_LISTS_AS_STRINGS); + } + final OtpMbox mbox = node.createMbox(); + + // Announce our presence + final OtpErlangObject[] amsg = new OtpErlangObject[3]; + amsg[0] = new OtpErlangAtom("echo_server"); + amsg[1] = new OtpErlangAtom(argv[0]); + amsg[2] = mbox.self(); + final OtpErlangTuple atuple = new OtpErlangTuple(amsg); + mbox.send(argv[3], argv[2], atuple); + + // Do echoing... + while (true) { + final OtpErlangObject o = mbox.receive(); + if (o == null) { + continue; + } + if (o instanceof OtpErlangTuple) { + final OtpErlangTuple msg = (OtpErlangTuple) o; + final int arity = msg.arity(); + if (arity < 2) { + System.out + .println("Arity < 2; echo_server aborting..."); + System.exit(2); + } else if (arity == 2) { + final OtpErlangPid from = (OtpErlangPid) msg + .elementAt(0); + if (debug) System.out.println("Echoing: " + + msg.elementAt(1)); + + final OtpErlangObject[] rmsg = new OtpErlangObject[2]; + rmsg[0] = mbox.self(); + rmsg[1] = msg.elementAt(1); + final OtpErlangTuple rtuple = new OtpErlangTuple(rmsg); + + mbox.send(from, rtuple); + continue; + } else if (arity == 3) { + echoTwisted(mbox, msg); + continue; + } else { + System.out + .println("Arity > 3; echo_server aborting..."); + System.exit(2); + } + } else if (o instanceof OtpErlangAtom) { + OtpErlangAtom a = (OtpErlangAtom) o; + if (a.atomValue().equals("debug")) { + debug = true; + } else if (a.atomValue().equals("bye")) { + System.out.println("echo_server halting..."); + System.exit(0); + } + } else { // probably 'bye' + } + System.out.println("Unexpected: " + o + + " echo_server aborting..."); + System.exit(2); + } + } catch (final Exception e) { + System.out.println("" + e); + System.exit(2); + } + } + + private static void echoTwisted(final OtpMbox mbox, + final OtpErlangTuple msg) + throws OtpErlangException { + final OtpErlangPid from = (OtpErlangPid) msg.elementAt(0); + + final OtpErlangObject[] rmsg = new OtpErlangObject[3]; + if (debug) System.out.println("Echo in: " + msg); + rmsg[0] = mbox.self(); + rmsg[1] = twist(msg.elementAt(1), rmsg[2] = msg.elementAt(2)); + final OtpErlangTuple rtuple = new OtpErlangTuple(rmsg); + if (debug) System.out.println("Echo out: " + rtuple); + + mbox.send(from, rtuple); + } + + private static HashSet<OtpErlangObject> hash_set = + new HashSet<OtpErlangObject>(); + + private static OtpErlangObject twist(final OtpErlangObject i, + final OtpErlangObject t) throws OtpErlangException { + hash_set.add(i); + if (t instanceof OtpErlangAtom) { + final String atomValue = ((OtpErlangAtom) t).atomValue(); + if (atomValue.equals("binary") && i instanceof OtpErlangBinary) { + final OtpErlangBinary b = (OtpErlangBinary) i; + final OtpInputStream bis = new OtpInputStream(b.binaryValue(), + 0); + final OtpErlangObject o = bis.read_any(); + return o; + } else if (atomValue.equals("compress")) { + final OtpOutputStream oos = new OtpOutputStream(); + oos.write1(OtpExternal.versionTag); + oos.write_compressed(i); + final OtpErlangBinary o = + new OtpErlangBinary(oos.toByteArray()); + return o; + } else if (atomValue.equals("bigint") + && i instanceof OtpErlangLong) { + final OtpErlangLong l = (OtpErlangLong) i; + final int w = l.signum() * l.bitLength(); + final OtpErlangLong x = new OtpErlangLong(l.longValue()); + final java.math.BigInteger b = l.bigIntegerValue(); + System.out.println("long: " + l + ": " + w + ": " + b.signum() + * b.bitLength() + ": " + x + ": " + l.isLong() + ": " + + l.isULong()); + return new OtpErlangTuple(new OtpErlangObject[] { l, + new OtpErlangInt(w), x, + new OtpErlangInt(l.isLong() ? 1 : 0), + new OtpErlangInt(l.isULong() ? 1 : 0) }); + } else if (atomValue.equals("tail") + && i instanceof OtpErlangList) { + final OtpErlangObject o = ((OtpErlangList) i).getTail(); + if (o == null) { + return new OtpErlangAtom("null"); + } + return o; + } else if (atomValue.equals("tail3") + && i instanceof OtpErlangList) { + final OtpErlangObject o = ((OtpErlangList) i).getNthTail(3); + if (o == null) { + return new OtpErlangAtom("null"); + } + return o; + } else if (atomValue.equals("strcat") + && i instanceof OtpErlangList) { + final java.lang.StringBuffer b = new java.lang.StringBuffer(); + final OtpErlangList l = (OtpErlangList) i; + for (final OtpErlangObject j : l) { + final OtpErlangString k = (OtpErlangString) j; + b.append(k.stringValue()); + } + final OtpErlangObject o = new OtpErlangString(b.toString()); + return o; + } else if (atomValue.equals("sub3atom") + && i instanceof OtpErlangString) { + final OtpErlangString s = (OtpErlangString) i; + final OtpErlangAtom o = new OtpErlangAtom(s.stringValue() + .substring(3)); + return o; + } else if (atomValue.equals("utf8")) { + if (i instanceof OtpErlangString) { + final OtpErlangString s = (OtpErlangString) i; + byte[] bytes; + try { + bytes = s.stringValue().getBytes("UTF-8"); + } catch (final UnsupportedEncodingException e) { + bytes = new byte[] { 'e', 'r', 'r', 'o', 'r' }; + } + final OtpErlangBinary b = new OtpErlangBinary(bytes); + return b; + } + } else if(atomValue.equals("to_string_neg_int_list")) { + OtpErlangString oes = null; + if (i instanceof OtpErlangString) { + oes = (OtpErlangString) i; + } else if (i instanceof OtpErlangList) { + OtpErlangList oel = (OtpErlangList) i; + try { + oes = new OtpErlangString(oel); + } catch (final Exception e) { + } + } + if (oes != null) { + String s = oes.stringValue(); + int n = s.length(); + OtpErlangObject l[] = new OtpErlangObject[n]; + for (int j = 0; j < n; j++) { + int c = s.charAt(j); + l[j] = new OtpErlangInt(-c); + } + return new OtpErlangList(l); + } + } else if(atomValue.equals("to_neg_int_list")) { + if (i instanceof OtpErlangString) { + OtpErlangString oes = (OtpErlangString) i; + OtpErlangList oel = new OtpErlangList(oes.stringValue()); + int n = oel.arity(); + OtpErlangObject l[] = new OtpErlangObject[n]; + for (int j = 0; j < n; j++) { + OtpErlangLong c = (OtpErlangLong) oel.elementAt(j); + l[j] = new OtpErlangInt(-c.intValue()); + } + return new OtpErlangList(l); + } + } else if (atomValue.equals("hash_lookup")) { + final boolean exists = hash_set.contains(i); + final OtpErlangBoolean b = new OtpErlangBoolean(exists); + return b; + } else if (atomValue.equals("hash_clear")) { + hash_set.clear(); + return new OtpErlangAtom("hash_cleared"); + } + } + return i; + } +} diff --git a/lib/jinterface/vsn.mk b/lib/jinterface/vsn.mk index 6b5719d7c5..26613febbf 100644 --- a/lib/jinterface/vsn.mk +++ b/lib/jinterface/vsn.mk @@ -1,19 +1 @@ -## -## %CopyrightBegin% -## -## Copyright Ericsson AB 2000-2010. All Rights Reserved. -## -## The contents of this file are subject to the Erlang Public License, -## Version 1.1, (the "License"); you may not use this file except in -## compliance with the License. You should have received a copy of the -## Erlang Public License along with this software. If not, it can be -## retrieved online at http://www.erlang.org/. -## -## Software distributed under the License is distributed on an "AS IS" -## basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See -## the License for the specific language governing rights and limitations -## under the License. -## -## %CopyrightEnd% - JINTERFACE_VSN = 1.5.3 diff --git a/lib/kernel/doc/src/code.xml b/lib/kernel/doc/src/code.xml index 19e1d3221c..b8db509fa8 100644 --- a/lib/kernel/doc/src/code.xml +++ b/lib/kernel/doc/src/code.xml @@ -54,7 +54,7 @@ for and tries to load the module.</p> </item> </list> - <p>To prevent accidentaly reloading modules affecting the Erlang + <p>To prevent accidentally reloading modules affecting the Erlang runtime system itself, the <c>kernel</c>, <c>stdlib</c> and <c>compiler</c> directories are considered <em>sticky</em>. This means that the system issues a warning and rejects the request if diff --git a/lib/kernel/doc/src/erl_ddll.xml b/lib/kernel/doc/src/erl_ddll.xml index 4e65bf46f8..9a62b45d63 100644 --- a/lib/kernel/doc/src/erl_ddll.xml +++ b/lib/kernel/doc/src/erl_ddll.xml @@ -177,7 +177,7 @@ <name>demonitor(MonitorRef) -> ok</name> <fsummary>Remove a monitor for a driver</fsummary> <type> - <v>MonitorRef = ref()</v> + <v>MonitorRef = reference()</v> </type> <desc> <p>Removes a driver monitor in much the same way as @@ -185,7 +185,7 @@ monitors. See <seealso marker="#monitor/2">monitor/2</seealso>, <seealso marker="#try_load/3">try_load/3</seealso> and <seealso marker="#try_unload/2">try_unload/2</seealso> for details about how to create driver monitors.</p> <p>The function throws a <c>badarg</c> exception if the - parameter is not a ref(). </p> + parameter is not a reference(). </p> </desc> </func> <func> @@ -400,7 +400,7 @@ <v>Item = {Name, When}</v> <v>Name = atom() | string()</v> <v>When = loaded | unloaded | unloaded_only</v> - <v>MonitorRef = ref()</v> + <v>MonitorRef = reference()</v> </type> <desc> <p>This function creates a driver monitor and works in many @@ -449,7 +449,7 @@ eventually lead to one of the following messages being sent:</p> <taglist> - <tag><em>{'UP', ref(), driver, Name, loaded}</em></tag> + <tag><em>{'UP', reference(), driver, Name, loaded}</em></tag> <item> <p>This message is sent, either immediately if the driver is already loaded and no reloading is @@ -459,7 +459,7 @@ expected to know if reloading is demanded prior to creating a monitor for loading.</p> </item> - <tag><em>{'UP', ref(), driver, Name, permanent}</em></tag> + <tag><em>{'UP', reference(), driver, Name, permanent}</em></tag> <item> <p>This message will be sent if reloading was expected, but the (old) driver made itself @@ -467,7 +467,7 @@ sent if the driver was permanent or statically linked in when trying to create the monitor.</p> </item> - <tag><em>{'DOWN', ref(), driver, Name, load_cancelled}</em></tag> + <tag><em>{'DOWN', reference(), driver, Name, load_cancelled}</em></tag> <item> <p>This message will arrive if reloading was underway, but the <seealso marker="#users">user</seealso> having requested @@ -476,7 +476,7 @@ (or <c>unload/1</c>/<c>unload_driver/1</c>) again before it was reloaded.</p> </item> - <tag><em>{'DOWN', ref(), driver, Name, {load_failure, Failure}}</em></tag> + <tag><em>{'DOWN', reference(), driver, Name, {load_failure, Failure}}</em></tag> <item> <p>This message will arrive if reloading was underway but the loading for some reason @@ -500,7 +500,7 @@ <p>A driver monitor for unload will eventually result in one of the following messages being sent:</p> <taglist> - <tag><em>{'DOWN', ref(), driver, Name, unloaded}</em></tag> + <tag><em>{'DOWN', reference(), driver, Name, unloaded}</em></tag> <item> <p>The driver instance monitored is now unloaded. As the unload might have been due to a @@ -508,7 +508,7 @@ again have been loaded when this message arrives.</p> </item> - <tag><em>{'UP', ref(), driver, Name, unload_cancelled}</em></tag> + <tag><em>{'UP', reference(), driver, Name, unload_cancelled}</em></tag> <item> <p>This message will be sent if unloading was expected, but while the driver was waiting for @@ -525,7 +525,7 @@ similar to an <c>unloaded</c> monitor, but does never result in this message.</p> </item> - <tag><em>{'UP', ref(), driver, Name, permanent}</em></tag> + <tag><em>{'UP', reference(), driver, Name, permanent}</em></tag> <item> <p>This message will be sent if unloading was expected, but the driver made itself @@ -539,7 +539,7 @@ <item> <p>A monitor created as <c>unloaded_only</c> behaves exactly as one created as <c>unloaded</c> with the - exception that the <c>{'UP', ref(), driver, Name, unload_cancelled}</c> message will never be + exception that the <c>{'UP', reference(), driver, Name, unload_cancelled}</c> message will never be sent, but the monitor instead persists until the driver <em>really</em> gets unloaded.</p> </item> @@ -626,7 +626,7 @@ <v>ReloadOption = pending_driver | pending</v> <v>Status = loaded | already_loaded | PendingStatus </v> <v>PendingStatus = pending_driver | pending_process</v> - <v>Ref = ref()</v> + <v>Ref = reference()</v> <v>ErrorDesc = ErrorAtom | OpaqueError</v> <v>ErrorAtom = linked_in_driver | inconsistent | permanent | not_loaded_by_this_process | not_loaded | pending_reload | pending_process</v> </type> @@ -650,7 +650,7 @@ registered and a corresponding <c>try_unload</c> is expected sometime in the future.</p> </item> - <tag><em>{ok, pending_driver}</em>or <em>{ok, pending_driver, ref()}</em></tag> + <tag><em>{ok, pending_driver}</em>or <em>{ok, pending_driver, reference()}</em></tag> <item> <p>The load request is registered, but the loading is delayed due to the fact that an earlier instance of the @@ -665,7 +665,7 @@ set. In other words, this return value will always need to be handled!</p> </item> - <tag><em>{ok, pending_process}</em>or <em>{ok, pending_process, ref()}</em></tag> + <tag><em>{ok, pending_process}</em>or <em>{ok, pending_process, reference()}</em></tag> <item> <p>The load request is registered, but the loading is delayed due to the fact that an earlier instance of the @@ -683,7 +683,7 @@ about when the driver is <em>actually</em> loaded. This can be achieved by using the <c>{monitor, PendingOption}</c> option.</p> <p>When monitoring is requested, and a corresponding <c>{ok, pending_driver}</c> or <c>{ok, pending_process}</c> would be - returned, the function will instead return a tuple <c>{ok, PendingStatus, ref()}</c> and the process will, at a later + returned, the function will instead return a tuple <c>{ok, PendingStatus, reference()}</c> and the process will, at a later time when the driver actually gets loaded, get a monitor message. The monitor message one can expect is described in the <seealso marker="#monitor/2">monitor/2</seealso> @@ -760,7 +760,7 @@ <p>A <c>MonitorOption</c> tells <c>try_load/3</c> to trigger a driver monitor under certain conditions. When the monitor is triggered, the - function will return a three-tuple <c>{ok, PendingStatus, ref()}</c>, where the <c>ref()</c> is + function will return a three-tuple <c>{ok, PendingStatus, reference()}</c>, where the <c>reference()</c> is the monitor ref for the driver monitor.</p> <p>Only one <c>MonitorOption</c> can be specified and it is either the atom <c>pending</c>, which means @@ -891,7 +891,7 @@ <v>MonitorOption = pending_driver | pending</v> <v>Status = unloaded | PendingStatus </v> <v>PendingStatus = pending_driver | pending_process</v> - <v>Ref = ref()</v> + <v>Ref = reference()</v> <v>ErrorAtom = linked_in_driver | not_loaded | not_loaded_by_this_process | permanent</v> </type> <desc> @@ -943,7 +943,7 @@ ports using it and there are no more <seealso marker="#users">users</seealso> requiring it to be loaded.</p> </item> - <tag><em>{ok, pending_driver}</em>or <em>{ok, pending_driver, ref()}</em></tag> + <tag><em>{ok, pending_driver}</em>or <em>{ok, pending_driver, reference()}</em></tag> <item> <p>This return value indicates that this call removed the last <seealso marker="#users">user</seealso> from the @@ -957,7 +957,7 @@ in that case, however transient. Monitors are as always useful to detect when the driver is really unloaded.</p> </item> - <tag><em>{ok, pending_process}</em>or <em>{ok, pending_process, ref()}</em></tag> + <tag><em>{ok, pending_process}</em>or <em>{ok, pending_process, reference()}</em></tag> <item> <p>The unload request is registered, but there are still other <seealso marker="#users">users</seealso> holding diff --git a/lib/kernel/doc/src/file.xml b/lib/kernel/doc/src/file.xml index a9ceac0bcf..2044b074ee 100644 --- a/lib/kernel/doc/src/file.xml +++ b/lib/kernel/doc/src/file.xml @@ -1229,7 +1229,7 @@ f.txt: {person, "kalle", 25}. </item> <tag><c>{no_translation, unicode, latin1}</c></tag> <item> - <p>The file is was opened with another <c>encoding</c> than <c>latin1</c> and the data on the file can not be translated to the byte-oriented data that this function returns.</p> + <p>The file was opened with another <c>encoding</c> than <c>latin1</c> and the data in the file can not be translated to the byte-oriented data that this function returns.</p> </item> </taglist> </desc> diff --git a/lib/kernel/internal_doc/distribution_handshake.txt b/lib/kernel/internal_doc/distribution_handshake.txt index f64ebe0302..6a3ee22ed3 100644 --- a/lib/kernel/internal_doc/distribution_handshake.txt +++ b/lib/kernel/internal_doc/distribution_handshake.txt @@ -11,7 +11,7 @@ The TCP/IP distribution uses a handshake which expects a connection based protocol, i.e. the protocol does not include any authentication after the handshake procedure. -This is not entirelly safe, as it is vulnerable against takeover +This is not entirely safe, as it is vulnerable against takeover attacks, but it is a tradeoff between fair safety and performance. The cookies are never sent in cleartext and the handshake procedure @@ -23,7 +23,7 @@ random numbers. DEFINITIONS ----------- -A challenge is a 32 bit integer number in big endian. Below the function +A challenge is a 32 bit integer number in big endian order. Below the function gen_challenge() returns a random 32 bit integer used as a challenge. A digest is a (16 bytes) MD5 hash of [the Challenge (as text) concatenated @@ -46,19 +46,19 @@ The cookies are text strings that can be viewed as passwords. Every message in the handshake starts with a 16 bit big endian integer which contains the length of the message (not counting the two initial bytes). In erlang this corresponds to the gen_tcp option {packet, 2}. Note that after -the handshake, the distribution switches to 4 byte backet headers. +the handshake, the distribution switches to 4 byte packet headers. THE HANDSHAKE IN DETAIL ----------------------- -Imagine two nodes, node A, which initiates the handshake and node B, whitch +Imagine two nodes, node A, which initiates the handshake and node B, which accepts the connection. 1) connect/accept: A connects to B via TCP/IP and B accepts the connection. 2) send_name/receive_name: A sends an initial identification to B. B receives the message. The message looks -like this (every "square" beeing one byte and the packet header removed): +like this (every "square" being one byte and the packet header removed): +---+--------+--------+-----+-----+-----+-----+-----+-----+-...-+-----+ |'n'|Version0|Version1|Flag0|Flag1|Flag2|Flag3|Name0|Name1| ... |NameN| @@ -67,7 +67,7 @@ like this (every "square" beeing one byte and the packet header removed): The 'n' is just a message tag, Version0 & Version1 is the distribution version selected by node A, based on information from EPMD. (16 bit big endian) -Flag0 ... Flag3 is capability flags, the capabilities defined in dist.hrl. +Flag0 ... Flag3 are capability flags, the capabilities defined in dist.hrl. (32 bit big endian) Name0 ... NameN is the full nodename of A, as a string of bytes (the packet length denotes how long it is). @@ -91,9 +91,9 @@ alive: A connection to the node is already active, which either means This is the format of the status message: -+---+-------+-------+ ... +-------+ ++---+-------+-------+-...-+-------+ |'s'|Status0|Status1| ... |StatusN| -+---+-------+-------+ ... +-------+ ++---+-------+-------+-...-+-------+ 's' is the message tag Status0 ... StatusN is the status as a string (not terminated) @@ -111,35 +111,35 @@ initially sent from A to B, with the addition of a 32 bit challenge: +---+--------+--------+-----+-----+-----+-----+-----+-----+-----+-----+--- |'n'|Version0|Version1|Flag0|Flag1|Flag2|Flag3|Chal0|Chal1|Chal2|Chal3| -+---+--------+--------+-----+-----+-----+-----+-----+-----+---- +-----+--- ++---+--------+--------+-----+-----+-----+-----+-----+-----+-----+-----+--- ------+-----+-...-+-----+ Name0|Name1| ... |NameN| ------+-----+-... +-----+ -Where Chal0 ... Chal3 is the challenge as a 32 bit biog endian integer +Where Chal0 ... Chal3 is the challenge as a 32 bit big endian integer and the other fields are B's version, flags and full nodename. 5) send_challenge_reply/recv_challenge_reply: Now A has generated -a digest and it's own challenge. Those are sent together in a package +a digest and its own challenge. Those are sent together in a package to B: -+---+-----+-----+-----+-----+-----+-----+-----+-----+ -|'r'|Chal0|Chal1|Chal2|Chal3|Dige0|Dige1|Dige2|Dige3| -+---+-----+-----+-----+-----+-----+-----+---- +-----+ ++---+-----+-----+-----+-----+-----+-----+-----+-----+-...-+------+ +|'r'|Chal0|Chal1|Chal2|Chal3|Dige0|Dige1|Dige2|Dige3| ... |Dige15| ++---+-----+-----+-----+-----+-----+-----+-----+-----+-...-+------+ Where 'r' is the tag, Chal0 ... Chal3 is A's challenge for B to handle and -Dige0 ... Dige3 is the digest that A constructed from the challenge B sent +Dige0 ... Dige15 is the digest that A constructed from the challenge B sent in the previous step. 6) recv_challenge_ack/send_challenge_ack: B checks that the digest received from A is correct and generates a digest from the challenge received from A. The digest is then sent to A. The message looks like this: -+---+-----+-----+-----+-----+ -|'a'|Dige0|Dige1|Dige2|Dige3| -+---+-----+-----+---- +-----+ ++---+-----+-----+-----+-----+-...-+------+ +|'a'|Dige0|Dige1|Dige2|Dige3| ... |Dige15| ++---+-----+-----+-----+-----+-...-+------+ -Where 'a' is the tag and Dige0 ... Dige3 is the digest calculated by B +Where 'a' is the tag and Dige0 ... Dige15 is the digest calculated by B for A's challenge. 7) A checks the digest from B and the connection is up. @@ -206,7 +206,7 @@ Currently the following capability flags are defined: %% The node implements distributed process monitoring. -define(DFLAG_DIST_MONITOR,8). -%% The node uses separate tag for fun's (labmdas) in the distribution protocol. +%% The node uses separate tag for fun's (lambdas) in the distribution protocol. -define(DFLAG_FUN_TAGS,16). An R6 erlang node implements all of the above, while a C or Java node only diff --git a/lib/kernel/src/auth.erl b/lib/kernel/src/auth.erl index 7fe30ae828..5c7fe2421d 100644 --- a/lib/kernel/src/auth.erl +++ b/lib/kernel/src/auth.erl @@ -50,6 +50,8 @@ %% Exported functions %%---------------------------------------------------------------------- +-spec start_link() -> {'ok',pid()} | {'error', term()} | 'ignore'. + start_link() -> gen_server:start_link({local, auth}, auth, [], []). @@ -134,7 +136,9 @@ init([]) -> %% The net kernel will let all message to the auth server %% through as is --type calls() :: 'echo' | 'sync_cookie' | {'set_cookie', node(), term()}. +-type calls() :: 'echo' | 'sync_cookie' + | {'get_cookie', node()} + | {'set_cookie', node(), term()}. -spec handle_call(calls(), {pid(), term()}, state()) -> {'reply', 'hello' | 'true' | 'nocookie' | cookie(), state()}. diff --git a/lib/kernel/src/code.erl b/lib/kernel/src/code.erl index 42d4818f08..ec256d5806 100644 --- a/lib/kernel/src/code.erl +++ b/lib/kernel/src/code.erl @@ -304,6 +304,8 @@ do_start(Flags) -> true -> ok end, + % Quietly load the native code for all modules loaded so far. + catch load_native_code_for_all_loaded(), Ok2; Other -> Other @@ -496,3 +498,19 @@ has_ext(Ext, Extlen,File) -> to_path(X) -> filename:join(packages:split(X)). + +-spec load_native_code_for_all_loaded() -> ok. +load_native_code_for_all_loaded() -> + Architecture = erlang:system_info(hipe_architecture), + ChunkName = hipe_unified_loader:chunk_name(Architecture), + lists:foreach(fun({Module, BeamFilename}) -> + case code:is_module_native(Module) of + false -> + case beam_lib:chunks(BeamFilename, [ChunkName]) of + {ok,{_,[{_,Bin}]}} when is_binary(Bin) -> + load_native_partial(Module, Bin); + {error, beam_lib, _} -> ok + end; + true -> ok + end + end, all_loaded()). diff --git a/lib/kernel/test/code_SUITE.erl b/lib/kernel/test/code_SUITE.erl index 08b6477c9d..c9437df258 100644 --- a/lib/kernel/test/code_SUITE.erl +++ b/lib/kernel/test/code_SUITE.erl @@ -31,7 +31,7 @@ where_is_file_cached/1, where_is_file_no_cache/1, purge_stacktrace/1, mult_lib_roots/1, bad_erl_libs/1, code_archive/1, code_archive2/1, on_load/1, - on_load_embedded/1, on_load_errors/1]). + on_load_embedded/1, on_load_errors/1, native_early_modules/1]). -export([init_per_testcase/2, fin_per_testcase/2, init_per_suite/1, end_per_suite/1, @@ -53,7 +53,7 @@ all(suite) -> where_is_file_no_cache, where_is_file_cached, purge_stacktrace, mult_lib_roots, bad_erl_libs, code_archive, code_archive2, on_load, on_load_embedded, - on_load_errors]. + on_load_errors, native_early_modules]. init_per_suite(Config) -> %% The compiler will no longer create a Beam file if @@ -1333,6 +1333,34 @@ do_on_load_error(ReturnValue) -> ?line {undef,[{on_load_error,main,[]}|_]} = Exit end. +native_early_modules(suite) -> []; +native_early_modules(doc) -> ["Test that the native code of early loaded modules is loaded"]; +native_early_modules(Config) when is_list(Config) -> + case erlang:system_info(hipe_architecture) of + undefined -> + {skip,"Native code support is not enabled"}; + Architecture -> + native_early_modules_1(Architecture) + end. + +native_early_modules_1(Architecture) -> + ?line {lists, ListsBinary, _ListsFilename} = code:get_object_code(lists), + ?line ChunkName = hipe_unified_loader:chunk_name(Architecture), + ?line NativeChunk = beam_lib:chunks(ListsBinary, [ChunkName]), + ?line IsHipeCompiled = case NativeChunk of + {ok,{_,[{_,Bin}]}} when is_binary(Bin) -> true; + {error, beam_lib, _} -> false + end, + case IsHipeCompiled of + false -> + {skip,"OTP apparently not configured with --enable-native-libs"}; + true -> + ?line true = lists:all(fun code:is_module_native/1, + [ets,file,filename,gb_sets,gb_trees, + hipe_unified_loader,lists,os,packages]), + ok + end. + %%----------------------------------------------------------------- %% error_logger handler. %% (Copied from stdlib/test/proc_lib_SUITE.erl.) diff --git a/lib/kernel/test/gen_udp_SUITE.erl b/lib/kernel/test/gen_udp_SUITE.erl index bd5685952e..fa1991872b 100644 --- a/lib/kernel/test/gen_udp_SUITE.erl +++ b/lib/kernel/test/gen_udp_SUITE.erl @@ -34,12 +34,12 @@ -export([send_to_closed/1, buffer_size/1, binary_passive_recv/1, bad_address/1, - read_packets/1, open_fd/1]). + read_packets/1, open_fd/1, connect/1]). all(suite) -> [send_to_closed, buffer_size, binary_passive_recv, bad_address, read_packets, - open_fd]. + open_fd, connect]. init_per_testcase(_Case, Config) -> ?line Dog=test_server:timetrap(?default_timeout), @@ -408,3 +408,20 @@ start_node(Name) -> stop_node(Node) -> ?t:stop_node(Node). + + +connect(suite) -> + []; +connect(doc) -> + ["Test that connect/3 has effect"]; +connect(Config) when is_list(Config) -> + Addr = {127,0,0,1}, + {ok,S1} = gen_udp:open(0), + {ok,P1} = inet:port(S1), + {ok,S2} = gen_udp:open(0), + ok = inet:setopts(S2, [{active,false}]), + ok = gen_udp:close(S1), + ok = gen_udp:connect(S2, Addr, P1), + ok = gen_udp:send(S2, <<16#deadbeef:32>>), + {error,econnrefused} = gen_udp:recv(S2, 0, 5), + ok. diff --git a/lib/kernel/vsn.mk b/lib/kernel/vsn.mk index 9a191f9aeb..651d082379 100644 --- a/lib/kernel/vsn.mk +++ b/lib/kernel/vsn.mk @@ -1,20 +1 @@ -# -# %CopyrightBegin% -# -# Copyright Ericsson AB 1997-2010. All Rights Reserved. -# -# The contents of this file are subject to the Erlang Public License, -# Version 1.1, (the "License"); you may not use this file except in -# compliance with the License. You should have received a copy of the -# Erlang Public License along with this software. If not, it can be -# retrieved online at http://www.erlang.org/. -# -# Software distributed under the License is distributed on an "AS IS" -# basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See -# the License for the specific language governing rights and limitations -# under the License. -# -# %CopyrightEnd% -# - KERNEL_VSN = 2.14.1 diff --git a/lib/megaco/doc/src/megaco.xml b/lib/megaco/doc/src/megaco.xml index ae9e250965..b9bf414299 100644 --- a/lib/megaco/doc/src/megaco.xml +++ b/lib/megaco/doc/src/megaco.xml @@ -662,7 +662,7 @@ megaco_incr_timer() = #megaco_incr_timer{} <taglist> <tag><c><![CDATA[none]]></c></tag> <item> - <p>Do not segment outgoing reply messages. This is usefull when + <p>Do not segment outgoing reply messages. This is useful when either it is known that messages are never to large or that the transport protocol can handle such things on its own (e.g. TCP or SCTP).</p> @@ -1182,7 +1182,7 @@ megaco_incr_timer() = #megaco_incr_timer{} <taglist> <tag><c><![CDATA[none]]></c></tag> <item> - <p>Do not segment outgoing reply messages. This is usefull when + <p>Do not segment outgoing reply messages. This is useful when either it is known that messages are never to large or that the transport protocol can handle such things on its own (e.g. TCP or SCTP).</p> diff --git a/lib/megaco/doc/src/megaco_flex_scanner.xml b/lib/megaco/doc/src/megaco_flex_scanner.xml index eb206e5d13..18c40bb71a 100644 --- a/lib/megaco/doc/src/megaco_flex_scanner.xml +++ b/lib/megaco/doc/src/megaco_flex_scanner.xml @@ -128,7 +128,7 @@ megaco_version() = integer() >= 1 <v>Boolean = boolean()</v> </type> <desc> - <p>Checks if a port is a flex scanner port or not (usefull when + <p>Checks if a port is a flex scanner port or not (useful when if a port exits). </p> <marker id="scan"></marker> diff --git a/lib/megaco/doc/src/megaco_user.xml b/lib/megaco/doc/src/megaco_user.xml index 7332fa684d..7987ed3392 100644 --- a/lib/megaco/doc/src/megaco_user.xml +++ b/lib/megaco/doc/src/megaco_user.xml @@ -504,7 +504,7 @@ protocol_version() = integer() ]]></code> not, is also included in the <c><![CDATA[UserReply]]></c>. </p> <p>The <c><![CDATA[ReplyData]]></c> defaults to <c><![CDATA[megaco:lookup(ConnHandle, reply_data)]]></c>, - but may be explicitely overridden by a + but may be explicitly overridden by a <c><![CDATA[megaco:cast/3]]></c> option in order to forward info about the calling context of the originating process.</p> <p>At <c><![CDATA[success()]]></c>, the <c><![CDATA[UserReply]]></c> either contains:</p> diff --git a/lib/megaco/vsn.mk b/lib/megaco/vsn.mk index efb46253aa..73ac5bbc63 100644 --- a/lib/megaco/vsn.mk +++ b/lib/megaco/vsn.mk @@ -1,151 +1,4 @@ -#-*-makefile-*- ; force emacs to enter makefile-mode - -# %CopyrightBegin% -# -# Copyright Ericsson AB 2001-2010. All Rights Reserved. -# -# The contents of this file are subject to the Erlang Public License, -# Version 1.1, (the "License"); you may not use this file except in -# compliance with the License. You should have received a copy of the -# Erlang Public License along with this software. If not, it can be -# retrieved online at http://www.erlang.org/. -# -# Software distributed under the License is distributed on an "AS IS" -# basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See -# the License for the specific language governing rights and limitations -# under the License. -# -# %CopyrightEnd% - APPLICATION = megaco MEGACO_VSN = 3.14.1.1 PRE_VSN = APP_VSN = "$(APPLICATION)-$(MEGACO_VSN)$(PRE_VSN)" - -TICKETS = OTP-8696 - -TICKETS_3_14_1 = OTP-8529 OTP-8561 OTP-8627 OTP-8634 - -TICKETS_3_14 = OTP-8317 OTP-8323 OTP-8328 OTP-8362 OTP-8403 - -TICKETS_3_13 = OTP-8205 OTP-8239 OTP-8249 - -TICKETS_3_12 = OTP-8183 OTP-8212 - -TICKETS_3_11_3 = OTP-8164 OTP-8167 OTP-8191 - -TICKETS_3_11_2 = OTP-8123 - -TICKETS_3_11_1 = OTP-8081 OTP-8114 - -TICKETS_3_11 = OTP-7302 OTP-7995 - -TICKETS_3_10_1 = OTP-7926 OTP-7936 - -TICKETS_3_10_0_1 = OTP-7851 - -TICKETS_3_10 = OTP-7713 OTP-7743 - -TICKETS_3_9_4 = OTP-7728 OTP-7733 - -TICKETS_3_9_3 = OTP-7700 - -TICKETS_3_9_2 = OTP-7671 OTP-7672 - -TICKETS_3_9_1_1 = OTP-7614 - -TICKETS_3_9_1 = OTP-7572 OTP-7573 OTP-7576 - -TICKETS_3_9 = OTP-7431 - -TICKETS_3_8_2 = OTP-7534 - -TICKETS_3_8_1 = OTP-7398 OTP-7417 OTP-7444 OTP-7449 OTP-7455 OTP-7457 OTP-7459 - -TICKETS_3_8 = OTP-7192 OTP-7228 OTP-7259 - -TICKETS_3_7_5 = OTP-7286 OTP-7303 - -TICKETS_3_7_4 = OTP-7249 OTP-7251 - -TICKETS_3_7_3 = OTP-7168 OTP-7180 OTP-7189 OTP-7216 - -TICKETS_3_7_2 = OTP-6972 OTP-7138 - -TICKETS_3_7_1 = OTP-6919 OTP-6971 OTP-6992 OTP-6999 OTP-7000 OTP-7005 OTP-7124 - -TICKETS_3_7 = OTP-5979 OTP-6753 OTP-6804 OTP-6865 OTP-6919 OTP-6976 - -TICKETS_3_6_2 = OTP-6921 - -TICKETS_3_6_1 = OTP-6803 - -TICKETS_3_6_0_1 = OTP-6704 - -TICKETS_3_6 = OTP-6185 OTP-6578 OTP-6441 OTP-6442 OTP-6544 OTP-6605 OTP-6609 - -TICKETS_3_5_3 = OTP-6520 OTP-6549 - -TICKETS_3_5_2 = OTP-6404 OTP-6422 OTP-6490 OTP-6503 - -TICKETS_3_5_1 = OTP-6275 OTP-6276 - -TICKETS_3_5 = OTP-6223 OTP-6253 OTP-6256 - -TICKETS_3_4_4 = OTP-6181 OTP-6182 OTP-6217 OTP-6219 - -TICKETS_3_4_3 = OTP-6170 OTP-6171 OTP-6172 - -TICKETS_3_4_2 = OTP-6148 - -TICKETS_3_4_1 = OTP-6113 - -TICKETS_3_4 = \ - OTP-5769 \ - OTP-5980 \ - OTP-6009 \ - OTP-6025 \ - OTP-6028 \ - OTP-6030 \ - OTP-6048 \ - OTP-6051 \ - OTP-6052 \ - OTP-6055 \ - OTP-6089 \ - OTP-6090 - -TICKETS_3_3_5 = OTP-6108 - -TICKETS_3_3_4 = OTP-6076 - -TICKETS_3_3_3 = OTP-6046 - -TICKETS_3_3_2 = OTP-6017 OTP-6022 - -TICKETS_3_3_1 = OTP-5993 - -TICKETS_3_3 = OTP-5965 OTP-5973 - -TICKETS_3_2_7 = OTP-5948 OTP-5952 OTP-5953 - -TICKETS_3_2_6 = OTP-5918 OTP-5919 OTP-5920 - -TICKETS_3_2_5 = OTP-5887 - -TICKETS_3_2_4 = OTP-5867 OTP-5879 OTP-5880 OTP-5881 OTP-5882 OTP-5885 OTP-5886 - -TICKETS_3_2_3 = OTP-5826 OTP-5830 OTP-5833 OTP-5836 OTP-5839 - -TICKETS_3_2_2 = OTP-5799 OTP-5803 OTP-5804 OTP-5805 OTP-5816 - -TICKETS_3_2_1 = OTP-5725 OTP-5793 - -TICKETS_3_2 = OTP-5717 OTP-5750 - -TICKETS_3_1 = OTP-5542 OTP-5597 OTP-5600 OTP-5601 OTP-5619 OTP-5664 - -TICKETS_3_0_1 = \ - OTP-5401 \ - OTP-5446 \ - OTP-5447 - diff --git a/lib/mnesia/vsn.mk b/lib/mnesia/vsn.mk index 2780b737b6..ab2bb73c33 100644 --- a/lib/mnesia/vsn.mk +++ b/lib/mnesia/vsn.mk @@ -1,17 +1 @@ - MNESIA_VSN = 4.4.14 - -TICKETS = OTP-8519 -#TICKETS_4.4.13 = OTP-8402 OTP-8406 -#TICKETS_4.4.12 = OTP-8250 -#TICKETS_4.4.11 = OTP-8074 -#TICKETS_4.4.10 = OTP-7928 OTP-7968 OTP-8002 -#TICKETS_4.4.9 = OTP-7911 -#TICKETS_4.4.8 = OTP-7753 OTP-7835 -#TICKETS_4.4.7 = OTP-7524 OTP-7625 -#TICKETS_4.4.6 = OTP-7585 -#TICKETS_4.4.5 = OTP-7466 -#TICKETS_4.4.4 = OTP-7419 -#TICKETS_4.4.3 = OTP-7340 OTP-7378 OTP-7383 -#TICKETS_4.4.2 = OTP-7205 OTP-7208 -#TICKETS_4.4.1 = OTP-7170 diff --git a/lib/odbc/doc/src/databases.xml b/lib/odbc/doc/src/databases.xml index 9776736909..a6ba0e5245 100644 --- a/lib/odbc/doc/src/databases.xml +++ b/lib/odbc/doc/src/databases.xml @@ -258,7 +258,7 @@ when p >= 16 </cell> that contains more than one SQL query. For example, the following SQLServer-specific statement creates a procedure that returns a result set containing information about employees - that work at the department and and a result set listing the + that work at the department and a result set listing the customers of that department. </p> <code type="none"> CREATE PROCEDURE DepartmentInfo (@DepartmentID INT) AS diff --git a/lib/odbc/vsn.mk b/lib/odbc/vsn.mk index d813466437..fac3f06d4b 100644 --- a/lib/odbc/vsn.mk +++ b/lib/odbc/vsn.mk @@ -1,23 +1 @@ ODBC_VSN = 2.10.8 - -TICKETS = OTP-7452 OTP-8511 - -TICKETS_2.10.6 = \ - OTP-8250 \ - OTP-8291 - -TICKETS_2.10.5 = \ - OTP-7978 - -TICKETS_2.10.4 = \ - OTP-7720 \ - OTP-7721 - -TICKETS_2.10.3 = \ - OTP-7418 -TICKETS_2.10.2 = \ - OTP-7297 -TICKETS_2.10.1 = \ - OTP-7019 \ - OTP-7294 \ - OTP-7307 diff --git a/lib/orber/vsn.mk b/lib/orber/vsn.mk index ec349ee189..cf80e27a61 100644 --- a/lib/orber/vsn.mk +++ b/lib/orber/vsn.mk @@ -1,21 +1 @@ - ORBER_VSN = 3.6.16 - -TICKETS = OTP-8489 \ - OTP-8543 - -TICKETS_3.6.15 = OTP-8353 \ - OTP-8354 \ - OTP-8374 \ - OTP-8409 \ - OTP-8448 - -TICKETS_3.6.14 = OTP-8201 - -TICKETS_3.6.13 = OTP-7987 - -TICKETS_3.6.12 = OTP-7906 - -TICKETS_3.6.11 = OTP-7837 - -TICKETS_3.6.10 = OTP-7595 diff --git a/lib/parsetools/include/yeccpre.hrl b/lib/parsetools/include/yeccpre.hrl index 33a103d95f..39dea0552d 100644 --- a/lib/parsetools/include/yeccpre.hrl +++ b/lib/parsetools/include/yeccpre.hrl @@ -26,8 +26,8 @@ parse(Tokens) -> yeccpars0(Tokens, {no_func, no_line}, 0, [], []). --spec parse_and_scan({function() | {atom(), atom()}, [_]} | {atom(), atom(), [_]}) -> - yecc_ret(). +-spec parse_and_scan({function() | {atom(), atom()}, [_]} + | {atom(), atom(), [_]}) -> yecc_ret(). parse_and_scan({F, A}) -> % Fun or {M, F} yeccpars0([], {{F, A}, no_line}, 0, [], []); parse_and_scan({M, F, A}) -> @@ -44,7 +44,7 @@ format_error(Message) -> %% To be used in grammar files to throw an error message to the parser %% toplevel. Doesn't have to be exported! --compile({nowarn_unused_function,{return_error,2}}). +-compile({nowarn_unused_function, return_error/2}). -spec return_error(integer(), any()) -> no_return(). return_error(Line, Message) -> throw({error, {Line, ?MODULE, Message}}). @@ -57,10 +57,7 @@ yeccpars0(Tokens, Tzr, State, States, Vstack) -> error: Error -> Stacktrace = erlang:get_stacktrace(), try yecc_error_type(Error, Stacktrace) of - {syntax_error, Token} -> - yeccerror(Token); - {missing_in_goto_table=Tag, Symbol, State} -> - Desc = {Symbol, State, Tag}, + Desc -> erlang:raise(error, {yecc_bug, ?CODE_VERSION, Desc}, Stacktrace) catch _:_ -> erlang:raise(error, Error, Stacktrace) @@ -70,13 +67,15 @@ yeccpars0(Tokens, Tzr, State, States, Vstack) -> Error end. -yecc_error_type(function_clause, [{?MODULE,F,[State,_,_,_,Token,_,_]} | _]) -> +yecc_error_type(function_clause, [{?MODULE,F,ArityOrArgs} | _]) -> case atom_to_list(F) of - "yeccpars2" ++ _ -> - {syntax_error, Token}; "yeccgoto_" ++ SymbolL -> {ok,[{atom,_,Symbol}],_} = erl_scan:string(SymbolL), - {missing_in_goto_table, Symbol, State} + State = case ArityOrArgs of + [S,_,_,_,_,_,_] -> S; + _ -> state_is_unknown + end, + {Symbol, State, missing_in_goto_table} end. yeccpars1([Token | Tokens], Tzr, State, States, Vstack) -> @@ -141,11 +140,13 @@ yecctoken_end_location(Token) -> yecctoken_location(Token) end. +-compile({nowarn_unused_function, yeccerror/1}). yeccerror(Token) -> Text = yecctoken_to_string(Token), Location = yecctoken_location(Token), {error, {Location, ?MODULE, ["syntax error before: ", Text]}}. +-compile({nowarn_unused_function, yecctoken_to_string/1}). yecctoken_to_string(Token) -> case catch erl_scan:token_info(Token, text) of {text, Txt} -> Txt; @@ -158,6 +159,7 @@ yecctoken_location(Token) -> _ -> element(2, Token) end. +-compile({nowarn_unused_function, yecctoken2string/1}). yecctoken2string({atom, _, A}) -> io_lib:write(A); yecctoken2string({integer,_,N}) -> io_lib:write(N); yecctoken2string({float,_,F}) -> io_lib:write(F); diff --git a/lib/parsetools/src/yecc.erl b/lib/parsetools/src/yecc.erl index c4a47d008f..4119e2631b 100644 --- a/lib/parsetools/src/yecc.erl +++ b/lib/parsetools/src/yecc.erl @@ -1875,8 +1875,12 @@ format_conflict({Symbol, N, Reduce, Confl}) -> %% - "__Stack" has been substituted for "Stack"; %% - several states can share yeccpars2_S_cont(), which reduces code size; %% - instead if calling lists:nthtail() matching code is emitted. +%% +%% "1.4", parsetools-2.0.4: +%% - yeccerror() is called when a syntax error is found (as in version 1.1). +%% - the include file yeccpre.hrl has been changed. --define(CODE_VERSION, "1.3"). +-define(CODE_VERSION, "1.4"). -define(YECC_BUG(M, A), iolist_to_binary([" erlang:error({yecc_bug,\"",?CODE_VERSION,"\",", io_lib:fwrite(M, A), "}).\n\n"])). @@ -2106,13 +2110,11 @@ output_call_to_includefile(NewState, St) -> fwrite(St, <<" yeccpars1(S, ~w, Ss, Stack, T, Ts, Tzr)">>, [NewState]). -output_state_actions_fini(State, #yecc{includefile_version = {1,1}}=St0) -> - %% Backward compatibility. +output_state_actions_fini(State, St0) -> + %% Backward compatible. St10 = delim(St0, false), St = fwrite(St10, <<"yeccpars2_~w(_, _, _, _, T, _, _) ->\n">>, [State]), - fwrite(St, <<" yeccerror(T).\n\n">>, []); -output_state_actions_fini(_State, St) -> - fwrite(St, <<".\n\n">>, []). + fwrite(St, <<" yeccerror(T).\n\n">>, []). output_reduce(St0, State, Terminal0, #reduce{rule_nmbr = RuleNmbr, @@ -2416,7 +2418,7 @@ include1(Line, Inport, Outport, Nmbr_of_lines) -> include1(io:get_line(Inport, ''), Inport, Outport, Nmbr_of_lines + Incr). includefile_version([]) -> - {1,2}; + {1,4}; includefile_version(Includefile) -> case epp:open(Includefile, []) of {ok, Epp} -> @@ -2432,7 +2434,7 @@ includefile_version(Includefile) -> parse_file(Epp) -> case epp:parse_erl_form(Epp) of {ok, {function,_Line,yeccpars1,7,_Clauses}} -> - {1,2}; + {1,4}; {eof,_Line} -> {1,1}; _Form -> diff --git a/lib/parsetools/src/yeccparser.erl b/lib/parsetools/src/yeccparser.erl index 415547b4ce..63127802ee 100644 --- a/lib/parsetools/src/yeccparser.erl +++ b/lib/parsetools/src/yeccparser.erl @@ -38,16 +38,16 @@ line_of(Token) -> -type yecc_ret() :: {'error', _} | {'ok', _}. --spec parse(_) -> yecc_ret(). +-spec parse(Tokens :: list()) -> yecc_ret(). parse(Tokens) -> - yeccpars0(Tokens, false). + yeccpars0(Tokens, {no_func, no_line}, 0, [], []). --spec parse_and_scan({function() | {atom(), atom()}, [_]} | {atom(), atom(), [_]}) -> - yecc_ret(). +-spec parse_and_scan({function() | {atom(), atom()}, [_]} + | {atom(), atom(), [_]}) -> yecc_ret(). parse_and_scan({F, A}) -> % Fun or {M, F} - yeccpars0([], {F, A}); + yeccpars0([], {{F, A}, no_line}, 0, [], []); parse_and_scan({M, F, A}) -> - yeccpars0([], {{M, F}, A}). + yeccpars0([], {{{M, F}, A}, no_line}, 0, [], []). -spec format_error(any()) -> [char() | list()]. format_error(Message) -> @@ -60,54 +60,58 @@ format_error(Message) -> %% To be used in grammar files to throw an error message to the parser %% toplevel. Doesn't have to be exported! --compile({nowarn_unused_function,{return_error,2}}). +-compile({nowarn_unused_function, return_error/2}). -spec return_error(integer(), any()) -> no_return(). return_error(Line, Message) -> throw({error, {Line, ?MODULE, Message}}). --define(CODE_VERSION, "1.3"). +-define(CODE_VERSION, "1.4"). -yeccpars0(Tokens, MFA) -> - try yeccpars1(Tokens, MFA, 0, [], []) +yeccpars0(Tokens, Tzr, State, States, Vstack) -> + try yeccpars1(Tokens, Tzr, State, States, Vstack) catch error: Error -> Stacktrace = erlang:get_stacktrace(), try yecc_error_type(Error, Stacktrace) of - {syntax_error, Token} -> - yeccerror(Token); - {missing_in_goto_table=Tag, Symbol, State} -> - Desc = {Symbol, State, Tag}, + Desc -> erlang:raise(error, {yecc_bug, ?CODE_VERSION, Desc}, - Stacktrace) + Stacktrace) catch _:_ -> erlang:raise(error, Error, Stacktrace) end; - throw: {error, {_Line, ?MODULE, _M}} = Error -> - Error % probably from return_error/2 + %% Probably thrown from return_error/2: + throw: {error, {_Line, ?MODULE, _M}} = Error -> + Error end. -yecc_error_type(function_clause, [{?MODULE,F,[State,_,_,_,Token,_,_]} | _]) -> +yecc_error_type(function_clause, [{?MODULE,F,ArityOrArgs} | _]) -> case atom_to_list(F) of - "yeccpars2" ++ _ -> - {syntax_error, Token}; "yeccgoto_" ++ SymbolL -> {ok,[{atom,_,Symbol}],_} = erl_scan:string(SymbolL), - {missing_in_goto_table, Symbol, State} + State = case ArityOrArgs of + [S,_,_,_,_,_,_] -> S; + _ -> state_is_unknown + end, + {Symbol, State, missing_in_goto_table} end. -yeccpars1([Token | Tokens], Tokenizer, State, States, Vstack) -> - yeccpars2(State, element(1, Token), States, Vstack, Token, Tokens, - Tokenizer); -yeccpars1([], {F, A}, State, States, Vstack) -> +yeccpars1([Token | Tokens], Tzr, State, States, Vstack) -> + yeccpars2(State, element(1, Token), States, Vstack, Token, Tokens, Tzr); +yeccpars1([], {{F, A},_Line}, State, States, Vstack) -> case apply(F, A) of - {ok, Tokens, _Endline} -> - yeccpars1(Tokens, {F, A}, State, States, Vstack); - {eof, _Endline} -> - yeccpars1([], false, State, States, Vstack); + {ok, Tokens, Endline} -> + yeccpars1(Tokens, {{F, A}, Endline}, State, States, Vstack); + {eof, Endline} -> + yeccpars1([], {no_func, Endline}, State, States, Vstack); {error, Descriptor, _Endline} -> {error, Descriptor} end; -yeccpars1([], false, State, States, Vstack) -> - yeccpars2(State, '$end', States, Vstack, {'$end', 999999}, [], false). +yeccpars1([], {no_func, no_line}, State, States, Vstack) -> + Line = 999999, + yeccpars2(State, '$end', States, Vstack, yecc_end(Line), [], + {no_func, Line}); +yeccpars1([], {no_func, Endline}, State, States, Vstack) -> + yeccpars2(State, '$end', States, Vstack, yecc_end(Endline), [], + {no_func, Endline}). %% yeccpars1/7 is called from generated code. %% @@ -115,48 +119,73 @@ yeccpars1([], false, State, States, Vstack) -> %% yeccpars1/7 can be found by parsing the file without following %% include directives. yecc will otherwise assume that an old %% yeccpre.hrl is included (one which defines yeccpars1/5). -yeccpars1(State1, State, States, Vstack, Stack1, [Token | Tokens], - Tokenizer) -> +yeccpars1(State1, State, States, Vstack, Token0, [Token | Tokens], Tzr) -> yeccpars2(State, element(1, Token), [State1 | States], - [Stack1 | Vstack], Token, Tokens, Tokenizer); -yeccpars1(State1, State, States, Vstack, Stack1, [], {F, A}) -> - case apply(F, A) of - {ok, Tokens, _Endline} -> - yeccpars1(State1, State, States, Vstack, Stack1, Tokens, {F, A}); - {eof, _Endline} -> - yeccpars1(State1, State, States, Vstack, Stack1, [], false); - {error, Descriptor, _Endline} -> - {error, Descriptor} - end; -yeccpars1(State1, State, States, Vstack, Stack1, [], false) -> - yeccpars2(State, '$end', [State1 | States], [Stack1 | Vstack], - {'$end', 999999}, [], false). + [Token0 | Vstack], Token, Tokens, Tzr); +yeccpars1(State1, State, States, Vstack, Token0, [], {{_F,_A}, _Line}=Tzr) -> + yeccpars1([], Tzr, State, [State1 | States], [Token0 | Vstack]); +yeccpars1(State1, State, States, Vstack, Token0, [], {no_func, no_line}) -> + Line = yecctoken_end_location(Token0), + yeccpars2(State, '$end', [State1 | States], [Token0 | Vstack], + yecc_end(Line), [], {no_func, Line}); +yeccpars1(State1, State, States, Vstack, Token0, [], {no_func, Line}) -> + yeccpars2(State, '$end', [State1 | States], [Token0 | Vstack], + yecc_end(Line), [], {no_func, Line}). + +%% For internal use only. +yecc_end({Line,_Column}) -> + {'$end', Line}; +yecc_end(Line) -> + {'$end', Line}. + +yecctoken_end_location(Token) -> + try + {text, Str} = erl_scan:token_info(Token, text), + {line, Line} = erl_scan:token_info(Token, line), + Parts = re:split(Str, "\n"), + Dline = length(Parts) - 1, + Yline = Line + Dline, + case erl_scan:token_info(Token, column) of + {column, Column} -> + Col = byte_size(lists:last(Parts)), + {Yline, Col + if Dline =:= 0 -> Column; true -> 1 end}; + undefined -> + Yline + end + catch _:_ -> + yecctoken_location(Token) + end. -% For internal use only. yeccerror(Token) -> - Text = case catch erl_scan:token_info(Token, text) of - {text, Txt} -> Txt; - _ -> yecctoken2string(Token) - end, - Location = case catch erl_scan:token_info(Token, location) of - {location, Loc} -> Loc; - _ -> element(2, Token) - end, + Text = yecctoken_to_string(Token), + Location = yecctoken_location(Token), {error, {Location, ?MODULE, ["syntax error before: ", Text]}}. +yecctoken_to_string(Token) -> + case catch erl_scan:token_info(Token, text) of + {text, Txt} -> Txt; + _ -> yecctoken2string(Token) + end. + +yecctoken_location(Token) -> + case catch erl_scan:token_info(Token, location) of + {location, Loc} -> Loc; + _ -> element(2, Token) + end. + yecctoken2string({atom, _, A}) -> io_lib:write(A); yecctoken2string({integer,_,N}) -> io_lib:write(N); yecctoken2string({float,_,F}) -> io_lib:write(F); yecctoken2string({char,_,C}) -> io_lib:write_char(C); yecctoken2string({var,_,V}) -> io_lib:format("~s", [V]); yecctoken2string({string,_,S}) -> io_lib:write_unicode_string(S); -yecctoken2string({reserved_symbol, _, A}) -> io_lib:format("~w", [A]); -yecctoken2string({_Cat, _, Val}) -> io_lib:format("~w", [Val]); +yecctoken2string({reserved_symbol, _, A}) -> io_lib:write(A); +yecctoken2string({_Cat, _, Val}) -> io_lib:write(Val); yecctoken2string({dot, _}) -> "'.'"; yecctoken2string({'$end', _}) -> []; yecctoken2string({Other, _}) when is_atom(Other) -> - io_lib:format("~w", [Other]); + io_lib:write(Other); yecctoken2string(Other) -> io_lib:write(Other). @@ -164,7 +193,7 @@ yecctoken2string(Other) -> --file("yeccparser.erl", 168). +-file("yeccparser.erl", 196). yeccpars2(0=S, Cat, Ss, Stack, T, Ts, Tzr) -> yeccpars2_0(S, Cat, Ss, Stack, T, Ts, Tzr); @@ -248,7 +277,9 @@ yeccpars2_0(S, integer, Ss, Stack, T, Ts, Tzr) -> yeccpars2_0(S, reserved_word, Ss, Stack, T, Ts, Tzr) -> yeccpars1(S, 8, Ss, Stack, T, Ts, Tzr); yeccpars2_0(S, var, Ss, Stack, T, Ts, Tzr) -> - yeccpars1(S, 9, Ss, Stack, T, Ts, Tzr). + yeccpars1(S, 9, Ss, Stack, T, Ts, Tzr); +yeccpars2_0(_, _, _, _, T, _, _) -> + yeccerror(T). yeccpars2_1(S, atom, Ss, Stack, T, Ts, Tzr) -> yeccpars1(S, 6, Ss, Stack, T, Ts, Tzr); @@ -267,10 +298,14 @@ yeccpars2_2(_S, Cat, Ss, Stack, T, Ts, Tzr) -> yeccgoto_grammar(hd(Ss), Cat, Ss, Stack, T, Ts, Tzr). yeccpars2_3(S, '->', Ss, Stack, T, Ts, Tzr) -> - yeccpars1(S, 10, Ss, Stack, T, Ts, Tzr). + yeccpars1(S, 10, Ss, Stack, T, Ts, Tzr); +yeccpars2_3(_, _, _, _, T, _, _) -> + yeccerror(T). -yeccpars2_4(_S, '$end', _Ss, Stack, _T, _Ts, _Tzr) -> - {ok, hd(Stack)}. +yeccpars2_4(_S, '$end', _Ss, Stack, _T, _Ts, _Tzr) -> + {ok, hd(Stack)}; +yeccpars2_4(_, _, _, _, T, _, _) -> + yeccerror(T). yeccpars2_5(_S, Cat, Ss, Stack, T, Ts, Tzr) -> yeccgoto_grammar(hd(Ss), Cat, Ss, Stack, T, Ts, Tzr). @@ -317,7 +352,9 @@ yeccpars2_13(_S, Cat, Ss, Stack, T, Ts, Tzr) -> yeccgoto_symbols(hd(Nss), Cat, Nss, NewStack, T, Ts, Tzr). yeccpars2_14(S, dot, Ss, Stack, T, Ts, Tzr) -> - yeccpars1(S, 29, Ss, Stack, T, Ts, Tzr). + yeccpars1(S, 29, Ss, Stack, T, Ts, Tzr); +yeccpars2_14(_, _, _, _, T, _, _) -> + yeccerror(T). yeccpars2_15(S, '->', Ss, Stack, T, Ts, Tzr) -> yeccpars1(S, 18, Ss, Stack, T, Ts, Tzr); @@ -338,7 +375,9 @@ yeccpars2_15(S, reserved_word, Ss, Stack, T, Ts, Tzr) -> yeccpars2_15(S, string, Ss, Stack, T, Ts, Tzr) -> yeccpars1(S, 26, Ss, Stack, T, Ts, Tzr); yeccpars2_15(S, var, Ss, Stack, T, Ts, Tzr) -> - yeccpars1(S, 27, Ss, Stack, T, Ts, Tzr). + yeccpars1(S, 27, Ss, Stack, T, Ts, Tzr); +yeccpars2_15(_, _, _, _, T, _, _) -> + yeccerror(T). yeccpars2_16(_S, Cat, Ss, Stack, T, Ts, Tzr) -> [_|Nss] = Ss, @@ -414,10 +453,14 @@ yeccpars2_29(_S, Cat, Ss, Stack, T, Ts, Tzr) -> yeccgoto_rule(hd(Nss), Cat, Nss, NewStack, T, Ts, Tzr). yeccpars2_30(S, dot, Ss, Stack, T, Ts, Tzr) -> - yeccpars1(S, 35, Ss, Stack, T, Ts, Tzr). + yeccpars1(S, 35, Ss, Stack, T, Ts, Tzr); +yeccpars2_30(_, _, _, _, T, _, _) -> + yeccerror(T). yeccpars2_31(S, dot, Ss, Stack, T, Ts, Tzr) -> - yeccpars1(S, 34, Ss, Stack, T, Ts, Tzr). + yeccpars1(S, 34, Ss, Stack, T, Ts, Tzr); +yeccpars2_31(_, _, _, _, T, _, _) -> + yeccerror(T). yeccpars2_32(S, string, Ss, Stack, T, Ts, Tzr) -> yeccpars1(S, 32, Ss, Stack, T, Ts, Tzr); @@ -486,7 +529,7 @@ yeccgoto_tokens(15=_S, Cat, Ss, Stack, T, Ts, Tzr) -> yeccgoto_tokens(17=_S, Cat, Ss, Stack, T, Ts, Tzr) -> yeccpars2_28(_S, Cat, Ss, Stack, T, Ts, Tzr). --compile({inline,{yeccpars2_6_,1}}). +-compile({inline,yeccpars2_6_/1}). -file("yeccgramm.yrl", 44). yeccpars2_6_(__Stack0) -> [__1 | __Stack] = __Stack0, @@ -494,7 +537,7 @@ yeccpars2_6_(__Stack0) -> symbol ( __1 ) end | __Stack]. --compile({inline,{yeccpars2_7_,1}}). +-compile({inline,yeccpars2_7_/1}). -file("yeccgramm.yrl", 45). yeccpars2_7_(__Stack0) -> [__1 | __Stack] = __Stack0, @@ -502,7 +545,7 @@ yeccpars2_7_(__Stack0) -> symbol ( __1 ) end | __Stack]. --compile({inline,{yeccpars2_8_,1}}). +-compile({inline,yeccpars2_8_/1}). -file("yeccgramm.yrl", 46). yeccpars2_8_(__Stack0) -> [__1 | __Stack] = __Stack0, @@ -510,7 +553,7 @@ yeccpars2_8_(__Stack0) -> symbol ( __1 ) end | __Stack]. --compile({inline,{yeccpars2_9_,1}}). +-compile({inline,yeccpars2_9_/1}). -file("yeccgramm.yrl", 43). yeccpars2_9_(__Stack0) -> [__1 | __Stack] = __Stack0, @@ -518,14 +561,14 @@ yeccpars2_9_(__Stack0) -> symbol ( __1 ) end | __Stack]. --compile({inline,{yeccpars2_11_,1}}). +-compile({inline,yeccpars2_11_/1}). -file("yeccgramm.yrl", 40). yeccpars2_11_(__Stack0) -> [begin { erlang_code , [ { atom , 0 , '$undefined' } ] } end | __Stack0]. --compile({inline,{yeccpars2_12_,1}}). +-compile({inline,yeccpars2_12_/1}). -file("yeccgramm.yrl", 35). yeccpars2_12_(__Stack0) -> [__1 | __Stack] = __Stack0, @@ -533,7 +576,7 @@ yeccpars2_12_(__Stack0) -> [ __1 ] end | __Stack]. --compile({inline,{yeccpars2_13_,1}}). +-compile({inline,yeccpars2_13_/1}). -file("yeccgramm.yrl", 36). yeccpars2_13_(__Stack0) -> [__2,__1 | __Stack] = __Stack0, @@ -541,7 +584,7 @@ yeccpars2_13_(__Stack0) -> [ __1 | __2 ] end | __Stack]. --compile({inline,{yeccpars2_16_,1}}). +-compile({inline,yeccpars2_16_/1}). -file("yeccgramm.yrl", 39). yeccpars2_16_(__Stack0) -> [__2,__1 | __Stack] = __Stack0, @@ -549,7 +592,7 @@ yeccpars2_16_(__Stack0) -> { erlang_code , __2 } end | __Stack]. --compile({inline,{yeccpars2_17_,1}}). +-compile({inline,yeccpars2_17_/1}). -file("yeccgramm.yrl", 41). yeccpars2_17_(__Stack0) -> [__1 | __Stack] = __Stack0, @@ -557,7 +600,7 @@ yeccpars2_17_(__Stack0) -> [ __1 ] end | __Stack]. --compile({inline,{yeccpars2_18_,1}}). +-compile({inline,yeccpars2_18_/1}). -file("yeccgramm.yrl", 55). yeccpars2_18_(__Stack0) -> [__1 | __Stack] = __Stack0, @@ -565,7 +608,7 @@ yeccpars2_18_(__Stack0) -> { '->' , line_of ( __1 ) } end | __Stack]. --compile({inline,{yeccpars2_19_,1}}). +-compile({inline,yeccpars2_19_/1}). -file("yeccgramm.yrl", 56). yeccpars2_19_(__Stack0) -> [__1 | __Stack] = __Stack0, @@ -573,7 +616,7 @@ yeccpars2_19_(__Stack0) -> { ':' , line_of ( __1 ) } end | __Stack]. --compile({inline,{yeccpars2_24_,1}}). +-compile({inline,yeccpars2_24_/1}). -file("yeccgramm.yrl", 53). yeccpars2_24_(__Stack0) -> [__1 | __Stack] = __Stack0, @@ -581,7 +624,7 @@ yeccpars2_24_(__Stack0) -> { value_of ( __1 ) , line_of ( __1 ) } end | __Stack]. --compile({inline,{yeccpars2_25_,1}}). +-compile({inline,yeccpars2_25_/1}). -file("yeccgramm.yrl", 54). yeccpars2_25_(__Stack0) -> [__1 | __Stack] = __Stack0, @@ -589,7 +632,7 @@ yeccpars2_25_(__Stack0) -> { value_of ( __1 ) , line_of ( __1 ) } end | __Stack]. --compile({inline,{yeccpars2_28_,1}}). +-compile({inline,yeccpars2_28_/1}). -file("yeccgramm.yrl", 42). yeccpars2_28_(__Stack0) -> [__2,__1 | __Stack] = __Stack0, @@ -597,7 +640,7 @@ yeccpars2_28_(__Stack0) -> [ __1 | __2 ] end | __Stack]. --compile({inline,{yeccpars2_29_,1}}). +-compile({inline,yeccpars2_29_/1}). -file("yeccgramm.yrl", 33). yeccpars2_29_(__Stack0) -> [__5,__4,__3,__2,__1 | __Stack] = __Stack0, @@ -605,7 +648,7 @@ yeccpars2_29_(__Stack0) -> { rule , [ __1 | __3 ] , __4 } end | __Stack]. --compile({inline,{yeccpars2_32_,1}}). +-compile({inline,yeccpars2_32_/1}). -file("yeccgramm.yrl", 37). yeccpars2_32_(__Stack0) -> [__1 | __Stack] = __Stack0, @@ -613,7 +656,7 @@ yeccpars2_32_(__Stack0) -> [ __1 ] end | __Stack]. --compile({inline,{yeccpars2_33_,1}}). +-compile({inline,yeccpars2_33_/1}). -file("yeccgramm.yrl", 38). yeccpars2_33_(__Stack0) -> [__2,__1 | __Stack] = __Stack0, @@ -621,7 +664,7 @@ yeccpars2_33_(__Stack0) -> [ __1 | __2 ] end | __Stack]. --compile({inline,{yeccpars2_34_,1}}). +-compile({inline,yeccpars2_34_/1}). -file("yeccgramm.yrl", 32). yeccpars2_34_(__Stack0) -> [__3,__2,__1 | __Stack] = __Stack0, @@ -629,7 +672,7 @@ yeccpars2_34_(__Stack0) -> { __1 , __2 } end | __Stack]. --compile({inline,{yeccpars2_35_,1}}). +-compile({inline,yeccpars2_35_/1}). -file("yeccgramm.yrl", 31). yeccpars2_35_(__Stack0) -> [__3,__2,__1 | __Stack] = __Stack0, diff --git a/lib/parsetools/test/yecc_SUITE.erl b/lib/parsetools/test/yecc_SUITE.erl index 61e2456323..93949a074a 100644 --- a/lib/parsetools/test/yecc_SUITE.erl +++ b/lib/parsetools/test/yecc_SUITE.erl @@ -298,8 +298,8 @@ syntax(Config) when is_list(Config) -> {_,[{L1,_,{undefined_function,{yeccpars2_2_,1}}}, {L2,_,{bad_inline,{yeccpars2_2_,1}}}]}], []} = compile:file(Parserfile1, [basic_validation,return]), - ?line L1 = 24 + SzYeccPre, - ?line L2 = 31 + SzYeccPre + ?line L1 = 28 + SzYeccPre, + ?line L2 = 35 + SzYeccPre end(), %% Bad macro in action. OTP-7224. @@ -316,8 +316,8 @@ syntax(Config) when is_list(Config) -> {_,[{L1,_,{undefined_function,{yeccpars2_2_,1}}}, {L2,_,{bad_inline,{yeccpars2_2_,1}}}]}], []} = compile:file(Parserfile1, [basic_validation,return]), - ?line L1 = 24 + SzYeccPre, - ?line L2 = 31 + SzYeccPre + ?line L1 = 28 + SzYeccPre, + ?line L2 = 35 + SzYeccPre end(), %% Check line numbers. OTP-7224. @@ -1584,8 +1584,8 @@ otp_7292(Config) when is_list(Config) -> {L2,_,{bad_inline,{yeccpars2_2_,1}}}]}], [{_,[{16,_,{unused_function,{foo,0}}}]}]} = compile:file(Parserfile1, [basic_validation, return]), - ?line L1 = 34 + SzYeccPre, - ?line L2 = 41 + SzYeccPre + ?line L1 = 38 + SzYeccPre, + ?line L2 = 45 + SzYeccPre end(), YeccPre = filename:join(Dir, "yeccpre.hrl"), @@ -1602,8 +1602,8 @@ otp_7292(Config) when is_list(Config) -> {L2,_,{bad_inline,{yeccpars2_2_,1}}}]}], [{_,[{16,_,{unused_function,{foo,0}}}]}]} = compile:file(Parserfile1, [basic_validation, return]), - ?line L1 = 33 + SzYeccPre, - ?line L2 = 40 + SzYeccPre + ?line L1 = 37 + SzYeccPre, + ?line L2 = 44 + SzYeccPre end(), file:delete(YeccPre), diff --git a/lib/parsetools/vsn.mk b/lib/parsetools/vsn.mk index f3e2dc0fb4..46915baed6 100644 --- a/lib/parsetools/vsn.mk +++ b/lib/parsetools/vsn.mk @@ -1 +1 @@ -PARSETOOLS_VSN = 2.0.3 +PARSETOOLS_VSN = 2.0.4 diff --git a/lib/public_key/doc/src/cert_records.xml b/lib/public_key/doc/src/cert_records.xml index 8cfe57f670..0d6113acef 100644 --- a/lib/public_key/doc/src/cert_records.xml +++ b/lib/public_key/doc/src/cert_records.xml @@ -1,4 +1,4 @@ -<?xml version="1.0" encoding="latin1" ?> +<?xml version="1.0" encoding="iso-8859-1" ?> <!DOCTYPE chapter SYSTEM "chapter.dtd"> <chapter> @@ -37,7 +37,7 @@ <p>This chapter briefly describes erlang records derived from asn1 specifications used to handle X509 certificates. The intent is to describe the data types and not to specify the meaning of each - component for this we refer you to RFC 3280. + component for this we refer you to RFC 5280. </p> <p>Use the following include directive to get access to the @@ -45,11 +45,7 @@ <code> -include_lib("public_key/include/public_key.hrl"). </code> - <p>The used specification is available in <c>OTP-PKIX.asn1</c>, - which is an amelioration of - the <c>PKIX1Explicit88.asn1</c>, <c>PKIX1Implicit88.asn1</c> - and <c>PKIX1Algorithms88.asn1</c> modules. - You find all these modules in the <c>asn1</c> subdirectory + <p>The used asn1 specifications are available <c>asn1</c> subdirectory of the application <c>public_key</c>. </p> @@ -62,6 +58,9 @@ marker="public_key">public key reference manual </seealso> or follows here.</p> + <p><c>oid() - a tuple of integers + as generated by the asn1 compiler.</c></p> + <p><c>time() = uct_time() | general_time()</c></p> <p><c>uct_time() = {utcTime, "YYMMDDHHMMSSZ"} </c></p> @@ -119,9 +118,31 @@ algorithm, % oid() parameters % asn1_der_encoded() }. +</code> + +<code> +#'OTPCertificate'{ + tbsCertificate, % #'OTPTBSCertificate'{} + signatureAlgorithm, % #'SignatureAlgorithm' + signature % {0, binary()} - asn1 compact bitstring + }. + +#'OTPTBSCertificate'{ + version, % v1 | v2 | v3 + serialNumber, % integer() + signature, % #'SignatureAlgorithm' + issuer, % {rdnSequence, [#AttributeTypeAndValue'{}]} + validity, % #'Validity'{} + subject, % {rdnSequence, [#AttributeTypeAndValue'{}]} + subjectPublicKeyInfo, % #'SubjectPublicKeyInfo'{} + issuerUniqueID, % binary() | asn1_novalue + subjectUniqueID, % binary() | asn1_novalue + extensions % [#'Extension'{}] + }. + #'SignatureAlgorithm'{ algorithm, % id_signature_algorithm() - parameters % public_key_params() + parameters % asn1_novalue | #'Dss-Parms'{} }. </code> diff --git a/lib/public_key/doc/src/public_key.xml b/lib/public_key/doc/src/public_key.xml index dc9a96906f..c72719fac4 100644 --- a/lib/public_key/doc/src/public_key.xml +++ b/lib/public_key/doc/src/public_key.xml @@ -1,4 +1,4 @@ -<?xml version="1.0" encoding="latin1" ?> +<?xml version="1.0" encoding="iso-8859-1" ?> <!DOCTYPE erlref SYSTEM "erlref.dtd"> <erlref> @@ -34,11 +34,7 @@ <modulesummary> API module for public key infrastructure.</modulesummary> <description> <p>This module provides functions to handle public key infrastructure - from RFC 3280 - X.509 certificates (will later be upgraded to RFC 5280) - and some parts of the PKCS-standard. - Currently this application is mainly used by the new - ssl implementation. The API is yet under construction - and only a few of the functions are currently documented and thereby supported. + from RFC 5280 - X.509 certificates and some parts of the PKCS-standard. </p> </description> @@ -62,37 +58,37 @@ <p><c>boolean() = true | false</c></p> - <p><c>string = [bytes()]</c></p> - - <p><c>asn1_der_encoded() = binary() | [bytes()]</c></p> + <p><c>string = [bytes()]</c></p> + + <p><c>der_encoded() = binary() </c></p> - <p><c>der_bin() = binary() </c></p> + <p><c>decrypt_der() = binary() </c></p> - <p><c>oid() - a tuple of integers - as generated by the asn1 compiler.</c></p> - - <p><c>public_key() = rsa_public_key() | dsa_public_key()</c></p> + <p><c>pki_asn1_type() = 'Certificate' | 'RSAPrivateKey'| + 'DSAPrivateKey' | 'DHParameter'</c></p> + <p><c>pem_entry () = {pki_asn1_type(), der_encoded() | decrypt_der(), not_encrypted | + {"DES-CBC" | "DES-EDE3-CBC", crypto:rand_bytes(8)}}.</c></p> + <p><c>rsa_public_key() = #'RSAPublicKey'{}</c></p> <p><c>rsa_private_key() = #'RSAPrivateKey'{} </c></p> - <p><c>dsa_public_key() = integer() </c></p> - - <p><c>public_key_params() = dsa_key_params() </c></p> - - <p><c>dsa_key_params() = #'Dss-Parms'{} </c></p> - - <p><c>private_key() = rsa_private_key() | dsa_private_key()</c></p> + <p><c>dsa_public_key() = {integer(), #'Dss-Parms'{}} </c></p> <p><c>rsa_private_key() = #'RSAPrivateKey'{} </c></p> <p><c>dsa_private_key() = #'DSAPrivateKey'{}</c></p> + + <p><c> public_crypt_options() = [{rsa_pad, rsa_padding()}]. </c></p> - <p><c>x509_certificate() = "#Certificate{}"</c></p> - - <p><c>x509_tbs_certificate() = #'TBSCertificate'{} </c></p> - + <p><c> rsa_padding() = 'rsa_pkcs1_padding' | 'rsa_pkcs1_oaep_padding' + | 'rsa_no_padding'</c></p> + + <p><c> rsa_digest_type() = 'md5' | 'sha' </c></p> + + <p><c> dss_digest_type() = 'none' | 'sha' </c></p> + <!-- <p><c>policy_tree() = [Root, Children]</c></p> --> <!-- <p><c>Root = #policy_tree_node{}</c></p> --> @@ -121,197 +117,301 @@ <!-- that would satisfy this policy in the certificate x+1. </item> --> <!-- </taglist> --> </section> - -<funcs> - <func> - <name>decode_private_key(KeyInfo) -> </name> - <name>decode_private_key(KeyInfo, Password) -> {ok, PrivateKey} | {error, Reason}</name> - <fsummary> Decodes an asn1 der encoded private key.</fsummary> - <type> - <v> KeyInfo = {KeyType, der_bin(), ChipherInfo} </v> - <d> As returned from pem_to_der/1 for private keys</d> - <v> KeyType = rsa_private_key | dsa_private_key </v> - <v> ChipherInfo = opaque() | no_encryption </v> - <d> ChipherInfo may contain encryption parameters if the private key is password - protected, these are opaque to the user just pass the value returned by pem_to_der/1 - to this function.</d> - <v> Password = string() </v> - <d>Must be specified if CipherInfo =/= no_encryption</d> - <v> PrivateKey = private_key() </v> - <v> Reason = term() </v> - </type> - <desc> - <p>Decodes an asn1 der encoded private key.</p> - </desc> - </func> - + +<funcs> + <func> - <name>pem_to_der(File) -> {ok, [Entry]}</name> - <fsummary>Reads a PEM file and translates it into its asn1 der - encoded parts.</fsummary> + <name>decrypt_private(CipherText, Key [, Options]) -> binary()</name> + <fsummary>Public key decryption.</fsummary> <type> - <v>File = path()</v> - <v>Password = string()</v> - <v>Entry = {entry_type(), der_bin(), CipherInfo}</v> - <v> ChipherInfo = opaque() | no_encryption </v> - <d> ChipherInfo may contain encryption parameters if the private key is password - protected, these will be handled by the function decode_private_key/2. </d> - <v>entry_type() = cert | cert_req | rsa_private_key | dsa_private_key | - dh_params </v> + <v>CipherText = binary()</v> + <v>Key = rsa_private_key()</v> + <v>Options = public_crypt_options()</v> </type> <desc> - <p>Reads a PEM file and translates it into its asn1 der - encoded parts.</p> + <p>Public key decryption using the private key.</p> + </desc> + </func> + + <func> + <name>decrypt_public(CipherText, Key [, Options]) - > binary()</name> + <fsummary></fsummary> + <type> + <v>CipherText = binary()</v> + <v>Key = rsa_public_key()</v> + <v>Options = public_crypt_options()</v> + </type> + <desc> + <p> Public key decryption using the public key.</p> </desc> </func> - - <func> - <name>pkix_decode_cert(Cert, Type) -> {ok, DecodedCert} | {error, Reason}</name> - <fsummary> Decodes an asn1 der encoded pkix certificate. </fsummary> - <type> - <v>Cert = asn1_der_encoded() </v> - <v>Type = plain | otp</v> - <v>DecodeCert = x509_certificate() </v> - <d>When type is specified as otp the asn1 spec OTP-PKIX.asn1 is used to decode known - extensions and enhance the signature field in - #'Certificate'{} and '#TBSCertificate'{}. This is currently used by the new ssl - implementation but not documented and supported for the public_key application.</d> - <v>Reason = term() </v> + + <func> + <name>der_decode(Asn1type, Der) -> term()</name> + <fsummary> Decodes a public key asn1 der encoded entity.</fsummary> + <type> + <v>Asn1Type = atom() -</v> + <d> Asn1 type present in the public_key applications + asn1 specifications.</d> + <v>Der = der_encoded()</v> </type> - <desc> - <p> Decodes an asn1 encoded pkix certificate.</p> + <desc> + <p> Decodes a public key asn1 der encoded entity.</p> </desc> </func> + + <func> + <name>der_encode(Asn1Type, Entity) -> der_encoded()</name> + <fsummary> Encodes a public key entity with asn1 DER encoding.</fsummary> + <type> + <v>Asn1Type = atom()</v> + <d> Asn1 type present in the public_key applications + asn1 specifications.</d> + <v>Entity = term() - The erlang representation of <c> Asn1Type</c></v> + </type> + <desc> + <p> Encodes a public key entity with asn1 DER encoding.</p> + </desc> + </func> + + <func> + <name>pem_decode(PemBin) -> [pem_entry()]</name> + <fsummary>Decode PEM binary data and return + entries as asn1 der encoded entities. </fsummary> + <type> + <v>PemBin = binary()</v> + <d>Example {ok, PemBin} = file:read_file("cert.pem").</d> + </type> + <desc> + <p>Decode PEM binary data and return + entries as asn1 der encoded entities.</p> + </desc> + </func> + + <func> + <name>pem_encode(PemEntries) -> binary()</name> + <fsummary>Creates a PEM binary</fsummary> + <type> + <v> PemEntries = [pem_entry()] </v> + </type> + <desc> + <p>Creates a PEM binary</p> + </desc> + </func> + + <func> + <name>pem_entry_decode(PemEntry [, Password]) -> term()</name> + <fsummary>Decodes a pem entry.</fsummary> + <type> + <v> PemEntry = pem_entry() </v> + <v> Password = string() </v> + </type> + <desc> + <p>Decodes a pem entry. pem_decode/1 returns a list of + pem entries.</p> + </desc> + </func> + + <func> + <name>pem_entry_encode(Asn1Type, Entity [,{CipherInfo, Password}]) -> pem_entry()</name> + <fsummary> Creates a pem entry that can be feed to pem_encode/1.</fsummary> + <type> + <v>Asn1Type = atom()</v> + <v>Entity = term()</v> + <v>CipherInfo = {"DES-CBC" | "DES-EDE3-CBC", crypto:rand_bytes(8)}</v> + <v>Password = string()</v> + </type> + <desc> + <p> Creates a pem entry that can be feed to pem_encode/1.</p> + </desc> + </func> + + <func> + <name>encrypt_private(PlainText, Key) -> binary()</name> + <fsummary> Public key encryption using the private key.</fsummary> + <type> + <v>PlainText = binary()</v> + <v>Key = rsa_private_key()</v> + </type> + <desc> + <p> Public key encryption using the private key.</p> + </desc> + </func> + + <func> + <name>encrypt_public(PlainText, Key) -> binary()</name> + <fsummary> Public key encryption using the public key.</fsummary> + <type> + <v>PlainText = binary()</v> + <v>Key = rsa_public_key()</v> + </type> + <desc> + <p> Public key encryption using the public key.</p> + </desc> + </func> -<!-- <func> --> -<!-- <name> pkix_encode_cert(Cert) -> {ok, EncodedCert} | {error, Reason}</name> --> -<!-- <fsummary>Encodes a certificate record using asn1. </fsummary> --> -<!-- <type> --> -<!-- <v>Cert = x509_certificate() </v> --> -<!-- <v>EncodedCert = asn1_der_encoded() </v> --> -<!-- <v>Reason = term() </v> --> -<!-- </type> --> -<!-- <desc> --> -<!-- <p> Encodes a certificate record using asn1.</p> --> -<!-- </desc> --> -<!-- </func> --> + <func> + <name> pkix_decode_cert(Cert, otp|plain) -> #'Certificate'{} | #'OTPCertificate'{}</name> + <fsummary> Decodes an asn1 der encoded pkix x509 certificate.</fsummary> + <type> + <v>Cert = der_encoded()</v> + </type> + <desc> + <p>Decodes an asn1 der encoded pkix certificate. The otp option + will use the customized asn1 specification OTP-PKIX.asn1 for + decoding and also recursively decode most of the standard + parts.</p> + </desc> + </func> -<!-- <func> --> -<!-- <name>pkix_path_validation(TrustedCert, CertChain, Options) -> {ok, Result} | {error, Reason}</name> --> - -<!-- <fsummary>Performs a basic path validation according to RFC 3280</fsummary> --> -<!-- <type> --> -<!-- <v>TrustedCert = asn1_der_encoded()</v> --> -<!-- <v>CertChain = [asn1_der_encoded()]</v> --> -<!-- <v>Options = [{Option, Value}]</v> --> -<!-- <v>Result = {{algorithm(), public_key(), --> -<!-- public_key_params()}, policy_tree()}</v> --> -<!-- </type> --> + <func> + <name>pkix_encode(Asn1Type, Entity, otp | plain) -> der_encoded()</name> + <fsummary>Der encodes a pkix x509 certificate or part of such a + certificate.</fsummary> + <type> + <v>Asn1Type = atom()</v> + <d>The asn1 type can be 'Certificate', 'OTPCertificate' or a subtype of either .</d> + </type> + <desc> + <p>Der encodes a pkix x509 certificate or part of such a + certificate. This function must be used for encoding certificates or parts of certificates + that are decoded/created on the otp format, whereas for the plain format this + function will directly call der_encode/2. </p> + </desc> + </func> + + <func> + <name>pkix_is_issuer(Cert, IssuerCert) -> boolean()</name> + <fsummary> Checks if <c>IssuerCert</c> issued <c>Cert</c> </fsummary> + <type> + <v>Cert = der_encode() | #'OTPCertificate'{}</v> + <v>IssuerCert = der_encode() | #'OTPCertificate'{}</v> + </type> + <desc> + <p> Checks if <c>IssuerCert</c> issued <c>Cert</c> </p> + </desc> + </func> + + <func> + <name>pkix_is_fixed_dh_cert(Cert) -> boolean()</name> + <fsummary> Checks if a Certificate is a fixed Diffie-Hellman Cert.</fsummary> + <type> + <v>Cert = der_encode() | #'OTPCertificate'{}</v> + </type> + <desc> + <p> Checks if a Certificate is a fixed Diffie-Hellman Cert.</p> + </desc> + </func> + + <func> + <name>pkix_is_self_signed(Cert) -> boolean()</name> + <fsummary> Checks if a Certificate is self signed.</fsummary> + <type> + <v>Cert = der_encode() | #'OTPCertificate'{}</v> + </type> + <desc> + <p> Checks if a Certificate is self signed.</p> + </desc> + </func> + + <func> + <name>pkix_issuer_id(Cert, IssuedBy) -> {ok, IssuerID} | {error, Reason}</name> + <fsummary> Returns the issuer id.</fsummary> + <type> + <v>Cert = der_encode() | #'OTPCertificate'{}</v> + <v>IssuedBy = self | other</v> + <v>IssuerID = {integer(), {rdnSequence, [#'AttributeTypeAndValue'{}]}}</v> + <d>The issuer id consists of the serial number and the issuers name.</d> + <v>Reason = term()</v> + </type> + <desc> + <p> Returns the issuer id.</p> + </desc> + </func> -<!-- <desc> --> -<!-- <p>Available options are: </p> --> -<!-- <taglist> --> -<!-- <tag>{validate_extension_fun, fun()}</tag> --> -<!-- <item> A fun behaving according to the following outline: --> -<!-- <code> --> -<!-- [...] --> -<!-- ValidateExtensionFun = fun(Extensions, UserState) -> --> -<!-- validate_extensions(Extensions, UserState, []) --> -<!-- end, --> -<!-- [...] --> + <func> + <name>pkix_normalize_name(Issuer) -> Normalized</name> + <fsummary>Normalizes a issuer name so that it can be easily + compared to another issuer name. </fsummary> + <type> + <v>Issuer = {rdnSequence,[#'AttributeTypeAndValue'{}]}</v> + <v>Normalized = {rdnSequence, [#'AttributeTypeAndValue'{}]}</v> + </type> + <desc> + <p>Normalizes a issuer name so that it can be easily + compared to another issuer name.</p> + </desc> + </func> + + <!-- <func> --> + <!-- <name>pkix_path_validation()</name> --> + <!-- <fsummary> Performs a basic path validation according to RFC 5280.</fsummary> --> + <!-- <type> --> + <!-- <v></v> --> + <!-- </type> --> + <!-- <desc> --> + <!-- <p> Performs a basic path validation according to RFC 5280.</p> --> + <!-- </desc> --> + <!-- </func> --> -<!-- validate_extensions([], UserState, UnknowExtension) -> --> -<!-- {UserState, UnknowExtension}; --> -<!-- validate_extensions([#'Extension'{} = Ext | Rest], UserState, UnknowExtension) -> --> -<!-- case valid_extension(Ext) of --> -<!-- {true, NewUserState} -> --> -<!-- validate_extensions(Rest, NewUserState, UnknowExtension); --> -<!-- unknown -> --> -<!-- validate_extensions(Rest, UserState, [Ext | UnknowExtension]); --> -<!-- {false, Reason} -> --> -<!-- throw(bad_cert, Reason) --> -<!-- end. --> -<!-- </code> --> - -<!-- </item> --> - -<!-- <tag>{policy_set, [oid()]}</tag> --> -<!-- <item>A set of certificate policy --> -<!-- identifiers naming the policies that are acceptable to the --> -<!-- certificate user. If the user is not concerned about --> -<!-- certificate policy there is no need --> -<!-- to set this option. Defaults to the --> -<!-- special value [?anyPolicy]. --> -<!-- </item> --> - -<!-- <tag>{policy_mapping, boolean()}</tag> --> -<!-- <item>Indicates if policy --> -<!-- mapping, initially, is allowed in the certification path. --> -<!-- Defaults to false. --> -<!-- </item> --> - -<!-- <tag> {explicit_policy, boolean()}</tag> --> -<!-- <item>Indicates if the path, initially, must be --> -<!-- valid for at least one of the certificate policies in the user --> -<!-- specified policy set. --> -<!-- Defaults to false. --> -<!-- </item> --> + + <func> + <name>pkix_sign(#'OTPTBSCertificate'{}, Key) -> der_encode()</name> + <fsummary>Signs certificate.</fsummary> + <type> + <v>Key = rsa_public_key() | dsa_public_key()</v> + </type> + <desc> + <p>Signs a 'OTPTBSCertificate'. Returns the corresponding + der encoded certificate.</p> + </desc> + </func> -<!-- <tag>{inhibit_any_policy, boolean()}</tag> --> -<!-- <item>Indicates whether the anyPolicy OID, initially, should --> -<!-- be processed if it is included in a certificate. --> -<!-- Defaults to false. --> -<!-- </item> --> - -<!-- </taglist> --> - -<!-- <p>Performs a basic path validation according to RFC 3280, --> -<!-- e.i. signature validation, time validation, issuer validation, --> -<!-- alternative subject name validation, CRL validation, policy --> -<!-- validation and checks that no unknown extensions --> -<!-- are marked as critical. The option <c>validate_extension_fun</c> --> -<!-- may be used to validate application specific extensions. If --> -<!-- a validation criteria is found to be invalid the validation process --> -<!-- will immediately be stopped and this functions will return --> -<!-- {error, Reason}. --> -<!-- </p> --> -<!-- </desc> --> -<!-- </func> --> + <func> + <name>pkix_verify(Cert, Key) -> boolean()</name> + <fsummary> Verify pkix x.509 certificate signature.</fsummary> + <type> + <v>Cert = der_encode()</v> + <v>Key = rsa_public_key() | dsa_public_key()</v> + </type> + <desc> + <p> Verify pkix x.509 certificate signature.</p> + </desc> + </func> -<!-- <func> --> -<!-- <name>sign(DigestOrTBSCert, Key) -> </name> --> -<!-- <name>sign(DigestOrTBSCert, Key, KeyParams) -> {ok, SignatureOrDerCert} | {error, Reason}</name> --> -<!-- <fsummary>Signs Digest/Certificate using Key.</fsummary> --> -<!-- <type> --> -<!-- <v>DigestOrTBSCert = binary() | x509_tbs_certificate()</v> --> -<!-- <v>Key = private_key()</v> --> -<!-- <v>SignatureORDerCert = binary() | der_bin() </v> --> -<!-- <v>Reason = term() </v> --> -<!-- </type> --> -<!-- <desc> --> -<!-- <p> Signs Digest/Certificate using Key, in the later --> -<!-- case a der encoded x509_certificate() will be returned. </p> --> -<!-- </desc> --> -<!-- </func> --> + <func> + <name>sign(Msg, DigestType, Key) -> binary()</name> + <fsummary> Create digital signature.</fsummary> + <type> + <v>Msg = binary()</v> + <d>The msg is either the binary "plain text" data to be + signed or in the case that digest type is <c>none</c> + it is the hashed value of "plain text" i.e. the digest.</d> + <v>DigestType = rsa_digest_type() | dsa_digest_type()</v> + <v>Key = rsa_public_key() | dsa_public_key()</v> + </type> + <desc> + <p> Creates a digital signature.</p> + </desc> + </func> -<!-- <func> --> -<!-- <name>verify_signature(Digest, Signature, Key) -> </name> --> -<!-- <name>verify_signature(DerCert, Key, KeyParams) -> </name> --> -<!-- <name>verify_signature(Digest, Signature, Key, Params) -> Verified </name> --> -<!-- <fsummary> Verifies the signature. </fsummary> --> -<!-- <type> --> -<!-- <v>Digest = binary() </v> --> -<!-- <v>DerCert = der_bin() </v> --> -<!-- <v>Signature = binary() </v> --> -<!-- <v>Key = public_key() </v> --> -<!-- <v>Params = key_params()</v> --> -<!-- <v>Verified = boolean()</v> --> -<!-- </type> --> -<!-- <desc> --> -<!-- <p> Verifies the signature Signature. If the key is an rsa-key no --> -<!-- paramters are neeed.</p> --> -<!-- </desc> --> -<!-- </func> --> + <func> + <name>verify(Msg, DigestType, Signature, Key) -> boolean()</name> + <fsummary>Verifies a digital signature.</fsummary> + <type> + <v>Msg = binary()</v> + <d>The msg is either the binary "plain text" data + or in the case that digest type is <c>none</c> + it is the hashed value of "plain text" i.e. the digest.</d> + <v>DigestType = rsa_digest_type() | dsa_digest_type()</v> + <v>Signature = binary()</v> + <v>Key = rsa_public_key() | dsa_public_key()</v> + </type> + <desc> + <p>Verifies a digital signature</p> + </desc> + </func> + </funcs> </erlref> diff --git a/lib/public_key/include/public_key.hrl b/lib/public_key/include/public_key.hrl index fbce10f0eb..6503321042 100644 --- a/lib/public_key/include/public_key.hrl +++ b/lib/public_key/include/public_key.hrl @@ -59,4 +59,13 @@ interim_reasons_mask }). + +-type der_encoded() :: binary(). +-type decrypt_der() :: binary(). +-type pki_asn1_type() :: 'Certificate' | 'RSAPrivateKey' + | 'DSAPrivateKey' | 'DHParameter'. +-type pem_entry() :: {pki_asn1_type(), der_encoded() | decrypt_der(), + not_encrypted | {Cipher :: string(), Salt :: binary()}}. +-type asn1_type() :: atom(). %% see "OTP-PUB-KEY.hrl + -endif. % -ifdef(public_key). diff --git a/lib/public_key/src/Makefile b/lib/public_key/src/Makefile index c30399f33a..51f405361b 100644 --- a/lib/public_key/src/Makefile +++ b/lib/public_key/src/Makefile @@ -42,8 +42,7 @@ MODULES = \ public_key \ pubkey_pem \ pubkey_cert \ - pubkey_cert_records \ - pubkey_crypto + pubkey_cert_records HRL_FILES = $(INCLUDE)/public_key.hrl diff --git a/lib/public_key/src/pubkey_cert.erl b/lib/public_key/src/pubkey_cert.erl index 0651dcec29..64fc8ab5bc 100644 --- a/lib/public_key/src/pubkey_cert.erl +++ b/lib/public_key/src/pubkey_cert.erl @@ -23,14 +23,14 @@ -include("public_key.hrl"). --export([verify_signature/3, - init_validation_state/3, prepare_for_next_cert/2, +-export([init_validation_state/3, prepare_for_next_cert/2, validate_time/3, validate_signature/6, validate_issuer/4, validate_names/6, validate_revoked_status/3, validate_extensions/4, validate_unknown_extensions/3, normalize_general_name/1, digest_type/1, is_self_signed/1, - is_issuer/2, issuer_id/2, is_fixed_dh_cert/1]). + is_issuer/2, issuer_id/2, is_fixed_dh_cert/1, + verify_data/1]). -define(NULL, 0). @@ -38,10 +38,22 @@ %% Internal application API %%==================================================================== -verify_signature(DerCert, Key, KeyParams) -> - {ok, OtpCert} = pubkey_cert_records:decode_cert(DerCert, otp), - verify_signature(OtpCert, DerCert, Key, KeyParams). +%%-------------------------------------------------------------------- +-spec verify_data(der_encoded()) -> {md5 | sha, binary(), binary()}. +%% +%% Description: Extracts data from DerCert needed to call public_key:verify/4. +%%-------------------------------------------------------------------- +verify_data(DerCert) -> + {ok, OtpCert} = pubkey_cert_records:decode_cert(DerCert), + extract_verify_data(OtpCert, DerCert). +%%-------------------------------------------------------------------- +-spec init_validation_state(#'OTPCertificate'{}, integer(), list()) -> + #path_validation_state{}. +%% +%% Description: Creates inital version of path_validation_state for +%% basic path validation of x509 certificates. +%%-------------------------------------------------------------------- init_validation_state(#'OTPCertificate'{} = OtpCert, DefaultPathLen, Options) -> PolicyTree = #policy_tree_node{valid_policy = ?anyPolicy, @@ -66,6 +78,12 @@ init_validation_state(#'OTPCertificate'{} = OtpCert, DefaultPathLen, cert_num = 0}, prepare_for_next_cert(OtpCert, State). +%%-------------------------------------------------------------------- +-spec prepare_for_next_cert(#'OTPCertificate'{}, #path_validation_state{}) -> + #path_validation_state{}. +%% +%% Description: Update path_validation_state for next iteration. +%%-------------------------------------------------------------------- prepare_for_next_cert(OtpCert, ValidationState = #path_validation_state{ working_public_key_algorithm = PrevAlgo, working_public_key_parameters = @@ -92,7 +110,13 @@ prepare_for_next_cert(OtpCert, ValidationState = #path_validation_state{ working_issuer_name = Issuer, cert_num = ValidationState#path_validation_state.cert_num + 1 }. - + + %%-------------------------------------------------------------------- +-spec validate_time(#'OTPCertificate'{}, list(), boolean()) -> list(). +%% +%% Description: Check that the certificate validity period includes the +%% current time. +%%-------------------------------------------------------------------- validate_time(OtpCert, AccErr, Verify) -> TBSCert = OtpCert#'OTPCertificate'.tbsCertificate, {'Validity', NotBeforeStr, NotAfterStr} @@ -107,7 +131,12 @@ validate_time(OtpCert, AccErr, Verify) -> false -> not_valid({bad_cert, cert_expired}, Verify, AccErr) end. - +%%-------------------------------------------------------------------- +-spec validate_issuer(#'OTPCertificate'{}, term(), list(), boolean()) -> list(). +%% +%% Description: Check that the certificate issuer name is the working_issuer_name +%% in path_validation_state. +%%-------------------------------------------------------------------- validate_issuer(OtpCert, Issuer, AccErr, Verify) -> TBSCert = OtpCert#'OTPCertificate'.tbsCertificate, case is_issuer(Issuer, TBSCert#'OTPTBSCertificate'.issuer) of @@ -116,7 +145,15 @@ validate_issuer(OtpCert, Issuer, AccErr, Verify) -> _ -> not_valid({bad_cert, invalid_issuer}, Verify, AccErr) end. - +%%-------------------------------------------------------------------- +-spec validate_signature(#'OTPCertificate'{}, der_encoded(), + term(),term(), list(), boolean()) -> list(). + +%% +%% Description: Check that the signature on the certificate can be verified using +%% working_public_key_algorithm, the working_public_key, and +%% the working_public_key_parameters in path_validation_state. +%%-------------------------------------------------------------------- validate_signature(OtpCert, DerCert, Key, KeyParams, AccErr, Verify) -> @@ -126,7 +163,12 @@ validate_signature(OtpCert, DerCert, Key, KeyParams, false -> not_valid({bad_cert, invalid_signature}, Verify, AccErr) end. - +%%-------------------------------------------------------------------- +-spec validate_names(#'OTPCertificate'{}, list(), list(), + term(), list(), boolean())-> list(). +%% +%% Description: Validate Subject Alternative Name. +%%-------------------------------------------------------------------- validate_names(OtpCert, Permit, Exclude, Last, AccErr, Verify) -> case is_self_signed(OtpCert) andalso (not Last) of true -> @@ -143,8 +185,10 @@ validate_names(OtpCert, Permit, Exclude, Last, AccErr, Verify) -> Name = [{directoryName, Subject}|EmailAddress], AltNames = case AltSubject of - undefined -> []; - _ -> AltSubject#'Extension'.extnValue + undefined -> + []; + _ -> + AltSubject#'Extension'.extnValue end, case (is_permitted(Name, Permit) andalso @@ -159,28 +203,36 @@ validate_names(OtpCert, Permit, Exclude, Last, AccErr, Verify) -> end end. - -%% See rfc3280 4.1.2.6 Subject: regarding emails. -extract_email({rdnSequence, List}) -> - extract_email2(List). -extract_email2([[#'AttributeTypeAndValue'{type=?'id-emailAddress', - value=Mail}]|_]) -> - [{rfc822Name, Mail}]; -extract_email2([_|Rest]) -> - extract_email2(Rest); -extract_email2([]) -> []. - +%%-------------------------------------------------------------------- +-spec validate_revoked_status(#'OTPCertificate'{}, boolean(), list()) -> + list(). +%% +%% Description: Check if certificate has been revoked. +%%-------------------------------------------------------------------- validate_revoked_status(_OtpCert, _Verify, AccErr) -> + %% TODO: Implement or leave for application?! %% true | %% throw({bad_cert, cert_revoked}) AccErr. - +%%-------------------------------------------------------------------- +-spec validate_extensions(#'OTPCertificate'{}, #path_validation_state{}, + boolean(), list())-> + {#path_validation_state{}, + UnknownExtensions :: list(), AccErrors :: list()}. +%% +%% Description: Check extensions included in basic path validation. +%%-------------------------------------------------------------------- validate_extensions(OtpCert, ValidationState, Verify, AccErr) -> TBSCert = OtpCert#'OTPCertificate'.tbsCertificate, Extensions = TBSCert#'OTPTBSCertificate'.extensions, validate_extensions(Extensions, ValidationState, no_basic_constraint, is_self_signed(OtpCert), [], Verify, AccErr). +%-------------------------------------------------------------------- + -spec validate_unknown_extensions(list(), list(), boolean())-> list(). +%% +%% Description: Check that all critical extensions has been handled. +%%-------------------------------------------------------------------- validate_unknown_extensions([], AccErr, _Verify) -> AccErr; validate_unknown_extensions([#'Extension'{critical = true} | _], @@ -190,27 +242,38 @@ validate_unknown_extensions([#'Extension'{critical = false} | Rest], AccErr, Verify) -> validate_unknown_extensions(Rest, AccErr, Verify). +%%-------------------------------------------------------------------- +-spec normalize_general_name({rdnSequence, term()}) -> {rdnSequence, term()}. +%% +%% Description: Normalizes a general name so that it can be easily +%% compared to another genral name. +%%-------------------------------------------------------------------- normalize_general_name({rdnSequence, Issuer}) -> - NormIssuer = normalize_general_name(Issuer), - {rdnSequence, NormIssuer}; - -normalize_general_name(Issuer) -> - Normalize = fun([{Description, Type, {printableString, Value}}]) -> - NewValue = string:to_lower(strip_spaces(Value)), - [{Description, Type, {printableString, NewValue}}]; - (Atter) -> - Atter - end, - lists:sort(lists:map(Normalize, Issuer)). + NormIssuer = do_normalize_general_name(Issuer), + {rdnSequence, NormIssuer}. +%%-------------------------------------------------------------------- +-spec is_self_signed(#'OTPCertificate'{}) -> boolean(). +%% +%% Description: Checks if the certificate is self signed. +%%-------------------------------------------------------------------- is_self_signed(#'OTPCertificate'{tbsCertificate= #'OTPTBSCertificate'{issuer = Issuer, subject = Subject}}) -> is_issuer(Issuer, Subject). - +%%-------------------------------------------------------------------- +-spec is_issuer({rdnSequence, term()}, {rdnSequence, term()}) -> boolean(). +%% +%% Description: Checks if <Issuer> issued <Candidate>. +%%-------------------------------------------------------------------- is_issuer({rdnSequence, Issuer}, {rdnSequence, Candidate}) -> is_dir_name(Issuer, Candidate, true). - +%%-------------------------------------------------------------------- +-spec issuer_id(#'OTPCertificate'{}, self | other) -> + {ok, {integer(), term()}} | {error, issuer_not_found}. +%% +%% Description: Extracts the issuer id from a certificate if possible. +%%-------------------------------------------------------------------- issuer_id(Otpcert, other) -> TBSCert = Otpcert#'OTPCertificate'.tbsCertificate, Extensions = extensions_list(TBSCert#'OTPTBSCertificate'.extensions), @@ -227,7 +290,12 @@ issuer_id(Otpcert, self) -> SerialNr = TBSCert#'OTPTBSCertificate'.serialNumber, {ok, {SerialNr, normalize_general_name(Issuer)}}. - +%%-------------------------------------------------------------------- +-spec is_fixed_dh_cert(#'OTPCertificate'{}) -> boolean(). +%% +%% Description: Checks if the certificate can be be used +%% for DH key agreement. +%%-------------------------------------------------------------------- is_fixed_dh_cert(#'OTPCertificate'{tbsCertificate = #'OTPTBSCertificate'{subjectPublicKeyInfo = SubjectPublicKeyInfo, @@ -238,6 +306,24 @@ is_fixed_dh_cert(#'OTPCertificate'{tbsCertificate = %%-------------------------------------------------------------------- %%% Internal functions %%-------------------------------------------------------------------- +do_normalize_general_name(Issuer) -> + Normalize = fun([{Description, Type, {printableString, Value}}]) -> + NewValue = string:to_lower(strip_spaces(Value)), + [{Description, Type, {printableString, NewValue}}]; + (Atter) -> + Atter + end, + lists:sort(lists:map(Normalize, Issuer)). + +%% See rfc3280 4.1.2.6 Subject: regarding emails. +extract_email({rdnSequence, List}) -> + extract_email2(List). +extract_email2([[#'AttributeTypeAndValue'{type=?'id-emailAddress', + value=Mail}]|_]) -> + [{rfc822Name, Mail}]; +extract_email2([_|Rest]) -> + extract_email2(Rest); +extract_email2([]) -> []. extensions_list(asn1_NOVALUE) -> []; @@ -249,17 +335,22 @@ not_valid(Error, true, _) -> not_valid(Error, false, AccErrors) -> [Error | AccErrors]. -verify_signature(OtpCert, DerCert, Key, KeyParams) -> - %% Signature is an ASN1 compact bit string +extract_verify_data(OtpCert, DerCert) -> {0, Signature} = OtpCert#'OTPCertificate'.signature, SigAlgRec = OtpCert#'OTPCertificate'.signatureAlgorithm, SigAlg = SigAlgRec#'SignatureAlgorithm'.algorithm, - EncTBSCert = encoded_tbs_cert(DerCert), - verify(SigAlg, EncTBSCert, Signature, Key, KeyParams). + PlainText = encoded_tbs_cert(DerCert), + DigestType = digest_type(SigAlg), + {DigestType, PlainText, Signature}. -verify(Alg, PlainText, Signature, Key, KeyParams) -> - public_key:verify_signature(PlainText, digest_type(Alg), - Signature, Key, KeyParams). +verify_signature(OtpCert, DerCert, Key, KeyParams) -> + {DigestType, PlainText, Signature} = extract_verify_data(OtpCert, DerCert), + case Key of + #'RSAPublicKey'{} -> + public_key:verify(PlainText, DigestType, Signature, Key); + _ -> + public_key:verify(PlainText, DigestType, Signature, {Key, KeyParams}) + end. encoded_tbs_cert(Cert) -> {ok, PKIXCert} = @@ -411,8 +502,8 @@ validate_extensions([#'Extension'{extnID = ?'id-ce-basicConstraints', ValidationState = #path_validation_state{max_path_length = Len}, _, SelfSigned, UnknownExtensions, Verify, AccErr) -> - Length = if SelfSigned -> min(N, Len); - true -> min(N, Len-1) + Length = if SelfSigned -> erlang:min(N, Len); + true -> erlang:min(N, Len-1) end, validate_extensions(Rest, ValidationState#path_validation_state{max_path_length = @@ -603,11 +694,6 @@ is_valid_subject_alt_name({_, [_|_]}) -> is_valid_subject_alt_name({_, _}) -> false. -min(N, M) when N =< M -> - N; -min(_, M) -> - M. - is_ip_address(Address) -> case inet_parse:address(Address) of {ok, _} -> @@ -670,10 +756,11 @@ split_auth_path(URIPart) -> end. split_uri(UriPart, SplitChar, NoMatchResult, SkipLeft, SkipRight) -> - case regexp:first_match(UriPart, SplitChar) of - {match, Match, _} -> - {string:substr(UriPart, 1, Match - SkipLeft), - string:substr(UriPart, Match + SkipRight, length(UriPart))}; + case re:run(UriPart, SplitChar) of + {match,[{Start, _}]} -> + StrPos = Start + 1, + {string:substr(UriPart, 1, StrPos - SkipLeft), + string:substr(UriPart, StrPos + SkipRight, length(UriPart))}; nomatch -> NoMatchResult end. @@ -926,7 +1013,7 @@ add_policy_constraints(ExpPolicy, MapPolicy, policy_constraint(Current, asn1_NOVALUE, _) -> Current; policy_constraint(Current, New, CertNum) -> - min(Current, New + CertNum). + erlang:min(Current, New + CertNum). process_policy_tree(_,_, ?NULL) -> ?NULL; diff --git a/lib/public_key/src/pubkey_cert_records.erl b/lib/public_key/src/pubkey_cert_records.erl index ac04e1c2cb..20b322b4a4 100644 --- a/lib/public_key/src/pubkey_cert_records.erl +++ b/lib/public_key/src/pubkey_cert_records.erl @@ -23,30 +23,61 @@ -include("public_key.hrl"). --export([decode_cert/2, encode_cert/1, encode_tbs_cert/1, transform/2]). +-export([decode_cert/1, transform/2]). %%==================================================================== %% Internal application API %%==================================================================== -decode_cert(DerCert, plain) -> - 'OTP-PUB-KEY':decode('Certificate', DerCert); -decode_cert(DerCert, otp) -> +%%-------------------------------------------------------------------- +-spec decode_cert(der_encoded()) -> {ok, #'OTPCertificate'{}}. +%% +%% Description: Recursively decodes a Certificate. +%%-------------------------------------------------------------------- +decode_cert(DerCert) -> {ok, Cert} = 'OTP-PUB-KEY':decode('OTPCertificate', DerCert), #'OTPCertificate'{tbsCertificate = TBS} = Cert, {ok, Cert#'OTPCertificate'{tbsCertificate = decode_tbs(TBS)}}. -encode_cert(Cert = #'Certificate'{}) -> - {ok, EncCert} = 'OTP-PUB-KEY':encode('Certificate', Cert), - list_to_binary(EncCert); -encode_cert(C = #'OTPCertificate'{tbsCertificate = TBS}) -> - Cert = C#'OTPCertificate'{tbsCertificate=encode_tbs(TBS)}, - {ok, EncCert} = 'OTP-PUB-KEY':encode('OTPCertificate', Cert), - list_to_binary(EncCert). - -encode_tbs_cert(TBS) -> - {ok, EncTBSCert} = 'OTP-PUB-KEY':encode('OTPTBSCertificate', encode_tbs(TBS)), - list_to_binary(EncTBSCert). +%%-------------------------------------------------------------------- +-spec transform(term(), encode | decode) ->term(). +%% +%% Description: Transforms between encoded and decode otp formated +%% certificate parts. +%%-------------------------------------------------------------------- + +transform(#'OTPCertificate'{tbsCertificate = TBS} = Cert, encode) -> + Cert#'OTPCertificate'{tbsCertificate=encode_tbs(TBS)}; +transform(#'OTPCertificate'{tbsCertificate = TBS} = Cert, decode) -> + Cert#'OTPCertificate'{tbsCertificate=decode_tbs(TBS)}; +transform(#'OTPTBSCertificate'{}= TBS, encode) -> + encode_tbs(TBS); +transform(#'OTPTBSCertificate'{}= TBS, decode) -> + decode_tbs(TBS); +transform(#'AttributeTypeAndValue'{type=Id,value=Value0} = ATAV, Func) -> + {ok, Value} = + case attribute_type(Id) of + Type when is_atom(Type) -> 'OTP-PUB-KEY':Func(Type, Value0); + _UnknownType -> {ok, Value0} + end, + ATAV#'AttributeTypeAndValue'{value=Value}; +transform(AKI = #'AuthorityKeyIdentifier'{authorityCertIssuer=ACI},Func) -> + AKI#'AuthorityKeyIdentifier'{authorityCertIssuer=transform(ACI,Func)}; +transform(List = [{directoryName, _}],Func) -> + [{directoryName, transform(Value,Func)} || {directoryName, Value} <- List]; +transform({directoryName, Value},Func) -> + {directoryName, transform(Value,Func)}; +transform({rdnSequence, SeqList},Func) when is_list(SeqList) -> + {rdnSequence, + lists:map(fun(Seq) -> + lists:map(fun(Element) -> transform(Element,Func) end, Seq) + end, SeqList)}; +transform(#'NameConstraints'{permittedSubtrees=Permitted, excludedSubtrees=Excluded}, Func) -> + #'NameConstraints'{permittedSubtrees=transform_sub_tree(Permitted,Func), + excludedSubtrees=transform_sub_tree(Excluded,Func)}; + +transform(Other,_) -> + Other. %%-------------------------------------------------------------------- %%% Internal functions @@ -132,31 +163,6 @@ encode_extensions(Exts) -> end end, Exts). -transform(#'AttributeTypeAndValue'{type=Id,value=Value0} = ATAV, Func) -> - {ok, Value} = - case attribute_type(Id) of - Type when is_atom(Type) -> 'OTP-PUB-KEY':Func(Type, Value0); - _UnknownType -> {ok, Value0} - end, - ATAV#'AttributeTypeAndValue'{value=Value}; -transform(AKI = #'AuthorityKeyIdentifier'{authorityCertIssuer=ACI},Func) -> - AKI#'AuthorityKeyIdentifier'{authorityCertIssuer=transform(ACI,Func)}; -transform(List = [{directoryName, _}],Func) -> - [{directoryName, transform(Value,Func)} || {directoryName, Value} <- List]; -transform({directoryName, Value},Func) -> - {directoryName, transform(Value,Func)}; -transform({rdnSequence, SeqList},Func) when is_list(SeqList) -> - {rdnSequence, - lists:map(fun(Seq) -> - lists:map(fun(Element) -> transform(Element,Func) end, Seq) - end, SeqList)}; -transform(#'NameConstraints'{permittedSubtrees=Permitted, excludedSubtrees=Excluded}, Func) -> - #'NameConstraints'{permittedSubtrees=transform_sub_tree(Permitted,Func), - excludedSubtrees=transform_sub_tree(Excluded,Func)}; - -transform(Other,_) -> - Other. - encode_tbs(TBS=#'OTPTBSCertificate'{issuer=Issuer0, subject=Subject0, subjectPublicKeyInfo=Spki0, diff --git a/lib/public_key/src/pubkey_crypto.erl b/lib/public_key/src/pubkey_crypto.erl deleted file mode 100644 index 7b7abb1c56..0000000000 --- a/lib/public_key/src/pubkey_crypto.erl +++ /dev/null @@ -1,171 +0,0 @@ -%% -%% %CopyrightBegin% -%% -%% Copyright Ericsson AB 2008-2010. All Rights Reserved. -%% -%% The contents of this file are subject to the Erlang Public License, -%% Version 1.1, (the "License"); you may not use this file except in -%% compliance with the License. You should have received a copy of the -%% Erlang Public License along with this software. If not, it can be -%% retrieved online at http://www.erlang.org/. -%% -%% Software distributed under the License is distributed on an "AS IS" -%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See -%% the License for the specific language governing rights and limitations -%% under the License. -%% -%% %CopyrightEnd% -%% - -%% -%% Description: Functions that call the crypto driver. - --module(pubkey_crypto). - --include("public_key.hrl"). - --export([encrypt_public/3, decrypt_private/3, - encrypt_private/3, decrypt_public/3, - sign/2, sign/3, verify/5, gen_key/2]). - --define(UINT32(X), X:32/unsigned-big-integer). - -%%==================================================================== -%% Internal application API -%%==================================================================== - -%%-------------------------------------------------------------------- -%% Function: encrypt(PlainText, Key, Padding) -> Encrypted -%% -%% PlainText = binary() -%% Key = rsa_public_key() | rsa_private_key() -%% Padding = rsa_pkcs1_padding | rsa_pkcs1_oaep_padding -%% Encrypted = binary() -%% -%% Description: Public key encrypts PlainText. -%%-------------------------------------------------------------------- -encrypt_public(PlainText, #'RSAPublicKey'{modulus=N,publicExponent=E}, - Padding) -> - crypto:rsa_public_encrypt(PlainText, [crypto:mpint(E),crypto:mpint(N)], - Padding); -encrypt_public(PlainText, #'RSAPrivateKey'{modulus=N,publicExponent=E}, - Padding) -> - crypto:rsa_public_encrypt(PlainText, [crypto:mpint(E),crypto:mpint(N)], - Padding). - -encrypt_private(PlainText, #'RSAPrivateKey'{modulus = N, - publicExponent = E, - privateExponent = D}, Padding) -> - crypto:rsa_private_encrypt(PlainText, [crypto:mpint(E), - crypto:mpint(N), - crypto:mpint(D)], Padding). - -%%-------------------------------------------------------------------- -%% Function: decrypt(CipherText, Key) -> PlainText -%% -%% ChipherText = binary() -%% Key = rsa_private_key() -%% Padding = rsa_pkcs1_padding | rsa_pkcs1_oaep_padding -%% PlainText = binary() -%% -%% Description: Uses private key to decrypt public key encrypted data. -%%-------------------------------------------------------------------- -decrypt_private(CipherText, - #'RSAPrivateKey'{modulus = N,publicExponent = E, - privateExponent = D}, - Padding) -> - crypto:rsa_private_decrypt(CipherText, - [crypto:mpint(E), crypto:mpint(N), - crypto:mpint(D)], Padding). -decrypt_public(CipherText, #'RSAPublicKey'{modulus = N, publicExponent = E}, - Padding) -> - crypto:rsa_public_decrypt(CipherText,[crypto:mpint(E), crypto:mpint(N)], - Padding); -decrypt_public(CipherText, #'RSAPrivateKey'{modulus = N, publicExponent = E}, - Padding) -> - crypto:rsa_public_decrypt(CipherText,[crypto:mpint(E), crypto:mpint(N)], - Padding). - -%%-------------------------------------------------------------------- -%% Function: sign(PlainText, Key) -> -%% sign(DigestType, PlainText, Key) -> Signature -%% -%% DigestType = sha | md5 -%% PlainText = binary() -%% Key = rsa_private_key() | dsa_private_key() -%% Signature = binary() -%% -%% Description: Signs PlainText using Key. -%%-------------------------------------------------------------------- -sign(PlainText, Digest) -> - sign(sha, PlainText, Digest). - -sign(DigestType, PlainText, #'RSAPrivateKey'{modulus = N, publicExponent = E, - privateExponent = D}) -> - crypto:rsa_sign(DigestType, sized_binary(PlainText), [crypto:mpint(E), - crypto:mpint(N), - crypto:mpint(D)]); - -sign(none, Hash, #'DSAPrivateKey'{p = P, q = Q, g = G, x = X}) -> - crypto:dss_sign(none, Hash, - [crypto:mpint(P), crypto:mpint(Q), - crypto:mpint(G), crypto:mpint(X)]); - -sign(sha, PlainText, #'DSAPrivateKey'{p = P, q = Q, g = G, x = X}) -> - crypto:dss_sign(sized_binary(PlainText), - [crypto:mpint(P), crypto:mpint(Q), - crypto:mpint(G), crypto:mpint(X)]). - -%%-------------------------------------------------------------------- -%% Function: verify(DigestType, PlainText, Signature, Key) -> true | false -%% -%% DigestType = sha | md5 -%% PlainText = binary() -%% Signature = binary() -%% Key = rsa_public_key() | dsa_public_key() -%% -%% Description: Verifies the signature <Signature>. -%%-------------------------------------------------------------------- -verify(DigestType, PlainText, Signature, - #'RSAPublicKey'{modulus = Mod, publicExponent = Exp}, _) -> - crypto:rsa_verify(DigestType, - sized_binary(PlainText), - sized_binary(Signature), - [crypto:mpint(Exp), crypto:mpint(Mod)]); - -verify(none, Hash, Signature, Key, #'Dss-Parms'{p = P, q = Q, g = G}) -> - crypto:dss_verify(none, Hash, - sized_binary(Signature), - [crypto:mpint(P), crypto:mpint(Q), - crypto:mpint(G), crypto:mpint(Key)]); - -verify(sha, PlainText, Signature, Key, #'Dss-Parms'{p = P, q = Q, g = G}) -> - crypto:dss_verify(sized_binary(PlainText), - sized_binary(Signature), - [crypto:mpint(P), crypto:mpint(Q), - crypto:mpint(G), crypto:mpint(Key)]). - - -%%-------------------------------------------------------------------- -%% Function: gen_key(Type, Params) -> -%% Type = diffie_hellman -%% Params = [P,G] | [Y, P, G] -%% Description: Generates keys. -%% ----------------------------------------------------------------- -gen_key(diffie_hellman, [Y, P, G]) -> - crypto:dh_generate_key(crypto:mpint(Y), [crypto:mpint(P), - crypto:mpint(G)]); -gen_key(diffie_hellman, [P, G]) -> - crypto:dh_generate_key([crypto:mpint(P), crypto:mpint(G)]). - -%%% TODO: Support rsa, dss key_gen - -%%-------------------------------------------------------------------- -%%% Internal functions -%%-------------------------------------------------------------------- -sized_binary(Binary) when is_binary(Binary) -> - Size = size(Binary), - <<?UINT32(Size), Binary/binary>>; -sized_binary(List) -> - sized_binary(list_to_binary(List)). - diff --git a/lib/public_key/src/pubkey_pem.erl b/lib/public_key/src/pubkey_pem.erl index 65879f1bbe..31d881973a 100644 --- a/lib/public_key/src/pubkey_pem.erl +++ b/lib/public_key/src/pubkey_pem.erl @@ -40,7 +40,10 @@ -module(pubkey_pem). --export([read_file/1, read_file/2, write_file/2, decode/2]). +-include("public_key.hrl"). + +-export([encode/1, decode/1, decipher/2, cipher/3]). +%% Backwards compatibility -export([decode_key/2]). -define(ENCODED_LINE_LENGTH, 64). @@ -48,28 +51,82 @@ %%==================================================================== %% Internal application API %%==================================================================== -read_file(File) -> - read_file(File, no_passwd). -read_file(File, Passwd) -> - {ok, Bin} = file:read_file(File), - decode(Bin, Passwd). +%%-------------------------------------------------------------------- +-spec decode(binary()) -> [pem_entry()]. +%% +%% Description: Decodes a PEM binary. +%%-------------------------------------------------------------------- +decode(Bin) -> + decode_pem_entries(split_bin(Bin), []). -write_file(File, Ds) -> - file:write_file(File, encode_file(Ds)). +%%-------------------------------------------------------------------- +-spec encode([pem_entry()]) -> iolist(). +%% +%% Description: Encodes a list of PEM entries. +%%-------------------------------------------------------------------- +encode(PemEntries) -> + encode_pem_entries(PemEntries). -decode_key({_Type, Bin, not_encrypted}, _) -> - Bin; -decode_key({_Type, Bin, {Chipher,Salt}}, Password) -> - decode_key(Bin, Password, Chipher, Salt). +%%-------------------------------------------------------------------- +-spec decipher({pki_asn1_type(), decrypt_der(),{Cipher :: string(), Salt :: binary()}}, string()) -> + der_encoded(). +%% +%% Description: Deciphers a decrypted pem entry. +%%-------------------------------------------------------------------- +decipher({_, DecryptDer, {Cipher,Salt}}, Password) -> + decode_key(DecryptDer, Password, Cipher, Salt). -decode(Bin, Passwd) -> - decode_file(split_bin(Bin), Passwd). +%%-------------------------------------------------------------------- +-spec cipher(der_encoded(),{Cipher :: string(), Salt :: binary()} , string()) -> binary(). +%% +%% Description: Ciphers a PEM entry +%%-------------------------------------------------------------------- +cipher(Der, {Cipher,Salt}, Password)-> + encode_key(Der, Password, Cipher, Salt). %%-------------------------------------------------------------------- %%% Internal functions %%-------------------------------------------------------------------- +encode_pem_entries(Entries) -> + [encode_pem_entry(Entry) || Entry <- Entries]. + +encode_pem_entry({Asn1Type, Der, not_encrypted}) -> + StartStr = pem_start(Asn1Type), + [StartStr, "\n", b64encode_and_split(Der), pem_end(StartStr) ,"\n\n"]; +encode_pem_entry({Asn1Type, Der, {Cipher, Salt}}) -> + StartStr = pem_start(Asn1Type), + [StartStr,"\n", pem_decrypt(),"\n", pem_decrypt_info(Cipher, Salt),"\n", + b64encode_and_split(Der), pem_end(StartStr) ,"\n\n"]. + +decode_pem_entries([], Entries) -> + lists:reverse(Entries); +decode_pem_entries([<<>>], Entries) -> + lists:reverse(Entries); +decode_pem_entries([<<>> | Lines], Entries) -> + decode_pem_entries(Lines, Entries); +decode_pem_entries([Start| Lines], Entries) -> + case pem_end(Start) of + undefined -> + decode_pem_entries(Lines, Entries); + _End -> + {Entry, RestLines} = join_entry(Lines, []), + decode_pem_entries(RestLines, [decode_pem_entry(Start, Entry) | Entries]) + end. +decode_pem_entry(Start, [<<"Proc-Type: 4,ENCRYPTED", _/binary>>, Line | Lines]) -> + Asn1Type = asn1_type(Start), + Cs = erlang:iolist_to_binary(Lines), + Decoded = base64:mime_decode(Cs), + [_, DekInfo0] = string:tokens(binary_to_list(Line), ": "), + [Cipher, Salt] = string:tokens(DekInfo0, ","), + {Asn1Type, Decoded, {Cipher, unhex(Salt)}}; +decode_pem_entry(Start, Lines) -> + Asn1Type = asn1_type(Start), + Cs = erlang:iolist_to_binary(Lines), + Der = base64:mime_decode(Cs), + {Asn1Type, Der, not_encrypted}. + split_bin(Bin) -> split_bin(0, Bin). @@ -85,88 +142,26 @@ split_bin(N, Bin) -> split_bin(N+1, Bin) end. -decode_file(Bin, Passwd) -> - decode_file(Bin, [], [Passwd]). - -decode_file([<<"-----BEGIN CERTIFICATE REQUEST-----", _/binary>>|Rest], Ens, Info) -> - decode_file2(Rest, [], Ens, cert_req, Info); -decode_file([<<"-----BEGIN CERTIFICATE-----", _/binary>>|Rest], Ens, Info) -> - decode_file2(Rest, [], Ens, cert, Info); -decode_file([<<"-----BEGIN RSA PRIVATE KEY-----", _/binary>>|Rest], Ens, Info) -> - decode_file2(Rest, [], Ens, rsa_private_key, Info); -decode_file([<<"-----BEGIN DSA PRIVATE KEY-----", _/binary>>|Rest], Ens, Info) -> - decode_file2(Rest, [], Ens, dsa_private_key, Info); -decode_file([<<"-----BEGIN DH PARAMETERS-----", _/binary>>|Rest], Ens, Info) -> - decode_file2(Rest, [], Ens, dh_params, Info); -decode_file([_|Rest], Ens, Info) -> - decode_file(Rest, Ens, Info); -decode_file([], Ens, _Info) -> - {ok, lists:reverse(Ens)}. - -decode_file2([<<"Proc-Type: 4,ENCRYPTED", _/binary>>| Rest0], RLs, Ens, Tag, Info0) -> - [InfoLine|Rest] = Rest0, - Info = dek_info(InfoLine, Info0), - decode_file2(Rest, RLs, Ens, Tag, Info); -decode_file2([<<"-----END", _/binary>>| Rest], RLs, Ens, Tag, Info0) -> - Cs = erlang:iolist_to_binary(lists:reverse(RLs)), - Bin = base64:mime_decode(Cs), - case Info0 of - [Password, Cipher, SaltHex | Info1] -> - Salt = unhex(SaltHex), - Enc = {Cipher, Salt}, - Decoded = decode_key(Bin, Password, Cipher, Salt), - decode_file(Rest, [{Tag, Decoded, Enc}| Ens], Info1); - _ -> - decode_file(Rest, [{Tag, Bin, not_encrypted}| Ens], Info0) - end; -decode_file2([L|Rest], RLs, Ens, Tag, Info0) -> - decode_file2(Rest, [L|RLs], Ens, Tag, Info0); -decode_file2([], _, Ens, _, _) -> - {ok, lists:reverse(Ens)}. - -%% Support same as decode_file -encode_file(Ds) -> - lists:map( - fun({cert, Bin, not_encrypted}) -> - %% PKIX (X.509) - ["-----BEGIN CERTIFICATE-----\n", - b64encode_and_split(Bin), - "-----END CERTIFICATE-----\n\n"]; - ({cert_req, Bin, not_encrypted}) -> - %% PKCS#10 - ["-----BEGIN CERTIFICATE REQUEST-----\n", - b64encode_and_split(Bin), - "-----END CERTIFICATE REQUEST-----\n\n"]; - ({rsa_private_key, Bin, not_encrypted}) -> - %% PKCS#? - ["XXX Following key assumed not encrypted\n", - "-----BEGIN RSA PRIVATE KEY-----\n", - b64encode_and_split(Bin), - "-----END RSA PRIVATE KEY-----\n\n"]; - ({dsa_private_key, Bin, not_encrypted}) -> - %% PKCS#? - ["XXX Following key assumed not encrypted\n", - "-----BEGIN DSA PRIVATE KEY-----\n", - b64encode_and_split(Bin), - "-----END DSA PRIVATE KEY-----\n\n"] - end, Ds). - -dek_info(Line0, Info) -> - Line = binary_to_list(Line0), - [_, DekInfo0] = string:tokens(Line, ": "), - DekInfo1 = string:tokens(DekInfo0, ",\n"), - Info ++ DekInfo1. +b64encode_and_split(Bin) -> + split_lines(base64:encode(Bin)). -unhex(S) -> - unhex(S, []). +split_lines(<<Text:?ENCODED_LINE_LENGTH/binary, Rest/binary>>) -> + [Text, $\n | split_lines(Rest)]; +split_lines(Bin) -> + [Bin, $\n]. -unhex("", Acc) -> - list_to_binary(lists:reverse(Acc)); -unhex([D1, D2 | Rest], Acc) -> - unhex(Rest, [erlang:list_to_integer([D1, D2], 16) | Acc]). +%% Ignore white space at end of line +join_entry([<<"-----END CERTIFICATE-----", _/binary>>| Lines], Entry) -> + {lists:reverse(Entry), Lines}; +join_entry([<<"-----END RSA PRIVATE KEY-----", _/binary>>| Lines], Entry) -> + {lists:reverse(Entry), Lines}; +join_entry([<<"-----END DSA PRIVATE KEY-----", _/binary>>| Lines], Entry) -> + {lists:reverse(Entry), Lines}; +join_entry([<<"-----END DH PARAMETERS-----", _/binary>>| Lines], Entry) -> + {lists:reverse(Entry), Lines}; +join_entry([Line | Lines], Entry) -> + join_entry(Lines, [Line | Entry]). -decode_key(Data, no_passwd, _Alg, _Salt) -> - Data; decode_key(Data, Password, "DES-CBC", Salt) -> Key = password_to_key(Password, Salt, 8), IV = Salt, @@ -177,6 +172,16 @@ decode_key(Data, Password, "DES-EDE3-CBC", Salt) -> <<Key1:8/binary, Key2:8/binary, Key3:8/binary>> = Key, crypto:des_ede3_cbc_decrypt(Key1, Key2, Key3, IV, Data). +encode_key(Data, Password, "DES-CBC", Salt) -> + Key = password_to_key(Password, Salt, 8), + IV = Salt, + crypto:des_cbc_encrypt(Key, IV, Data); +encode_key(Data, Password, "DES-EDE3-CBC", Salt) -> + Key = password_to_key(Password, Salt, 24), + IV = Salt, + <<Key1:8/binary, Key2:8/binary, Key3:8/binary>> = Key, + crypto:des_ede3_cbc_encrypt(Key1, Key2, Key3, IV, Data). + password_to_key(Data, Salt, KeyLen) -> <<Key:KeyLen/binary, _/binary>> = password_to_key(<<>>, Data, Salt, KeyLen, <<>>), @@ -188,11 +193,58 @@ password_to_key(Prev, Data, Salt, Len, Acc) -> M = crypto:md5([Prev, Data, Salt]), password_to_key(M, Data, Salt, Len - size(M), <<Acc/binary, M/binary>>). -b64encode_and_split(Bin) -> - split_lines(base64:encode(Bin)). +unhex(S) -> + unhex(S, []). -split_lines(<<Text:?ENCODED_LINE_LENGTH/binary, Rest/binary>>) -> - [Text, $\n | split_lines(Rest)]; -split_lines(Bin) -> - [Bin, $\n]. +unhex("", Acc) -> + list_to_binary(lists:reverse(Acc)); +unhex([D1, D2 | Rest], Acc) -> + unhex(Rest, [erlang:list_to_integer([D1, D2], 16) | Acc]). + +hexify(L) -> [[hex_byte(B)] || B <- binary_to_list(L)]. + +hex_byte(B) when B < 16#10 -> ["0", erlang:integer_to_list(B, 16)]; +hex_byte(B) -> erlang:integer_to_list(B, 16). + +pem_start('Certificate') -> + <<"-----BEGIN CERTIFICATE-----">>; +pem_start('RSAPrivateKey') -> + <<"-----BEGIN RSA PRIVATE KEY-----">>; +pem_start('DSAPrivateKey') -> + <<"-----BEGIN DSA PRIVATE KEY-----">>; +pem_start('DHParameter') -> + <<"-----BEGIN DH PARAMETERS-----">>. + +pem_end(<<"-----BEGIN CERTIFICATE-----">>) -> + <<"-----END CERTIFICATE-----">>; +pem_end(<<"-----BEGIN RSA PRIVATE KEY-----">>) -> + <<"-----END RSA PRIVATE KEY-----">>; +pem_end(<<"-----BEGIN DSA PRIVATE KEY-----">>) -> + <<"-----END DSA PRIVATE KEY-----">>; +pem_end(<<"-----BEGIN DH PARAMETERS-----">>) -> + <<"-----END DH PARAMETERS-----">>; +pem_end(_) -> + undefined. + +asn1_type(<<"-----BEGIN CERTIFICATE-----">>) -> + 'Certificate'; +asn1_type(<<"-----BEGIN RSA PRIVATE KEY-----">>) -> + 'RSAPrivateKey'; +asn1_type(<<"-----BEGIN DSA PRIVATE KEY-----">>) -> + 'DSAPrivateKey'; +asn1_type(<<"-----BEGIN DH PARAMETERS-----">>) -> + 'DHParameter'. + +pem_decrypt() -> + <<"Proc-Type: 4,ENCRYPTED">>. + +pem_decrypt_info(Cipher, Salt) -> + io_lib:format("DEK-Info: ~s,~s", [Cipher, lists:flatten(hexify(Salt))]). +%%-------------------------------------------------------------------- +%%% Deprecated +%%-------------------------------------------------------------------- +decode_key({_Type, Bin, not_encrypted}, _) -> + Bin; +decode_key({_Type, Bin, {Chipher,Salt}}, Password) -> + decode_key(Bin, Password, Chipher, Salt). diff --git a/lib/public_key/src/public_key.app.src b/lib/public_key/src/public_key.app.src index d5e1705827..60487946fa 100644 --- a/lib/public_key/src/public_key.app.src +++ b/lib/public_key/src/public_key.app.src @@ -4,7 +4,6 @@ {modules, [ public_key, pubkey_pem, - pubkey_crypto, pubkey_cert, pubkey_cert_records, 'OTP-PUB-KEY' diff --git a/lib/public_key/src/public_key.appup.src b/lib/public_key/src/public_key.appup.src index 2eb5750923..c9d15b8747 100644 --- a/lib/public_key/src/public_key.appup.src +++ b/lib/public_key/src/public_key.appup.src @@ -1,6 +1,15 @@ %% -*- erlang -*- {"%VSN%", [ + {"0.7", + [ + {update, 'OTP-PUB-KEY', soft, soft_purge, soft_purge, []}, + {update, public_key, soft, soft_purge, soft_purge, []}, + {update, pubkey_pem, soft, soft_purge, soft_purge, []}, + {update, pubkey_cert_records, soft, soft_purge, soft_purge, []} + {update, pubkey_cert, soft, soft_purge, soft_purge, []} + ] + }, {"0.6", [ {update, 'OTP-PUB-KEY', soft, soft_purge, soft_purge, []}, @@ -22,6 +31,15 @@ } ], [ + {"0.7", + [ + {update, 'OTP-PUB-KEY', soft, soft_purge, soft_purge, []}, + {update, public_key, soft, soft_purge, soft_purge, []}, + {update, pubkey_pem, soft, soft_purge, soft_purge, []}, + {update, pubkey_cert_records, soft, soft_purge, soft_purge, []} + {update, pubkey_cert, soft, soft_purge, soft_purge, []} + ] + }, {"0.6", [ {update, 'OTP-PUB-KEY', soft, soft_purge, soft_purge, []}, diff --git a/lib/public_key/src/public_key.erl b/lib/public_key/src/public_key.erl index 12354eee5d..f9b992afd3 100644 --- a/lib/public_key/src/public_key.erl +++ b/lib/public_key/src/public_key.erl @@ -23,239 +23,394 @@ -include("public_key.hrl"). --export([decode_private_key/1, decode_private_key/2, decode_dhparams/1, - decrypt_private/2, decrypt_private/3, encrypt_public/2, - encrypt_public/3, decrypt_public/2, decrypt_public/3, - encrypt_private/2, encrypt_private/3, gen_key/1, sign/2, sign/3, - verify_signature/3, verify_signature/4, verify_signature/5, - pem_to_der/1, pem_to_der/2, der_to_pem/2, - pkix_decode_cert/2, pkix_encode_cert/1, pkix_transform/2, - pkix_is_self_signed/1, pkix_is_fixed_dh_cert/1, +-export([pem_decode/1, pem_encode/1, + der_decode/2, der_encode/2, + pem_entry_decode/1, + pem_entry_decode/2, + pem_entry_encode/2, + pem_entry_encode/3, + pkix_decode_cert/2, pkix_encode/3, + encrypt_private/2, encrypt_private/3, + decrypt_private/2, decrypt_private/3, + encrypt_public/2, encrypt_public/3, + decrypt_public/2, decrypt_public/3, + sign/3, verify/4, + pkix_sign/2, pkix_verify/2, + pkix_is_self_signed/1, + pkix_is_fixed_dh_cert/1, + pkix_is_issuer/2, pkix_issuer_id/2, - pkix_is_issuer/2, pkix_normalize_general_name/1, + pkix_normalize_name/1, pkix_path_validation/3 ]). +%% Deprecated +-export([decode_private_key/1, decode_private_key/2, pem_to_der/1]). + +-deprecated({pem_to_der, 1, next_major_release}). +-deprecated({decode_private_key, 1, next_major_release}). +-deprecated({decode_private_key, 2, next_major_release}). + +-type rsa_public_key() :: #'RSAPublicKey'{}. +-type rsa_private_key() :: #'RSAPrivateKey'{}. +-type dsa_private_key() :: #'DSAPrivateKey'{}. +-type dsa_public_key() :: {integer(), #'Dss-Parms'{}}. +-type rsa_padding() :: 'rsa_pkcs1_padding' | 'rsa_pkcs1_oaep_padding' + | 'rsa_no_padding'. +-type public_crypt_options() :: [{rsa_pad, rsa_padding()}]. +-type rsa_digest_type() :: 'md5' | 'sha'. +-type dss_digest_type() :: 'none' | 'sha'. + +-define(UINT32(X), X:32/unsigned-big-integer). + %%==================================================================== %% API %%==================================================================== %%-------------------------------------------------------------------- -%% Function: decode_private_key(KeyInfo [,Password]) -> -%% {ok, PrivateKey} | {error, Reason} -%% -%% KeyInfo = {Type, der_bin(), ChipherInfo} - as returned from -%% pem_to_der/[1,2] for private keys -%% Type = rsa_private_key | dsa_private_key -%% ChipherInfo = opaque() | no_encryption +-spec pem_decode(binary()) -> [pem_entry()]. +%% +%% Description: Decode PEM binary data and return +%% entries as asn1 der encoded entities. +%%-------------------------------------------------------------------- +pem_decode(PemBin) when is_binary(PemBin) -> + pubkey_pem:decode(PemBin). + +%%-------------------------------------------------------------------- +-spec pem_encode([pem_entry()]) -> binary(). %% -%% Description: Decodes an asn1 der encoded private key. +%% Description: Creates a PEM binary. %%-------------------------------------------------------------------- -decode_private_key(KeyInfo) -> - decode_private_key(KeyInfo, no_passwd). +pem_encode(PemEntries) when is_list(PemEntries) -> + iolist_to_binary(pubkey_pem:encode(PemEntries)). -decode_private_key(KeyInfo = {rsa_private_key, _, _}, Password) -> - DerEncoded = pubkey_pem:decode_key(KeyInfo, Password), - 'OTP-PUB-KEY':decode('RSAPrivateKey', DerEncoded); -decode_private_key(KeyInfo = {dsa_private_key, _, _}, Password) -> - DerEncoded = pubkey_pem:decode_key(KeyInfo, Password), - 'OTP-PUB-KEY':decode('DSAPrivateKey', DerEncoded). +%%-------------------------------------------------------------------- +-spec pem_entry_decode(pem_entry(), [string()]) -> term(). +% +%% Description: Decodes a pem entry. pem_decode/1 returns a list of +%% pem entries. +%%-------------------------------------------------------------------- +pem_entry_decode({Asn1Type, Der, not_encrypted}) when is_atom(Asn1Type), + is_binary(Der) -> + der_decode(Asn1Type, Der). +pem_entry_decode({Asn1Type, Der, not_encrypted}, _) when is_atom(Asn1Type), + is_binary(Der) -> + der_decode(Asn1Type, Der); +pem_entry_decode({Asn1Type, CryptDer, {Cipher, Salt}} = PemEntry, + Password) when is_atom(Asn1Type), + is_binary(CryptDer), + is_list(Cipher), + is_binary(Salt), + erlang:byte_size(Salt) == 8 + -> + Der = pubkey_pem:decipher(PemEntry, Password), + der_decode(Asn1Type, Der). +%%-------------------------------------------------------------------- +-spec pem_entry_encode(pki_asn1_type(), term()) -> pem_entry(). +-spec pem_entry_encode(pki_asn1_type(), term(), + {{Cipher :: string(), Salt :: binary()}, string()}) -> pem_entry(). +% +%% Description: Creates a pem entry that can be feed to pem_encode/1. +%%-------------------------------------------------------------------- +pem_entry_encode(Asn1Type, Entity) when is_atom(Asn1Type) -> + Der = der_encode(Asn1Type, Entity), + {Asn1Type, Der, not_encrypted}. +pem_entry_encode(Asn1Type, Entity, + {{Cipher, Salt}= CipherInfo, Password}) when is_atom(Asn1Type), + is_list(Cipher), + is_binary(Salt), + erlang:byte_size(Salt) == 8, + is_list(Password)-> + Der = der_encode(Asn1Type, Entity), + DecryptDer = pubkey_pem:cipher(Der, CipherInfo, Password), + {Asn1Type, DecryptDer, CipherInfo}. %%-------------------------------------------------------------------- -%% Function: decode_dhparams(DhParamInfo) -> -%% {ok, DhParams} | {error, Reason} -%% -%% DhParamsInfo = {Type, der_bin(), ChipherInfo} - as returned from -%% pem_to_der/[1,2] for DH parameters. -%% Type = dh_params -%% ChipherInfo = opaque() | no_encryption +-spec der_decode(asn1_type(), der_encoded()) -> term(). %% -%% Description: Decodes an asn1 der encoded DH parameters. +%% Description: Decodes a public key asn1 der encoded entity. %%-------------------------------------------------------------------- -decode_dhparams({dh_params, DerEncoded, not_encrypted}) -> - 'OTP-PUB-KEY':decode('DHParameter', DerEncoded). +der_decode(Asn1Type, Der) when is_atom(Asn1Type), is_binary(Der) -> + try + {ok, Decoded} = 'OTP-PUB-KEY':decode(Asn1Type, Der), + Decoded + catch + error:{badmatch, {error, _}} = Error -> + erlang:error(Error) + end. %%-------------------------------------------------------------------- -%% Function: decrypt_private(CipherText, Key) -> -%% decrypt_private(CipherText, Key, Options) -> PlainTex -%% decrypt_public(CipherText, Key) -> -%% decrypt_public(CipherText, Key, Options) -> PlainTex +-spec der_encode(asn1_type(), term()) -> der_encoded(). %% -%% CipherText = binary() -%% Key = rsa_key() -%% PlainText = binary() +%% Description: Encodes a public key entity with asn1 DER encoding. +%%-------------------------------------------------------------------- +der_encode(Asn1Type, Entity) when is_atom(Asn1Type) -> + try + {ok, Encoded} = 'OTP-PUB-KEY':encode(Asn1Type, Entity), + iolist_to_binary(Encoded) + catch + error:{badmatch, {error, _}} = Error -> + erlang:error(Error) + end. + +%%-------------------------------------------------------------------- +-spec pkix_decode_cert(der_encoded(), plain | otp) -> + #'Certificate'{} | #'OTPCertificate'{}. %% -%% Description: Decrypts <CipherText>. +%% Description: Decodes an asn1 der encoded pkix certificate. The otp +%% option will use the customized asn1 specification OTP-PKIX.asn1 for +%% decoding and also recursively decode most of the standard +%% extensions. +%% -------------------------------------------------------------------- +pkix_decode_cert(DerCert, plain) when is_binary(DerCert) -> + der_decode('Certificate', DerCert); +pkix_decode_cert(DerCert, otp) when is_binary(DerCert) -> + try + {ok, #'OTPCertificate'{}= Cert} = + pubkey_cert_records:decode_cert(DerCert), + Cert + catch + error:{badmatch, {error, _}} = Error -> + erlang:error(Error) + end. + +%%-------------------------------------------------------------------- +-spec pkix_encode(asn1_type(), term(), otp | plain) -> der_encoded(). +%% +%% Description: Der encodes a certificate or part of a certificate. +%% This function must be used for encoding certificates or parts of certificates +%% that are decoded with the otp format, whereas for the plain format this +%% function will only call der_encode/2. +%%-------------------------------------------------------------------- +pkix_encode(Asn1Type, Term, plain) when is_atom(Asn1Type) -> + der_encode(Asn1Type, Term); + +pkix_encode(Asn1Type, Term0, otp) when is_atom(Asn1Type) -> + Term = pubkey_cert_records:transform(Term0, encode), + der_encode(Asn1Type, Term). + +%%-------------------------------------------------------------------- +-spec decrypt_private(CipherText :: binary(), rsa_private_key()) -> + PlainText :: binary(). +-spec decrypt_private(CipherText :: binary(), rsa_private_key(), + public_crypt_options()) -> PlainText :: binary(). +%% +%% Description: Public key decryption using the private key. %%-------------------------------------------------------------------- decrypt_private(CipherText, Key) -> decrypt_private(CipherText, Key, []). -decrypt_private(CipherText, Key, Options) -> - Padding = proplists:get_value(rsa_pad, Options, rsa_pkcs1_padding), - pubkey_crypto:decrypt_private(CipherText, Key, Padding). -decrypt_public(CipherText, Key) -> - decrypt_public(CipherText, Key, []). -decrypt_public(CipherText, Key, Options) -> +decrypt_private(CipherText, + #'RSAPrivateKey'{modulus = N,publicExponent = E, + privateExponent = D}, + Options) when is_binary(CipherText), + is_list(Options) -> Padding = proplists:get_value(rsa_pad, Options, rsa_pkcs1_padding), - pubkey_crypto:decrypt_public(CipherText, Key, Padding). + crypto:rsa_private_decrypt(CipherText, + [crypto:mpint(E), crypto:mpint(N), + crypto:mpint(D)], Padding). %%-------------------------------------------------------------------- -%% Function: encrypt_public(PlainText, Key, Options) -> CipherText -%% encrypt_private(PlainText, Key, Options) -> CipherText +-spec decrypt_public(CipherText :: binary(), rsa_public_key()) -> + PlainText :: binary(). +-spec decrypt_public(CipherText :: binary(), rsa_public_key(), + public_crypt_options()) -> PlainText :: binary(). %% -%% PlainText = iolist() -%% Key = rsa_private_key() -%% CipherText = binary() -%% -%% Description: Encrypts <Plain> +%% Description: Public key decryption using the public key. %%-------------------------------------------------------------------- -encrypt_public(PlainText, Key) -> - encrypt_public(PlainText, Key, []). -encrypt_public(PlainText, Key, Options) -> - Padding = proplists:get_value(rsa_pad, Options, rsa_pkcs1_padding), - pubkey_crypto:encrypt_public(PlainText, Key, Padding). +decrypt_public(CipherText, Key) -> + decrypt_public(CipherText, Key, []). -encrypt_private(PlainText, Key) -> - encrypt_private(PlainText, Key, []). -encrypt_private(PlainText, Key, Options) -> - Padding = proplists:get_value(rsa_pad, Options, rsa_pkcs1_padding), - pubkey_crypto:encrypt_private(PlainText, Key, Padding). +decrypt_public(CipherText, #'RSAPublicKey'{modulus = N, publicExponent = E}, + Options) when is_binary(CipherText), is_list(Options) -> + decrypt_public(CipherText, N,E, Options); -%%-------------------------------------------------------------------- -%% Function: gen_key(Params) -> Keys -%% -%% Params = #'DomainParameters'{} - Currently only supported option -%% Keys = {PublicDHKey = integer(), PrivateDHKey = integer()} -%% -%% Description: Generates keys. Currently supports Diffie-Hellman keys. -%%-------------------------------------------------------------------- -gen_key(#'DHParameter'{prime = P, base = G}) when is_integer(P), - is_integer(G) -> - pubkey_crypto:gen_key(diffie_hellman, [P, G]). +decrypt_public(CipherText,#'RSAPrivateKey'{modulus = N, publicExponent = E}, + Options) when is_binary(CipherText), is_list(Options) -> + decrypt_public(CipherText, N,E, Options). %%-------------------------------------------------------------------- -%% Function: pem_to_der(CertSource) -> -%% pem_to_der(CertSource, Password) -> {ok, [Entry]} | -%% {error, Reason} -%% -%% CertSource = File | CertData -%% CertData = binary() -%% File = path() -%% Entry = {entry_type(), der_bin(), ChipherInfo} -%% ChipherInfo = opague() | no_encryption -%% der_bin() = binary() -%% entry_type() = cert | cert_req | rsa_private_key | dsa_private_key -%% dh_params +-spec encrypt_public(PlainText :: binary(), rsa_public_key()) -> + CipherText :: binary(). +-spec encrypt_public(PlainText :: binary(), rsa_public_key(), + public_crypt_options()) -> CipherText :: binary(). %% -%% Description: decode PEM binary data or a PEM file and return -%% entries as asn1 der encoded entities. Currently supported entry -%% types are certificates, certificate requests, rsa private keys and -%% dsa private keys. In the case of a key entry ChipherInfo will be -%% private keys and Diffie Hellam parameters .In the case of a key -%% entry ChipherInfo will be used by decode_private_key/2 if the key -%% is protected by a password. +%% Description: Public key encryption using the public key. %%-------------------------------------------------------------------- -pem_to_der(CertSource) -> - pem_to_der(CertSource, no_passwd). +encrypt_public(PlainText, Key) -> + encrypt_public(PlainText, Key, []). -pem_to_der(File, Password) when is_list(File) -> - pubkey_pem:read_file(File, Password); -pem_to_der(PemBin, Password) when is_binary(PemBin) -> - pubkey_pem:decode(PemBin, Password). +encrypt_public(PlainText, #'RSAPublicKey'{modulus=N,publicExponent=E}, + Options) when is_binary(PlainText), is_list(Options) -> + encrypt_public(PlainText, N,E, Options); -der_to_pem(File, TypeDerList) -> - pubkey_pem:write_file(File, TypeDerList). +encrypt_public(PlainText, #'RSAPrivateKey'{modulus=N,publicExponent=E}, + Options) when is_binary(PlainText), is_list(Options) -> + encrypt_public(PlainText, N,E, Options). %%-------------------------------------------------------------------- -%% Function: pkix_decode_cert(BerCert, Type) -> {ok, Cert} | {error, Reason} +-spec encrypt_private(PlainText :: binary(), rsa_private_key()) -> + CipherText :: binary(). +-spec encrypt_private(PlainText :: binary(), rsa_private_key(), + public_crypt_options()) -> CipherText :: binary(). %% -%% BerCert = binary() -%% Type = plain | otp -%% Cert = certificate() -%% -%% Description: Decodes an asn1 ber encoded pkix certificate. -%% otp - Uses OTP-PKIX.asn1 to decode known extensions and -%% enhance the signature field in #'Certificate'{} and '#TBSCertificate'{}. +%% Description: Public key encryption using the private key. %%-------------------------------------------------------------------- -pkix_decode_cert(BinCert, Type) -> - pubkey_cert_records:decode_cert(BinCert, Type). +encrypt_private(PlainText, Key) -> + encrypt_private(PlainText, Key, []). + +encrypt_private(PlainText, #'RSAPrivateKey'{modulus = N, + publicExponent = E, + privateExponent = D}, + Options) when is_binary(PlainText), is_list(Options) -> + Padding = proplists:get_value(rsa_pad, Options, rsa_pkcs1_padding), + crypto:rsa_private_encrypt(PlainText, [crypto:mpint(E), + crypto:mpint(N), + crypto:mpint(D)], Padding). %%-------------------------------------------------------------------- -%% Function: pkix_encode_cert(Cert) -> {ok, binary()} | {error, Reason} +-spec sign(PlainTextOrDigest :: binary(), rsa_digest_type() | dss_digest_type(), + rsa_private_key() | + dsa_private_key()) -> Signature :: binary(). %% -%% Cert = #'Certificate'{} -%% -%% Description: Encodes a certificate record using asn1. +%% Description: Create digital signature. %%-------------------------------------------------------------------- -pkix_encode_cert(Cert) -> - pubkey_cert_records:encode_cert(Cert). +sign(PlainText, DigestType, #'RSAPrivateKey'{modulus = N, publicExponent = E, + privateExponent = D}) + when is_binary(PlainText), + DigestType == md5; + DigestType == sha -> + + crypto:rsa_sign(DigestType, sized_binary(PlainText), [crypto:mpint(E), + crypto:mpint(N), + crypto:mpint(D)]); + +sign(Digest, none, #'DSAPrivateKey'{p = P, q = Q, g = G, x = X}) + when is_binary(Digest)-> + crypto:dss_sign(none, Digest, + [crypto:mpint(P), crypto:mpint(Q), + crypto:mpint(G), crypto:mpint(X)]); + +sign(PlainText, sha, #'DSAPrivateKey'{p = P, q = Q, g = G, x = X}) + when is_binary(PlainText) -> + crypto:dss_sign(sized_binary(PlainText), + [crypto:mpint(P), crypto:mpint(Q), + crypto:mpint(G), crypto:mpint(X)]). + +%%-------------------------------------------------------------------- +-spec verify(PlainTextOrDigest :: binary(), rsa_digest_type() | dss_digest_type(), + Signature :: binary(), rsa_public_key() + | dsa_public_key()) -> boolean(). +%% +%% Description: Verifies a digital signature. +%%-------------------------------------------------------------------- +verify(PlainText, DigestType, Signature, + #'RSAPublicKey'{modulus = Mod, publicExponent = Exp}) + when is_binary (PlainText), DigestType == sha; DigestType == md5 -> + crypto:rsa_verify(DigestType, + sized_binary(PlainText), + sized_binary(Signature), + [crypto:mpint(Exp), crypto:mpint(Mod)]); + +verify(Digest, none, Signature, {Key, #'Dss-Parms'{p = P, q = Q, g = G}}) + when is_integer(Key), is_binary(Digest), is_binary(Signature) -> + crypto:dss_verify(none, + Digest, + sized_binary(Signature), + [crypto:mpint(P), crypto:mpint(Q), + crypto:mpint(G), crypto:mpint(Key)]); +verify(PlainText, sha, Signature, {Key, #'Dss-Parms'{p = P, q = Q, g = G}}) + when is_integer(Key), is_binary(PlainText), is_binary(Signature) -> + crypto:dss_verify(sized_binary(PlainText), + sized_binary(Signature), + [crypto:mpint(P), crypto:mpint(Q), + crypto:mpint(G), crypto:mpint(Key)]). %%-------------------------------------------------------------------- -%% Function: pkix_transform(CertPart, Op) -> TransformedCertPart +-spec pkix_sign(#'OTPTBSCertificate'{}, + rsa_private_key() | dsa_private_key()) -> der_encoded(). %% -%% CertPart = pkix part data -%% Op = encode | decode -%% -%% Description: Transform parts of a pkix certificate between 'plain' format -%% and the internal 'otp' format, see pkix_decode_cert/2. -%% Decode transforms from 'plain' to 'otp' and encode from 'otp' to 'plain' -%% format. +%% Description: Sign a pkix x.509 certificate. Returns the corresponding +%% der encoded 'Certificate'{} %%-------------------------------------------------------------------- -pkix_transform(CertPart, Op) -> - pubkey_cert_records:transform(CertPart, Op). +pkix_sign(#'OTPTBSCertificate'{signature = + #'SignatureAlgorithm'{algorithm = Alg} + = SigAlg} = TBSCert, Key) -> + + Msg = pkix_encode('OTPTBSCertificate', TBSCert, otp), + DigestType = pubkey_cert:digest_type(Alg), + Signature = sign(Msg, DigestType, Key), + Cert = #'OTPCertificate'{tbsCertificate= TBSCert, + signatureAlgorithm = SigAlg, + signature = {0, Signature} + }, + pkix_encode('OTPCertificate', Cert, otp). %%-------------------------------------------------------------------- -%% Function: pkix_path_validation(TrustedCert, CertChain, Options) -> -%% {ok, {{algorithm(), public_key(), public_key_params()} policy_tree()}} | -%% {error, Reason} +-spec pkix_verify(der_encoded(), rsa_public_key()| + dsa_public_key()) -> boolean(). %% -%% Description: Performs a bacis path validation according to RFC 3280. +%% Description: Verify pkix x.509 certificate signature. %%-------------------------------------------------------------------- -pkix_path_validation(TrustedCert, CertChain, Options) - when is_binary(TrustedCert) -> - {ok, OtpCert} = pkix_decode_cert(TrustedCert, otp), - pkix_path_validation(OtpCert, CertChain, Options); +pkix_verify(DerCert, {Key, #'Dss-Parms'{}} = DSAKey) + when is_binary(DerCert), is_integer(Key) -> + {DigestType, PlainText, Signature} = pubkey_cert:verify_data(DerCert), + verify(PlainText, DigestType, Signature, DSAKey); + +pkix_verify(DerCert, #'RSAPublicKey'{} = RSAKey) + when is_binary(DerCert) -> + {DigestType, PlainText, Signature} = pubkey_cert:verify_data(DerCert), + verify(PlainText, DigestType, Signature, RSAKey). -pkix_path_validation(#'OTPCertificate'{} = TrustedCert, CertChain, Options) - when is_list(CertChain), is_list(Options) -> - MaxPathDefault = length(CertChain), - ValidationState = pubkey_cert:init_validation_state(TrustedCert, - MaxPathDefault, - Options), - Fun = proplists:get_value(validate_extensions_fun, Options, - fun(Extensions, State, _, AccError) -> - {Extensions, State, AccError} - end), - Verify = proplists:get_value(verify, Options, true), - path_validation(CertChain, ValidationState, Fun, Verify). %%-------------------------------------------------------------------- -%% Function: pkix_is_fixed_dh_cert(Cert) -> true | false +-spec pkix_is_issuer(Cert :: der_encoded()| #'OTPCertificate'{}, + IssuerCert :: der_encoded()| + #'OTPCertificate'{}) -> boolean(). %% -%% Description: Checks if a Certificate is a fixed Diffie-Hellman Cert +%% Description: Checks if <IssuerCert> issued <Cert>. %%-------------------------------------------------------------------- -pkix_is_fixed_dh_cert(#'OTPCertificate'{} = OTPCert) -> - pubkey_cert:is_fixed_dh_cert(OTPCert); -pkix_is_fixed_dh_cert(Cert) when is_binary(Cert) -> - {ok, OtpCert} = pkix_decode_cert(Cert, otp), - pkix_is_fixed_dh_cert(OtpCert). +pkix_is_issuer(Cert, IssuerCert) when is_binary(Cert) -> + OtpCert = pkix_decode_cert(Cert, otp), + pkix_is_issuer(OtpCert, IssuerCert); +pkix_is_issuer(Cert, IssuerCert) when is_binary(IssuerCert) -> + OtpIssuerCert = pkix_decode_cert(IssuerCert, otp), + pkix_is_issuer(Cert, OtpIssuerCert); +pkix_is_issuer(#'OTPCertificate'{tbsCertificate = TBSCert}, + #'OTPCertificate'{tbsCertificate = Candidate}) -> + pubkey_cert:is_issuer(TBSCert#'OTPTBSCertificate'.issuer, + Candidate#'OTPTBSCertificate'.subject). %%-------------------------------------------------------------------- -%% Function: pkix_is_self_signed(Cert) -> true | false +-spec pkix_is_self_signed(der_encoded()| #'OTPCertificate'{}) -> boolean(). %% %% Description: Checks if a Certificate is self signed. %%-------------------------------------------------------------------- pkix_is_self_signed(#'OTPCertificate'{} = OTPCert) -> pubkey_cert:is_self_signed(OTPCert); pkix_is_self_signed(Cert) when is_binary(Cert) -> - {ok, OtpCert} = pkix_decode_cert(Cert, otp), + OtpCert = pkix_decode_cert(Cert, otp), pkix_is_self_signed(OtpCert). - + %%-------------------------------------------------------------------- -%% Function: pkix_issuer_id(Cert) -> {ok, {SerialNr, Issuer}} | {error, Reason} -%% -%% Cert = asn1_der_encoded() | 'OTPCertificate'{} +-spec pkix_is_fixed_dh_cert(der_encoded()| #'OTPCertificate'{}) -> boolean(). %% +%% Description: Checks if a Certificate is a fixed Diffie-Hellman Cert. +%%-------------------------------------------------------------------- +pkix_is_fixed_dh_cert(#'OTPCertificate'{} = OTPCert) -> + pubkey_cert:is_fixed_dh_cert(OTPCert); +pkix_is_fixed_dh_cert(Cert) when is_binary(Cert) -> + OtpCert = pkix_decode_cert(Cert, otp), + pkix_is_fixed_dh_cert(OtpCert). + +%%-------------------------------------------------------------------- +-spec pkix_issuer_id(der_encoded()| #'OTPCertificate'{}, + IssuedBy :: self | other) -> + {ok, {SerialNr :: integer(), + Issuer :: {rdnSequence, + [#'AttributeTypeAndValue'{}]}}} + | {error, Reason :: term()}. +% %% Description: Returns the issuer id. %%-------------------------------------------------------------------- pkix_issuer_id(#'OTPCertificate'{} = OtpCert, self) -> @@ -265,115 +420,70 @@ pkix_issuer_id(#'OTPCertificate'{} = OtpCert, other) -> pubkey_cert:issuer_id(OtpCert, other); pkix_issuer_id(Cert, Signed) when is_binary(Cert) -> - {ok, OtpCert} = pkix_decode_cert(Cert, otp), + OtpCert = pkix_decode_cert(Cert, otp), pkix_issuer_id(OtpCert, Signed). %%-------------------------------------------------------------------- -%% Function: pkix_is_issuer(Cert, IssuerCert) -> true | false +-spec pkix_normalize_name({rdnSequence, + [#'AttributeTypeAndValue'{}]}) -> + {rdnSequence, + [#'AttributeTypeAndValue'{}]}. %% -%% Cert = asn1_der_encoded() | 'OTPCertificate'{} -%% IssuerCert = asn1_der_encoded() | 'OTPCertificate'{} -%% -%% Description: Checks if <IssuerCert> issued <Cert>. +%% Description: Normalizes a issuer name so that it can be easily +%% compared to another issuer name. %%-------------------------------------------------------------------- -pkix_is_issuer(Cert, IssuerCert) when is_binary(Cert) -> - {ok, OtpCert} = pkix_decode_cert(Cert, otp), - pkix_is_issuer(OtpCert, IssuerCert); +pkix_normalize_name(Issuer) -> + pubkey_cert:normalize_general_name(Issuer). -pkix_is_issuer(Cert, IssuerCert) when is_binary(IssuerCert) -> - {ok, OtpIssuerCert} = pkix_decode_cert(IssuerCert, otp), - pkix_is_issuer(Cert, OtpIssuerCert); +%%-------------------------------------------------------------------- +-spec pkix_path_validation(der_encoded()| #'OTPCertificate'{} | unknown_ca, + CertChain :: [der_encoded()] , + Options :: list()) -> + {ok, {PublicKeyInfo :: term(), + PolicyTree :: term(), + [{bad_cert, Reason :: term()}]}} | + {error, {bad_cert, Reason :: term()}}. +%% Description: Performs a basic path validation according to RFC 5280. +%%-------------------------------------------------------------------- +pkix_path_validation(unknown_ca, [Cert | Chain], Options) -> + case proplists:get_value(verify, Options, true) of + true -> + {error, {bad_cert, unknown_ca}}; + false -> + pkix_path_validation(Cert, Chain, [{acc_errors, [{bad_cert, unknown_ca}]}]) + end; +pkix_path_validation(TrustedCert, CertChain, Options) when + is_binary(TrustedCert) -> OtpCert = pkix_decode_cert(TrustedCert, + otp), pkix_path_validation(OtpCert, CertChain, Options); -pkix_is_issuer(#'OTPCertificate'{tbsCertificate = TBSCert}, - #'OTPCertificate'{tbsCertificate = Candidate}) -> - pubkey_cert:is_issuer(TBSCert#'OTPTBSCertificate'.issuer, - Candidate#'OTPTBSCertificate'.subject). - -%%-------------------------------------------------------------------- -%% Function: pkix_normalize_general_name(Issuer) -> -%% -%% Issuer = general_name() - see PKIX -%% -%% Description: Normalizes a general name so that it can be easily -%% compared to another genral name. -%%-------------------------------------------------------------------- -pkix_normalize_general_name(Issuer) -> - pubkey_cert:normalize_general_name(Issuer). +pkix_path_validation(#'OTPCertificate'{} = TrustedCert, CertChain, Options) + when is_list(CertChain), is_list(Options) -> + MaxPathDefault = length(CertChain), + ValidationState = pubkey_cert:init_validation_state(TrustedCert, + MaxPathDefault, + Options), + Fun = proplists:get_value(validate_extensions_fun, Options, + fun(Extensions, State, _, AccError) -> + {Extensions, State, AccError} + end), + Verify = proplists:get_value(verify, Options, true), + path_validation(CertChain, ValidationState, Fun, Verify). %%-------------------------------------------------------------------- -%% Function:sign(Msg, Key) -> {ok, Signature} -%% sign(Msg, Key, KeyParams) -> {ok, Signature} -%% -%% Msg = binary() | #'TBSCertificate'{} -%% Key = private_key() -%% KeyParams = key_params() -%% Signature = binary() -%% -%% Description: Signs plaintext Msg or #TBSCertificate{}, in the later -%% case a der encoded "#Certificate{}" will be returned. +%%% Internal functions %%-------------------------------------------------------------------- -sign(Msg, #'RSAPrivateKey'{} = Key) when is_binary(Msg) -> - pubkey_crypto:sign(Msg, Key); - -sign(Msg, #'DSAPrivateKey'{} = Key) when is_binary(Msg) -> - pubkey_crypto:sign(Msg, Key); -sign(#'OTPTBSCertificate'{signature = #'SignatureAlgorithm'{algorithm = Alg} - = SigAlg} = TBSCert, Key) -> - Msg = pubkey_cert_records:encode_tbs_cert(TBSCert), - DigestType = pubkey_cert:digest_type(Alg), - Signature = pubkey_crypto:sign(DigestType, Msg, Key), - Cert = #'OTPCertificate'{tbsCertificate= TBSCert, - signatureAlgorithm = SigAlg, - signature = {0, Signature} - }, - pkix_encode_cert(Cert). +encrypt_public(PlainText, N, E, Options)-> + Padding = proplists:get_value(rsa_pad, Options, rsa_pkcs1_padding), + crypto:rsa_public_encrypt(PlainText, [crypto:mpint(E),crypto:mpint(N)], + Padding). -sign(DigestType, Msg, Key) -> - pubkey_crypto:sign(DigestType, Msg, Key). +decrypt_public(CipherText, N,E, Options) -> + Padding = proplists:get_value(rsa_pad, Options, rsa_pkcs1_padding), + crypto:rsa_public_decrypt(CipherText,[crypto:mpint(E), crypto:mpint(N)], + Padding). -%%-------------------------------------------------------------------- -%% Function: verify_signature(PlainText, DigestType, Signature, Key) -> -%% verify_signature(PlainText, DigestType, -%% Signature, Key, KeyParams) -> -%% verify_signature(DerCert, Key, KeyParams) -> -%% -%% PlainText = binary() -%% DigestType = md5 | sha -%% DerCert = asn1_der_encoded() -%% Signature = binary() -%% Key = public_key() -%% KeyParams = key_params() -%% Verified = boolean() -%% -%% Description: Verifies the signature <Signature>. -%%-------------------------------------------------------------------- -verify_signature(PlainText, DigestType, Signature, #'RSAPublicKey'{} = Key) - when is_binary(PlainText), is_binary(Signature), DigestType == sha; - DigestType == md5 -> - pubkey_crypto:verify(DigestType, PlainText, Signature, Key, undefined). - -verify_signature(PlainText, DigestType, Signature, #'RSAPublicKey'{} = Key, - KeyParams) - when is_binary(PlainText), is_binary(Signature), DigestType == sha; - DigestType == md5 -> - pubkey_crypto:verify(DigestType, PlainText, Signature, Key, KeyParams); -verify_signature(PlainText, sha, Signature, Key, #'Dss-Parms'{} = KeyParams) - when is_binary(PlainText), is_binary(Signature), is_integer(Key) -> - pubkey_crypto:verify(sha, PlainText, Signature, Key, KeyParams); -verify_signature(Hash, none, Signature, Key, KeyParams) -> - pubkey_crypto:verify(none, Hash, Signature, Key, KeyParams). - -verify_signature(DerCert, Key, #'Dss-Parms'{} = KeyParams) - when is_binary(DerCert), is_integer(Key) -> - pubkey_cert:verify_signature(DerCert, Key, KeyParams); -verify_signature(DerCert, #'RSAPublicKey'{} = Key, KeyParams) - when is_binary(DerCert) -> - pubkey_cert:verify_signature(DerCert, Key, KeyParams). -%%-------------------------------------------------------------------- -%%% Internal functions -%%-------------------------------------------------------------------- path_validation([], #path_validation_state{working_public_key_algorithm = Algorithm, working_public_key = @@ -423,7 +533,7 @@ validate(DerCert, #path_validation_state{working_issuer_name = Issuer, user_state = UserState0, acc_errors = AccErr0} = ValidationState0, ValidateExtensionFun, Verify) -> - {ok, OtpCert} = pkix_decode_cert(DerCert, otp), + OtpCert = pkix_decode_cert(DerCert, otp), %% All validate functions will throw {bad_cert, Reason} if they %% fail and Verify = true if Verify = false errors %% will be accumulated in the validationstate @@ -456,3 +566,26 @@ validate(DerCert, #path_validation_state{working_issuer_name = Issuer, ValidationState1#path_validation_state{user_state = UserState, acc_errors = AccErr}, pubkey_cert:prepare_for_next_cert(OtpCert, ValidationState). + +sized_binary(Binary) when is_binary(Binary) -> + Size = size(Binary), + <<?UINT32(Size), Binary/binary>>; +sized_binary(List) -> + sized_binary(list_to_binary(List)). + +%%-------------------------------------------------------------------- +%%% Deprecated functions +%%-------------------------------------------------------------------- +pem_to_der(CertSource) -> + {ok, Bin} = file:read_file(CertSource), + pubkey_pem:decode(Bin). + +decode_private_key(KeyInfo) -> + decode_private_key(KeyInfo, no_passwd). + +decode_private_key(KeyInfo = {'RSAPrivateKey', _, _}, Password) -> + DerEncoded = pubkey_pem:decode_key(KeyInfo, Password), + 'OTP-PUB-KEY':decode('RSAPrivateKey', DerEncoded); +decode_private_key(KeyInfo = {'DSAPrivateKey', _, _}, Password) -> + DerEncoded = pubkey_pem:decode_key(KeyInfo, Password), + 'OTP-PUB-KEY':decode('DSAPrivateKey', DerEncoded). diff --git a/lib/public_key/test/Makefile b/lib/public_key/test/Makefile index 5544339ff2..e20b903942 100644 --- a/lib/public_key/test/Makefile +++ b/lib/public_key/test/Makefile @@ -28,7 +28,7 @@ INCLUDES= -I. -I ../include # ---------------------------------------------------- MODULES= \ - pkey_test \ + erl_make_certs \ public_key_SUITE \ pkits_SUITE diff --git a/lib/public_key/test/pkey_test.erl b/lib/public_key/test/erl_make_certs.erl index 4cf20f0174..e31e5552d3 100644 --- a/lib/public_key/test/pkey_test.erl +++ b/lib/public_key/test/erl_make_certs.erl @@ -19,7 +19,7 @@ %% Create test certificates --module(pkey_test). +-module(erl_make_certs). -include_lib("public_key/include/public_key.hrl"). -export([make_cert/1, gen_rsa/1, verify_signature/3, write_pem/3]). @@ -34,7 +34,7 @@ %% version 3 %% subject [] list of the following content %% {name, Name} -%% {email, Email} +%% {email, Email} %% {city, City} %% {state, State} %% {org, Org} @@ -56,7 +56,7 @@ make_cert(Opts) -> SubjectPrivateKey = get_key(Opts), {TBSCert, IssuerKey} = make_tbs(SubjectPrivateKey, Opts), - Cert = public_key:sign(TBSCert, IssuerKey), + Cert = public_key:pkix_sign(TBSCert, IssuerKey), true = verify_signature(Cert, IssuerKey, undef), %% verify that the keys where ok {Cert, encode_key(SubjectPrivateKey)}. @@ -66,8 +66,9 @@ make_cert(Opts) -> %% @end %%-------------------------------------------------------------------- write_pem(Dir, FileName, {Cert, Key = {_,_,not_encrypted}}) when is_binary(Cert) -> - ok = public_key:der_to_pem(filename:join(Dir, FileName ++ ".pem"), [{cert, Cert, not_encrypted}]), - ok = public_key:der_to_pem(filename:join(Dir, FileName ++ "_key.pem"), [Key]). + ok = der_to_pem(filename:join(Dir, FileName ++ ".pem"), + [{'Certificate', Cert, not_encrypted}]), + ok = der_to_pem(filename:join(Dir, FileName ++ "_key.pem"), [Key]). %%-------------------------------------------------------------------- %% @doc Creates a rsa key (OBS: for testing only) @@ -94,18 +95,14 @@ gen_dsa(LSize,NSize) when is_integer(LSize), is_integer(NSize) -> %% @spec (::binary(), ::tuple()) -> ::boolean() %% @end %%-------------------------------------------------------------------- -verify_signature(DerEncodedCert, DerKey, KeyParams) -> +verify_signature(DerEncodedCert, DerKey, _KeyParams) -> Key = decode_key(DerKey), case Key of #'RSAPrivateKey'{modulus=Mod, publicExponent=Exp} -> - public_key:verify_signature(DerEncodedCert, - #'RSAPublicKey'{modulus=Mod, publicExponent=Exp}, - 'NULL'); + public_key:pkix_verify(DerEncodedCert, + #'RSAPublicKey'{modulus=Mod, publicExponent=Exp}); #'DSAPrivateKey'{p=P, q=Q, g=G, y=Y} -> - public_key:verify_signature(DerEncodedCert, Y, #'Dss-Parms'{p=P, q=Q, g=G}); - - _ -> - public_key:verify_signature(DerEncodedCert, Key, KeyParams) + public_key:pkix_verify(DerEncodedCert, {Y, #'Dss-Parms'{p=P, q=Q, g=G}}) end. %%%%%%%%%%%%%%%%%%%%%%%%% Implementation %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% @@ -132,59 +129,63 @@ decode_key(#'RSAPrivateKey'{} = Key,_) -> Key; decode_key(#'DSAPrivateKey'{} = Key,_) -> Key; -decode_key(Der = {_,_,_}, Pw) -> - {ok, Key} = public_key:decode_private_key(Der, Pw), - Key; -decode_key(FileOrDer, Pw) -> - {ok, [KeyInfo]} = public_key:pem_to_der(FileOrDer), +decode_key(PemEntry = {_,_,_}, Pw) -> + public_key:pem_entry_decode(PemEntry, Pw); +decode_key(PemBin, Pw) -> + [KeyInfo] = public_key:pem_decode(PemBin), decode_key(KeyInfo, Pw). encode_key(Key = #'RSAPrivateKey'{}) -> {ok, Der} = 'OTP-PUB-KEY':encode('RSAPrivateKey', Key), - {rsa_private_key, list_to_binary(Der), not_encrypted}; + {'RSAPrivateKey', list_to_binary(Der), not_encrypted}; encode_key(Key = #'DSAPrivateKey'{}) -> {ok, Der} = 'OTP-PUB-KEY':encode('DSAPrivateKey', Key), - {dsa_private_key, list_to_binary(Der), not_encrypted}. + {'DSAPrivateKey', list_to_binary(Der), not_encrypted}. make_tbs(SubjectKey, Opts) -> Version = list_to_atom("v"++integer_to_list(proplists:get_value(version, Opts, 3))), - {Issuer, IssuerKey} = issuer(Opts, SubjectKey), + + IssuerProp = proplists:get_value(issuer, Opts, true), + {Issuer, IssuerKey} = issuer(IssuerProp, Opts, SubjectKey), {Algo, Parameters} = sign_algorithm(IssuerKey, Opts), SignAlgo = #'SignatureAlgorithm'{algorithm = Algo, parameters = Parameters}, - + Subject = case IssuerProp of + true -> %% Is a Root Ca + Issuer; + _ -> + subject(proplists:get_value(subject, Opts),false) + end, + {#'OTPTBSCertificate'{serialNumber = trunc(random:uniform()*100000000)*10000 + 1, signature = SignAlgo, issuer = Issuer, validity = validity(Opts), - subject = subject(proplists:get_value(subject, Opts),false), + subject = Subject, subjectPublicKeyInfo = publickey(SubjectKey), version = Version, extensions = extensions(Opts) }, IssuerKey}. -issuer(Opts, SubjectKey) -> - IssuerProp = proplists:get_value(issuer, Opts, true), - case IssuerProp of - true -> %% Self signed - {subject(proplists:get_value(subject, Opts), true), SubjectKey}; - {Issuer, IssuerKey} when is_binary(Issuer) -> - {issuer_der(Issuer), decode_key(IssuerKey)}; - {File, IssuerKey} when is_list(File) -> - {ok, [{cert, Cert, _}|_]} = public_key:pem_to_der(File), - {issuer_der(Cert), decode_key(IssuerKey)} - end. +issuer(true, Opts, SubjectKey) -> + %% Self signed + {subject(proplists:get_value(subject, Opts), true), SubjectKey}; +issuer({Issuer, IssuerKey}, _Opts, _SubjectKey) when is_binary(Issuer) -> + {issuer_der(Issuer), decode_key(IssuerKey)}; +issuer({File, IssuerKey}, _Opts, _SubjectKey) when is_list(File) -> + {ok, [{cert, Cert, _}|_]} = public_key:pem_to_der(File), + {issuer_der(Cert), decode_key(IssuerKey)}. issuer_der(Issuer) -> - {ok, Decoded} = public_key:pkix_decode_cert(Issuer, otp), + Decoded = public_key:pkix_decode_cert(Issuer, otp), #'OTPCertificate'{tbsCertificate=Tbs} = Decoded, #'OTPTBSCertificate'{subject=Subject} = Tbs, Subject. -subject(undefined, IsCA) -> - User = if IsCA -> "CA"; true -> os:getenv("USER") end, +subject(undefined, IsRootCA) -> + User = if IsRootCA -> "RootCA"; true -> os:getenv("USER") end, Opts = [{email, User ++ "@erlang.org"}, {name, User}, {city, "Stockholm"}, @@ -410,3 +411,11 @@ extended_gcd(A, B) -> {X, Y} = extended_gcd(B, N), {Y, X-Y*(A div B)} end. + +pem_to_der(File) -> + {ok, PemBin} = file:read_file(File), + public_key:pem_decode(PemBin). + +der_to_pem(File, Entries) -> + PemBin = public_key:pem_encode(Entries), + file:write_file(File, PemBin). diff --git a/lib/public_key/test/pkits_SUITE.erl b/lib/public_key/test/pkits_SUITE.erl index 5d58b39e26..1d75e1aed2 100644 --- a/lib/public_key/test/pkits_SUITE.erl +++ b/lib/public_key/test/pkits_SUITE.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2008-2009. All Rights Reserved. +%% Copyright Ericsson AB 2008-2010. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in @@ -187,9 +187,9 @@ run([],_) -> ok. read_certs(Test) -> File = test_file(Test), %% io:format("Read ~p ",[File]), - {ok, Ders} = public_key:pem_to_der(File), + Ders = erl_make_certs:pem_to_der(File), %% io:format("Ders ~p ~n",[length(Ders)]), - [Cert || {cert,Cert,not_encrypted} <- Ders]. + [Cert || {'Certificate', Cert, not_encrypted} <- Ders]. test_file(Test) -> file(?CONV, lists:append(string:tokens(Test, " -")) ++ ".pem"). diff --git a/lib/public_key/test/public_key_SUITE.erl b/lib/public_key/test/public_key_SUITE.erl index dc1015969a..09235ff460 100644 --- a/lib/public_key/test/public_key_SUITE.erl +++ b/lib/public_key/test/public_key_SUITE.erl @@ -101,13 +101,12 @@ all(doc) -> all(suite) -> [app, - dh, - pem_to_der, - decode_private_key, + pk_decode_encode, encrypt_decrypt, sign_verify, pkix, - pkix_path_validation + pkix_path_validation, + deprecated ]. %% Test cases starts here. @@ -120,85 +119,100 @@ app(suite) -> app(Config) when is_list(Config) -> ok = test_server:app_test(public_key). -dh(doc) -> - "Test diffie-hellman functions file is ok"; -dh(suite) -> +pk_decode_encode(doc) -> + ["Tests pem_decode/1, pem_encode/1, " + "der_decode/2, der_encode/2, " + "pem_entry_decode/1, pem_entry_decode/2," + "pem_entry_encode/2, pem_entry_encode/3."]; + +pk_decode_encode(suite) -> []; -dh(Config) when is_list(Config) -> +pk_decode_encode(Config) when is_list(Config) -> Datadir = ?config(data_dir, Config), - {ok,[DerDHparams = {dh_params, _, _}]} = - public_key:pem_to_der(filename:join(Datadir, "dh.pem")), - {ok, DHps = #'DHParameter'{prime=P,base=G}} = public_key:decode_dhparams(DerDHparams), - DHKeys = {Private,_Public} = public_key:gen_key(DHps), - test_server:format("DHparams = ~p~nDH Keys~p~n", [DHps, DHKeys]), - {_Private,_Public2} = pubkey_crypto:gen_key(diffie_hellman, [crypto:erlint(Private), P, G]), - ok. + + [{'DSAPrivateKey', DerDSAKey, not_encrypted} = Entry0 ] = + erl_make_certs:pem_to_der(filename:join(Datadir, "dsa.pem")), + + DSAKey = public_key:der_decode('DSAPrivateKey', DerDSAKey), + + DSAKey = public_key:pem_entry_decode(Entry0), + + [{'RSAPrivateKey', DerRSAKey, not_encrypted} = Entry1 ] = + erl_make_certs:pem_to_der(filename:join(Datadir, "client_key.pem")), + + RSAKey0 = public_key:der_decode('RSAPrivateKey', DerRSAKey), + + RSAKey0 = public_key:pem_entry_decode(Entry1), + + [{'RSAPrivateKey', _, {_,_}} = Entry2] = + erl_make_certs:pem_to_der(filename:join(Datadir, "rsa.pem")), + true = check_entry_type(public_key:pem_entry_decode(Entry2, "abcd1234"), + 'RSAPrivateKey'), -pem_to_der(doc) -> - ["Check that supported PEM files are decoded into the expected entry type"]; -pem_to_der(suite) -> - []; -pem_to_der(Config) when is_list(Config) -> - Datadir = ?config(data_dir, Config), - {ok,DSAKey =[{dsa_private_key, _, not_encrypted}]} = - public_key:pem_to_der(filename:join(Datadir, "dsa.pem")), - {ok,[{rsa_private_key, _, _}]} = - public_key:pem_to_der(filename:join(Datadir, "client_key.pem")), - {ok, [{rsa_private_key, _, _}]} = - public_key:pem_to_der(filename:join(Datadir, "rsa.pem")), - {ok,[{rsa_private_key, _, _}]} = - public_key:pem_to_der(filename:join(Datadir, "rsa.pem"), "abcd1234"), - {ok, Bin0} = file:read_file(filename:join(Datadir, "rsa.pem")), - {ok, [{rsa_private_key, _, _}]} = public_key:pem_to_der(Bin0, "abcd1234"), - - {ok,[{dh_params, _, _}]} = - public_key:pem_to_der(filename:join(Datadir, "dh.pem")), - {ok,[{cert, _, not_encrypted}]} = - public_key:pem_to_der(filename:join(Datadir, "client_cert.pem")), - {ok,[{cert_req, _, _}]} = - public_key:pem_to_der(filename:join(Datadir, "req.pem")), - {ok, Certs = [{cert, _, _}, {cert, _, _}]} = - public_key:pem_to_der(filename:join(Datadir, "cacerts.pem")), - - {ok, Bin1} = file:read_file(filename:join(Datadir, "cacerts.pem")), - {ok, [{cert, _, _}, {cert, _, _}]} = public_key:pem_to_der(Bin1), - - ok = public_key:der_to_pem(filename:join(Datadir, "wcacerts.pem"), Certs), - ok = public_key:der_to_pem(filename:join(Datadir, "wdsa.pem"), DSAKey), + Salt0 = crypto:rand_bytes(8), + Entry3 = public_key:pem_entry_encode('RSAPrivateKey', RSAKey0, + {{"DES-EDE3-CBC", Salt0}, "1234abcd"}), + + RSAKey0 = public_key:pem_entry_decode(Entry3,"1234abcd"), - {ok, Certs} = public_key:pem_to_der(filename:join(Datadir, "wcacerts.pem")), - {ok, DSAKey} = public_key:pem_to_der(filename:join(Datadir, "wdsa.pem")), + Des3KeyFile = filename:join(Datadir, "des3_client_key.pem"), - ok. -%%-------------------------------------------------------------------- -decode_private_key(doc) -> - ["Check that private keys are decode to the expected key type."]; -decode_private_key(suite) -> - []; -decode_private_key(Config) when is_list(Config) -> - Datadir = ?config(data_dir, Config), - {ok,[DsaKey = {dsa_private_key, _DsaKey, _}]} = - public_key:pem_to_der(filename:join(Datadir, "dsa.pem")), - {ok,[RsaKey = {rsa_private_key, _RsaKey,_}]} = - public_key:pem_to_der(filename:join(Datadir, "client_key.pem")), - {ok,[ProtectedRsaKey1 = {rsa_private_key, _ProtectedRsaKey1,_}]} = - public_key:pem_to_der(filename:join(Datadir, "rsa.pem"), "abcd1234"), - {ok,[ProtectedRsaKey2 = {rsa_private_key, _ProtectedRsaKey2,_}]} = - public_key:pem_to_der(filename:join(Datadir, "rsa.pem")), + erl_make_certs:der_to_pem(Des3KeyFile, [Entry3]), - {ok, #'DSAPrivateKey'{}} = public_key:decode_private_key(DsaKey), - {ok, #'RSAPrivateKey'{}} = public_key:decode_private_key(RsaKey), - {ok, #'RSAPrivateKey'{}} = public_key:decode_private_key(ProtectedRsaKey1), - {ok, #'RSAPrivateKey'{}} = public_key:decode_private_key(ProtectedRsaKey2, "abcd1234"), + [{'RSAPrivateKey', _, {"DES-EDE3-CBC", Salt0}}] = erl_make_certs:pem_to_der(Des3KeyFile), + + Salt1 = crypto:rand_bytes(8), + Entry4 = public_key:pem_entry_encode('RSAPrivateKey', RSAKey0, + {{"DES-CBC", Salt1}, "4567efgh"}), + + + DesKeyFile = filename:join(Datadir, "des_client_key.pem"), + + erl_make_certs:der_to_pem(DesKeyFile, [Entry4]), + + [{'RSAPrivateKey', _, {"DES-CBC", Salt1}} =Entry5] = erl_make_certs:pem_to_der(DesKeyFile), + + + true = check_entry_type(public_key:pem_entry_decode(Entry5, "4567efgh"), + 'RSAPrivateKey'), + + [{'DHParameter', DerDH, not_encrypted} = Entry6] = + erl_make_certs:pem_to_der(filename:join(Datadir, "dh.pem")), + + erl_make_certs:der_to_pem(filename:join(Datadir, "new_dh.pem"), [Entry6]), + + DHParameter = public_key:der_decode('DHParameter', DerDH), + DHParameter = public_key:pem_entry_decode(Entry6), + + Entry6 = public_key:pem_entry_encode('DHParameter', DHParameter), + + [{'Certificate', DerCert, not_encrypted} = Entry7] = + erl_make_certs:pem_to_der(filename:join(Datadir, "client_cert.pem")), + + Cert = public_key:der_decode('Certificate', DerCert), + Cert = public_key:pem_entry_decode(Entry7), + + CertEntries = [{'Certificate', _, not_encrypted} = CertEntry0, + {'Certificate', _, not_encrypted} = CertEntry1] = + erl_make_certs:pem_to_der(filename:join(Datadir, "cacerts.pem")), + + ok = erl_make_certs:der_to_pem(filename:join(Datadir, "wcacerts.pem"), CertEntries), + ok = erl_make_certs:der_to_pem(filename:join(Datadir, "wdsa.pem"), [Entry0]), + + NewCertEntries = erl_make_certs:pem_to_der(filename:join(Datadir, "wcacerts.pem")), + true = lists:member(CertEntry0, NewCertEntries), + true = lists:member(CertEntry1, NewCertEntries), + [Entry0] = erl_make_certs:pem_to_der(filename:join(Datadir, "wdsa.pem")), ok. + %%-------------------------------------------------------------------- encrypt_decrypt(doc) -> [""]; encrypt_decrypt(suite) -> []; encrypt_decrypt(Config) when is_list(Config) -> - {PrivateKey, _DerKey} = pkey_test:gen_rsa(64), + {PrivateKey, _DerKey} = erl_make_certs:gen_rsa(64), #'RSAPrivateKey'{modulus=Mod, publicExponent=Exp} = PrivateKey, PublicKey = #'RSAPublicKey'{modulus=Mod, publicExponent=Exp}, Msg = list_to_binary(lists:duplicate(5, "Foo bar 100")), @@ -219,69 +233,81 @@ sign_verify(suite) -> []; sign_verify(Config) when is_list(Config) -> %% Make cert signs and validates the signature using RSA and DSA - Ca = {_, CaKey} = pkey_test:make_cert([]), - {ok, PrivateRSA = #'RSAPrivateKey'{modulus=Mod, publicExponent=Exp}} = - public_key:decode_private_key(CaKey), + Ca = {_, CaKey} = erl_make_certs:make_cert([]), + PrivateRSA = #'RSAPrivateKey'{modulus=Mod, publicExponent=Exp} = + public_key:pem_entry_decode(CaKey), - CertInfo = {Cert1,CertKey1} = pkey_test:make_cert([{key, dsa}, {issuer, Ca}]), + CertInfo = {Cert1,CertKey1} = erl_make_certs:make_cert([{key, dsa}, {issuer, Ca}]), PublicRSA = #'RSAPublicKey'{modulus=Mod, publicExponent=Exp}, - true = public_key:verify_signature(Cert1, PublicRSA, undefined), + true = public_key:pkix_verify(Cert1, PublicRSA), - {Cert2,_CertKey} = pkey_test:make_cert([{issuer, CertInfo}]), + {Cert2,_CertKey} = erl_make_certs:make_cert([{issuer, CertInfo}]), - {ok, #'DSAPrivateKey'{p=P, q=Q, g=G, y=Y, x=_X}} = - public_key:decode_private_key(CertKey1), - true = public_key:verify_signature(Cert2, Y, #'Dss-Parms'{p=P, q=Q, g=G}), + #'DSAPrivateKey'{p=P, q=Q, g=G, y=Y, x=_X} = + public_key:pem_entry_decode(CertKey1), + true = public_key:pkix_verify(Cert2, {Y, #'Dss-Parms'{p=P, q=Q, g=G}}), %% RSA sign Msg0 = lists:duplicate(5, "Foo bar 100"), Msg = list_to_binary(Msg0), - RSASign = public_key:sign(sha, Msg0, PrivateRSA), - RSASign = public_key:sign(Msg, PrivateRSA), - true = public_key:verify_signature(Msg, sha, RSASign, PublicRSA), - false = public_key:verify_signature(<<1:8, Msg/binary>>, sha, RSASign, PublicRSA), - false = public_key:verify_signature(Msg, sha, <<1:8, RSASign/binary>>, PublicRSA), - RSASign = public_key:sign(sha, Msg, PrivateRSA), - - RSASign1 = public_key:sign(md5, Msg, PrivateRSA), - true = public_key:verify_signature(Msg, md5, RSASign1, PublicRSA), + + RSASign = public_key:sign(Msg0, sha, PrivateRSA), + RSASign = public_key:sign(Msg, sha, PrivateRSA), + true = public_key:verify(Msg, sha, RSASign, PublicRSA), + false = public_key:verify(<<1:8, Msg/binary>>, sha, RSASign, PublicRSA), + false = public_key:verify(Msg, sha, <<1:8, RSASign/binary>>, PublicRSA), + + RSASign1 = public_key:sign(Msg, md5, PrivateRSA), + true = public_key:verify(Msg, md5, RSASign1, PublicRSA), %% DSA sign Datadir = ?config(data_dir, Config), - {ok,[DsaKey = {dsa_private_key, _, _}]} = - public_key:pem_to_der(filename:join(Datadir, "dsa.pem")), - {ok, DSAPrivateKey} = public_key:decode_private_key(DsaKey), + [DsaKey = {'DSAPrivateKey', _, _}] = + erl_make_certs:pem_to_der(filename:join(Datadir, "dsa.pem")), + DSAPrivateKey = public_key:pem_entry_decode(DsaKey), #'DSAPrivateKey'{p=P1, q=Q1, g=G1, y=Y1, x=_X1} = DSAPrivateKey, - DSASign = public_key:sign(Msg, DSAPrivateKey), + DSASign = public_key:sign(Msg, sha, DSAPrivateKey), DSAPublicKey = Y1, DSAParams = #'Dss-Parms'{p=P1, q=Q1, g=G1}, - true = public_key:verify_signature(Msg, sha, DSASign, DSAPublicKey, DSAParams), - false = public_key:verify_signature(<<1:8, Msg/binary>>, sha, DSASign, DSAPublicKey, DSAParams), - false = public_key:verify_signature(Msg, sha, <<1:8, DSASign/binary>>, DSAPublicKey, DSAParams), + true = public_key:verify(Msg, sha, DSASign, {DSAPublicKey, DSAParams}), + false = public_key:verify(<<1:8, Msg/binary>>, sha, DSASign, + {DSAPublicKey, DSAParams}), + false = public_key:verify(Msg, sha, <<1:8, DSASign/binary>>, + {DSAPublicKey, DSAParams}), + + Digest = crypto:sha(Msg), + DigestSign = public_key:sign(Digest, none, DSAPrivateKey), + true = public_key:verify(Digest, none, DigestSign, {DSAPublicKey, DSAParams}), + <<_:8, RestDigest/binary>> = Digest, + false = public_key:verify(<<1:8, RestDigest/binary>>, none, DigestSign, + {DSAPublicKey, DSAParams}), + false = public_key:verify(Digest, none, <<1:8, DigestSign/binary>>, + {DSAPublicKey, DSAParams}), ok. - +%%-------------------------------------------------------------------- pkix(doc) -> "Misc pkix tests not covered elsewhere"; pkix(suite) -> []; pkix(Config) when is_list(Config) -> Datadir = ?config(data_dir, Config), - {ok,Certs0} = public_key:pem_to_der(filename:join(Datadir, "cacerts.pem")), - {ok,Certs1} = public_key:pem_to_der(filename:join(Datadir, "client_cert.pem")), - TestTransform = fun({cert, CertDer, not_encrypted}) -> - {ok, PlainCert} = public_key:pkix_decode_cert(CertDer, plain), - {ok, OtpCert} = public_key:pkix_decode_cert(CertDer, otp), - CertDer = public_key:pkix_encode_cert(OtpCert), - CertDer = public_key:pkix_encode_cert(PlainCert), - - OTPSubj = (OtpCert#'OTPCertificate'.tbsCertificate)#'OTPTBSCertificate'.subject, - Subj = public_key:pkix_transform(OTPSubj, encode), - {ok, DNEncoded} = 'OTP-PUB-KEY':encode('Name', Subj), - Subj2 = (PlainCert#'Certificate'.tbsCertificate)#'TBSCertificate'.subject, - {ok, DNEncoded} = 'OTP-PUB-KEY':encode('Name', Subj2), - OTPSubj = public_key:pkix_transform(Subj2, decode), + Certs0 = erl_make_certs:pem_to_der(filename:join(Datadir, "cacerts.pem")), + Certs1 = erl_make_certs:pem_to_der(filename:join(Datadir, "client_cert.pem")), + TestTransform = fun({'Certificate', CertDer, not_encrypted}) -> + PlainCert = public_key:pkix_decode_cert(CertDer, plain), + OtpCert = public_key:pkix_decode_cert(CertDer, otp), + CertDer = + public_key:pkix_encode('OTPCertificate', OtpCert, otp), + CertDer = + public_key:pkix_encode('Certificate', PlainCert, plain), + OTPTBS = OtpCert#'OTPCertificate'.tbsCertificate, + OTPSubj = OTPTBS#'OTPTBSCertificate'.subject, + DNEncoded = public_key:pkix_encode('Name', OTPSubj, otp), + PlainTBS = PlainCert#'Certificate'.tbsCertificate, + Subj2 = PlainTBS#'TBSCertificate'.subject, + DNEncoded = public_key:pkix_encode('Name', Subj2, plain), false = public_key:pkix_is_fixed_dh_cert(CertDer) end, @@ -290,26 +316,31 @@ pkix(Config) when is_list(Config) -> true = public_key:pkix_is_self_signed(element(2,hd(Certs0))), false = public_key:pkix_is_self_signed(element(2,hd(Certs1))), - CaIds = [element(2, public_key:pkix_issuer_id(Cert, self)) || {cert, Cert, _} <- Certs0], - {ok, IssuerId = {_, IssuerName}} = public_key:pkix_issuer_id(element(2,hd(Certs1)), other), + CaIds = [element(2, public_key:pkix_issuer_id(Cert, self)) || + {'Certificate', Cert, _} <- Certs0], + {ok, IssuerId = {_, _IssuerName}} = + public_key:pkix_issuer_id(element(2,hd(Certs1)), other), + true = lists:member(IssuerId, CaIds), %% Should be normalized allready - TestStr = {rdnSequence, [[{'AttributeTypeAndValue', {2,5,4,3},{printableString,"ERLANGCA"}}], - [{'AttributeTypeAndValue', {2,5,4,3},{printableString," erlang ca "}}]]}, - VerifyStr = {rdnSequence, [[{'AttributeTypeAndValue', {2,5,4,3},{printableString,"erlang ca"}}], - [{'AttributeTypeAndValue', {2,5,4,3},{printableString,"erlangca"}}]]}, - VerifyStr = public_key:pkix_normalize_general_name(TestStr), + TestStr = {rdnSequence, + [[{'AttributeTypeAndValue', {2,5,4,3},{printableString,"ERLANGCA"}}], + [{'AttributeTypeAndValue', {2,5,4,3},{printableString," erlang ca "}}]]}, + VerifyStr = {rdnSequence, + [[{'AttributeTypeAndValue', {2,5,4,3},{printableString,"erlang ca"}}], + [{'AttributeTypeAndValue', {2,5,4,3},{printableString,"erlangca"}}]]}, + VerifyStr = public_key:pkix_normalize_name(TestStr), ok. - +%%-------------------------------------------------------------------- pkix_path_validation(doc) -> "Misc pkix tests not covered elsewhere"; pkix_path_validation(suite) -> []; pkix_path_validation(Config) when is_list(Config) -> CaK = {Trusted,_} = - pkey_test:make_cert([{key, dsa}, + erl_make_certs:make_cert([{key, dsa}, {subject, [ {name, "Public Key"}, {?'id-at-name', {printableString, "public_key"}}, @@ -320,26 +351,64 @@ pkix_path_validation(Config) when is_list(Config) -> {org_unit, "testing dep"} ]} ]), - ok = pkey_test:write_pem("./", "public_key_cacert", CaK), + ok = erl_make_certs:write_pem("./", "public_key_cacert", CaK), - CertK1 = {Cert1, _} = pkey_test:make_cert([{issuer, CaK}]), - CertK2 = {Cert2,_} = pkey_test:make_cert([{issuer, CertK1}, {digest, md5}, {extensions, false}]), - ok = pkey_test:write_pem("./", "public_key_cert", CertK2), + CertK1 = {Cert1, _} = erl_make_certs:make_cert([{issuer, CaK}]), + CertK2 = {Cert2,_} = erl_make_certs:make_cert([{issuer, CertK1}, + {digest, md5}, {extensions, false}]), + ok = erl_make_certs:write_pem("./", "public_key_cert", CertK2), {ok, _} = public_key:pkix_path_validation(Trusted, [Cert1], []), - {error, {bad_cert,invalid_issuer}} = public_key:pkix_path_validation(Trusted, [Cert2], []), - %%{error, {bad_cert,invalid_issuer}} = public_key:pkix_path_validation(Trusted, [Cert2], [{verify,false}]), + {error, {bad_cert,invalid_issuer}} = + public_key:pkix_path_validation(Trusted, [Cert2], []), {ok, _} = public_key:pkix_path_validation(Trusted, [Cert1, Cert2], []), {error, issuer_not_found} = public_key:pkix_issuer_id(Cert2, other), - CertK3 = {Cert3,_} = pkey_test:make_cert([{issuer, CertK1}, {extensions, [{basic_constraints, false}]}]), - {Cert4,_} = pkey_test:make_cert([{issuer, CertK3}]), + CertK3 = {Cert3,_} = erl_make_certs:make_cert([{issuer, CertK1}, + {extensions, [{basic_constraints, false}]}]), + {Cert4,_} = erl_make_certs:make_cert([{issuer, CertK3}]), {error, E={bad_cert,missing_basic_constraint}} = public_key:pkix_path_validation(Trusted, [Cert1, Cert3,Cert4], []), - {ok, {_,_,[E]}} = public_key:pkix_path_validation(Trusted, [Cert1, Cert3,Cert4], [{verify,false}]), + {ok, {_,_,[E]}} = public_key:pkix_path_validation(Trusted, [Cert1, Cert3,Cert4], + [{verify,false}]), - % test_server:format("PV ~p ~n", [Result]), + {error, {bad_cert,unknown_ca}} = public_key:pkix_path_validation(unknown_ca, [Cert1, Cert3, Cert4], []), + + {ok, {_,_,[{bad_cert,unknown_ca}]}} = + public_key:pkix_path_validation(unknown_ca, [Cert1], [{verify, false}]), ok. + +%%-------------------------------------------------------------------- +deprecated(doc) -> + ["Check deprecated functions."]; +deprecated(suite) -> + []; +deprecated(Config) when is_list(Config) -> + Datadir = ?config(data_dir, Config), + [DsaKey = {'DSAPrivateKey', _DsaKey, _}] = + public_key:pem_to_der(filename:join(Datadir, "dsa.pem")), + [RsaKey = {'RSAPrivateKey', _RsaKey,_}] = + public_key:pem_to_der(filename:join(Datadir, "client_key.pem")), + [ProtectedRsaKey = {'RSAPrivateKey', _ProtectedRsaKey,_}] = + public_key:pem_to_der(filename:join(Datadir, "rsa.pem")), + + {ok, #'DSAPrivateKey'{}} = public_key:decode_private_key(DsaKey), + {ok, #'RSAPrivateKey'{}} = public_key:decode_private_key(RsaKey), + {ok, #'RSAPrivateKey'{}} = public_key:decode_private_key(ProtectedRsaKey, "abcd1234"), + ok. + +%%-------------------------------------------------------------------- + +check_entry_type(#'DSAPrivateKey'{}, 'DSAPrivateKey') -> + true; +check_entry_type(#'RSAPrivateKey'{}, 'RSAPrivateKey') -> + true; +check_entry_type(#'DHParameter'{}, 'DHParameter') -> + true; +check_entry_type(#'Certificate'{}, 'Certificate') -> + true; +check_entry_type(_,_) -> + false. diff --git a/lib/public_key/vsn.mk b/lib/public_key/vsn.mk index 4b3071a85b..f70209d891 100644 --- a/lib/public_key/vsn.mk +++ b/lib/public_key/vsn.mk @@ -1,11 +1 @@ -PUBLIC_KEY_VSN = 0.7 - -TICKETS = OTP-8626 OTP-8649 - -#TICKETS_0.6 = OTP-7046 \ -# OTP-8553 -#TICKETS_0.5 = OTP-8372 -#TICKETS_0.4 = OTP-8250 -#TICKETS_0.3 = OTP-8100 OTP-8142 -#TICKETS_0.2 = OTP-7860 -#TICKETS_0.1 = OTP-7637
\ No newline at end of file +PUBLIC_KEY_VSN = 0.8 diff --git a/lib/reltool/doc/src/reltool.xml b/lib/reltool/doc/src/reltool.xml index 0c2b7d2a2b..598594145a 100644 --- a/lib/reltool/doc/src/reltool.xml +++ b/lib/reltool/doc/src/reltool.xml @@ -48,8 +48,8 @@ <c>root_dir</c> is the root directory of the analysed system and it defaults to the system executing <c>reltool</c>. Applications may also be located outside <c>root_dir</c>. <c>lib_dirs</c> - defines additional library directories where applications - additional may reside and it defaults to the the directories + defines library directories where additional applications + may reside and it defaults to the directories listed by the operating system environment variable <c>ERL_LIBS</c>. See the module <c>code</c> for more info. Finally single modules and entire applications may be read from @@ -58,10 +58,10 @@ <p>Some configuration parameters control the behavior of Reltool on system (<c>sys</c>) level. Others provide control on application (<c>app</c>) level and yet others are on module - (<c>mod</c>) level. Module level parameters overrides application - level parameters and application level parameters overrides system + (<c>mod</c>) level. Module level parameters override application + level parameters and application level parameters override system level parameters. Escript <c>escript</c> level parameters - overrides system level parameters.</p> + override system level parameters.</p> <p>The following top level <c>options</c> are supported:</p> @@ -74,7 +74,7 @@ a name of a <c>file</c> containing a sys tuple.</p> </item> - <tag><c>trap_exit></c></tag> + <tag><c>trap_exit</c></tag> <item> <p>This option controls the error handling behavior of <c>reltool</c>. By default the window processes traps @@ -123,10 +123,10 @@ defaults to <c>all</c> which means that if an application is included (either explicitly or implicitly) all modules in that application will be included. This implies that both modules - that exists on the <c>ebin</c> directory of the application, + that exist in the <c>ebin</c> directory of the application, as well as modules that are named in the <c>app</c> file will be included. If the parameter is set to <c>ebin</c>, both - modules on the <c>ebin</c> directory and derived modules are + modules in the <c>ebin</c> directory and derived modules are included. If the parameter is set to <c>app</c>, both modules in the <c>app</c> file and derived modules are included. <c>derived</c> means that only modules that are used by other @@ -138,13 +138,13 @@ <item> <p>This parameter controls the application and escript inclusion policy. It defaults to <c>derived</c> which means - that the applications that not have any explicit + that the applications that do not have any explicit <c>incl_cond</c> setting, will only be included if any other (explicitly or implicitly included) application uses it. The value <c>include</c> implies that all applications and - escripts that that not have any explicit <c>incl_cond</c> + escripts that do not have any explicit <c>incl_cond</c> setting will be included. <c>exclude</c> implies that all - applications and escripts) that that not have any explicit + applications and escripts) that do not have any explicit <c>incl_cond</c> setting will be excluded.</p> </item> @@ -158,7 +158,7 @@ <tag><c>rel</c></tag> <item> <p>Release specific configuration. Each release maps to a - <c>rel</c>, <c>script</c> and <c>boot </c> file. See the + <c>rel</c>, <c>script</c> and <c>boot</c> file. See the module <c>systools</c> for more info about the details. Each release has a name, a version and a set of applications with a few release specific parameters such as type and included @@ -168,7 +168,7 @@ <tag><c>relocatable</c></tag> <item> <p>This parameter controls whether the <c>erl</c> executable - in the target system automatically should determine where it + in the target system should automatically determine where it is installed or if it should use a hardcoded path to the installation. In the latter case the target system must be installed with <c>reltool:install/2</c> before it can be @@ -182,7 +182,7 @@ <p>The creation of the specification for a target system is performed in two steps. In the first step a complete specification is generated. It will likely contain much more - files than you are interested in your customized target + files than you are interested in in your customized target system. In the second step the specification will be filtered according to your filters. There you have the ability to specify filters per application as well as system wide @@ -224,12 +224,12 @@ <tag><c>incl_sys_filters</c></tag> <item> <p>This parameter normally contains a list of regular - expressions that controls which files in the system that + expressions that controls which files in the system should be included. Each file in the target system must match at least one of the listed regular expressions in order to be included. Further the files may not match any filter in <c>excl_sys_filters</c> in order to be included. Which - application files that should be included are controlled with + application files should be included is controlled with the parameters <c>incl_app_filters</c> and <c>excl_app_filters</c>. This parameter defaults to <c>[".*"]</c>.</p> @@ -238,8 +238,8 @@ <tag><c>excl_sys_filters</c></tag> <item> <p>This parameter normally contains a list of regular - expressions that controls which files in the system that not - should be included in the target system. In order to be + expressions that controls which files in the system should + not be included in the target system. In order to be included, a file must match some filter in <c>incl_sys_filters</c> but not any filter in <c>excl_sys_filters</c>. This parameter defaults to @@ -260,7 +260,7 @@ <item> <p>This parameter normally contains a list of regular expressions that controls which application specific files - that not should be included in the target system. In order to + should not be included in the target system. In order to be included, a file must match some filter in <c>incl_app_filters</c> but not any filter in <c>excl_app_filters</c>. This parameter defaults to @@ -271,8 +271,8 @@ <item> <p>This parameter normally contains a list of regular expressions that controls which top level directories in an - application that should be included in an archive file (as - opposed of beeing included as a regular directory outside the + application should be included in an archive file (as + opposed to being included as a regular directory outside the archive). Each top directory in the application must match at least one of the listed regular expressions in order to be included. Further the files may not match any filter in @@ -284,7 +284,7 @@ <item> <p>This parameter normally contains a list of regular expressions that controls which top level directories in an - application that not should be included in an archive file. In + application should not be included in an archive file. In order to be included in the application archive, a top directory must match some filter in <c>incl_archive_filters</c> but not any filter in <c>excl_archive_filters</c>. This @@ -295,15 +295,15 @@ <item> <p>This parameter contains a list of options that are given to <c>zip:create/3</c> when application specific files are - packaged into an archive. All options are not supported. The - most useful options in this context, are the ones that - controls which types of files that should be compressed. This + packaged into an archive. Only a subset of the options are + supported. The most useful options in this context are the ones + that control which types of files should be compressed. This parameter defaults to <c>[]</c>.</p> </item> </taglist> - <p>On application (<c>escript</c>) level,the following options are + <p>On application (<c>escript</c>) level, the following options are supported:</p> <taglist> @@ -314,7 +314,7 @@ </item> </taglist> - <p>On application (<c>app</c>) level,the following options are + <p>On application (<c>app</c>) level, the following options are supported:</p> <taglist> @@ -322,8 +322,8 @@ <item> <p>The version of the application. In an installed system there may exist several versions of an application. The <c>vsn</c> parameter - controls which version of the application that will be choosen. If it - is omitted, the latest version will be choosen.</p> + controls which version of the application will be chosen. If it + is omitted, the latest version will be chosen.</p> </item> <tag><c>mod</c></tag> <item> @@ -380,7 +380,7 @@ </item> </taglist> - <p>On module (<c>mod</c>) level,the following options are + <p>On module (<c>mod</c>) level, the following options are supported:</p> <taglist> @@ -391,9 +391,9 @@ will be used to control whether the module is included or not. The value of <c>incl_cond</c> overrides the module inclusion policy. <c>include</c> implies that the module is included, while - <c>exclude</c> implies that the module not is included. - <c>derived</c> implies that the is included if any included uses the - module.</p> + <c>exclude</c> implies that the module is not included. + <c>derived</c> implies that the module is included if it is used + by any other included module.</p> </item> <tag><c>debug_info</c></tag> <item> @@ -546,12 +546,12 @@ target_spec() = [target_spec()] files are by default copied to the target system. The <c>releases</c> directory contains generated <c>rel</c>, <c>script</c>, and <c>boot</c> files. The <c>lib</c> directory - contains the applications. Which applications that are included + contains the applications. Which applications are included and if they should be customized (archived, stripped from debug info etc.) is specified with various configuration parameters. The files in the <c>bin</c> directory are copied from the <c>erts-vsn/bin</c> directory, but only those files - that was originally included in <c>bin</c> directory of the + that were originally included in the <c>bin</c> directory of the source system.</p> <p>If the configuration parameter <c>relocatable</c> was set to @@ -584,10 +584,10 @@ target_spec() = [target_spec()] <v>Reason = reason()</v> </type> <desc><p>Get reltool configuration. Normally, only the explicit - configuration parameters with values that differs from their + configuration parameters with values that differ from their defaults are interesting. But the builtin default values can be returned by setting <c>InclDefaults</c> to <c>true</c>. The - derived configuration can be return by setting + derived configuration can be returned by setting <c>InclDerived</c> to <c>true</c>.</p></desc> </func> @@ -705,7 +705,7 @@ target_spec() = [target_spec()] <v>Reason = reason()</v> </type> <desc><p>Start a server process with options. The server process - identity can be given as argument to several other functions in the + identity can be given as an argument to several other functions in the API.</p></desc> </func> diff --git a/lib/reltool/doc/src/reltool_usage.xml b/lib/reltool/doc/src/reltool_usage.xml index 885828d1f0..0a053a014e 100644 --- a/lib/reltool/doc/src/reltool_usage.xml +++ b/lib/reltool/doc/src/reltool_usage.xml @@ -44,7 +44,7 @@ <section> <title>System window</title> <p>The system window is started with the function - <c>reltool:start/1</c>. At startup the tool will process the all + <c>reltool:start/1</c>. At startup the tool will process all <c>beam</c> files and <c>app</c> files in order to find out dependencies between applications and their modules. Once all this information has been derived, it will be possible to explore the tool.</p> @@ -67,29 +67,29 @@ <section> <title>Libraries</title> <p>On the library page it is possible to control which sources - that the tool will use. The page is organized as a tree which + the tool will use. The page is organized as a tree which can be expanded and collapsed by clicking on the little symbol in the beginning of the expandable/collapsible lines.</p> <p>The <c>Root directory</c> can be edited by selecting the line where the path of the root directory is displayed and - clicking with the right mouse button. Choose edit in the menu - that pops up. </p> + clicking the right mouse button. Choose edit in the menu + that pops up.</p> <p>Library directories can be added, edited or deleted. This is done by selecting the line where the path to a library - directory is displayed and clicking with the right mouse + directory is displayed and clicking the right mouse button. Choose add, edit or delete in the menu that pops up. New library directories can also be added by selecting the - line <c>Library directories</c> and clicking with the right + line <c>Library directories</c> and clicking the right mouse button. Choose add in the menu that pops up.</p> <p>Escript files can be added, edited or deleted. This is done by selecting the line where the path to an escript file is - displayed and clicking with the right mouse button. Choose + displayed and clicking the right mouse button. Choose add, edit or delete in the menu that pops up. New escripts can also be added by selecting the line <c>Escript files</c> and - clicking with the right mouse button. Choose add in the menu + clicking the right mouse button. Choose add in the menu that pops up.</p> <p>When libraries and escripts are expanded, the names of @@ -102,7 +102,7 @@ <p>On the system settings page it is possible to control some global settings that are used as defaults for all applications. Set the <c>Application inclusion policy</c> to - <c>include</c> to include all applications that not are + <c>include</c> to include all applications that are not explicitly excluded. See <c>incl_cond</c> (application inclusion) and <c>mod_cond</c> (module inclusion) in the reference manual for the module <c>reltool</c> for more @@ -131,14 +131,14 @@ <p>The symbols in front of the application names are intended to describe the status of the application. There are error - symbols and warning symbols that means that there are - something that needs attention. The tick symbol means that the + and warning symbols to signalize that there is + something which needs attention. The tick symbol means that the application is included or derived and no problem has been detected. The cross symbol means that the application is excluded or available and no problem has been detected. Applications with error symbols are listed first in - each category, then comes the warnings and the normal ones - (ticks and crosses) are found at the end.</p> + each category and are followed by the warnings and the + normal ones (ticks and crosses) at the end.</p> <p>Double click on an application to launch its application window.</p> @@ -175,8 +175,8 @@ </item> <item> <p><c>Save configuration</c> - Saves the current - configuration to file. Normally, only the explictit - configuration parameters with values that differs from their + configuration to file. Normally, only the explicit + configuration parameters with values that differ from their defaults are saved. But the configuration with or without default values and with or without derived values may also be saved.</p> @@ -204,21 +204,21 @@ <p>It is possible to perform some limited manipulations of the graph. Nodes can be moved, selected, locked or deleted. Move a single node or the entire graph by moving the mouse while the - left mouse button is pressed. A node is can be locked into a fix + left mouse button is pressed. A node can be locked into a fix position by holding down the shift button when the left mouse button is released. Select several nodes by moving the mouse - while the control key and the left mouse button i + while the control key and the left mouse button are pressed. Selected nodes can be locked, unlocked or deleted by - klicking on a suitable button.</p> + clicking on a suitable button.</p> <p>The algorithm that is used to draw a graph with as few crossed links as possible is called force graph. A force graph - consists of nodes and directed link between nodes. Each node is + consists of nodes and directed links between nodes. Each node is associated with a repulsive force that pushes nodes away from each other. This force can be adjusted with the left slider or with the mouse wheel. Each link is associated with an attractive - force that pulls the nodes nearer each other. This force can be - adjusted with the right slider. If this force becomes to strong, + force that pulls the nodes nearer to each other. This force can be + adjusted with the right slider. If this force becomes too strong, the graph will be unstable. The third parameter that can be adjusted is the length of the links. It is adjusted with the middle slider.</p> @@ -256,7 +256,7 @@ <p>Select version of the application in the <c>Source selection policy</c> part of the page. By default the latest version of the application is selected, but it is possible to override this by - explicitly select another version.</p> + explicitly selecting another version.</p> <p>By default the <c>Application inclusion policy</c> on system level is used for all applications. Set the value to @@ -272,10 +272,10 @@ want actually used modules to be included. Set it to <c>app</c> if you, besides derived modules, also want the modules listed in the app file to be included. Set it to <c>ebin</c> if you, besides - derived modules, also want the modules that exists as beam files - on the ebin directory to be included. Set it to <c>all</c> if you + derived modules, also want the modules that exist as beam files + in the ebin directory to be included. Set it to <c>all</c> if you want all modules to be included, that is the union of modules - found on the ebin directory and listed in the app file.</p> + found in the ebin directory and listed in the app file.</p> <p>The application settings page is rather incomplete.</p> </section> @@ -299,16 +299,16 @@ undone.</p> <p>The symbols in front of the module names are intended to - describe the status of the module. There are error symbols - and warning symbols that means that there are something that needs + describe the status of the module. There are error and + and warning symbols to signalize that there is something that needs attention. The tick symbol means that the module is included or derived and no problem has been detected. The cross symbol means that the module is excluded or available and no problem has been detected. Modules with error symbols are listed - first in each category, then comes the warnings and the normal - ones (ticks and crosses) are found at the end.</p> + first in each category and are followed by warnings and the + normal ones (ticks and crosses) at the end.</p> - <p>Double click on an module to launch its module window.</p> + <p>Double click on a module to launch its module window.</p> </section> @@ -323,7 +323,7 @@ <c>app</c> file. If the application includes other applications, these are listed under <c>Included</c>. These applications are listed in the <c>included_applications</c> part of the <c>app</c> - file. If the application uses modules other applications, these + file. If the application uses other applications, these are listed under <c>Uses</c>.</p> <p>Double click on an application name to launch an application window.</p> @@ -336,7 +336,7 @@ <p>There are two categories of modules on the <c>Module dependencies</c> page. If the module is used by other modules, these are listed under <c>Modules used by others</c>. If the - module uses modules other modules, these are listed under <c>Used + module uses other modules, these are listed under <c>Used modules</c>.</p> <p>Double click on an module name to launch a module window.</p> @@ -365,8 +365,8 @@ <p>There are two categories of modules on the <c>Dependencies</c> page. If the module is used by other modules, these are listed - under <c>Modules used by others</c>. If the module uses modules - other modules, these are listed under <c>Used modules</c>.</p> + under <c>Modules used by others</c>. If the module uses other + modules, these are listed under <c>Used modules</c>.</p> <p>Double click on an module name to launch a module window.</p> @@ -378,7 +378,7 @@ <p>On the <c>Code</c> page the Erlang source code is displayed. It is possible to search forwards and backwards for text in the module. Enter a regular expression in the <c>Find</c> field and - press enter. It is also possible to goto a certain line on the + press enter. It is also possible to go to a certain line in the module. The <c>Back</c> button can be used to go back to the previous position.</p> diff --git a/lib/reltool/vsn.mk b/lib/reltool/vsn.mk index f23a7e84a2..9e0bce1d01 100644 --- a/lib/reltool/vsn.mk +++ b/lib/reltool/vsn.mk @@ -1,28 +1 @@ -# This is an -*-makefile-*- file. -# %CopyrightBegin% -# -# Copyright Ericsson AB 2009-2010. All Rights Reserved. -# -# The contents of this file are subject to the Erlang Public License, -# Version 1.1, (the "License"); you may not use this file except in -# compliance with the License. You should have received a copy of the -# Erlang Public License along with this software. If not, it can be -# retrieved online at http://www.erlang.org/. -# -# Software distributed under the License is distributed on an "AS IS" -# basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See -# the License for the specific language governing rights and limitations -# under the License. -# -# %CopyrightEnd% - RELTOOL_VSN = 0.5.4 - -TICKETS = OTP-8521 OTP-8590 -TICKETS_0_5_3 = OTP-8057 -TICKETS_0_5_2 = OTP-8254 -TICKETS_0_5_1 = OTP-8199 -TICKETS_0_5 = OTP-7949 -TICKETS_0_2_2 = OTP-7999 -TICKETS_2_2_1 = OTP-7840 -TICKETS_0_2 = OTP-7805 diff --git a/lib/snmp/doc/src/notes.xml b/lib/snmp/doc/src/notes.xml index 3f4954cfbd..d5d6605b64 100644 --- a/lib/snmp/doc/src/notes.xml +++ b/lib/snmp/doc/src/notes.xml @@ -13,12 +13,12 @@ compliance with the License. You should have received a copy of the Erlang Public License along with this software. If not, it can be retrieved online at http://www.erlang.org/. - + Software distributed under the License is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for the specific language governing rights and limitations under the License. - + </legalnotice> <title>SNMP Release Notes</title> @@ -33,6 +33,34 @@ </header> <section> + <title>SNMP Development Toolkit 4.17.1</title> + <p>Version 4.17.1 supports code replacement in runtime from/to + version 4.17, 4.16.2, 4.16.1, 4.16, 4.15, 4.14 and 4.13.5.</p> + + <section> + <title>Improvements and new features</title> + <p>-</p> + </section> + + <section> + <title>Reported Fixed Bugs and Malfunctions</title> + <list type="bulleted"> + <item> + <p>When the function FilterMod:accept_recv/2 + returned false the SNMP agent stopped collecting messages from UDP.</p> + <p>Own Id: OTP-8761</p> + </item> + </list> + </section> + + <section> + <title>Incompatibilities</title> + <p>-</p> + </section> + </section> <!-- 4.17.1 --> + + + <section> <title>SNMP Development Toolkit 4.17</title> <p>Version 4.17 supports code replacement in runtime from/to version 4.16.2, 4.16.1, 4.16, 4.15, 4.14 and 4.13.5.</p> diff --git a/lib/snmp/doc/src/snmpa.xml b/lib/snmp/doc/src/snmpa.xml index 1be6abe6dd..f546724a78 100644 --- a/lib/snmp/doc/src/snmpa.xml +++ b/lib/snmp/doc/src/snmpa.xml @@ -1233,7 +1233,7 @@ snmp_agent:register_subagent(SA1,[1,2,3], SA2). </type> <desc> <p>Restart the worker process of a multi-threaded agent.</p> - <p>This is a utility function, that can be usefull when + <p>This is a utility function, that can be useful when e.g. debugging instrumentation functions.</p> <marker id="restart_set_worker"></marker> @@ -1249,7 +1249,7 @@ snmp_agent:register_subagent(SA1,[1,2,3], SA2). </type> <desc> <p>Restart the set worker process of a multi-threaded agent.</p> - <p>This is a utility function, that can be usefull when + <p>This is a utility function, that can be useful when e.g. debugging instrumentation functions.</p> <marker id="verbosity"></marker> diff --git a/lib/snmp/src/agent/snmpa_net_if.erl b/lib/snmp/src/agent/snmpa_net_if.erl index 3a91cf4033..97a7a63dee 100644 --- a/lib/snmp/src/agent/snmpa_net_if.erl +++ b/lib/snmp/src/agent/snmpa_net_if.erl @@ -1,19 +1,19 @@ %% %% %CopyrightBegin% -%% +%% %% Copyright Ericsson AB 2004-2010. All Rights Reserved. -%% +%% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in %% compliance with the License. You should have received a copy of the %% Erlang Public License along with this software. If not, it can be %% retrieved online at http://www.erlang.org/. -%% +%% %% Software distributed under the License is distributed on an "AS IS" %% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See %% the License for the specific language governing rights and limitations %% under the License. -%% +%% %% %CopyrightEnd% %% -module(snmpa_net_if). @@ -478,12 +478,13 @@ update_req_counter_outgoing(#state{limit = Limit, rcnt = RCnt} = S, S#state{rcnt = NewRCnt}. -maybe_handle_recv(#state{filter = FilterMod} = S, +maybe_handle_recv(#state{usock = Sock, filter = FilterMod} = S, Ip, Port, Packet) -> case (catch FilterMod:accept_recv(Ip, Port)) of false -> %% Drop the received packet inc(netIfMsgInDrops), + active_once(Sock), S; _ -> handle_recv(S, Ip, Port, Packet) diff --git a/lib/snmp/src/app/snmp.appup.src b/lib/snmp/src/app/snmp.appup.src index 9ad16ffad2..2bd26e11db 100644 --- a/lib/snmp/src/app/snmp.appup.src +++ b/lib/snmp/src/app/snmp.appup.src @@ -1,19 +1,19 @@ %% %% %CopyrightBegin% -%% +%% %% Copyright Ericsson AB 1999-2010. All Rights Reserved. -%% +%% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in %% compliance with the License. You should have received a copy of the %% Erlang Public License along with this software. If not, it can be %% retrieved online at http://www.erlang.org/. -%% +%% %% Software distributed under the License is distributed on an "AS IS" %% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See %% the License for the specific language governing rights and limitations %% under the License. -%% +%% %% %CopyrightEnd% %% @@ -22,6 +22,11 @@ %% ----- U p g r a d e ------------------------------------------------------- [ + {"4.17", + [ + {load_module, snmpa_net_if, soft_purge, soft_purge, []} + ] + }, {"4.16.2", [ {load_module, snmp_log, soft_purge, soft_purge, []}, @@ -29,6 +34,7 @@ {load_module, snmpa_mpd, soft_purge, soft_purge, [snmpa_usm]}, {load_module, snmpa_usm, soft_purge, soft_purge, []}, {update, snmpa_agent, soft, soft_purge, soft_purge, []}, + {load_module, snmpa_net_if, soft_purge, soft_purge, []}, {load_module, snmpm_mpd, soft_purge, soft_purge, []} ] @@ -44,6 +50,7 @@ {load_module, snmpa_usm, soft_purge, soft_purge, [snmp_usm]}, {update, snmpa_mib, soft, soft_purge, soft_purge, []}, {update, snmpa_agent, soft, soft_purge, soft_purge, [snmpa_mib]}, + {load_module, snmpa_net_if, soft_purge, soft_purge, []}, {load_module, snmpm_mpd, soft_purge, soft_purge, []}, {update, snmpm_server, soft, soft_purge, soft_purge, []} @@ -61,6 +68,7 @@ {load_module, snmpa_usm, soft_purge, soft_purge, [snmp_usm]}, {update, snmpa_mib, soft, soft_purge, soft_purge, []}, {update, snmpa_agent, soft, soft_purge, soft_purge, [snmpa_mib]}, + {load_module, snmpa_net_if, soft_purge, soft_purge, []}, {load_module, snmpm_mpd, soft_purge, soft_purge, []}, {update, snmpm_net_if, soft, soft_purge, soft_purge, []}, @@ -149,6 +157,11 @@ %% ------D o w n g r a d e --------------------------------------------------- [ + {"4.17", + [ + {load_module, snmpa_net_if, soft_purge, soft_purge, []} + ] + }, {"4.16.2", [ {load_module, snmp_log, soft_purge, soft_purge, []}, @@ -157,6 +170,7 @@ {load_module, snmpa_mpd, soft_purge, soft_purge, [snmpa_usm]}, {load_module, snmpa_usm, soft_purge, soft_purge, []}, {update, snmpa_agent, soft, soft_purge, soft_purge, []}, + {load_module, snmpa_net_if, soft_purge, soft_purge, []}, {load_module, snmpm_mpd, soft_purge, soft_purge, []} ] @@ -172,6 +186,7 @@ {load_module, snmpa_usm, soft_purge, soft_purge, [snmp_usm]}, {update, snmpa_mib, soft, soft_purge, soft_purge, []}, {update, snmpa_agent, soft, soft_purge, soft_purge, [snmpa_mib]}, + {load_module, snmpa_net_if, soft_purge, soft_purge, []}, {load_module, snmpm_mpd, soft_purge, soft_purge, []}, {update, snmpm_server, soft, soft_purge, soft_purge, []} @@ -189,6 +204,7 @@ {load_module, snmpa_usm, soft_purge, soft_purge, [snmp_usm]}, {update, snmpa_mib, soft, soft_purge, soft_purge, []}, {update, snmpa_agent, soft, soft_purge, soft_purge, [snmpa_mib]}, + {load_module, snmpa_net_if, soft_purge, soft_purge, []}, {load_module, snmpm_mpd, soft_purge, soft_purge, []}, {update, snmpm_net_if, soft, soft_purge, soft_purge, []}, diff --git a/lib/snmp/vsn.mk b/lib/snmp/vsn.mk index 4ca1fb7901..95103433a4 100644 --- a/lib/snmp/vsn.mk +++ b/lib/snmp/vsn.mk @@ -1,57 +1,3 @@ -#-*-makefile-*- ; force emacs to enter makefile-mode - -# %CopyrightBegin% -# -# Copyright Ericsson AB 1997-2010. All Rights Reserved. -# -# The contents of this file are subject to the Erlang Public License, -# Version 1.1, (the "License"); you may not use this file except in -# compliance with the License. You should have received a copy of the -# Erlang Public License along with this software. If not, it can be -# retrieved online at http://www.erlang.org/. -# -# Software distributed under the License is distributed on an "AS IS" -# basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See -# the License for the specific language governing rights and limitations -# under the License. -# -# %CopyrightEnd% - -SNMP_VSN = 4.17 +SNMP_VSN = 4.17.1 PRE_VSN = APP_VSN = "snmp-$(SNMP_VSN)$(PRE_VSN)" - -TICKETS = OTP-8478 - -TICKETS_4_16_2 = \ - OTP-8563 \ - OTP-8574 \ - OTP-8594 \ - OTP-8595 \ - OTP-8646 \ - OTP-8648 - -TICKETS_4_16_1 = \ - OTP-8480 \ - OTP-8481 - -TICKETS_4_16 = \ - OTP-8395 \ - OTP-8433 \ - OTP-8442 - -TICKETS_4_15 = \ - OTP-8229 \ - OTP-8249 - -TICKETS_4_14 = \ - OTP-8223 \ - OTP-8228 \ - OTP-8237 - -TICKETS_4_13_5 = \ - OTP-8116 \ - OTP-8120 \ - OTP-8181 \ - OTP-8182 - diff --git a/lib/ssh/src/ssh_channel.erl b/lib/ssh/src/ssh_channel.erl index 8a49a44a6c..dcb2d69290 100644 --- a/lib/ssh/src/ssh_channel.erl +++ b/lib/ssh/src/ssh_channel.erl @@ -238,9 +238,19 @@ handle_info(Msg, #state{cm = ConnectionManager, channel_cb = Module, {noreply, State#state{channel_state = ChannelState}}; {ok, ChannelState, Timeout} -> {noreply, State#state{channel_state = ChannelState}, Timeout}; + {stop, Reason, ChannelState} when is_atom(Reason)-> + {stop, Reason, State#state{close_sent = true, + channel_state = ChannelState}}; {stop, ChannelId, ChannelState} -> - ssh_connection:close(ConnectionManager, ChannelId), - {stop, normal, State#state{close_sent = true, + Reason = + case Msg of + {'EXIT', _Pid, shutdown} -> + shutdown; + _ -> + normal + end, + (catch ssh_connection:close(ConnectionManager, ChannelId)), + {stop, Reason, State#state{close_sent = true, channel_state = ChannelState}} end. diff --git a/lib/ssh/src/ssh_connection_manager.erl b/lib/ssh/src/ssh_connection_manager.erl index cffeade485..9e55312e5f 100644 --- a/lib/ssh/src/ssh_connection_manager.erl +++ b/lib/ssh/src/ssh_connection_manager.erl @@ -1,19 +1,19 @@ %% %% %CopyrightBegin% -%% +%% %% Copyright Ericsson AB 2008-2010. All Rights Reserved. -%% +%% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in %% compliance with the License. You should have received a copy of the %% Erlang Public License along with this software. If not, it can be %% retrieved online at http://www.erlang.org/. -%% +%% %% Software distributed under the License is distributed on an "AS IS" %% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See %% the License for the specific language governing rights and limitations %% under the License. -%% +%% %% %CopyrightEnd% %% %% @@ -146,6 +146,8 @@ adjust_window(ConnectionManager, Channel, Bytes) -> close(ConnectionManager, ChannelId) -> try call(ConnectionManager, {close, ChannelId}) of ok -> + ok; + {error,normal} -> ok catch exit:{noproc, _} -> @@ -155,6 +157,8 @@ close(ConnectionManager, ChannelId) -> stop(ConnectionManager) -> try call(ConnectionManager, stop) of ok -> + ok; + {error,normal} -> ok catch exit:{noproc, _} -> @@ -593,7 +597,9 @@ call(Pid, Msg, Timeout) -> Result catch exit:{timeout, _} -> - {error, timeout} + {error, timeout}; + exit:{normal, _} -> + {error, normal} end. cast(Pid, Msg) -> diff --git a/lib/ssh/vsn.mk b/lib/ssh/vsn.mk index ccdbfe4f9a..a8821625a2 100644 --- a/lib/ssh/vsn.mk +++ b/lib/ssh/vsn.mk @@ -2,83 +2,3 @@ SSH_VSN = 2.0 APP_VSN = "ssh-$(SSH_VSN)" - -TICKETS = OTP-8524 \ - OTP-8534 \ - OTP-8535 \ - OTP-8550 \ - OTP-8596 \ - OTP-8644 \ - OTP-8645 - -TICKETS_1.1.8 = OTP-8356 \ - OTP-8401 - -TICKETS_1.1.7 = OTP-8121 \ - OTP-8277 \ - OTP-8278 \ - OTP-8201 - -TICKETS_1.1.6 = OTP-8110 \ - OTP-8162 \ - OTP-8173 \ - OTP-8174 \ - OTP-8175 \ - OTP-8176 - -TICKETS_1.1.5 = OTP-8159 \ - OTP-8160 \ - OTP-8161 - -TICKETS_1.1.4 = OTP-8071 - -TICKETS_1.1.3 = OTP-7996 \ - OTP-8034 \ - OTP-8035 - -TICKETS_1.1.2 = OTP-7914 \ - OTP-7917 \ - OTP-7918 \ - OTP-7921 \ - OTP-7919 \ - OTP-7930 \ - OTP-7957 - -TICKETS_1.1.1 = OTP-7828 \ - OTP-7795 \ - OTP-7807 \ - OTP-7808 \ - OTP-7809 - -TICKETS_1.1 = OTP-7676 \ - OTP-7683 \ - OTP-7685 \ - OTP-7766 \ - OTP-7767 \ - OTP-7768 \ - OTP-7770 \ - OTP-7456 \ - OTP-7769 \ - OTP-7516 \ - OTP-7645 \ - -TICKETS_1.0.2 = \ - OTP-7141\ - -TICKETS_1.0.1 = \ - OTP-7318 \ - OTP-7305 \ - OTP-7564 \ - OTP-7565 \ - OTP-7566 \ - -TICKETS_1.0 = \ - OTP-7485 \ - OTP-7504 \ - OTP-7356 \ - OTP-7502 \ - OTP-7503 - -TICKETS_0.9.9.6 = \ - OTP-7246 \ - OTP-7247 \
\ No newline at end of file diff --git a/lib/ssl/Makefile b/lib/ssl/Makefile index b8b51270c9..8c9d78d4bc 100644 --- a/lib/ssl/Makefile +++ b/lib/ssl/Makefile @@ -24,21 +24,11 @@ include $(ERL_TOP)/make/$(TARGET)/otp.mk # # Macros # -ifeq ($(findstring win32,$(TARGET)),win32) -ifeq ($(HOST_OS),) -HOST_OS := $(shell $(ERL_TOP)/erts/autoconf/config.guess) -endif -ifeq ($(findstring solaris,$(HOST_OS)),solaris) -SKIP_BUILDING_BINARIES := true -endif -else -SKIP_BUILDING_BINARIES := false -endif -ifeq ($(SKIP_BUILDING_BINARIES), true) SUB_DIRECTORIES = src c_src doc/src -else -SUB_DIRECTORIES = src c_src doc/src examples/certs examples/src + +ifeq ($(CROSS_COMPILING),no) +SUB_DIRECTORIES += examples/certs examples/src endif include vsn.mk diff --git a/lib/ssl/doc/src/notes.xml b/lib/ssl/doc/src/notes.xml index 151b685941..95e968aa22 100644 --- a/lib/ssl/doc/src/notes.xml +++ b/lib/ssl/doc/src/notes.xml @@ -819,7 +819,7 @@ <title>Fixed Bugs and Malfunctions</title> <list type="bulleted"> <item> - <p>When a file descriptor was marked for closing, and and + <p>When a file descriptor was marked for closing, and end-of-file condition had already been detected, the file descriptor was never closed.</p> <p>Own Id: OTP-5093 Aux Id: seq8806 </p> diff --git a/lib/ssl/src/ssl.appup.src b/lib/ssl/src/ssl.appup.src index 65f23e2f74..88cd73be74 100644 --- a/lib/ssl/src/ssl.appup.src +++ b/lib/ssl/src/ssl.appup.src @@ -1,6 +1,7 @@ %% -*- erlang -*- {"%VSN%", [ + {"4.0", [{restart_application, ssl}]}, {"3.11.1", [{restart_application, ssl}]}, {"3.11", [{restart_application, ssl}]}, {"3.10", [{restart_application, ssl}]}, @@ -15,6 +16,7 @@ {"3.10.9", [{restart_application, ssl}]} ], [ + {"4.0", [{restart_application, ssl}]}, {"3.11.1", [{restart_application, ssl}]}, {"3.11", [{restart_application, ssl}]}, {"3.10", [{restart_application, ssl}]}, diff --git a/lib/ssl/src/ssl.erl b/lib/ssl/src/ssl.erl index df4cd7c84d..6e26f05c3d 100644 --- a/lib/ssl/src/ssl.erl +++ b/lib/ssl/src/ssl.erl @@ -77,8 +77,9 @@ stop() -> application:stop(ssl). %%-------------------------------------------------------------------- --spec connect(host() | port(), port_num(), list()) -> {ok, #sslsocket{}}. --spec connect(host() | port(), port_num(), list(), timeout()) -> {ok, #sslsocket{}}. +-spec connect(host() | port(), list()) -> {ok, #sslsocket{}}. +-spec connect(host() | port(), list() | port_num(), timeout() | list()) -> {ok, #sslsocket{}}. +-spec connect(host() | port(), port_num(), list(), timeout()) -> {ok, #sslsocket{}}. %% %% Description: Connect to a ssl server. %%-------------------------------------------------------------------- @@ -215,8 +216,8 @@ ssl_accept(Socket, SslOptions, Timeout) when is_port(Socket) -> {ok, #config{cb=CbInfo,ssl=SslOpts, emulated=EmOpts}} -> {ok, Port} = inet:port(Socket), ssl_connection:ssl_accept(Port, Socket, - {SslOpts, EmOpts}, - self(), CbInfo, Timeout) + {SslOpts, EmOpts}, + self(), CbInfo, Timeout) catch Error = {error, _Reason} -> Error end. @@ -326,7 +327,7 @@ decode_peercert(BinCert, Opts) -> {ok, BinCert} end. -select_part(otp, {ok, Cert}, Opts) -> +select_part(otp, Cert, Opts) -> case lists:member(subject, Opts) of true -> TBS = Cert#'OTPCertificate'.tbsCertificate, @@ -335,7 +336,7 @@ select_part(otp, {ok, Cert}, Opts) -> {ok, Cert} end; -select_part(plain, {ok, Cert}, Opts) -> +select_part(plain, Cert, Opts) -> case lists:member(subject, Opts) of true -> TBS = Cert#'Certificate'.tbsCertificate, @@ -446,8 +447,8 @@ session_info(#sslsocket{pid = Pid, fd = new_ssl}) -> ssl_connection:session_info(Pid). %%--------------------------------------------------------------- --spec versions() -> [{{ssl_app, string()}, {supported, [tls_version()]}, - {available, [tls_version()]}}]. +-spec versions() -> [{ssl_app, string()} | {supported, [tls_atom_version()]} | + {available, [tls_atom_version()]}]. %% %% Description: Returns a list of relevant versions. %%-------------------------------------------------------------------- @@ -457,6 +458,7 @@ versions() -> AvailableVsns = ?DEFAULT_SUPPORTED_VERSIONS, [{ssl_app, ?VSN}, {supported, SupportedVsns}, {available, AvailableVsns}]. + %%--------------------------------------------------------------- -spec renegotiate(#sslsocket{}) -> ok | {error, reason()}. %% diff --git a/lib/ssl/src/ssl_app.erl b/lib/ssl/src/ssl_app.erl index d9a354086d..8d50fd7bdb 100644 --- a/lib/ssl/src/ssl_app.erl +++ b/lib/ssl/src/ssl_app.erl @@ -29,14 +29,14 @@ %%-------------------------------------------------------------------- -spec start(normal | {takeover, node()} | {failover, node()}, list()) -> - {ok, pid()} | {ok, pid(), term()} | {error, term()}. + ignore | {ok, pid()} | {error, term()}. %%-------------------------------------------------------------------- start(_Type, _StartArgs) -> ssl_sup:start_link(). %-------------------------------------------------------------------- -spec stop(term())-> ok. -%%-------------------------------------------------------------------- +%%-------------------------------------------------------------------- stop(_State) -> ok. diff --git a/lib/ssl/src/ssl_certificate.erl b/lib/ssl/src/ssl_certificate.erl index 8a79f75725..5026c760bd 100644 --- a/lib/ssl/src/ssl_certificate.erl +++ b/lib/ssl/src/ssl_certificate.erl @@ -31,7 +31,7 @@ -include("ssl_debug.hrl"). -include_lib("public_key/include/public_key.hrl"). --export([trusted_cert_and_path/3, +-export([trusted_cert_and_path/2, certificate_chain/2, file_to_certificats/1, validate_extensions/6, @@ -47,61 +47,59 @@ %%==================================================================== %%-------------------------------------------------------------------- --spec trusted_cert_and_path([der_cert()], certdb_ref(), boolean()) -> - {der_cert(), [der_cert()], list()}. +-spec trusted_cert_and_path([der_cert()], certdb_ref()) -> + {der_cert() | unknown_ca, [der_cert()]}. %% %% Description: Extracts the root cert (if not presents tries to %% look it up, if not found {bad_cert, unknown_ca} will be added verification %% errors. Returns {RootCert, Path, VerifyErrors} %%-------------------------------------------------------------------- -trusted_cert_and_path(CertChain, CertDbRef, Verify) -> - [Cert | RestPath] = lists:reverse(CertChain), - {ok, OtpCert} = public_key:pkix_decode_cert(Cert, otp), - IssuerAnPath = +trusted_cert_and_path(CertChain, CertDbRef) -> + Path = [Cert | _] = lists:reverse(CertChain), + OtpCert = public_key:pkix_decode_cert(Cert, otp), + IssuerID = case public_key:pkix_is_self_signed(OtpCert) of true -> {ok, IssuerId} = public_key:pkix_issuer_id(OtpCert, self), - {IssuerId, RestPath}; - false -> + IssuerId; + false -> case public_key:pkix_issuer_id(OtpCert, other) of {ok, IssuerId} -> - {IssuerId, [Cert | RestPath]}; + IssuerId; {error, issuer_not_found} -> case find_issuer(OtpCert, no_candidate) of {ok, IssuerId} -> - {IssuerId, [Cert | RestPath]}; + IssuerId; Other -> - {Other, RestPath} + Other end end end, - case IssuerAnPath of - {{error, issuer_not_found}, _ } -> - %% The root CA was not sent and can not be found, we fail if verify = true - not_valid(?ALERT_REC(?FATAL, ?UNKNOWN_CA), Verify, {Cert, RestPath}); - {{SerialNr, Issuer}, Path} -> - case ssl_manager:lookup_trusted_cert(CertDbRef, - SerialNr, Issuer) of + case IssuerID of + {error, issuer_not_found} -> + %% The root CA was not sent and can not be found. + {unknown_ca, Path}; + {SerialNr, Issuer} -> + case ssl_manager:lookup_trusted_cert(CertDbRef, SerialNr, Issuer) of {ok, {BinCert,_}} -> - {BinCert, Path, []}; + {BinCert, Path}; _ -> - %% Fail if verify = true - not_valid(?ALERT_REC(?FATAL, ?UNKNOWN_CA), - Verify, {Cert, RestPath}) + %% Root CA could not be verified + {unknown_ca, Path} end end. %%-------------------------------------------------------------------- -spec certificate_chain(undefined | binary(), certdb_ref()) -> - {error, no_cert} | [der_cert()]. + {error, no_cert} | {ok, [der_cert()]}. %% %% Description: Return the certificate chain to send to peer. %%-------------------------------------------------------------------- certificate_chain(undefined, _CertsDbRef) -> {error, no_cert}; certificate_chain(OwnCert, CertsDbRef) -> - {ok, ErlCert} = public_key:pkix_decode_cert(OwnCert, otp), + ErlCert = public_key:pkix_decode_cert(OwnCert, otp), certificate_chain(ErlCert, OwnCert, CertsDbRef, [OwnCert]). %%-------------------------------------------------------------------- -spec file_to_certificats(string()) -> [der_cert()]. @@ -110,7 +108,7 @@ certificate_chain(OwnCert, CertsDbRef) -> %%-------------------------------------------------------------------- file_to_certificats(File) -> {ok, List} = ssl_manager:cache_pem_file(File), - [Bin || {cert, Bin, not_encrypted} <- List]. + [Bin || {'Certificate', Bin, not_encrypted} <- List]. %%-------------------------------------------------------------------- -spec validate_extensions([#'Extension'{}], term(), [#'Extension'{}], boolean(), list(), client | server) -> {[#'Extension'{}], term(), list()}. @@ -219,7 +217,7 @@ certificate_chain(CertsDbRef, Chain, SerialNr, Issuer, _SelfSigned) -> case ssl_manager:lookup_trusted_cert(CertsDbRef, SerialNr, Issuer) of {ok, {IssuerCert, ErlCert}} -> - {ok, ErlCert} = public_key:pkix_decode_cert(IssuerCert, otp), + ErlCert = public_key:pkix_decode_cert(IssuerCert, otp), certificate_chain(ErlCert, IssuerCert, CertsDbRef, [IssuerCert | Chain]); _ -> @@ -244,11 +242,6 @@ find_issuer(OtpCert, PrevCandidateKey) -> end end. -not_valid(Alert, true, _) -> - throw(Alert); -not_valid(_, false, {ErlCert, Path}) -> - {ErlCert, Path, [{bad_cert, unknown_ca}]}. - is_valid_extkey_usage(KeyUse, client) -> %% Client wants to verify server is_valid_key_usage(KeyUse,?'id-kp-serverAuth'); diff --git a/lib/ssl/src/ssl_certificate_db.erl b/lib/ssl/src/ssl_certificate_db.erl index e953821057..00d3079cb3 100644 --- a/lib/ssl/src/ssl_certificate_db.erl +++ b/lib/ssl/src/ssl_certificate_db.erl @@ -54,10 +54,9 @@ remove(Dbs) -> lists:foreach(fun(Db) -> true = ets:delete(Db) end, Dbs). %%-------------------------------------------------------------------- --spec lookup_trusted_cert(reference(), serialnumber(), issuer()) -> {der_cert(), #'OTPCertificate'{}}. +-spec lookup_trusted_cert(reference(), serialnumber(), issuer()) -> + undefined | {ok, {der_cert(), #'OTPCertificate'{}}}. -%% SerialNumber = integer() -%% Issuer = {rdnSequence, IssuerAttrs} %% %% Description: Retrives the trusted certificate identified by %% <SerialNumber, Issuer>. Ref is used as it is specified @@ -101,10 +100,11 @@ add_trusted_certs(Pid, File, [CertsDb, FileToRefDb, PidToFileDb]) -> %% Description: Cache file as binary in DB %%-------------------------------------------------------------------- cache_pem_file(Pid, File, [CertsDb, _FileToRefDb, PidToFileDb]) -> - Res = {ok, Content} = public_key:pem_to_der(File), + {ok, PemBin} = file:read_file(File), + Content = public_key:pem_decode(PemBin), insert({file, File}, Content, CertsDb), insert(Pid, File, PidToFileDb), - Res. + {ok, Content}. %%-------------------------------------------------------------------- -spec remove_trusted_certs(pid(), certdb_ref()) -> term(). @@ -138,13 +138,13 @@ remove_trusted_certs(Pid, [CertsDb, FileToRefDb, PidToFileDb]) -> end. %%-------------------------------------------------------------------- --spec issuer_candidate(no_candidate | cert_key()) -> - {cert_key(), der_cert()} | no_more_candidates. +-spec issuer_candidate(no_candidate | cert_key() | {file, term()}) -> + {cert_key(),{der_cert(), #'OTPCertificate'{}}} | no_more_candidates. %% %% Description: If a certificat does not define its issuer through %% the extension 'ce-authorityKeyIdentifier' we can %% try to find the issuer in the database over known -%% certificates. +%% certificates. %%-------------------------------------------------------------------- issuer_candidate(no_candidate) -> Db = certificate_db_name(), @@ -203,14 +203,15 @@ remove_certs(Ref, CertsDb) -> ets:match_delete(CertsDb, {{Ref, '_', '_'}, '_'}). add_certs_from_file(File, Ref, CertsDb) -> - Decode = fun(Cert) -> - {ok, ErlCert} = public_key:pkix_decode_cert(Cert, otp), + Add = fun(Cert) -> + ErlCert = public_key:pkix_decode_cert(Cert, otp), TBSCertificate = ErlCert#'OTPCertificate'.tbsCertificate, SerialNumber = TBSCertificate#'OTPTBSCertificate'.serialNumber, - Issuer = public_key:pkix_normalize_general_name( + Issuer = public_key:pkix_normalize_name( TBSCertificate#'OTPTBSCertificate'.issuer), insert({Ref, SerialNumber, Issuer}, {Cert,ErlCert}, CertsDb) end, - {ok,Der} = public_key:pem_to_der(File), - [Decode(Cert) || {cert, Cert, not_encrypted} <- Der]. + {ok, PemBin} = file:read_file(File), + PemEntries = public_key:pem_decode(PemBin), + [Add(Cert) || {'Certificate', Cert, not_encrypted} <- PemEntries]. diff --git a/lib/ssl/src/ssl_cipher.erl b/lib/ssl/src/ssl_cipher.erl index a6e80047c2..8230149304 100644 --- a/lib/ssl/src/ssl_cipher.erl +++ b/lib/ssl/src/ssl_cipher.erl @@ -40,7 +40,7 @@ -compile(inline). %%-------------------------------------------------------------------- --spec security_parameters(erl_cipher_suite(), #security_parameters{}) -> +-spec security_parameters(cipher_suite(), #security_parameters{}) -> #security_parameters{}. %% %% Description: Returns a security parameters record where the @@ -119,7 +119,7 @@ block_cipher(Fun, BlockSz, #cipher_state{key=Key, iv=IV} = CS0, %%-------------------------------------------------------------------- -spec decipher(cipher_enum(), integer(), #cipher_state{}, binary(), tls_version()) -> - {binary(), #cipher_state{}}. + {binary(), binary(), #cipher_state{}} | #alert{}. %% %% Description: Decrypts the data and the MAC using cipher described %% by cipher_enum() and updating the cipher state. @@ -370,7 +370,7 @@ openssl_suite_name(Cipher) -> filter(undefined, Ciphers) -> Ciphers; filter(DerCert, Ciphers) -> - {ok, OtpCert} = public_key:pkix_decode_cert(DerCert, otp), + OtpCert = public_key:pkix_decode_cert(DerCert, otp), SigAlg = OtpCert#'OTPCertificate'.signatureAlgorithm, case ssl_certificate:signature_type(SigAlg#'SignatureAlgorithm'.algorithm) of rsa -> @@ -506,6 +506,12 @@ generic_stream_cipher_from_bin(T, HashSz) -> is_correct_padding(_, {3, 0}) -> true; +%% For interoperability reasons we do not check the padding in TLS 1.0 as it +%% is not strictly required and breaks interopability with for instance +%% Google. +is_correct_padding(_, {3, 1}) -> + true; +%% Padding must be check in TLS 1.1 and after is_correct_padding(#generic_block_cipher{padding_length = Len, padding = Padding}, _) -> list_to_binary(lists:duplicate(Len, Len)) == Padding. diff --git a/lib/ssl/src/ssl_cipher.hrl b/lib/ssl/src/ssl_cipher.hrl index 19de709d9c..8bd68cc190 100644 --- a/lib/ssl/src/ssl_cipher.hrl +++ b/lib/ssl/src/ssl_cipher.hrl @@ -28,7 +28,7 @@ -type cipher() :: null |rc4_128 | idea_cbc | des40_cbc | des_cbc | '3des_ede_cbc' | aes_128_cbc | aes_256_cbc. --type hash() :: sha | md5. +-type hash() :: null | sha | md5. -type erl_cipher_suite() :: {key_algo(), cipher(), hash()}. -type cipher_suite() :: binary(). -type cipher_enum() :: integer(). diff --git a/lib/ssl/src/ssl_connection.erl b/lib/ssl/src/ssl_connection.erl index 5b4b129e30..dd8f77a0ca 100644 --- a/lib/ssl/src/ssl_connection.erl +++ b/lib/ssl/src/ssl_connection.erl @@ -125,8 +125,9 @@ send(Pid, Data) -> recv(Pid, Length, Timeout) -> sync_send_all_state_event(Pid, {recv, Length}, Timeout). %%-------------------------------------------------------------------- --spec connect(host(), port_num(), port(), list(), pid(), tuple(), timeout()) -> - {ok, #sslsocket{}} | {error, reason()}. +-spec connect(host(), port_num(), port(), {#ssl_options{}, #socket_options{}}, + pid(), tuple(), timeout()) -> + {ok, #sslsocket{}} | {error, reason()}. %% %% Description: Connect to a ssl server. %%-------------------------------------------------------------------- @@ -138,7 +139,8 @@ connect(Host, Port, Socket, Options, User, CbInfo, Timeout) -> {error, ssl_not_started} end. %%-------------------------------------------------------------------- --spec ssl_accept(port_num(), port(), list(), pid(), tuple(), timeout()) -> +-spec ssl_accept(port_num(), port(), {#ssl_options{}, #socket_options{}}, + pid(), tuple(), timeout()) -> {ok, #sslsocket{}} | {error, reason()}. %% %% Description: Performs accept on a ssl listen socket. e.i. performs @@ -253,7 +255,7 @@ session_info(ConnectionPid) -> sync_send_all_state_event(ConnectionPid, session_info). %%-------------------------------------------------------------------- --spec peer_certificate(pid()) -> {ok, binary()} | {error, reason()}. +-spec peer_certificate(pid()) -> {ok, binary()| undefined} | {error, reason()}. %% %% Description: Returns the peer cert %%-------------------------------------------------------------------- @@ -288,9 +290,10 @@ start_link(Role, Host, Port, Socket, Options, User, CbInfo) -> %% gen_fsm callbacks %%==================================================================== %%-------------------------------------------------------------------- --spec init(list()) -> {ok, state_name(), #state{}} - | {ok, state_name(), #state{}, timeout()} | - ignore | {stop, term()}. +-spec init(list()) -> {ok, state_name(), #state{}} | {stop, term()}. +%% Possible return values not used now. +%% | {ok, state_name(), #state{}, timeout()} | +%% ignore %% Description:Whenever a gen_fsm is started using gen_fsm:start/[3,4] or %% gen_fsm:start_link/3,4, this function is called by the new process to %% initialize. @@ -331,14 +334,12 @@ hello(start, #state{host = Host, port = Port, role = client, ssl_options = SslOpts, transport_cb = Transport, socket = Socket, connection_states = ConnectionStates, - own_cert = Cert, renegotiation = {Renegotiation, _}} = State0) -> Hello = ssl_handshake:client_hello(Host, Port, ConnectionStates, - SslOpts, Cert, - Renegotiation), + SslOpts, Renegotiation), Version = Hello#client_hello.client_version, Hashes0 = ssl_handshake:init_hashes(), @@ -350,7 +351,7 @@ hello(start, #state{host = Host, port = Port, role = client, session = #session{session_id = Hello#client_hello.session_id, is_resumable = false}, - tls_handshake_hashes = Hashes1}, + tls_handshake_hashes = Hashes1}, {Record, State} = next_record(State1), next_state(hello, Record, State); @@ -576,58 +577,61 @@ certify(#client_key_exchange{} = Msg, %% We expect a certificate here handle_unexpected_message(Msg, certify_client_key_exchange, State); -certify(#client_key_exchange{exchange_keys - = #encrypted_premaster_secret{premaster_secret - = EncPMS}}, - #state{negotiated_version = Version, - connection_states = ConnectionStates0, - session = Session0, - private_key = Key} = State0) -> - try ssl_handshake:decrypt_premaster_secret(EncPMS, Key) of - PremasterSecret -> - case ssl_handshake:master_secret(Version, PremasterSecret, - ConnectionStates0, server) of - {MasterSecret, ConnectionStates} -> - Session = Session0#session{master_secret = MasterSecret}, - State1 = State0#state{connection_states = ConnectionStates, - session = Session}, - {Record, State} = next_record(State1), - next_state(cipher, Record, State); - #alert{} = Alert -> - handle_own_alert(Alert, Version, - certify_client_key_exchange, State0), - {stop, normal, State0} - end +certify(#client_key_exchange{exchange_keys = Keys}, + State = #state{key_algorithm = KeyAlg, negotiated_version = Version}) -> + try + certify_client_key_exchange(ssl_handshake:decode_client_key(Keys, KeyAlg, Version), State) catch #alert{} = Alert -> - handle_own_alert(Alert, Version, certify_client_key_exchange, - State0), + handle_own_alert(Alert, Version, certify_client_key_exchange, State), + {stop, normal, State} + end; + +certify(Msg, State) -> + handle_unexpected_message(Msg, certify, State). + +certify_client_key_exchange(#encrypted_premaster_secret{premaster_secret= EncPMS}, + #state{negotiated_version = Version, + connection_states = ConnectionStates0, + session = Session0, + private_key = Key} = State0) -> + PremasterSecret = ssl_handshake:decrypt_premaster_secret(EncPMS, Key), + case ssl_handshake:master_secret(Version, PremasterSecret, + ConnectionStates0, server) of + {MasterSecret, ConnectionStates} -> + Session = Session0#session{master_secret = MasterSecret}, + State1 = State0#state{connection_states = ConnectionStates, + session = Session}, + {Record, State} = next_record(State1), + next_state(cipher, Record, State); + #alert{} = Alert -> + handle_own_alert(Alert, Version, + certify_client_key_exchange, State0), {stop, normal, State0} end; -certify(#client_key_exchange{exchange_keys = #client_diffie_hellman_public{ - dh_public = ClientPublicDhKey}}, - #state{negotiated_version = Version, - diffie_hellman_params = #'DHParameter'{prime = P, - base = G}, - diffie_hellman_keys = {_, ServerDhPrivateKey}, - role = Role, - session = Session, - connection_states = ConnectionStates0} = State0) -> - +certify_client_key_exchange(#client_diffie_hellman_public{dh_public = ClientPublicDhKey}, + #state{negotiated_version = Version, + diffie_hellman_params = #'DHParameter'{prime = P, + base = G}, + diffie_hellman_keys = {_, ServerDhPrivateKey}, + role = Role, + session = Session, + connection_states = ConnectionStates0} = State0) -> + PMpint = crypto:mpint(P), GMpint = crypto:mpint(G), PremasterSecret = crypto:dh_compute_key(mpint_binary(ClientPublicDhKey), ServerDhPrivateKey, [PMpint, GMpint]), - + case ssl_handshake:master_secret(Version, PremasterSecret, ConnectionStates0, Role) of {MasterSecret, ConnectionStates} -> State1 = State0#state{session = - Session#session{master_secret - = MasterSecret}, - connection_states = ConnectionStates}, + Session#session{master_secret + = MasterSecret}, + connection_states = ConnectionStates}, {Record, State} = next_record(State1), next_state(cipher, Record, State); @@ -635,10 +639,7 @@ certify(#client_key_exchange{exchange_keys = #client_diffie_hellman_public{ handle_own_alert(Alert, Version, certify_client_key_exchange, State0), {stop, normal, State0} - end; - -certify(Msg, State) -> - handle_unexpected_message(Msg, certify, State). + end. %%-------------------------------------------------------------------- -spec cipher(#hello_request{} | #certificate_verify{} | #finished{} | term(), @@ -698,14 +699,13 @@ connection(#hello_request{}, #state{host = Host, port = Port, socket = Socket, ssl_options = SslOpts, negotiated_version = Version, - own_cert = Cert, transport_cb = Transport, connection_states = ConnectionStates0, renegotiation = {Renegotiation, _}, tls_handshake_hashes = Hashes0} = State0) -> - Hello = ssl_handshake:client_hello(Host, Port, - ConnectionStates0, SslOpts, Cert, Renegotiation), + Hello = ssl_handshake:client_hello(Host, Port, ConnectionStates0, + SslOpts, Renegotiation), {BinMsg, ConnectionStates1, Hashes1} = encode_handshake(Hello, Version, ConnectionStates0, Hashes0), @@ -720,7 +720,9 @@ connection(#client_hello{} = Hello, #state{role = server} = State) -> connection(Msg, State) -> handle_unexpected_message(Msg, connection, State). %%-------------------------------------------------------------------- --spec handle_event(term(), state_name(), #state{}) -> gen_fsm_state_return(). +-spec handle_event(term(), state_name(), #state{}) -> term(). +%% As it is not currently used gen_fsm_state_return() makes +%% dialyzer unhappy! %% %% Description: Whenever a gen_fsm receives an event sent using %% gen_fsm:send_all_state_event/2, this function is called to handle @@ -1038,20 +1040,22 @@ ssl_init(SslOpts, Role) -> init_certificates(#ssl_options{cacertfile = CACertFile, certfile = CertFile}, Role) -> + {ok, CertDbRef, CacheRef} = + try + {ok, _, _} = ssl_manager:connection_init(CACertFile, Role) + catch + Error:Reason -> + handle_file_error(?LINE, Error, Reason, CACertFile, ecacertfile, + erlang:get_stacktrace()) + end, + init_certificates(CertDbRef, CacheRef, CertFile, Role). - case ssl_manager:connection_init(CACertFile, Role) of - {ok, CertDbRef, CacheRef} -> - init_certificates(CertDbRef, CacheRef, CertFile, Role); - {error, Reason} -> - handle_file_error(?LINE, error, Reason, CACertFile, ecacertfile, - erlang:get_stacktrace()) - end. init_certificates(CertDbRef, CacheRef, CertFile, client) -> try [OwnCert] = ssl_certificate:file_to_certificats(CertFile), {ok, CertDbRef, CacheRef, OwnCert} - catch _E:_R -> + catch _Error:_Reason -> {ok, CertDbRef, CacheRef, undefined} end; @@ -1068,15 +1072,15 @@ init_certificates(CertDbRef, CacheRef, CertFile, server) -> init_private_key(undefined, "", _Password, client) -> undefined; init_private_key(undefined, KeyFile, Password, _) -> - case ssl_manager:cache_pem_file(KeyFile) of - {ok, List} -> - [Der] = [Der || Der = {PKey, _ , _} <- List, - PKey =:= rsa_private_key orelse - PKey =:= dsa_private_key], - {ok, Decoded} = public_key:decode_private_key(Der,Password), - Decoded; - {error, Reason} -> - handle_file_error(?LINE, error, Reason, KeyFile, ekeyfile, + try + {ok, List} = ssl_manager:cache_pem_file(KeyFile), + [PemEntry] = [PemEntry || PemEntry = {PKey, _ , _} <- List, + PKey =:= 'RSAPrivateKey' orelse + PKey =:= 'DSAPrivateKey'], + public_key:pem_entry_decode(PemEntry, Password) + catch + Error:Reason -> + handle_file_error(?LINE, Error, Reason, KeyFile, ekeyfile, erlang:get_stacktrace()) end; @@ -1088,6 +1092,7 @@ handle_file_error(Line, Error, {badmatch, Reason}, File, Throw, Stack) -> handle_file_error(Line, Error, Reason, File, Throw, Stack) -> file_error(Line, Error, Reason, File, Throw, Stack). +-spec(file_error/6 :: (_,_,_,_,_,_) -> no_return()). file_error(Line, Error, Reason, File, Throw, Stack) -> Report = io_lib:format("SSL: ~p: ~p:~p ~s~n ~p~n", [Line, Error, Reason, File, Stack]), @@ -1099,17 +1104,18 @@ init_diffie_hellman(_, client) -> init_diffie_hellman(undefined, _) -> ?DEFAULT_DIFFIE_HELLMAN_PARAMS; init_diffie_hellman(DHParamFile, server) -> - case ssl_manager:cache_pem_file(DHParamFile) of - {ok, List} -> - case [Der || Der = {dh_params, _ , _} <- List] of - [Der] -> - {ok, Decoded} = public_key:decode_dhparams(Der), - Decoded; - [] -> - ?DEFAULT_DIFFIE_HELLMAN_PARAMS - end; - {error, Reason} -> - handle_file_error(?LINE, error, Reason, DHParamFile, edhfile, erlang:get_stacktrace()) + try + {ok, List} = ssl_manager:cache_pem_file(DHParamFile), + case [Entry || Entry = {'DHParameter', _ , _} <- List] of + [Entry] -> + public_key:pem_entry_decode(Entry); + [] -> + ?DEFAULT_DIFFIE_HELLMAN_PARAMS + end + catch + Error:Reason -> + handle_file_error(?LINE, Error, Reason, + DHParamFile, edhfile, erlang:get_stacktrace()) end. sync_send_all_state_event(FsmPid, Event) -> @@ -1178,7 +1184,7 @@ verify_client_cert(#state{client_certificate_requested = true, role = client, tls_handshake_hashes = Hashes1}; ignore -> State; - #alert{} = Alert -> + #alert{} = Alert -> handle_own_alert(Alert, Version, certify, State) end; @@ -1186,18 +1192,19 @@ verify_client_cert(#state{client_certificate_requested = false} = State) -> State. do_server_hello(Type, #state{negotiated_version = Version, - session = Session, + session = #session{session_id = SessId} = Session, connection_states = ConnectionStates0, renegotiation = {Renegotiation, _}} = State0) when is_atom(Type) -> + ServerHello = - ssl_handshake:server_hello(Session#session.session_id, Version, + ssl_handshake:server_hello(SessId, Version, ConnectionStates0, Renegotiation), State1 = server_hello(ServerHello, State0), case Type of new -> - do_server_hello(ServerHello, State1); + new_server_hello(ServerHello, State1); resumed -> ConnectionStates1 = State1#state.connection_states, case ssl_handshake:master_secret(Version, Session, @@ -1216,9 +1223,9 @@ do_server_hello(Type, #state{negotiated_version = Version, handle_own_alert(Alert, Version, hello, State1), {stop, normal, State1} end - end; + end. -do_server_hello(#server_hello{cipher_suite = CipherSuite, +new_server_hello(#server_hello{cipher_suite = CipherSuite, compression_method = Compression, session_id = SessionId}, #state{session = Session0, @@ -1343,7 +1350,7 @@ certify_server(#state{transport_cb = Transport, key_exchange(#state{role = server, key_algorithm = rsa} = State) -> State; key_exchange(#state{role = server, key_algorithm = Algo, - diffie_hellman_params = Params, + diffie_hellman_params = #'DHParameter'{prime = P, base = G} = Params, private_key = PrivateKey, connection_states = ConnectionStates0, negotiated_version = Version, @@ -1354,7 +1361,7 @@ key_exchange(#state{role = server, key_algorithm = Algo, when Algo == dhe_dss; Algo == dhe_rsa -> - Keys = public_key:gen_key(Params), + Keys = crypto:dh_generate_key([crypto:mpint(P), crypto:mpint(G)]), ConnectionState = ssl_record:pending_connection_state(ConnectionStates0, read), SecParams = ConnectionState#connection_state.security_parameters, @@ -1406,6 +1413,8 @@ key_exchange(#state{role = client, State#state{connection_states = ConnectionStates1, tls_handshake_hashes = Hashes1}. +-spec(rsa_key_exchange/2 :: (_,_) -> no_return()). + rsa_key_exchange(PremasterSecret, PublicKeyInfo = {Algorithm, _, _}) when Algorithm == ?rsaEncryption; Algorithm == ?md2WithRSAEncryption; @@ -1536,7 +1545,7 @@ verify_dh_params(Signed, Hashes, {?rsaEncryption, PubKey, _PubKeyParams}) -> false end; verify_dh_params(Signed, Hash, {?'id-dsa', PublicKey, PublicKeyParams}) -> - public_key:verify_signature(Hash, none, Signed, PublicKey, PublicKeyParams). + public_key:verify(Hash, none, Signed, {PublicKey, PublicKeyParams}). cipher_role(client, Data, Session, #state{connection_states = ConnectionStates0} = State) -> @@ -1563,7 +1572,7 @@ encode_change_cipher(#change_cipher_spec{}, Version, ConnectionStates) -> ssl_record:encode_change_cipher_spec(Version, ConnectionStates). encode_handshake(HandshakeRec, Version, ConnectionStates, Hashes) -> - encode_handshake(HandshakeRec, undefined, Version, + encode_handshake(HandshakeRec, null, Version, ConnectionStates, Hashes). encode_handshake(HandshakeRec, SigAlg, Version, ConnectionStates0, Hashes0) -> @@ -1626,8 +1635,6 @@ application_data(Data, #state{user_application = {_Mon, Pid}, true -> <<Buffer0/binary, Data/binary>> end, case get_data(SOpts, BytesToRead, Buffer1) of - {ok, <<>>, Buffer} -> % no reply, we need more data - next_record(State0#state{user_data_buffer = Buffer}); {ok, ClientData, Buffer} -> % Send data SocketOpt = deliver_app_data(SOpts, ClientData, Pid, From), State = State0#state{user_data_buffer = Buffer, @@ -1643,12 +1650,16 @@ application_data(Data, #state{user_application = {_Mon, Pid}, true -> %% We have more data application_data(<<>>, State) end; + {more, Buffer} -> % no reply, we need more data + next_record(State0#state{user_data_buffer = Buffer}); {error,_Reason} -> %% Invalid packet in packet mode deliver_packet_error(SOpts, Buffer1, Pid, From), {stop, normal, State0} end. %% Picks ClientData +get_data(_, _, <<>>) -> + {more, <<>>}; get_data(#socket_options{active=Active, packet=Raw}, BytesToRead, Buffer) when Raw =:= raw; Raw =:= 0 -> %% Raw Mode if @@ -1661,13 +1672,13 @@ get_data(#socket_options{active=Active, packet=Raw}, BytesToRead, Buffer) {ok, Data, Rest}; true -> %% Passive Mode not enough data - {ok, <<>>, Buffer} + {more, Buffer} end; get_data(#socket_options{packet=Type, packet_size=Size}, _, Buffer) -> PacketOpts = [{packet_size, Size}], case decode_packet(Type, Buffer, PacketOpts) of {more, _} -> - {ok, <<>>, Buffer}; + {more, Buffer}; Decoded -> Decoded end. @@ -1726,11 +1737,13 @@ format_packet_error(#socket_options{active = _, mode = Mode}, Data) -> format_reply(binary, _, N, Data) when N > 0 -> % Header mode header(N, Data); -format_reply(binary, _, _, Data) -> Data; -format_reply(list, Packet, _, Data) when is_integer(Packet); Packet == raw -> - binary_to_list(Data); +format_reply(binary, _, _, Data) -> + Data; +format_reply(list, Packet, _, Data) + when Packet == http; Packet == {http, headers}; Packet == http_bin; Packet == {http_bin, headers} -> + Data; format_reply(list, _,_, Data) -> - Data. + binary_to_list(Data). header(0, <<>>) -> <<>>; @@ -1780,9 +1793,7 @@ next_state(Next, #ssl_tls{type = ?ALERT, fragment = EncAlerts}, State) -> handle_alerts(Alerts, {next_state, Next, State}); next_state(StateName, #ssl_tls{type = ?HANDSHAKE, fragment = Data}, - State0 = #state{key_algorithm = KeyAlg, - tls_handshake_buffer = Buf0, - negotiated_version = Version}) -> + State0 = #state{tls_handshake_buffer = Buf0, negotiated_version = Version}) -> Handle = fun({#hello_request{} = Packet, _}, {next_state, connection = SName, State}) -> %% This message should not be included in handshake @@ -1805,7 +1816,7 @@ next_state(StateName, #ssl_tls{type = ?HANDSHAKE, fragment = Data}, (_, StopState) -> StopState end, try - {Packets, Buf} = ssl_handshake:get_tls_handshake(Data,Buf0, KeyAlg,Version), + {Packets, Buf} = ssl_handshake:get_tls_handshake(Data,Buf0), State = State0#state{tls_packets = Packets, tls_handshake_buffer = Buf}, handle_tls_handshake(Handle, StateName, State) catch throw:#alert{} = Alert -> @@ -1817,7 +1828,7 @@ next_state(StateName, #ssl_tls{type = ?APPLICATION_DATA, fragment = Data}, State case application_data(Data, State0) of Stop = {stop,_,_} -> Stop; - {Record, State} -> + {Record, State} -> next_state(StateName, Record, State) end; next_state(StateName, #ssl_tls{type = ?CHANGE_CIPHER_SPEC, fragment = <<1>>} = @@ -2154,7 +2165,7 @@ renegotiate(#state{role = server, negotiated_version = Version, connection_states = ConnectionStates0} = State0) -> HelloRequest = ssl_handshake:hello_request(), - Frag = ssl_handshake:encode_handshake(HelloRequest, Version, undefined), + Frag = ssl_handshake:encode_handshake(HelloRequest, Version, null), Hs0 = ssl_handshake:init_hashes(), {BinMsg, ConnectionStates} = ssl_record:encode_handshake(Frag, Version, ConnectionStates0), diff --git a/lib/ssl/src/ssl_handshake.erl b/lib/ssl/src/ssl_handshake.erl index 3811906d77..add5147fb4 100644 --- a/lib/ssl/src/ssl_handshake.erl +++ b/lib/ssl/src/ssl_handshake.erl @@ -31,32 +31,34 @@ -include("ssl_debug.hrl"). -include_lib("public_key/include/public_key.hrl"). --export([master_secret/4, client_hello/6, server_hello/4, hello/4, +-export([master_secret/4, client_hello/5, server_hello/4, hello/4, hello_request/0, certify/7, certificate/3, client_certificate_verify/6, certificate_verify/6, certificate_request/2, key_exchange/2, server_key_exchange_hash/2, finished/4, verify_connection/5, - get_tls_handshake/4, + get_tls_handshake/2, decode_client_key/3, server_hello_done/0, sig_alg/1, encode_handshake/3, init_hashes/0, update_hashes/2, decrypt_premaster_secret/2]). --type tls_handshake() :: #client_hello{} | #server_hello{} | #server_hello_done{} | -#certificate{} | #client_key_exchange{} | #finished{} | #certificate_verify{}. +-type tls_handshake() :: #client_hello{} | #server_hello{} | + #server_hello_done{} | #certificate{} | #certificate_request{} | + #client_key_exchange{} | #finished{} | #certificate_verify{} | + #hello_request{}. %%==================================================================== %% Internal application API %%==================================================================== %%-------------------------------------------------------------------- -spec client_hello(host(), port_num(), #connection_states{}, - #ssl_options{}, binary(), boolean()) -> #client_hello{}. + #ssl_options{}, boolean()) -> #client_hello{}. %% %% Description: Creates a client hello message. %%-------------------------------------------------------------------- client_hello(Host, Port, ConnectionStates, #ssl_options{versions = Versions, ciphers = UserSuites} - = SslOpts, Cert, Renegotiation) -> + = SslOpts, Renegotiation) -> Fun = fun(Version) -> ssl_record:protocol_version(Version) @@ -64,7 +66,7 @@ client_hello(Host, Port, ConnectionStates, #ssl_options{versions = Versions, Version = ssl_record:highest_protocol_version(lists:map(Fun, Versions)), Pending = ssl_record:pending_connection_state(ConnectionStates, read), SecParams = Pending#connection_state.security_parameters, - Ciphers = available_suites(Cert, UserSuites, Version), + Ciphers = available_suites(UserSuites, Version), Id = ssl_manager:client_session_id(Host, Port, SslOpts), @@ -110,7 +112,7 @@ hello_request() -> #connection_states{} | {port_num(), #session{}, cache_ref(), atom(), #connection_states{}, binary()}, boolean()) -> {tls_version(), session_id(), #connection_states{}}| - {tls_version(), {resumed | new, session_id()}, + {tls_version(), {resumed | new, #session{}}, #connection_states{}} | #alert{}. %% %% Description: Handles a recieved hello message @@ -201,18 +203,15 @@ certify(#certificate{asn1_certificates = ASN1Certs}, CertDbRef, end end, try - %% Allow missing root_cert and check that with VerifyFun - ssl_certificate:trusted_cert_and_path(ASN1Certs, CertDbRef, false) of - {TrustedErlCert, CertPath, VerifyErrors} -> + ssl_certificate:trusted_cert_and_path(ASN1Certs, CertDbRef) of + {TrustedErlCert, CertPath} -> Result = public_key:pkix_path_validation(TrustedErlCert, CertPath, [{max_path_length, MaxPathLen}, {verify, VerifyBool}, {validate_extensions_fun, - ValidateExtensionFun}, - {acc_errors, - VerifyErrors}]), + ValidateExtensionFun}]), case Result of {error, Reason} -> path_validation_alert(Reason, Verify); @@ -232,7 +231,7 @@ certify(#certificate{asn1_certificates = ASN1Certs}, CertDbRef, end. %%-------------------------------------------------------------------- --spec certificate(der_cert(), term(), client | server) -> #certificate{}. +-spec certificate(der_cert(), term(), client | server) -> #certificate{} | #alert{}. %% %% Description: Creates a certificate message. %%-------------------------------------------------------------------- @@ -260,8 +259,8 @@ certificate(OwnCert, CertDbRef, server) -> %%-------------------------------------------------------------------- -spec client_certificate_verify(undefined | der_cert(), binary(), tls_version(), key_algo(), private_key(), - {binary(), binary()}) -> - #certificate_verify{} | ignore. + {{binary(), binary()},{binary(), binary()}}) -> + #certificate_verify{} | ignore | #alert{}. %% %% Description: Creates a certificate_verify message, called by the client. %%-------------------------------------------------------------------- @@ -283,9 +282,9 @@ client_certificate_verify(OwnCert, MasterSecret, Version, Algorithm, end. %%-------------------------------------------------------------------- --spec certificate_verify(binary(), public_key_info(), tls_version(), - binary(), key_algo(), - {binary(), binary()}) -> valid | #alert{}. +%% -spec certificate_verify(binary(), public_key_info(), tls_version(), +%% binary(), key_algo(), +%% {_, {binary(), binary()}}) -> valid | #alert{}. %% %% Description: Checks that the certificate_verify message is valid. %%-------------------------------------------------------------------- @@ -304,9 +303,15 @@ certificate_verify(Signature, {_, PublicKey, _}, Version, end; certificate_verify(Signature, {_, PublicKey, PublicKeyParams}, Version, MasterSecret, dhe_dss = Algorithm, {_, Hashes0}) -> - Hashes = calc_certificate_verify(Version, MasterSecret, - Algorithm, Hashes0), - public_key:verify_signature(Hashes, sha, Signature, PublicKey, PublicKeyParams). + Hashes = calc_certificate_verify(Version, MasterSecret, + Algorithm, Hashes0), + case public_key:verify(Hashes, none, Signature, {PublicKey, PublicKeyParams}) of + true -> + valid; + false -> + ?ALERT_REC(?FATAL, ?BAD_CERTIFICATE) + end. + %%-------------------------------------------------------------------- -spec certificate_request(#connection_states{}, certdb_ref()) -> @@ -329,7 +334,7 @@ certificate_request(ConnectionStates, CertDbRef) -> -spec key_exchange(client | server, {premaster_secret, binary(), public_key_info()} | {dh, binary()} | - {dh, binary(), #'DHParameter'{}, key_algo(), + {dh, {binary(), binary()}, #'DHParameter'{}, key_algo(), binary(), binary(), private_key()}) -> #client_key_exchange{} | #server_key_exchange{}. %% @@ -406,7 +411,7 @@ master_secret(Version, PremasterSecret, ConnectionStates, Role) -> end. %%-------------------------------------------------------------------- --spec finished(tls_version(), client | server, binary(), {binary(), binary()}) -> +-spec finished(tls_version(), client | server, binary(), {{binary(), binary()},_}) -> #finished{}. %% %% Description: Creates a handshake finished message @@ -417,7 +422,7 @@ finished(Version, Role, MasterSecret, {Hashes, _}) -> % use the current hashes %%-------------------------------------------------------------------- -spec verify_connection(tls_version(), #finished{}, client | server, binary(), - {binary(), binary()}) -> verified | #alert{}. + {_, {binary(), binary()}}) -> verified | #alert{}. %% %% Description: Checks the ssl handshake finished message to verify %% the connection. @@ -442,7 +447,7 @@ server_hello_done() -> #server_hello_done{}. %%-------------------------------------------------------------------- --spec encode_handshake(tls_handshake(), tls_version(), key_algo()) -> binary(). +-spec encode_handshake(tls_handshake(), tls_version(), key_algo()) -> iolist(). %% %% Description: Encode a handshake packet to binary %%-------------------------------------------------------------------- @@ -453,29 +458,36 @@ encode_handshake(Package, Version, KeyAlg) -> [MsgType, ?uint24(Len), Bin]. %%-------------------------------------------------------------------- --spec get_tls_handshake(binary(), binary(), key_algo(), tls_version()) -> - {[tls_handshake()], [binary()], binary()}. +-spec get_tls_handshake(binary(), binary() | iolist()) -> + {[tls_handshake()], binary()}. %% %% Description: Given buffered and new data from ssl_record, collects %% and returns it as a list of handshake messages, also returns leftover %% data. %%-------------------------------------------------------------------- -get_tls_handshake(Data, <<>>, KeyAlg, Version) -> - get_tls_handshake_aux(Data, KeyAlg, Version, []); -get_tls_handshake(Data, Buffer, KeyAlg, Version) -> - get_tls_handshake_aux(list_to_binary([Buffer, Data]), - KeyAlg, Version, []). +get_tls_handshake(Data, <<>>) -> + get_tls_handshake_aux(Data, []); +get_tls_handshake(Data, Buffer) -> + get_tls_handshake_aux(list_to_binary([Buffer, Data]), []). + +%%-------------------------------------------------------------------- +-spec decode_client_key(binary(), key_algo(), tls_version()) -> + #encrypted_premaster_secret{} | #client_diffie_hellman_public{}. +%% +%% Description: Decode client_key data and return appropriate type +%%-------------------------------------------------------------------- +decode_client_key(ClientKey, Type, Version) -> + dec_client_key(ClientKey, key_exchange_alg(Type), Version). %%-------------------------------------------------------------------- %%% Internal functions %%-------------------------------------------------------------------- get_tls_handshake_aux(<<?BYTE(Type), ?UINT24(Length), - Body:Length/binary,Rest/binary>>, KeyAlg, - Version, Acc) -> + Body:Length/binary,Rest/binary>>, Acc) -> Raw = <<?BYTE(Type), ?UINT24(Length), Body/binary>>, - H = dec_hs(Type, Body, key_exchange_alg(KeyAlg), Version), - get_tls_handshake_aux(Rest, KeyAlg, Version, [{H,Raw} | Acc]); -get_tls_handshake_aux(Data, _KeyAlg, _Version, Acc) -> + H = dec_hs(Type, Body), + get_tls_handshake_aux(Rest, [{H,Raw} | Acc]); +get_tls_handshake_aux(Data, Acc) -> {lists:reverse(Acc), Data}. verify_bool(verify_peer) -> @@ -495,6 +507,8 @@ path_validation_alert({bad_cert, unknown_critical_extension}, _) -> ?ALERT_REC(?FATAL, ?UNSUPPORTED_CERTIFICATE); path_validation_alert({bad_cert, cert_revoked}, _) -> ?ALERT_REC(?FATAL, ?CERTIFICATE_REVOKED); +path_validation_alert({bad_cert, unknown_ca}, _) -> + ?ALERT_REC(?FATAL, ?UNKNOWN_CA); path_validation_alert(_, _) -> ?ALERT_REC(?FATAL, ?HANDSHAKE_FAILURE). @@ -518,13 +532,16 @@ select_session(Hello, Port, Session, Version, {resumed, CacheCb:lookup(Cache, {Port, SessionId})} end. -available_suites(Cert, UserSuites, Version) -> +available_suites(UserSuites, Version) -> case UserSuites of [] -> - ssl_cipher:filter(Cert, ssl_cipher:suites(Version)); + ssl_cipher:suites(Version); _ -> - ssl_cipher:filter(Cert, UserSuites) + UserSuites end. + +available_suites(ServerCert, UserSuites, Version) -> + ssl_cipher:filter(ServerCert, available_suites(UserSuites, Version)). cipher_suites(Suites, false) -> [?TLS_EMPTY_RENEGOTIATION_INFO_SCSV | Suites]; @@ -718,7 +735,7 @@ master_secret(Version, MasterSecret, #security_parameters{ ServerCipherState, Role)}. -dec_hs(?HELLO_REQUEST, <<>>, _, _) -> +dec_hs(?HELLO_REQUEST, <<>>) -> #hello_request{}; %% Client hello v2. @@ -728,8 +745,7 @@ dec_hs(?CLIENT_HELLO, <<?BYTE(Major), ?BYTE(Minor), ?UINT16(CSLength), ?UINT16(0), ?UINT16(CDLength), CipherSuites:CSLength/binary, - ChallengeData:CDLength/binary>>, - _, _) -> + ChallengeData:CDLength/binary>>) -> ?DBG_HEX(CipherSuites), ?DBG_HEX(CipherSuites), #client_hello{client_version = {Major, Minor}, @@ -743,8 +759,7 @@ dec_hs(?CLIENT_HELLO, <<?BYTE(Major), ?BYTE(Minor), Random:32/binary, ?BYTE(SID_length), Session_ID:SID_length/binary, ?UINT16(Cs_length), CipherSuites:Cs_length/binary, ?BYTE(Cm_length), Comp_methods:Cm_length/binary, - Extensions/binary>>, - _, _) -> + Extensions/binary>>) -> RenegotiationInfo = proplists:get_value(renegotiation_info, dec_hello_extensions(Extensions), undefined), @@ -759,7 +774,7 @@ dec_hs(?CLIENT_HELLO, <<?BYTE(Major), ?BYTE(Minor), Random:32/binary, dec_hs(?SERVER_HELLO, <<?BYTE(Major), ?BYTE(Minor), Random:32/binary, ?BYTE(SID_length), Session_ID:SID_length/binary, - Cipher_suite:2/binary, ?BYTE(Comp_method)>>, _, _) -> + Cipher_suite:2/binary, ?BYTE(Comp_method)>>) -> #server_hello{ server_version = {Major,Minor}, random = Random, @@ -771,7 +786,7 @@ dec_hs(?SERVER_HELLO, <<?BYTE(Major), ?BYTE(Minor), Random:32/binary, dec_hs(?SERVER_HELLO, <<?BYTE(Major), ?BYTE(Minor), Random:32/binary, ?BYTE(SID_length), Session_ID:SID_length/binary, Cipher_suite:2/binary, ?BYTE(Comp_method), - ?UINT16(ExtLen), Extensions:ExtLen/binary>>, _, _) -> + ?UINT16(ExtLen), Extensions:ExtLen/binary>>) -> RenegotiationInfo = proplists:get_value(renegotiation_info, dec_hello_extensions(Extensions, []), undefined), @@ -782,44 +797,42 @@ dec_hs(?SERVER_HELLO, <<?BYTE(Major), ?BYTE(Minor), Random:32/binary, cipher_suite = Cipher_suite, compression_method = Comp_method, renegotiation_info = RenegotiationInfo}; -dec_hs(?CERTIFICATE, <<?UINT24(ACLen), ASN1Certs:ACLen/binary>>, _, _) -> +dec_hs(?CERTIFICATE, <<?UINT24(ACLen), ASN1Certs:ACLen/binary>>) -> #certificate{asn1_certificates = certs_to_list(ASN1Certs)}; dec_hs(?SERVER_KEY_EXCHANGE, <<?UINT16(PLen), P:PLen/binary, ?UINT16(GLen), G:GLen/binary, ?UINT16(YLen), Y:YLen/binary, - ?UINT16(Len), Sig:Len/binary>>, - ?KEY_EXCHANGE_DIFFIE_HELLMAN, _) -> + ?UINT16(Len), Sig:Len/binary>>) -> #server_key_exchange{params = #server_dh_params{dh_p = P,dh_g = G, dh_y = Y}, signed_params = Sig}; dec_hs(?CERTIFICATE_REQUEST, <<?BYTE(CertTypesLen), CertTypes:CertTypesLen/binary, - ?UINT16(CertAuthsLen), CertAuths:CertAuthsLen/binary>>, _, _) -> + ?UINT16(CertAuthsLen), CertAuths:CertAuthsLen/binary>>) -> #certificate_request{certificate_types = CertTypes, certificate_authorities = CertAuths}; -dec_hs(?SERVER_HELLO_DONE, <<>>, _, _) -> +dec_hs(?SERVER_HELLO_DONE, <<>>) -> #server_hello_done{}; -dec_hs(?CERTIFICATE_VERIFY,<<?UINT16(_), Signature/binary>>, _, _)-> +dec_hs(?CERTIFICATE_VERIFY,<<?UINT16(_), Signature/binary>>)-> #certificate_verify{signature = Signature}; -dec_hs(?CLIENT_KEY_EXCHANGE, PKEPMS, ?KEY_EXCHANGE_RSA, {3, 0}) -> - PreSecret = #encrypted_premaster_secret{premaster_secret = PKEPMS}, - #client_key_exchange{exchange_keys = PreSecret}; -dec_hs(?CLIENT_KEY_EXCHANGE, <<?UINT16(_), PKEPMS/binary>>, - ?KEY_EXCHANGE_RSA, _) -> - PreSecret = #encrypted_premaster_secret{premaster_secret = PKEPMS}, - #client_key_exchange{exchange_keys = PreSecret}; -dec_hs(?CLIENT_KEY_EXCHANGE, <<>>, ?KEY_EXCHANGE_DIFFIE_HELLMAN, _) -> - throw(?ALERT_REC(?FATAL, ?UNSUPPORTED_CERTIFICATE)); -dec_hs(?CLIENT_KEY_EXCHANGE, <<?UINT16(DH_YLen), DH_Y:DH_YLen/binary>>, - ?KEY_EXCHANGE_DIFFIE_HELLMAN, _) -> - #client_key_exchange{exchange_keys = - #client_diffie_hellman_public{dh_public = DH_Y}}; -dec_hs(?FINISHED, VerifyData, _, _) -> +dec_hs(?CLIENT_KEY_EXCHANGE, PKEPMS) -> + #client_key_exchange{exchange_keys = PKEPMS}; +dec_hs(?FINISHED, VerifyData) -> #finished{verify_data = VerifyData}; -dec_hs(_, _, _, _) -> +dec_hs(_, _) -> throw(?ALERT_REC(?FATAL, ?HANDSHAKE_FAILURE)). +dec_client_key(PKEPMS, ?KEY_EXCHANGE_RSA, {3, 0}) -> + #encrypted_premaster_secret{premaster_secret = PKEPMS}; +dec_client_key(<<?UINT16(_), PKEPMS/binary>>, ?KEY_EXCHANGE_RSA, _) -> + #encrypted_premaster_secret{premaster_secret = PKEPMS}; +dec_client_key(<<>>, ?KEY_EXCHANGE_DIFFIE_HELLMAN, _) -> + throw(?ALERT_REC(?FATAL, ?UNSUPPORTED_CERTIFICATE)); +dec_client_key(<<?UINT16(DH_YLen), DH_Y:DH_YLen/binary>>, + ?KEY_EXCHANGE_DIFFIE_HELLMAN, _) -> + #client_diffie_hellman_public{dh_public = DH_Y}. + dec_hello_extensions(<<>>) -> []; dec_hello_extensions(<<?UINT16(ExtLen), Extensions:ExtLen/binary>>) -> @@ -1036,9 +1049,10 @@ certificate_authorities(CertDbRef) -> Authorities = certificate_authorities_from_db(CertDbRef), Enc = fun(#'OTPCertificate'{tbsCertificate=TBSCert}) -> OTPSubj = TBSCert#'OTPTBSCertificate'.subject, - Subj = public_key:pkix_transform(OTPSubj, encode), - {ok, DNEncoded} = 'OTP-PUB-KEY':encode('Name', Subj), - DNEncodedBin = iolist_to_binary(DNEncoded), + DNEncodedBin = public_key:pkix_encode('Name', OTPSubj, otp), + %%Subj = public_key:pkix_transform(OTPSubj, encode), + %% {ok, DNEncoded} = 'OTP-PUB-KEY':encode('Name', Subj), + %% DNEncodedBin = iolist_to_binary(DNEncoded), DNEncodedLen = byte_size(DNEncodedBin), <<?UINT16(DNEncodedLen), DNEncodedBin/binary>> end, @@ -1062,7 +1076,7 @@ digitally_signed(Hash, #'RSAPrivateKey'{} = Key) -> public_key:encrypt_private(Hash, Key, [{rsa_pad, rsa_pkcs1_padding}]); digitally_signed(Hash, #'DSAPrivateKey'{} = Key) -> - public_key:sign(none, Hash, Key). + public_key:sign(Hash, none, Key). calc_master_secret({3,0}, PremasterSecret, ClientRandom, ServerRandom) -> ssl_ssl3:master_secret(PremasterSecret, ClientRandom, ServerRandom); @@ -1114,7 +1128,7 @@ sig_alg(_) -> key_exchange_alg(rsa) -> ?KEY_EXCHANGE_RSA; key_exchange_alg(Alg) when Alg == dhe_rsa; Alg == dhe_dss; - Alg == dh_dss; Alg == dh_rsa; Alg == dh_anon -> + Alg == dh_dss; Alg == dh_rsa -> ?KEY_EXCHANGE_DIFFIE_HELLMAN; key_exchange_alg(_) -> ?NULL. diff --git a/lib/ssl/src/ssl_internal.hrl b/lib/ssl/src/ssl_internal.hrl index ddace02dea..337403531e 100644 --- a/lib/ssl/src/ssl_internal.hrl +++ b/lib/ssl/src/ssl_internal.hrl @@ -96,12 +96,12 @@ -type from() :: term(). -type host() :: string() | tuple(). -type port_num() :: integer(). --type session_id() :: binary(). +-type session_id() :: 0 | binary(). -type tls_version() :: {integer(), integer()}. -type tls_atom_version() :: sslv3 | tlsv1. -type cache_ref() :: term(). -type certdb_ref() :: term(). --type key_algo() :: rsa | dhe_rsa | dhe_dss. +-type key_algo() :: null | rsa | dhe_rsa | dhe_dss. -type enum_algo() :: integer(). -type public_key() :: #'RSAPublicKey'{} | integer(). -type public_key_params() :: #'Dss-Parms'{} | term(). diff --git a/lib/ssl/src/ssl_manager.erl b/lib/ssl/src/ssl_manager.erl index af30f78dbf..459dcefb79 100644 --- a/lib/ssl/src/ssl_manager.erl +++ b/lib/ssl/src/ssl_manager.erl @@ -29,7 +29,8 @@ %% Internal application API -export([start_link/1, connection_init/2, cache_pem_file/1, - lookup_trusted_cert/3, issuer_candidate/1, client_session_id/3, server_session_id/3, + lookup_trusted_cert/3, issuer_candidate/1, client_session_id/3, + server_session_id/3, register_session/2, register_session/3, invalidate_session/2, invalidate_session/3]). @@ -88,14 +89,17 @@ cache_pem_file(File) -> end. %%-------------------------------------------------------------------- -spec lookup_trusted_cert(reference(), serialnumber(), issuer()) -> - {der_cert(), #'OTPCertificate'{}}. + undefined | + {ok, {der_cert(), #'OTPCertificate'{}}}. %% -%% Description: Lookup the trusted cert with Key = {reference(), serialnumber(), issuer()}. -%%-------------------------------------------------------------------- +%% Description: Lookup the trusted cert with Key = {reference(), +%% serialnumber(), issuer()}. +%% -------------------------------------------------------------------- lookup_trusted_cert(Ref, SerialNumber, Issuer) -> ssl_certificate_db:lookup_trusted_cert(Ref, SerialNumber, Issuer). %%-------------------------------------------------------------------- --spec issuer_candidate(cert_key()) -> {cert_key(), der_cert()} | no_more_candidates. +-spec issuer_candidate(cert_key() | no_candidate) -> + {cert_key(), {der_cert(), #'OTPCertificate'{}}} | no_more_candidates. %% %% Description: Return next issuer candidate. %%-------------------------------------------------------------------- @@ -143,8 +147,9 @@ invalidate_session(Port, Session) -> %%==================================================================== %%-------------------------------------------------------------------- --spec init(list()) -> {ok, #state{}} | {ok, #state{}, timeout()} | - ignore | {stop, term()}. +-spec init(list()) -> {ok, #state{}}. +%% Possible return values not used now. +%% | {ok, #state{}, timeout()} | ignore | {stop, term()}. %% %% Description: Initiates the server %%-------------------------------------------------------------------- @@ -164,12 +169,13 @@ init([Opts]) -> session_validation_timer = Timer}}. %%-------------------------------------------------------------------- --spec handle_call(msg(), from(), #state{}) -> {reply, reply(), #state{}} | - {reply, reply(), #state{}, timeout()} | - {noreply, #state{}} | - {noreply, #state{}, timeout()} | - {stop, reason(), reply(), #state{}} | - {stop, reason(), #state{}}. +-spec handle_call(msg(), from(), #state{}) -> {reply, reply(), #state{}}. +%% Possible return values not used now. +%% {reply, reply(), #state{}, timeout()} | +%% {noreply, #state{}} | +%% {noreply, #state{}, timeout()} | +%% {stop, reason(), reply(), #state{}} | +%% {stop, reason(), #state{}}. %% %% Description: Handling call messages %%-------------------------------------------------------------------- @@ -216,9 +222,10 @@ handle_call({{cache_pem, File},Pid}, _, State = #state{certificate_db = Db}) -> {reply, {error, Reason}, State} end. %%-------------------------------------------------------------------- --spec handle_cast(msg(), #state{}) -> {noreply, #state{}} | - {noreply, #state{}, timeout()} | - {stop, reason(), #state{}}. +-spec handle_cast(msg(), #state{}) -> {noreply, #state{}}. +%% Possible return values not used now. +%% | {noreply, #state{}, timeout()} | +%% {stop, reason(), #state{}}. %% %% Description: Handling cast messages %%-------------------------------------------------------------------- @@ -253,9 +260,10 @@ handle_cast({invalidate_session, Port, #session{session_id = ID}}, {noreply, State}. %%-------------------------------------------------------------------- --spec handle_info(msg(), #state{}) -> {noreply, #state{}} | - {noreply, #state{}, timeout()} | - {stop, reason(), #state{}}. +-spec handle_info(msg(), #state{}) -> {noreply, #state{}}. +%% Possible return values not used now. +%% |{noreply, #state{}, timeout()} | +%% {stop, reason(), #state{}}. %% %% Description: Handling all non call/cast messages %%-------------------------------------------------------------------- diff --git a/lib/ssl/src/ssl_record.erl b/lib/ssl/src/ssl_record.erl index 90615c22a1..acd0d49c19 100644 --- a/lib/ssl/src/ssl_record.erl +++ b/lib/ssl/src/ssl_record.erl @@ -149,7 +149,7 @@ set_mac_secret(ReadMacSecret, WriteMacSecret, %%-------------------------------------------------------------------- --spec set_master_secret(binary(), #connection_state{}) -> #connection_states{}. +-spec set_master_secret(binary(), #connection_states{}) -> #connection_states{}. %% %% Description: Set master_secret in pending connection states %%-------------------------------------------------------------------- @@ -306,7 +306,7 @@ set_pending_cipher_state(#connection_states{pending_read = Read, pending_write = Write#connection_state{cipher_state = ClientState}}. %%-------------------------------------------------------------------- --spec get_tls_records(binary(), binary()) -> {[binary()], binary()}. +-spec get_tls_records(binary(), binary()) -> {[binary()], binary()} | #alert{}. %% %% Description: Given old buffer and new data from TCP, packs up a records %% and returns it as a list of tls_compressed binaries also returns leftover @@ -372,7 +372,8 @@ get_tls_records_aux(Data, Acc) -> {lists:reverse(Acc), Data}. %%-------------------------------------------------------------------- --spec protocol_version(tls_atom_version()) -> tls_version(). +-spec protocol_version(tls_atom_version() | tls_version()) -> + tls_version() | tls_atom_version(). %% %% Description: Creates a protocol version record from a version atom %% or vice versa. @@ -467,7 +468,7 @@ is_acceptable_version(_) -> false. %%-------------------------------------------------------------------- --spec compressions() -> binary(). +-spec compressions() -> [binary()]. %% %% Description: return a list of compressions supported (currently none) %%-------------------------------------------------------------------- @@ -476,7 +477,7 @@ compressions() -> %%-------------------------------------------------------------------- -spec decode_cipher_text(#ssl_tls{}, #connection_states{}) -> - {#ssl_tls{}, #connection_states{}}. + {#ssl_tls{}, #connection_states{}}| #alert{}. %% %% Description: Decode cipher text %%-------------------------------------------------------------------- diff --git a/lib/ssl/src/ssl_session.erl b/lib/ssl/src/ssl_session.erl index e9755cb0e1..6db13e5b7a 100644 --- a/lib/ssl/src/ssl_session.erl +++ b/lib/ssl/src/ssl_session.erl @@ -35,7 +35,7 @@ -type seconds() :: integer(). %%-------------------------------------------------------------------- --spec is_new(binary(), binary()) -> boolean(). +-spec is_new(session_id(), session_id()) -> boolean(). %% %% Description: Checks if the session id decided by the server is a %% new or resumed sesion id. diff --git a/lib/ssl/src/ssl_ssl3.erl b/lib/ssl/src/ssl_ssl3.erl index 375adf263a..1add203fb0 100644 --- a/lib/ssl/src/ssl_ssl3.erl +++ b/lib/ssl/src/ssl_ssl3.erl @@ -121,9 +121,10 @@ mac_hash(Method, Mac_write_secret, Seq_num, Type, Length, Fragment) -> ?DBG_HEX(Mac), Mac. --spec setup_keys(binary(), binary(), binary(), binary(), - integer(), integer(), binary()) -> {binary(), binary(), binary(), - binary(), binary(), binary()}. +-spec setup_keys(binary(), binary(), binary(), + integer(), integer(), term(), integer()) -> + {binary(), binary(), binary(), + binary(), binary(), binary()}. setup_keys(MasterSecret, ServerRandom, ClientRandom, HS, KML, _EKML, IVS) -> KeyBlock = generate_keyblock(MasterSecret, ServerRandom, ClientRandom, diff --git a/lib/ssl/src/ssl_sup.erl b/lib/ssl/src/ssl_sup.erl index b7cb5c3ab3..316ed8a4e9 100644 --- a/lib/ssl/src/ssl_sup.erl +++ b/lib/ssl/src/ssl_sup.erl @@ -32,14 +32,17 @@ %%%========================================================================= %%% API %%%========================================================================= + +-spec start_link() -> {ok, pid()} | ignore | {error, term()}. + start_link() -> supervisor:start_link({local, ?MODULE}, ?MODULE, []). %%%========================================================================= %%% Supervisor callback %%%========================================================================= -%% init([]) -> {ok, {SupFlags, [ChildSpec]}} -%% +-spec init([]) -> {ok, {SupFlags :: tuple(), [ChildSpec :: tuple()]}}. + init([]) -> %% OLD ssl - moved start to ssl.erl only if old %% ssl is acctualy run! diff --git a/lib/ssl/test/erl_make_certs.erl b/lib/ssl/test/erl_make_certs.erl index 1d2cea6c72..f8aef55754 100644 --- a/lib/ssl/test/erl_make_certs.erl +++ b/lib/ssl/test/erl_make_certs.erl @@ -56,7 +56,7 @@ make_cert(Opts) -> SubjectPrivateKey = get_key(Opts), {TBSCert, IssuerKey} = make_tbs(SubjectPrivateKey, Opts), - Cert = public_key:sign(TBSCert, IssuerKey), + Cert = public_key:pkix_sign(TBSCert, IssuerKey), true = verify_signature(Cert, IssuerKey, undef), %% verify that the keys where ok {Cert, encode_key(SubjectPrivateKey)}. @@ -66,8 +66,9 @@ make_cert(Opts) -> %% @end %%-------------------------------------------------------------------- write_pem(Dir, FileName, {Cert, Key = {_,_,not_encrypted}}) when is_binary(Cert) -> - ok = public_key:der_to_pem(filename:join(Dir, FileName ++ ".pem"), [{cert, Cert, not_encrypted}]), - ok = public_key:der_to_pem(filename:join(Dir, FileName ++ "_key.pem"), [Key]). + ok = der_to_pem(filename:join(Dir, FileName ++ ".pem"), + [{'Certificate', Cert, not_encrypted}]), + ok = der_to_pem(filename:join(Dir, FileName ++ "_key.pem"), [Key]). %%-------------------------------------------------------------------- %% @doc Creates a rsa key (OBS: for testing only) @@ -94,18 +95,14 @@ gen_dsa(LSize,NSize) when is_integer(LSize), is_integer(NSize) -> %% @spec (::binary(), ::tuple()) -> ::boolean() %% @end %%-------------------------------------------------------------------- -verify_signature(DerEncodedCert, DerKey, KeyParams) -> +verify_signature(DerEncodedCert, DerKey, _KeyParams) -> Key = decode_key(DerKey), case Key of #'RSAPrivateKey'{modulus=Mod, publicExponent=Exp} -> - public_key:verify_signature(DerEncodedCert, - #'RSAPublicKey'{modulus=Mod, publicExponent=Exp}, - 'NULL'); + public_key:pkix_verify(DerEncodedCert, + #'RSAPublicKey'{modulus=Mod, publicExponent=Exp}); #'DSAPrivateKey'{p=P, q=Q, g=G, y=Y} -> - public_key:verify_signature(DerEncodedCert, Y, #'Dss-Parms'{p=P, q=Q, g=G}); - - _ -> - public_key:verify_signature(DerEncodedCert, Key, KeyParams) + public_key:pkix_verify(DerEncodedCert, {Y, #'Dss-Parms'{p=P, q=Q, g=G}}) end. %%%%%%%%%%%%%%%%%%%%%%%%% Implementation %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% @@ -132,59 +129,63 @@ decode_key(#'RSAPrivateKey'{} = Key,_) -> Key; decode_key(#'DSAPrivateKey'{} = Key,_) -> Key; -decode_key(Der = {_,_,_}, Pw) -> - {ok, Key} = public_key:decode_private_key(Der, Pw), - Key; -decode_key(FileOrDer, Pw) -> - {ok, [KeyInfo]} = public_key:pem_to_der(FileOrDer), +decode_key(PemEntry = {_,_,_}, Pw) -> + public_key:pem_entry_decode(PemEntry, Pw); +decode_key(PemBin, Pw) -> + [KeyInfo] = public_key:pem_decode(PemBin), decode_key(KeyInfo, Pw). encode_key(Key = #'RSAPrivateKey'{}) -> {ok, Der} = 'OTP-PUB-KEY':encode('RSAPrivateKey', Key), - {rsa_private_key, list_to_binary(Der), not_encrypted}; + {'RSAPrivateKey', list_to_binary(Der), not_encrypted}; encode_key(Key = #'DSAPrivateKey'{}) -> {ok, Der} = 'OTP-PUB-KEY':encode('DSAPrivateKey', Key), - {dsa_private_key, list_to_binary(Der), not_encrypted}. + {'DSAPrivateKey', list_to_binary(Der), not_encrypted}. make_tbs(SubjectKey, Opts) -> Version = list_to_atom("v"++integer_to_list(proplists:get_value(version, Opts, 3))), - {Issuer, IssuerKey} = issuer(Opts, SubjectKey), + + IssuerProp = proplists:get_value(issuer, Opts, true), + {Issuer, IssuerKey} = issuer(IssuerProp, Opts, SubjectKey), {Algo, Parameters} = sign_algorithm(IssuerKey, Opts), SignAlgo = #'SignatureAlgorithm'{algorithm = Algo, parameters = Parameters}, - + Subject = case IssuerProp of + true -> %% Is a Root Ca + Issuer; + _ -> + subject(proplists:get_value(subject, Opts),false) + end, + {#'OTPTBSCertificate'{serialNumber = trunc(random:uniform()*100000000)*10000 + 1, signature = SignAlgo, issuer = Issuer, validity = validity(Opts), - subject = subject(proplists:get_value(subject, Opts),false), + subject = Subject, subjectPublicKeyInfo = publickey(SubjectKey), version = Version, extensions = extensions(Opts) }, IssuerKey}. -issuer(Opts, SubjectKey) -> - IssuerProp = proplists:get_value(issuer, Opts, true), - case IssuerProp of - true -> %% Self signed - {subject(proplists:get_value(subject, Opts), true), SubjectKey}; - {Issuer, IssuerKey} when is_binary(Issuer) -> - {issuer_der(Issuer), decode_key(IssuerKey)}; - {File, IssuerKey} when is_list(File) -> - {ok, [{cert, Cert, _}|_]} = public_key:pem_to_der(File), - {issuer_der(Cert), decode_key(IssuerKey)} - end. +issuer(true, Opts, SubjectKey) -> + %% Self signed + {subject(proplists:get_value(subject, Opts), true), SubjectKey}; +issuer({Issuer, IssuerKey}, _Opts, _SubjectKey) when is_binary(Issuer) -> + {issuer_der(Issuer), decode_key(IssuerKey)}; +issuer({File, IssuerKey}, _Opts, _SubjectKey) when is_list(File) -> + {ok, [{cert, Cert, _}|_]} = public_key:pem_to_der(File), + {issuer_der(Cert), decode_key(IssuerKey)}. issuer_der(Issuer) -> - {ok, Decoded} = public_key:pkix_decode_cert(Issuer, otp), + Decoded = public_key:pkix_decode_cert(Issuer, otp), #'OTPCertificate'{tbsCertificate=Tbs} = Decoded, #'OTPTBSCertificate'{subject=Subject} = Tbs, Subject. -subject(undefined, IsCA) -> - User = if IsCA -> "CA"; true -> os:getenv("USER") end, +subject(undefined, IsRootCA) -> + User = if IsRootCA -> "RootCA"; true -> os:getenv("USER") end, Opts = [{email, User ++ "@erlang.org"}, {name, User}, {city, "Stockholm"}, @@ -271,7 +272,7 @@ publickey(#'DSAPrivateKey'{p=P, q=Q, g=G, y=Y}) -> #'OTPSubjectPublicKeyInfo'{algorithm = Algo, subjectPublicKey = Y}. validity(Opts) -> - DefFrom0 = date(), + DefFrom0 = calendar:gregorian_days_to_date(calendar:date_to_gregorian_days(date())-1), DefTo0 = calendar:gregorian_days_to_date(calendar:date_to_gregorian_days(date())+7), {DefFrom, DefTo} = proplists:get_value(validity, Opts, {DefFrom0, DefTo0}), Format = fun({Y,M,D}) -> lists:flatten(io_lib:format("~w~2..0w~2..0w000000Z",[Y,M,D])) end, @@ -410,3 +411,11 @@ extended_gcd(A, B) -> {X, Y} = extended_gcd(B, N), {Y, X-Y*(A div B)} end. + +pem_to_der(File) -> + {ok, PemBin} = file:read_file(File), + public_key:pem_decode(PemBin). + +der_to_pem(File, Entries) -> + PemBin = public_key:pem_encode(Entries), + file:write_file(File, PemBin). diff --git a/lib/ssl/test/make_certs.erl b/lib/ssl/test/make_certs.erl index 0cdf33c3e2..3c18a905b4 100644 --- a/lib/ssl/test/make_certs.erl +++ b/lib/ssl/test/make_certs.erl @@ -90,8 +90,10 @@ enduser(Root, OpenSSLCmd, CA, User) -> KeyFile = filename:join([UsrRoot, "key.pem"]), ReqFile = filename:join([UsrRoot, "req.pem"]), create_req(Root, OpenSSLCmd, CnfFile, KeyFile, ReqFile), - CertFile = filename:join([UsrRoot, "cert.pem"]), - sign_req(Root, OpenSSLCmd, CA, "user_cert", ReqFile, CertFile). + CertFileAllUsage = filename:join([UsrRoot, "cert.pem"]), + sign_req(Root, OpenSSLCmd, CA, "user_cert", ReqFile, CertFileAllUsage), + CertFileDigitalSigOnly = filename:join([UsrRoot, "digital_signature_only_cert.pem"]), + sign_req(Root, OpenSSLCmd, CA, "user_cert_digital_signature_only", ReqFile, CertFileDigitalSigOnly). collect_certs(Root, CAs, Users) -> Bins = lists:foldr( @@ -255,6 +257,7 @@ ca_cnf(CA) -> "RANDFILE = $dir/private/RAND\n" "\n" "x509_extensions = user_cert\n" + "unique_subject = no\n" "default_days = 3600\n" "default_md = sha1\n" "preserve = no\n" @@ -279,6 +282,15 @@ ca_cnf(CA) -> "issuerAltName = issuer:copy\n" "\n" + "[user_cert_digital_signature_only]\n" + "basicConstraints = CA:false\n" + "keyUsage = digitalSignature\n" + "subjectKeyIdentifier = hash\n" + "authorityKeyIdentifier = keyid,issuer:always\n" + "subjectAltName = email:copy\n" + "issuerAltName = issuer:copy\n" + "\n" + "[ca_cert]\n" "basicConstraints = critical,CA:true\n" "keyUsage = cRLSign, keyCertSign\n" diff --git a/lib/ssl/test/ssl_basic_SUITE.erl b/lib/ssl/test/ssl_basic_SUITE.erl index 8a1b90ed98..d50b34b6ac 100644 --- a/lib/ssl/test/ssl_basic_SUITE.erl +++ b/lib/ssl/test/ssl_basic_SUITE.erl @@ -7,7 +7,7 @@ %% Version 1.1, (the "License"); you may not use this file except in %% compliance with the License. You should have received a copy of the %% Erlang Public License along with this software. If not, it can be -%% retrieved online at http://www.erlang.org/. +%% retrieved online at http://www.erlang.org/.2 %% %% Software distributed under the License is distributed on an "AS IS" %% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See @@ -233,7 +233,9 @@ all(suite) -> server_renegotiate_reused_session, client_no_wrap_sequence_number, server_no_wrap_sequence_number, extended_key_usage, validate_extensions_fun, no_authority_key_identifier, - invalid_signature_client, invalid_signature_server, cert_expired + invalid_signature_client, invalid_signature_server, cert_expired, + client_with_cert_cipher_suites_handshake, unknown_server_ca_fail, + unknown_server_ca_accept ]. %% Test cases starts here. @@ -578,8 +580,8 @@ peercert(Config) when is_list(Config) -> {options, ClientOpts}]), CertFile = proplists:get_value(certfile, ServerOpts), - {ok, [{cert, BinCert, _}]} = public_key:pem_to_der(CertFile), - {ok, ErlCert} = public_key:pkix_decode_cert(BinCert, otp), + [{'Certificate', BinCert, _}]= ssl_test_lib:pem_to_der(CertFile), + ErlCert = public_key:pkix_decode_cert(BinCert, otp), ServerMsg = {{error, no_peercert}, {error, no_peercert}}, ClientMsg = {{ok, BinCert}, {ok, ErlCert}}, @@ -1552,25 +1554,26 @@ cipher(CipherSuite, Version, Config, ClientOpts, ServerOpts) -> process_flag(trap_exit, true), test_server:format("Testing CipherSuite ~p~n", [CipherSuite]), {ClientNode, ServerNode, Hostname} = ssl_test_lib:run_where(Config), + + ErlangCipherSuite = erlang_cipher_suite(CipherSuite), + + ConnectionInfo = {ok, {Version, ErlangCipherSuite}}, + Server = ssl_test_lib:start_server([{node, ServerNode}, {port, 0}, {from, self()}, - {mfa, {?MODULE, connection_info_result, []}}, + {mfa, {ssl_test_lib, cipher_result, [ConnectionInfo]}}, {options, ServerOpts}]), Port = ssl_test_lib:inet_port(Server), Client = ssl_test_lib:start_client([{node, ClientNode}, {port, Port}, {host, Hostname}, {from, self()}, - {mfa, {?MODULE, connection_info_result, []}}, + {mfa, {ssl_test_lib, cipher_result, [ConnectionInfo]}}, {options, [{ciphers,[CipherSuite]} | ClientOpts]}]), - - ErlangCipherSuite = erlang_cipher_suite(CipherSuite), - - ServerMsg = ClientMsg = {ok, {Version, ErlangCipherSuite}}, - - Result = ssl_test_lib:wait_for_result(Server, ServerMsg, - Client, ClientMsg), + + Result = ssl_test_lib:wait_for_result(Server, ok, Client, ok), + ssl_test_lib:close(Server), receive {'EXIT', Server, normal} -> @@ -2525,35 +2528,35 @@ extended_key_usage(Config) when is_list(Config) -> PrivDir = ?config(priv_dir, Config), KeyFile = filename:join(PrivDir, "otpCA/private/key.pem"), - {ok, [KeyInfo]} = public_key:pem_to_der(KeyFile), - {ok, Key} = public_key:decode_private_key(KeyInfo), + [KeyEntry] = ssl_test_lib:pem_to_der(KeyFile), + Key = public_key:pem_entry_decode(KeyEntry), ServerCertFile = proplists:get_value(certfile, ServerOpts), NewServerCertFile = filename:join(PrivDir, "server/new_cert.pem"), - {ok, [{cert, ServerDerCert, _}]} = public_key:pem_to_der(ServerCertFile), - {ok, ServerOTPCert} = public_key:pkix_decode_cert(ServerDerCert, otp), + [{'Certificate', ServerDerCert, _}] = ssl_test_lib:pem_to_der(ServerCertFile), + ServerOTPCert = public_key:pkix_decode_cert(ServerDerCert, otp), ServerExtKeyUsageExt = {'Extension', ?'id-ce-extKeyUsage', true, [?'id-kp-serverAuth']}, ServerOTPTbsCert = ServerOTPCert#'OTPCertificate'.tbsCertificate, ServerExtensions = ServerOTPTbsCert#'OTPTBSCertificate'.extensions, NewServerOTPTbsCert = ServerOTPTbsCert#'OTPTBSCertificate'{extensions = [ServerExtKeyUsageExt | ServerExtensions]}, - NewServerDerCert = public_key:sign(NewServerOTPTbsCert, Key), - public_key:der_to_pem(NewServerCertFile, [{cert, NewServerDerCert, not_encrypted}]), + NewServerDerCert = public_key:pkix_sign(NewServerOTPTbsCert, Key), + ssl_test_lib:der_to_pem(NewServerCertFile, [{'Certificate', NewServerDerCert, not_encrypted}]), NewServerOpts = [{certfile, NewServerCertFile} | proplists:delete(certfile, ServerOpts)], ClientCertFile = proplists:get_value(certfile, ClientOpts), NewClientCertFile = filename:join(PrivDir, "client/new_cert.pem"), - {ok, [{cert, ClientDerCert, _}]} = public_key:pem_to_der(ClientCertFile), - {ok, ClientOTPCert} = public_key:pkix_decode_cert(ClientDerCert, otp), + [{'Certificate', ClientDerCert, _}] = ssl_test_lib:pem_to_der(ClientCertFile), + ClientOTPCert = public_key:pkix_decode_cert(ClientDerCert, otp), ClientExtKeyUsageExt = {'Extension', ?'id-ce-extKeyUsage', true, [?'id-kp-clientAuth']}, ClientOTPTbsCert = ClientOTPCert#'OTPCertificate'.tbsCertificate, ClientExtensions = ClientOTPTbsCert#'OTPTBSCertificate'.extensions, NewClientOTPTbsCert = ClientOTPTbsCert#'OTPTBSCertificate'{extensions = [ClientExtKeyUsageExt | ClientExtensions]}, - NewClientDerCert = public_key:sign(NewClientOTPTbsCert, Key), - public_key:der_to_pem(NewClientCertFile, [{cert, NewClientDerCert, not_encrypted}]), + NewClientDerCert = public_key:pkix_sign(NewClientOTPTbsCert, Key), + ssl_test_lib:der_to_pem(NewClientCertFile, [{'Certificate', NewClientDerCert, not_encrypted}]), NewClientOpts = [{certfile, NewClientCertFile} | proplists:delete(certfile, ClientOpts)], {ClientNode, ServerNode, Hostname} = ssl_test_lib:run_where(Config), @@ -2611,23 +2614,24 @@ validate_extensions_fun(Config) when is_list(Config) -> %%-------------------------------------------------------------------- no_authority_key_identifier(doc) -> - ["Test cert that does not have authorityKeyIdentifier extension"]; + ["Test cert that does not have authorityKeyIdentifier extension" + " but are present in trusted certs db."]; no_authority_key_identifier(suite) -> []; no_authority_key_identifier(Config) when is_list(Config) -> - ClientOpts = ?config(client_opts, Config), + ClientOpts = ?config(client_verification_opts, Config), ServerOpts = ?config(server_opts, Config), PrivDir = ?config(priv_dir, Config), KeyFile = filename:join(PrivDir, "otpCA/private/key.pem"), - {ok, [KeyInfo]} = public_key:pem_to_der(KeyFile), - {ok, Key} = public_key:decode_private_key(KeyInfo), + [KeyEntry] = ssl_test_lib:pem_to_der(KeyFile), + Key = public_key:pem_entry_decode(KeyEntry), CertFile = proplists:get_value(certfile, ServerOpts), NewCertFile = filename:join(PrivDir, "server/new_cert.pem"), - {ok, [{cert, DerCert, _}]} = public_key:pem_to_der(CertFile), - {ok, OTPCert} = public_key:pkix_decode_cert(DerCert, otp), + [{'Certificate', DerCert, _}] = ssl_test_lib:pem_to_der(CertFile), + OTPCert = public_key:pkix_decode_cert(DerCert, otp), OTPTbsCert = OTPCert#'OTPCertificate'.tbsCertificate, Extensions = OTPTbsCert#'OTPTBSCertificate'.extensions, NewExtensions = delete_authority_key_extension(Extensions, []), @@ -2635,8 +2639,8 @@ no_authority_key_identifier(Config) when is_list(Config) -> test_server:format("Extensions ~p~n, NewExtensions: ~p~n", [Extensions, NewExtensions]), - NewDerCert = public_key:sign(NewOTPTbsCert, Key), - public_key:der_to_pem(NewCertFile, [{cert, NewDerCert, not_encrypted}]), + NewDerCert = public_key:pkix_sign(NewOTPTbsCert, Key), + ssl_test_lib:der_to_pem(NewCertFile, [{'Certificate', NewDerCert, not_encrypted}]), NewServerOpts = [{certfile, NewCertFile} | proplists:delete(certfile, ServerOpts)], {ClientNode, ServerNode, Hostname} = ssl_test_lib:run_where(Config), @@ -2674,21 +2678,21 @@ invalid_signature_server(suite) -> []; invalid_signature_server(Config) when is_list(Config) -> - ClientOpts = ?config(client_opts, Config), + ClientOpts = ?config(client_verification_opts, Config), ServerOpts = ?config(server_verification_opts, Config), PrivDir = ?config(priv_dir, Config), KeyFile = filename:join(PrivDir, "server/key.pem"), - {ok, [KeyInfo]} = public_key:pem_to_der(KeyFile), - {ok, Key} = public_key:decode_private_key(KeyInfo), + [KeyEntry] = ssl_test_lib:pem_to_der(KeyFile), + Key = public_key:pem_entry_decode(KeyEntry), ServerCertFile = proplists:get_value(certfile, ServerOpts), NewServerCertFile = filename:join(PrivDir, "server/invalid_cert.pem"), - {ok, [{cert, ServerDerCert, _}]} = public_key:pem_to_der(ServerCertFile), - {ok, ServerOTPCert} = public_key:pkix_decode_cert(ServerDerCert, otp), + [{'Certificate', ServerDerCert, _}] = ssl_test_lib:pem_to_der(ServerCertFile), + ServerOTPCert = public_key:pkix_decode_cert(ServerDerCert, otp), ServerOTPTbsCert = ServerOTPCert#'OTPCertificate'.tbsCertificate, - NewServerDerCert = public_key:sign(ServerOTPTbsCert, Key), - public_key:der_to_pem(NewServerCertFile, [{cert, NewServerDerCert, not_encrypted}]), + NewServerDerCert = public_key:pkix_sign(ServerOTPTbsCert, Key), + ssl_test_lib:der_to_pem(NewServerCertFile, [{'Certificate', NewServerDerCert, not_encrypted}]), NewServerOpts = [{certfile, NewServerCertFile} | proplists:delete(certfile, ServerOpts)], {ClientNode, ServerNode, Hostname} = ssl_test_lib:run_where(Config), @@ -2719,16 +2723,16 @@ invalid_signature_client(Config) when is_list(Config) -> PrivDir = ?config(priv_dir, Config), KeyFile = filename:join(PrivDir, "client/key.pem"), - {ok, [KeyInfo]} = public_key:pem_to_der(KeyFile), - {ok, Key} = public_key:decode_private_key(KeyInfo), + [KeyEntry] = ssl_test_lib:pem_to_der(KeyFile), + Key = public_key:pem_entry_decode(KeyEntry), ClientCertFile = proplists:get_value(certfile, ClientOpts), NewClientCertFile = filename:join(PrivDir, "client/invalid_cert.pem"), - {ok, [{cert, ClientDerCert, _}]} = public_key:pem_to_der(ClientCertFile), - {ok, ClientOTPCert} = public_key:pkix_decode_cert(ClientDerCert, otp), + [{'Certificate', ClientDerCert, _}] = ssl_test_lib:pem_to_der(ClientCertFile), + ClientOTPCert = public_key:pkix_decode_cert(ClientDerCert, otp), ClientOTPTbsCert = ClientOTPCert#'OTPCertificate'.tbsCertificate, - NewClientDerCert = public_key:sign(ClientOTPTbsCert, Key), - public_key:der_to_pem(NewClientCertFile, [{cert, NewClientDerCert, not_encrypted}]), + NewClientDerCert = public_key:pkix_sign(ClientOTPTbsCert, Key), + ssl_test_lib:der_to_pem(NewClientCertFile, [{'Certificate', NewClientDerCert, not_encrypted}]), NewClientOpts = [{certfile, NewClientCertFile} | proplists:delete(certfile, ClientOpts)], {ClientNode, ServerNode, Hostname} = ssl_test_lib:run_where(Config), @@ -2791,18 +2795,18 @@ cert_expired(suite) -> []; cert_expired(Config) when is_list(Config) -> - ClientOpts = ?config(client_opts, Config), + ClientOpts = ?config(client_verification_opts, Config), ServerOpts = ?config(server_verification_opts, Config), PrivDir = ?config(priv_dir, Config), KeyFile = filename:join(PrivDir, "otpCA/private/key.pem"), - {ok, [KeyInfo]} = public_key:pem_to_der(KeyFile), - {ok, Key} = public_key:decode_private_key(KeyInfo), + [KeyEntry] = ssl_test_lib:pem_to_der(KeyFile), + Key = public_key:pem_entry_decode(KeyEntry), ServerCertFile = proplists:get_value(certfile, ServerOpts), NewServerCertFile = filename:join(PrivDir, "server/expired_cert.pem"), - {ok, [{cert, DerCert, _}]} = public_key:pem_to_der(ServerCertFile), - {ok, OTPCert} = public_key:pkix_decode_cert(DerCert, otp), + [{'Certificate', DerCert, _}] = ssl_test_lib:pem_to_der(ServerCertFile), + OTPCert = public_key:pkix_decode_cert(DerCert, otp), OTPTbsCert = OTPCert#'OTPCertificate'.tbsCertificate, {Year, Month, Day} = date(), @@ -2825,8 +2829,8 @@ cert_expired(Config) when is_list(Config) -> [OTPTbsCert#'OTPTBSCertificate'.validity, NewValidity]), NewOTPTbsCert = OTPTbsCert#'OTPTBSCertificate'{validity = NewValidity}, - NewServerDerCert = public_key:sign(NewOTPTbsCert, Key), - public_key:der_to_pem(NewServerCertFile, [{cert, NewServerDerCert, not_encrypted}]), + NewServerDerCert = public_key:pkix_sign(NewOTPTbsCert, Key), + ssl_test_lib:der_to_pem(NewServerCertFile, [{'Certificate', NewServerDerCert, not_encrypted}]), NewServerOpts = [{certfile, NewServerCertFile} | proplists:delete(certfile, ServerOpts)], {ClientNode, ServerNode, Hostname} = ssl_test_lib:run_where(Config), @@ -2849,6 +2853,92 @@ two_digits_str(N) -> lists:flatten(io_lib:format("~p", [N])). %%-------------------------------------------------------------------- + +client_with_cert_cipher_suites_handshake(doc) -> + ["Test that client with a certificate without keyEncipherment usage " + " extension can connect to a server with restricted cipher suites "]; + +client_with_cert_cipher_suites_handshake(suite) -> + []; + +client_with_cert_cipher_suites_handshake(Config) when is_list(Config) -> + ClientOpts = ?config(client_verification_opts_digital_signature_only, Config), + ServerOpts = ?config(server_verification_opts, Config), + {ClientNode, ServerNode, Hostname} = ssl_test_lib:run_where(Config), + Server = ssl_test_lib:start_server([{node, ServerNode}, {port, 0}, + {from, self()}, + {mfa, {?MODULE, + send_recv_result_active, []}}, + {options, [{active, true}, + {ciphers, ssl_test_lib:rsa_non_signed_suites()} + | ServerOpts]}]), + Port = ssl_test_lib:inet_port(Server), + Client = ssl_test_lib:start_client([{node, ClientNode}, {port, Port}, + {host, Hostname}, + {from, self()}, + {mfa, {?MODULE, + send_recv_result_active, []}}, + {options, [{active, true} + | ClientOpts]}]), + + ssl_test_lib:check_result(Server, ok, Client, ok), + ssl_test_lib:close(Server), + ssl_test_lib:close(Client). +%%-------------------------------------------------------------------- +unknown_server_ca_fail(doc) -> + ["Test that the client fails if the ca is unknown in verify_peer mode"]; +unknown_server_ca_fail(suite) -> + []; +unknown_server_ca_fail(Config) when is_list(Config) -> + ClientOpts = ?config(client_opts, Config), + ServerOpts = ?config(server_opts, Config), + {ClientNode, ServerNode, Hostname} = ssl_test_lib:run_where(Config), + Server = ssl_test_lib:start_server_error([{node, ServerNode}, {port, 0}, + {from, self()}, + {mfa, {ssl_test_lib, + no_result, []}}, + {options, ServerOpts}]), + Port = ssl_test_lib:inet_port(Server), + Client = ssl_test_lib:start_client_error([{node, ClientNode}, {port, Port}, + {host, Hostname}, + {from, self()}, + {mfa, {ssl_test_lib, + no_result, []}}, + {options, + [{verify, verify_peer}| ClientOpts]}]), + + ssl_test_lib:check_result(Server, {error,"unknown ca"}, Client, {error, "unknown ca"}), + ssl_test_lib:close(Server), + ssl_test_lib:close(Client). + +%%-------------------------------------------------------------------- +unknown_server_ca_accept(doc) -> + ["Test that the client succeds if the ca is unknown in verify_none mode"]; +unknown_server_ca_accept(suite) -> + []; +unknown_server_ca_accept(Config) when is_list(Config) -> + ClientOpts = ?config(client_opts, Config), + ServerOpts = ?config(server_opts, Config), + {ClientNode, ServerNode, Hostname} = ssl_test_lib:run_where(Config), + Server = ssl_test_lib:start_server([{node, ServerNode}, {port, 0}, + {from, self()}, + {mfa, {?MODULE, + send_recv_result_active, []}}, + {options, ServerOpts}]), + Port = ssl_test_lib:inet_port(Server), + Client = ssl_test_lib:start_client([{node, ClientNode}, {port, Port}, + {host, Hostname}, + {from, self()}, + {mfa, {?MODULE, + send_recv_result_active, []}}, + {options, + [{verify, verify_none}| ClientOpts]}]), + + ssl_test_lib:check_result(Server, ok, Client, ok), + ssl_test_lib:close(Server), + ssl_test_lib:close(Client). + +%%-------------------------------------------------------------------- %%% Internal functions %%-------------------------------------------------------------------- send_recv_result(Socket) -> @@ -2873,6 +2963,7 @@ send_recv_result_active_once(Socket) -> result_ok(_Socket) -> ok. + renegotiate(Socket, Data) -> test_server:format("Renegotiating ~n", []), Result = ssl:renegotiate(Socket), diff --git a/lib/ssl/test/ssl_packet_SUITE.erl b/lib/ssl/test/ssl_packet_SUITE.erl index 1b8754afe9..1e7cde1c25 100644 --- a/lib/ssl/test/ssl_packet_SUITE.erl +++ b/lib/ssl/test/ssl_packet_SUITE.erl @@ -145,14 +145,19 @@ all(suite) -> packet_baddata_passive, packet_baddata_active, packet_size_passive, packet_size_active, packet_cdr_decode, + packet_cdr_decode_list, packet_http_decode, packet_http_decode_list, packet_http_bin_decode_multi, packet_line_decode, - packet_asn1_decode, + packet_line_decode_list, + packet_asn1_decode, + packet_asn1_decode_list, packet_tpkt_decode, + packet_tpkt_decode_list, %packet_fcgi_decode, packet_sunrm_decode, + packet_sunrm_decode_list, header_decode_one_byte, header_decode_two_bytes, header_decode_two_bytes_one_sent, @@ -1429,7 +1434,7 @@ packet_size_passive(Config) when is_list(Config) -> %%-------------------------------------------------------------------- packet_cdr_decode(doc) -> - ["Test setting the packet option {packet, cdr}"]; + ["Test setting the packet option {packet, cdr}, {mode, binary}"]; packet_cdr_decode(suite) -> []; packet_cdr_decode(Config) when is_list(Config) -> @@ -1463,8 +1468,44 @@ packet_cdr_decode(Config) when is_list(Config) -> ssl_test_lib:close(Client). %%-------------------------------------------------------------------- +packet_cdr_decode_list(doc) -> + ["Test setting the packet option {packet, cdr} {mode, list}"]; +packet_cdr_decode_list(suite) -> + []; +packet_cdr_decode_list(Config) when is_list(Config) -> + ClientOpts = ?config(client_opts, Config), + ServerOpts = ?config(server_opts, Config), + {ClientNode, ServerNode, Hostname} = ssl_test_lib:run_where(Config), + + %% A valid cdr packet + Data = [71,73,79,80,1,2,2,1,0,0,0,41,0,0,0,0,0,0,0,0,0,0,0,1,78, + 69,79,0,0,0,0,2,0,10,0,0,0,0,0,0,0,0,0,18,0,0,0,0,0,0,0,4,49], + + Server = ssl_test_lib:start_server([{node, ClientNode}, {port, 0}, + {from, self()}, + {mfa, {?MODULE, server_packet_decode, + [Data]}}, + {options, [{active, true}, list, + {packet, cdr}|ServerOpts]}]), + + Port = ssl_test_lib:inet_port(Server), + Client = ssl_test_lib:start_client([{node, ServerNode}, {port, Port}, + {host, Hostname}, + {from, self()}, + {mfa, {?MODULE, client_packet_decode, + [Data]}}, + {options, [{active, true}, {packet, cdr}, + list | ClientOpts]}]), + + ssl_test_lib:check_result(Server, ok, Client, ok), + + ssl_test_lib:close(Server), + ssl_test_lib:close(Client). + +%%-------------------------------------------------------------------- packet_http_decode(doc) -> - ["Test setting the packet option {packet, http} {mode, binary}"]; + ["Test setting the packet option {packet, http} {mode, binary} " + "(Body will be binary http strings are lists)"]; packet_http_decode(suite) -> []; @@ -1485,7 +1526,7 @@ packet_http_decode(Config) when is_list(Config) -> {from, self()}, {mfa, {?MODULE, server_http_decode, [Response]}}, - {options, [{active, true}, binary, + {options, [{active, true},binary, {packet, http} | ServerOpts]}]), Port = ssl_test_lib:inet_port(Server), @@ -1494,7 +1535,7 @@ packet_http_decode(Config) when is_list(Config) -> {from, self()}, {mfa, {?MODULE, client_http_decode, [Request]}}, - {options, [{active, true}, binary, + {options, [{active, true}, binary, {packet, http} | ClientOpts]}]), @@ -1548,7 +1589,8 @@ client_http_decode(Socket, HttpRequest) -> %%-------------------------------------------------------------------- packet_http_decode_list(doc) -> - ["Test setting the packet option {packet, http}, {mode, list}"]; + ["Test setting the packet option {packet, http}, {mode, list}" + "(Body will be litst too)"]; packet_http_decode_list(suite) -> []; packet_http_decode_list(Config) when is_list(Config) -> @@ -1697,7 +1739,7 @@ client_http_bin_decode(_, _, _) -> ok. %%-------------------------------------------------------------------- packet_line_decode(doc) -> - ["Test setting the packet option {packet, line}"]; + ["Test setting the packet option {packet, line}, {mode, binary}"]; packet_line_decode(suite) -> []; packet_line_decode(Config) when is_list(Config) -> @@ -1731,30 +1773,44 @@ packet_line_decode(Config) when is_list(Config) -> ssl_test_lib:close(Server), ssl_test_lib:close(Client). +%%-------------------------------------------------------------------- -server_line_packet_decode(Socket, Lines) -> - receive - {ssl, Socket, <<"Line ends here.\n">>} -> ok; - Other1 -> exit({?LINE, Other1}) - end, - receive - {ssl, Socket, <<"Now it is a new line.\n">>} -> ok; - Other2 -> exit({?LINE, Other2}) - end, - ok = ssl:send(Socket, Lines). +packet_line_decode_list(doc) -> + ["Test setting the packet option {packet, line}, {mode, list}"]; +packet_line_decode_list(suite) -> + []; +packet_line_decode_list(Config) when is_list(Config) -> + ClientOpts = ?config(client_opts, Config), + ServerOpts = ?config(server_opts, Config), + {ClientNode, ServerNode, Hostname} = ssl_test_lib:run_where(Config), + + Data = lists:flatten(io_lib:format("Line ends here.~n" + "Now it is a new line.~n", [])), + + Server = ssl_test_lib:start_server([{node, ClientNode}, {port, 0}, + {from, self()}, + {mfa, {?MODULE, + server_line_packet_decode, + [Data]}}, + {options, [{active, true}, list, + {packet, line}|ServerOpts]}]), + + Port = ssl_test_lib:inet_port(Server), + Client = ssl_test_lib:start_client([{node, ServerNode}, {port, Port}, + {host, Hostname}, + {from, self()}, + {mfa, {?MODULE, + client_line_packet_decode, + [Data]}}, + {options, [{active, true}, + {packet, line}, + list | ClientOpts]}]), + + ssl_test_lib:check_result(Server, ok, Client, ok), + + ssl_test_lib:close(Server), + ssl_test_lib:close(Client). -client_line_packet_decode(Socket, Lines) -> - <<P1:10/binary, P2/binary>> = Lines, - ok = ssl:send(Socket, P1), - ok = ssl:send(Socket, P2), - receive - {ssl, Socket, <<"Line ends here.\n">>} -> ok; - Other1 -> exit({?LINE, Other1}) - end, - receive - {ssl, Socket, <<"Now it is a new line.\n">>} -> ok; - Other2 -> exit({?LINE, Other2}) - end. %%-------------------------------------------------------------------- @@ -1770,7 +1826,7 @@ packet_asn1_decode(Config) when is_list(Config) -> File = proplists:get_value(certfile, ServerOpts), %% A valid asn1 BER packet (DER is stricter BER) - {ok,[{cert, Data, _}]} = public_key:pem_to_der(File), + [{'Certificate', Data, _}] = ssl_test_lib:pem_to_der(File), Server = ssl_test_lib:start_server([{node, ClientNode}, {port, 0}, {from, self()}, @@ -1794,6 +1850,44 @@ packet_asn1_decode(Config) when is_list(Config) -> ssl_test_lib:close(Client). %%-------------------------------------------------------------------- +packet_asn1_decode_list(doc) -> + ["Test setting the packet option {packet, asn1}"]; +packet_asn1_decode_list(suite) -> + []; +packet_asn1_decode_list(Config) when is_list(Config) -> + ClientOpts = ?config(client_opts, Config), + ServerOpts = ?config(server_opts, Config), + {ClientNode, ServerNode, Hostname} = ssl_test_lib:run_where(Config), + + File = proplists:get_value(certfile, ServerOpts), + + %% A valid asn1 BER packet (DER is stricter BER) + [{'Certificate', BinData, _}] = ssl_test_lib:pem_to_der(File), + + Data = binary_to_list(BinData), + + Server = ssl_test_lib:start_server([{node, ClientNode}, {port, 0}, + {from, self()}, + {mfa, {?MODULE, server_packet_decode, + [Data]}}, + {options, [{active, true}, list, + {packet, asn1}|ServerOpts]}]), + + Port = ssl_test_lib:inet_port(Server), + Client = ssl_test_lib:start_client([{node, ServerNode}, {port, Port}, + {host, Hostname}, + {from, self()}, + {mfa, {?MODULE, client_packet_decode, + [Data]}}, + {options, [{active, true}, {packet, asn1}, + list | ClientOpts]}]), + + ssl_test_lib:check_result(Server, ok, Client, ok), + + ssl_test_lib:close(Server), + ssl_test_lib:close(Client). + +%%-------------------------------------------------------------------- packet_tpkt_decode(doc) -> ["Test setting the packet option {packet, tpkt}"]; packet_tpkt_decode(suite) -> @@ -1826,6 +1920,38 @@ packet_tpkt_decode(Config) when is_list(Config) -> ssl_test_lib:close(Server), ssl_test_lib:close(Client). +%%-------------------------------------------------------------------- +packet_tpkt_decode_list(doc) -> + ["Test setting the packet option {packet, tpkt}"]; +packet_tpkt_decode_list(suite) -> + []; +packet_tpkt_decode_list(Config) when is_list(Config) -> + ClientOpts = ?config(client_opts, Config), + ServerOpts = ?config(server_opts, Config), + {ClientNode, ServerNode, Hostname} = ssl_test_lib:run_where(Config), + + Data = binary_to_list(list_to_binary(add_tpkt_header("TPKT data"))), + + Server = ssl_test_lib:start_server([{node, ClientNode}, {port, 0}, + {from, self()}, + {mfa, {?MODULE, server_packet_decode, + [Data]}}, + {options, [{active, true}, list, + {packet, tpkt}|ServerOpts]}]), + + Port = ssl_test_lib:inet_port(Server), + Client = ssl_test_lib:start_client([{node, ServerNode}, {port, Port}, + {host, Hostname}, + {from, self()}, + {mfa, {?MODULE, client_packet_decode, + [Data]}}, + {options, [{active, true}, {packet, tpkt}, + list | ClientOpts]}]), + + ssl_test_lib:check_result(Server, ok, Client, ok), + + ssl_test_lib:close(Server), + ssl_test_lib:close(Client). %%-------------------------------------------------------------------- @@ -1895,6 +2021,39 @@ packet_sunrm_decode(Config) when is_list(Config) -> ssl_test_lib:close(Server), ssl_test_lib:close(Client). + +%%-------------------------------------------------------------------- +packet_sunrm_decode_list(doc) -> + ["Test setting the packet option {packet, sunrm}"]; +packet_sunrm_decode_list(suite) -> + []; +packet_sunrm_decode_list(Config) when is_list(Config) -> + ClientOpts = ?config(client_opts, Config), + ServerOpts = ?config(server_opts, Config), + {ClientNode, ServerNode, Hostname} = ssl_test_lib:run_where(Config), + + Data = binary_to_list(list_to_binary([<<11:32>>, "Hello world"])), + + Server = ssl_test_lib:start_server([{node, ClientNode}, {port, 0}, + {from, self()}, + {mfa, {?MODULE, server_packet_decode, + [Data]}}, + {options, [{active, true}, list, + {packet, sunrm}|ServerOpts]}]), + + Port = ssl_test_lib:inet_port(Server), + Client = ssl_test_lib:start_client([{node, ServerNode}, {port, Port}, + {host, Hostname}, + {from, self()}, + {mfa, {?MODULE, client_packet_decode, + [Data]}}, + {options, [{active, true}, {packet, sunrm}, + list | ClientOpts]}]), + + ssl_test_lib:check_result(Server, ok, Client, ok), + + ssl_test_lib:close(Server), + ssl_test_lib:close(Client). %%-------------------------------------------------------------------- header_decode_one_byte(doc) -> @@ -2037,21 +2196,29 @@ header_decode_two_bytes_one_sent(Config) when is_list(Config) -> %%-------------------------------------------------------------------- %% Internal functions -send_raw(_,_, 0) -> +send_raw(Socket,_, 0) -> + ssl:send(Socket, <<>>), no_result_msg; send_raw(Socket, Data, N) -> ssl:send(Socket, Data), send_raw(Socket, Data, N-1). -passive_raw(_, _, 0) -> +passive_raw(Socket, _, 0) -> + {error, timeout} = ssl:recv(Socket, 0, 500), ok; passive_raw(Socket, Data, N) -> Length = length(Data), {ok, Data} = ssl:recv(Socket, Length), passive_raw(Socket, Data, N-1). -passive_recv_packet(_, _, 0) -> - ok; +passive_recv_packet(Socket, _, 0) -> + case ssl:recv(Socket, 0) of + {ok, []} -> + {error, timeout} = ssl:recv(Socket, 0, 500), + ok; + Other -> + {other, Other, ssl:session_info(Socket), 0} + end; passive_recv_packet(Socket, Data, N) -> case ssl:recv(Socket, 0) of {ok, Data} -> @@ -2060,7 +2227,8 @@ passive_recv_packet(Socket, Data, N) -> {other, Other, ssl:session_info(Socket), N} end. -send(_,_, 0) -> +send(Socket,_, 0) -> + ssl:send(Socket, <<>>), no_result_msg; send(Socket, Data, N) -> case ssl:send(Socket, [Data]) of @@ -2074,6 +2242,7 @@ send_incomplete(Socket, Data, N) -> send_incomplete(Socket, Data, N, <<>>). send_incomplete(Socket, _Data, 0, Prev) -> ssl:send(Socket, Prev), + ssl:send(Socket, [?uint32(0)]), no_result_msg; send_incomplete(Socket, Data, N, Prev) -> Length = size(Data), @@ -2102,8 +2271,13 @@ active_once_raw(Socket, Data, N, Acc) -> end end. -active_once_packet(_,_, 0) -> - ok; +active_once_packet(Socket,_, 0) -> + receive + {ssl, Socket, []} -> + ok; + {ssl, Socket, Other} -> + {other, Other, ssl:session_info(Socket), 0} + end; active_once_packet(Socket, Data, N) -> receive {ssl, Socket, Data} -> @@ -2115,7 +2289,7 @@ active_once_packet(Socket, Data, N) -> active_raw(Socket, Data, N) -> active_raw(Socket, Data, N, []). -active_raw(_, _, 0, _) -> +active_raw(_Socket, _, 0, _) -> ok; active_raw(Socket, Data, N, Acc) -> receive @@ -2130,8 +2304,13 @@ active_raw(Socket, Data, N, Acc) -> end end. -active_packet(_, _, 0) -> - ok; +active_packet(Socket, _, 0) -> + receive + {ssl, Socket, []} -> + ok; + Other -> + {other, Other, ssl:session_info(Socket), 0} + end; active_packet(Socket, Data, N) -> receive {ssl, Socket, Data} -> @@ -2155,8 +2334,14 @@ server_packet_decode(Socket, Packet) -> end, ok = ssl:send(Socket, Packet). -client_packet_decode(Socket, Packet) -> +client_packet_decode(Socket, Packet) when is_binary(Packet)-> <<P1:10/binary, P2/binary>> = Packet, + client_packet_decode(Socket, P1, P2, Packet); +client_packet_decode(Socket, [Head | Tail] = Packet) -> + client_packet_decode(Socket, [Head], Tail, Packet). + +client_packet_decode(Socket, P1, P2, Packet) -> + test_server:format("Packet: ~p ~n", [Packet]), ok = ssl:send(Socket, P1), ok = ssl:send(Socket, P2), receive @@ -2176,7 +2361,7 @@ server_header_decode(Socket, Packet, Result) -> end, ok = ssl:send(Socket, Packet), receive - {ssl, Socket, Result} -> ok; + {ssl, Socket, Result} -> ok; Other2 -> exit({?LINE, Other2}) end, ok = ssl:send(Socket, Packet). @@ -2192,6 +2377,44 @@ client_header_decode(Socket, Packet, Result) -> {ssl, Socket, Result} -> ok; Other2 -> exit({?LINE, Other2}) end. + +server_line_packet_decode(Socket, Packet) when is_binary(Packet) -> + [L1, L2] = string:tokens(binary_to_list(Packet), "\n"), + server_line_packet_decode(Socket, list_to_binary(L1 ++ "\n"), list_to_binary(L2 ++ "\n"), Packet); +server_line_packet_decode(Socket, Packet) -> + [L1, L2] = string:tokens(Packet, "\n"), + server_line_packet_decode(Socket, L1 ++ "\n", L2 ++ "\n", Packet). + +server_line_packet_decode(Socket, L1, L2, Packet) -> + receive + {ssl, Socket, L1} -> ok; + Other1 -> exit({?LINE, Other1}) + end, + receive + {ssl, Socket, L2} -> ok; + Other2 -> exit({?LINE, Other2}) + end, + ok = ssl:send(Socket, Packet). + +client_line_packet_decode(Socket, Packet) when is_binary(Packet)-> + <<P1:10/binary, P2/binary>> = Packet, + [L1, L2] = string:tokens(binary_to_list(Packet), "\n"), + client_line_packet_decode(Socket, P1, P2, list_to_binary(L1 ++ "\n"), list_to_binary(L2 ++ "\n")); +client_line_packet_decode(Socket, [Head | Tail] = Packet) -> + [L1, L2] = string:tokens(Packet, "\n"), + client_line_packet_decode(Socket, [Head], Tail, L1 ++ "\n", L2 ++ "\n"). + +client_line_packet_decode(Socket, P1, P2, L1, L2) -> + ok = ssl:send(Socket, P1), + ok = ssl:send(Socket, P2), + receive + {ssl, Socket, L1} -> ok; + Other1 -> exit({?LINE, Other1}) + end, + receive + {ssl, Socket, L2} -> ok; + Other2 -> exit({?LINE, Other2}) + end. add_tpkt_header(Data) when is_binary(Data) -> L = size(Data) + 4, diff --git a/lib/ssl/test/ssl_test_lib.erl b/lib/ssl/test/ssl_test_lib.erl index 40715dbf30..ce164f7e4c 100644 --- a/lib/ssl/test/ssl_test_lib.erl +++ b/lib/ssl/test/ssl_test_lib.erl @@ -268,6 +268,8 @@ cert_options(Config) -> "client", "cacerts.pem"]), ClientCertFile = filename:join([?config(priv_dir, Config), "client", "cert.pem"]), + ClientCertFileDigitalSignatureOnly = filename:join([?config(priv_dir, Config), + "client", "digital_signature_only_cert.pem"]), ServerCaCertFile = filename:join([?config(priv_dir, Config), "server", "cacerts.pem"]), ServerCertFile = filename:join([?config(priv_dir, Config), @@ -292,6 +294,10 @@ cert_options(Config) -> {certfile, ClientCertFile}, {keyfile, ClientKeyFile}, {ssl_imp, new}]}, + {client_verification_opts_digital_signature_only, [{cacertfile, ClientCaCertFile}, + {certfile, ClientCertFileDigitalSignatureOnly}, + {keyfile, ClientKeyFile}, + {ssl_imp, new}]}, {server_opts, [{ssl_imp, new},{reuseaddr, true}, {certfile, ServerCertFile}, {keyfile, ServerKeyFile}]}, {server_verification_opts, [{ssl_imp, new},{reuseaddr, true}, @@ -325,6 +331,10 @@ make_dsa_cert(Config) -> [{server_dsa_opts, [{ssl_imp, new},{reuseaddr, true}, {cacertfile, ServerCaCertFile}, {certfile, ServerCertFile}, {keyfile, ServerKeyFile}]}, + {server_dsa_verify_opts, [{ssl_imp, new},{reuseaddr, true}, + {cacertfile, ClientCaCertFile}, + {certfile, ServerCertFile}, {keyfile, ServerKeyFile}, + {verify, verify_peer}]}, {client_dsa_opts, [{ssl_imp, new},{reuseaddr, true}, {cacertfile, ClientCaCertFile}, {certfile, ClientCertFile}, {keyfile, ClientKeyFile}]} @@ -342,9 +352,9 @@ make_dsa_cert_files(RoleStr, Config) -> KeyFile = filename:join([?config(priv_dir, Config), RoleStr, "dsa_key.pem"]), - public_key:der_to_pem(CaCertFile, [{cert, CaCert, not_encrypted}]), - public_key:der_to_pem(CertFile, [{cert, Cert, not_encrypted}]), - public_key:der_to_pem(KeyFile, [CertKey]), + der_to_pem(CaCertFile, [{'Certificate', CaCert, not_encrypted}]), + der_to_pem(CertFile, [{'Certificate', Cert, not_encrypted}]), + der_to_pem(KeyFile, [CertKey]), {CaCertFile, CertFile, KeyFile}. start_upgrade_server(Args) -> @@ -567,6 +577,14 @@ rsa_suites() -> end, ssl:cipher_suites()). +rsa_non_signed_suites() -> + lists:filter(fun({rsa, _, _}) -> + true; + (_) -> + false + end, + ssl:cipher_suites()). + dsa_suites() -> lists:filter(fun({dhe_dss, _, _}) -> true; @@ -597,3 +615,28 @@ openssl_dsa_suites() -> true end end, Ciphers). + +pem_to_der(File) -> + {ok, PemBin} = file:read_file(File), + public_key:pem_decode(PemBin). + +der_to_pem(File, Entries) -> + PemBin = public_key:pem_encode(Entries), + file:write_file(File, PemBin). + +cipher_result(Socket, Result) -> + Result = ssl:connection_info(Socket), + test_server:format("Successfull connect: ~p~n", [Result]), + %% Importante to send two packets here + %% to properly test "cipher state" handling + ssl:send(Socket, "Hello\n"), + receive + {ssl, Socket, "Hello\n"} -> + ssl:send(Socket, " world\n"), + receive + {ssl, Socket, " world\n"} -> + ok + end; + Other -> + {unexpected, Other} + end. diff --git a/lib/ssl/test/ssl_to_openssl_SUITE.erl b/lib/ssl/test/ssl_to_openssl_SUITE.erl index d2a4ca8db5..7f512f2ab9 100644 --- a/lib/ssl/test/ssl_to_openssl_SUITE.erl +++ b/lib/ssl/test/ssl_to_openssl_SUITE.erl @@ -309,7 +309,7 @@ tls1_erlang_server_openssl_client_dsa_cert(suite) -> tls1_erlang_server_openssl_client_dsa_cert(Config) when is_list(Config) -> process_flag(trap_exit, true), ClientOpts = ?config(client_dsa_opts, Config), - ServerOpts = ?config(server_dsa_opts, Config), + ServerOpts = ?config(server_dsa_verify_opts, Config), {_, ServerNode, _} = ssl_test_lib:run_where(Config), @@ -398,7 +398,7 @@ ssl3_erlang_server_openssl_client_dsa_cert(suite) -> ssl3_erlang_server_openssl_client_dsa_cert(Config) when is_list(Config) -> process_flag(trap_exit, true), ClientOpts = ?config(client_dsa_opts, Config), - ServerOpts = ?config(server_dsa_opts, Config), + ServerOpts = ?config(server_dsa_verify_opts, Config), {_, ServerNode, _} = ssl_test_lib:run_where(Config), @@ -1136,17 +1136,31 @@ cipher(CipherSuite, Version, Config, ClientOpts, ServerOpts) -> wait_for_openssl_server(), + ConnectionInfo = {ok, {Version, CipherSuite}}, + Client = ssl_test_lib:start_client([{node, ClientNode}, {port, Port}, {host, Hostname}, {from, self()}, - {mfa, {?MODULE, connection_info_result, []}}, + {mfa, {ssl_test_lib, cipher_result, [ConnectionInfo]}}, {options, [{ciphers,[CipherSuite]} | ClientOpts]}]), - - ClientMsg = {ok, {Version, CipherSuite}}, - - Result = ssl_test_lib:wait_for_result(Client, ClientMsg), + + port_command(OpenSslPort, "Hello\n"), + + receive + {Port, {data, _}} when is_port(Port) -> + ok + after 500 -> + test_server:format("Time out on openssl port, check that" + " the messages Hello and world are received" + " during close of port" , []), + ok + end, + + port_command(OpenSslPort, " world\n"), + + Result = ssl_test_lib:wait_for_result(Client, ok), close_port(OpenSslPort), %% Clean close down! diff --git a/lib/ssl/vsn.mk b/lib/ssl/vsn.mk index 74b1cf4c78..709a089892 100644 --- a/lib/ssl/vsn.mk +++ b/lib/ssl/vsn.mk @@ -1,61 +1 @@ -# -# %CopyrightBegin% -# -# Copyright Ericsson AB 1999-2010. All Rights Reserved. -# -# The contents of this file are subject to the Erlang Public License, -# Version 1.1, (the "License"); you may not use this file except in -# compliance with the License. You should have received a copy of the -# Erlang Public License along with this software. If not, it can be -# retrieved online at http://www.erlang.org/. -# -# Software distributed under the License is distributed on an "AS IS" -# basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See -# the License for the specific language governing rights and limitations -# under the License. -# -# %CopyrightEnd% -# - -SSL_VSN = 4.0 - -TICKETS = OTP-8587\ - OTP-8695 - -#TICKETS = OTP-8679 \ -# OTP-7047 \ -# OTP-7049 \ -# OTP-8568 \ -# OTP-8588 - -#TICKETS_3.11 = OTP-8517 \ -# OTP-7046 \ -# OTP-8557 \ -# OTP-8560 \ -# OTP-8545 \ -# OTP-8554 - -#TICKETS_3.10.9 = OTP-8510 - -#TICKETS_3.10.8 = OTP-8372 OTP-8441 OTP-8459 -#TICKETS_3.10.7 = OTP-8260 OTP-8218 OTP-8250 - -#TICKETS_3.10.6 = OTP-8275 - -#TICKETS_3.10.5 = OTP-8224 OTP-8244 - -#TICKETS_3.10.4 = OTP-8137 - -#TICKETS_3.10.3 = OTP-8011 -#TICKETS_3.10.2 = OTP-7963 - -# TICKETS_3.10.1 = OTP-7878 \ -# OTP-7656 \ -# OTP-7870 \ -# OTP-7871 - -# TICKETS_3.10 = OTP-7258 \ -# OTP-6894 \ -# OTP-7037 \ -# OTP-7039 \ -# OTP-7150 +SSL_VSN = 4.0.1 diff --git a/lib/stdlib/doc/src/beam_lib.xml b/lib/stdlib/doc/src/beam_lib.xml index 27308e02f3..adc411e272 100644 --- a/lib/stdlib/doc/src/beam_lib.xml +++ b/lib/stdlib/doc/src/beam_lib.xml @@ -341,6 +341,7 @@ chunkref() = chunkname() | chunkid()</code> <v>Beam1 = Beam2 = beam()</v> <v>Reason = {modules_different, Module1, Module2}</v> <v> | {chunks_different, ChunkId}</v> + <v> | different_chunks</v> <v> | Reason1 -- see info/1</v> <v> Module1 = Module2 = atom()</v> <v> ChunkId = chunkid()</v> diff --git a/lib/stdlib/doc/src/dets.xml b/lib/stdlib/doc/src/dets.xml index 8d1398d3b7..ad100d2cf5 100644 --- a/lib/stdlib/doc/src/dets.xml +++ b/lib/stdlib/doc/src/dets.xml @@ -109,7 +109,7 @@ bool() = true | false file() = string() int() = integer() >= 0 keypos() = integer() >= 1 -name() = atom() | ref() +name() = atom() | reference() no_slots() = integer() >= 0 | default object() = tuple() object_cont() = tuple() @@ -759,7 +759,7 @@ ok <fsummary>Open an existing Dets table.</fsummary> <type> <v>FileName = file()</v> - <v>Reference = ref()</v> + <v>Reference = reference()</v> </type> <desc> <p>Opens an existing table. If the table has not been properly diff --git a/lib/stdlib/doc/src/ets.xml b/lib/stdlib/doc/src/ets.xml index ee1befc882..dd4a289c61 100644 --- a/lib/stdlib/doc/src/ets.xml +++ b/lib/stdlib/doc/src/ets.xml @@ -1039,15 +1039,22 @@ ets:select(Table,MatchSpec),</code> the owner terminates.</p> </item> <item> + <marker id="new_2_write_concurrency"></marker> <p><c>{write_concurrency,bool()}</c> - Performance tuning. Default is <c>false</c>, which means that the table - is optimized towards concurrent read access. An operation that + Performance tuning. Default is <c>false</c>. An operation that mutates (writes to) the table will obtain exclusive access, blocking any concurrent access of the same table until finished. If set to <c>true</c>, the table is optimized towards concurrent write access. Different objects of the same table can be mutated (and read) by concurrent processes. This is achieved to some degree at the expense of single access and concurrent reader performance. + The <c>write_concurrency</c> option can be combined with the + <seealso marker="#new_2_read_concurrency">read_concurrency</seealso> + option. You typically want to combine these when large concurrent + read bursts and large concurrent write bursts are common (see the + documentation of the + <seealso marker="#new_2_read_concurrency">read_concurrency</seealso> + option for more information). Note that this option does not change any guarantees about <seealso marker="#concurrency">atomicy and isolation</seealso>. Functions that makes such promises over several objects (like @@ -1055,6 +1062,29 @@ ets:select(Table,MatchSpec),</code> <p>Table type <c>ordered_set</c> is not affected by this option in current implementation.</p> </item> + <item> + <marker id="new_2_read_concurrency"></marker> + <p><c>{read_concurrency,bool()}</c> + Performance tuning. Default is <c>false</c>. When set to + <c>true</c>, the table is optimized for concurrent read + operations. When this option is enabled on a runtime system with + SMP support, read operations become much cheaper; especially on + systems with multiple physical processors. However, switching + between read and write operations becomes more expensive. You + typically want to enable this option when concurrent read + operations are much more frequent than write operations, or when + concurrent reads and writes comes in large read and write + bursts (i.e., lots of reads not interrupted by writes, and lots + of writes not interrupted by reads). You typically do + <em>not</em> want to enable this option when the common access + pattern is a few read operations interleaved with a few write + operations repeatedly. In this case you will get a performance + degradation by enabling this option. The <c>read_concurrency</c> + option can be combined with the + <seealso marker="#new_2_write_concurrency">write_concurrency</seealso> + option. You typically want to combine these when large concurrent + read bursts and large concurrent write bursts are common.</p> + </item> </list> </desc> </func> @@ -1355,6 +1385,28 @@ is_integer(X), is_integer(Y), X + Y < 4711]]></code> </desc> </func> <func> + <name>select_count(Tab, MatchSpec) -> NumMatched</name> + <fsummary>Match the objects in an ETS table against a match_spec and returns the number of objects for which the match_spec returned 'true'</fsummary> + <type> + <v>Tab = tid() | atom()</v> + <v>Object = tuple()</v> + <v>MatchSpec = match_spec()</v> + <v>NumMatched = integer()</v> + </type> + <desc> + <p>Matches the objects in the table <c>Tab</c> using a + <seealso marker="#match_spec">match_spec</seealso>. If the + match_spec returns <c>true</c> for an object, that object + considered a match and is counted. For any other result from + the match_spec the object is not considered a match and is + therefore not counted.</p> + <p>The function could be described as a <c>match_delete/2</c> + that does not actually delete any elements, but only counts + them.</p> + <p>The function returns the number of objects matched.</p> + </desc> + </func> + <func> <name>select_delete(Tab, MatchSpec) -> NumDeleted</name> <fsummary>Match the objects in an ETS table against a match_spec and deletes objects where the match_spec returns 'true'</fsummary> <type> @@ -1381,25 +1433,82 @@ is_integer(X), is_integer(Y), X + Y < 4711]]></code> </desc> </func> <func> - <name>select_count(Tab, MatchSpec) -> NumMatched</name> - <fsummary>Match the objects in an ETS table against a match_spec and returns the number of objects for which the match_spec returned 'true'</fsummary> + <name>select_reverse(Tab, MatchSpec) -> [Match]</name> + <fsummary>Match the objects in an ETS table against a match_spec.</fsummary> <type> <v>Tab = tid() | atom()</v> - <v>Object = tuple()</v> + <v>Match = term()</v> <v>MatchSpec = match_spec()</v> - <v>NumMatched = integer()</v> </type> <desc> - <p>Matches the objects in the table <c>Tab</c> using a - <seealso marker="#match_spec">match_spec</seealso>. If the - match_spec returns <c>true</c> for an object, that object - considered a match and is counted. For any other result from - the match_spec the object is not considered a match and is - therefore not counted.</p> - <p>The function could be described as a <c>match_delete/2</c> - that does not actually delete any elements, but only counts - them.</p> - <p>The function returns the number of objects matched.</p> + + <p>Works like <c>select/2</c>, but returns the list in reverse + order for the <c>ordered_set</c> table type. For all other table + types, the return value is identical to that of <c>select/2</c>.</p> + + </desc> + </func> + <func> + <name>select_reverse(Tab, MatchSpec, Limit) -> {[Match],Continuation} | '$end_of_table'</name> + <fsummary>Match the objects in an ETS table against a match_spec and returns part of the answers.</fsummary> + <type> + <v>Tab = tid() | atom()</v> + <v>Match = term()</v> + <v>MatchSpec = match_spec()</v> + <v>Continuation = term()</v> + </type> + <desc> + + <p>Works like <c>select/3</c>, but for the <c>ordered_set</c> + table type, traversing is done starting at the last object in + Erlang term order and moves towards the first. For all other + table types, the return value is identical to that of + <c>select/3</c>.</p> + + <p>Note that this is <em>not</em> equivalent to + reversing the result list of a <c>select/3</c> call, as the result list + is not only reversed, but also contains the last <c>Limit</c> + matching objects in the table, not the first.</p> + + </desc> + </func> + <func> + <name>select_reverse(Continuation) -> {[Match],Continuation} | '$end_of_table'</name> + <fsummary>Continue matching objects in an ETS table.</fsummary> + <type> + <v>Match = term()</v> + <v>Continuation = term()</v> + </type> + <desc> + + <p>Continues a match started with + <c>ets:select_reverse/3</c>. If the table is an + <c>ordered_set</c>, the traversal of the table will continue + towards objects with keys earlier in the Erlang term order. The + returned list will also contain objects with keys in reverse + order.</p> + + <p>For all other table types, the behaviour is exatly that of <c>select/1</c>.</p> + <p>Example:</p> + <code> +1> T = ets:new(x,[ordered_set]). +2> [ ets:insert(T,{N}) || N <- lists:seq(1,10) ]. +... +3> {R0,C0} = ets:select_reverse(T,[{'_',[],['$_']}],4). +... +4> R0. +[{10},{9},{8},{7}] +5> {R1,C1} = ets:select_reverse(C0). +... +6> R1. +[{6},{5},{4},{3}] +7> {R2,C2} = ets:select_reverse(C1). +... +8> R2. +[{2},{1}] +9> '$end_of_table' = ets:select_reverse(C2). +... + </code> </desc> </func> <func> diff --git a/lib/stdlib/doc/src/filename.xml b/lib/stdlib/doc/src/filename.xml index 0cf82fa48b..fe6c6f898e 100644 --- a/lib/stdlib/doc/src/filename.xml +++ b/lib/stdlib/doc/src/filename.xml @@ -49,7 +49,7 @@ <title>DATA TYPES</title> <code type="none"> name() = string() | atom() | DeepList - DeepList = [char() | atom() | DeepList]</code> +DeepList = [char() | atom() | DeepList]</code> </section> <funcs> <func> diff --git a/lib/stdlib/doc/src/io_protocol.xml b/lib/stdlib/doc/src/io_protocol.xml index b52e862a5c..a97d996d98 100644 --- a/lib/stdlib/doc/src/io_protocol.xml +++ b/lib/stdlib/doc/src/io_protocol.xml @@ -79,7 +79,7 @@ sends the reply to.</item> io_reply. The io-module in the Erlang standard library simply uses the pid() of the io_server as the ReplyAs datum, but a more complicated client could have several outstanding io-requests to the same server and -would then use i.e. a ref() or something else to differentiate among +would then use i.e. a reference() or something else to differentiate among the incoming io_reply's. The ReplyAs element should be considered opaque by the io_server. Note that the pid() of the server is not explicitly present in the io_reply. The reply can be sent from any diff --git a/lib/stdlib/doc/src/lists.xml b/lib/stdlib/doc/src/lists.xml index a273a2301f..b3ad7aaf46 100644 --- a/lib/stdlib/doc/src/lists.xml +++ b/lib/stdlib/doc/src/lists.xml @@ -48,7 +48,7 @@ <item><p>if x <c>F</c> y and y <c>F</c> x then x = y (<c>F</c> is antisymmetric);</p> </item> - <item><p>if x <c>F</c> y and and y <c>F</c> z then x <c>F</c> z + <item><p>if x <c>F</c> y and y <c>F</c> z then x <c>F</c> z (<c>F</c> is transitive);</p> </item> <item><p>x <c>F</c> y or y <c>F</c> x (<c>F</c> is total).</p> diff --git a/lib/stdlib/doc/src/sofs.xml b/lib/stdlib/doc/src/sofs.xml index 8c8ae51262..729df1e678 100644 --- a/lib/stdlib/doc/src/sofs.xml +++ b/lib/stdlib/doc/src/sofs.xml @@ -210,7 +210,7 @@ X[i] to Y[i] and S a subset of X[1] × ... × X[n]. The <marker id="multiple_relative_product"></marker><em>multiple - relative product</em> of TR and and S is defined to be the + relative product</em> of TR and S is defined to be the set {z : z = ((x[1], ..., x[n]), (y[1],...,y[n])) for some (x[1], ..., x[n]) in S and for some (x[i], y[i]) in R[i], diff --git a/lib/stdlib/doc/src/timer.xml b/lib/stdlib/doc/src/timer.xml index 034fff3c25..1b34e71490 100644 --- a/lib/stdlib/doc/src/timer.xml +++ b/lib/stdlib/doc/src/timer.xml @@ -202,19 +202,33 @@ </func> <func> <name>tc(Module, Function, Arguments) -> {Time, Value}</name> - <fsummary>Measure the real time it takes to evaluate <c>apply(Module, Function, Arguments)</c></fsummary> + <name>tc(Fun, Arguments) -> {Time, Value}</name> + <fsummary>Measure the real time it takes to evaluate <c>apply(Module, + Function, Arguments)</c> or <c>apply(Fun, Arguments)</c></fsummary> <type> <v>Module = Function = atom()</v> + <v>Fun = fun()</v> <v>Arguments = [term()]</v> <v>Time = integer() in microseconds</v> <v>Value = term()</v> </type> <desc> - <p>Evaluates <c>apply(Module, Function, Arguments)</c> and measures - the elapsed real time as reported by <c>now/0</c>. - Returns <c>{Time, Value}</c>, where - <c>Time</c> is the elapsed real time in <em>microseconds</em>, - and <c>Value</c> is what is returned from the apply.</p> + <p></p> + <taglist> + <tag><c>tc/3</c></tag> + <item> + <p>Evaluates <c>apply(Module, Function, Arguments)</c> and measures + the elapsed real time as reported by <c>now/0</c>. + Returns <c>{Time, Value}</c>, where + <c>Time</c> is the elapsed real time in <em>microseconds</em>, + and <c>Value</c> is what is returned from the apply.</p> + </item> + <tag><c>tc/2</c></tag> + <item> + <p>Evaluates <c>apply(Fun, Arguments)</c>. Otherwise works + like <c>tc/3</c>.</p> + </item> + </taglist> </desc> </func> <func> diff --git a/lib/stdlib/src/beam_lib.erl b/lib/stdlib/src/beam_lib.erl index 91ff2438c6..e612bf71e7 100644 --- a/lib/stdlib/src/beam_lib.erl +++ b/lib/stdlib/src/beam_lib.erl @@ -105,6 +105,7 @@ | info_rsn(). -type cmp_rsn() :: {'modules_different', module(), module()} | {'chunks_different', chunkid()} + | 'different_chunks' | info_rsn(). %%------------------------------------------------------------------------- diff --git a/lib/stdlib/src/escript.erl b/lib/stdlib/src/escript.erl index d26443f277..99e454f593 100644 --- a/lib/stdlib/src/escript.erl +++ b/lib/stdlib/src/escript.erl @@ -24,35 +24,41 @@ %% Internal API. -export([start/0, start/1]). --include_lib("kernel/include/file.hrl"). +%%----------------------------------------------------------------------- -define(SHEBANG, "/usr/bin/env escript"). -define(COMMENT, "This is an -*- erlang -*- file"). --record(state, {file, - module, +%%----------------------------------------------------------------------- + +-type mode() :: 'compile' | 'debug' | 'interpret' | 'run'. +-type source() :: 'archive' | 'beam' | 'text'. + +-record(state, {file :: file:filename(), + module :: module(), forms_or_bin, - source, - n_errors, - mode, - exports_main, - has_records}). --record(sections, {type, - shebang, - comment, - emu_args, - body}). --record(extract_options, {compile_source}). + source :: source(), + n_errors :: non_neg_integer(), + mode :: mode(), + exports_main :: boolean(), + has_records :: boolean()}). -type shebang() :: string(). -type comment() :: string(). -type emu_args() :: string(). --type escript_filename() :: string(). --type filename() :: string(). + +-record(sections, {type, + shebang :: shebang(), + comment :: comment(), + emu_args :: emu_args(), + body}). + +-record(extract_options, {compile_source}). + -type zip_file() :: - filename() - | {filename(), binary()} - | {filename(), binary(), #file_info{}}. + file:filename() + | {file:filename(), binary()} + | {file:filename(), binary(), file:file_info()}. -type zip_create_option() :: term(). -type section() :: shebang @@ -60,13 +66,15 @@ | comment | {comment, comment()} | {emu_args, emu_args()} - | {source, filename() | binary()} - | {beam, filename() | binary()} - | {archive, filename() | binary()} + | {source, file:filename() | binary()} + | {beam, file:filename() | binary()} + | {archive, file:filename() | binary()} | {archive, [zip_file()], [zip_create_option()]}. +%%----------------------------------------------------------------------- + %% Create a complete escript file with both header and body --spec create(escript_filename() | binary, [section()]) -> +-spec create(file:filename() | binary, [section()]) -> ok | {ok, binary()} | {error, term()}. create(File, Options) when is_list(Options) -> @@ -149,7 +157,9 @@ prepare(BadOptions, _) -> -type section_name() :: shebang | comment | emu_args | body . -type extract_option() :: compile_source | {section, [section_name()]}. --spec extract(filename(), [extract_option()]) -> {ok, [section()]} | {error, term()}. +-spec extract(file:filename(), [extract_option()]) -> + {ok, [section()]} | {error, term()}. + extract(File, Options) when is_list(File), is_list(Options) -> try EO = parse_extract_options(Options, @@ -239,6 +249,7 @@ normalize_section(Name, Chars) -> {Name, Chars}. -spec script_name() -> string(). + script_name() -> [ScriptName|_] = init:get_plain_arguments(), ScriptName. @@ -248,10 +259,12 @@ script_name() -> %% -spec start() -> no_return(). + start() -> start([]). -spec start([string()]) -> no_return(). + start(EscriptOptions) -> try %% Commands run using -run or -s are run in a process @@ -484,18 +497,12 @@ find_first_body_line(Fd, HeaderSz0, LineNo, KeepFirst, Sections) -> classify_line(Line) -> case Line of - [$\#, $\! | _] -> - shebang; - [$P, $K | _] -> - archive; - [$F, $O, $R, $1 | _] -> - beam; - [$%, $%, $\! | _] -> - emu_args; - [$% | _] -> - comment; - _ -> - undefined + "#!" ++ _ -> shebang; + "PK" ++ _ -> archive; + "FOR1" ++ _ -> beam; + "%%!" ++ _ -> emu_args; + "%" ++ _ -> comment; + _ -> undefined end. guess_type(Line) -> @@ -531,7 +538,6 @@ parse_archive(S, File, HeaderSz) -> end, list_to_atom(lists:reverse(RevBase2)) end, - S#state{source = archive, mode = run, module = Mod, @@ -587,8 +593,8 @@ parse_source(S, File, Fd, StartLine, HeaderSz, CheckOnly) -> epp_parse_file2(Epp, S2, [ModForm, FileForm], OptModRes); {error, _} -> epp_parse_file2(Epp, S2, [FileForm], OptModRes); - {eof,LastLine} -> - S#state{forms_or_bin = [FileForm, {eof,LastLine}]} + {eof, _LastLine} = Eof -> + S#state{forms_or_bin = [FileForm, Eof]} end, ok = epp:close(Epp), ok = file:close(Fd), @@ -683,8 +689,8 @@ epp_parse_file2(Epp, S, Forms, Parsed) -> io:format("~s:~w: ~s\n", [S#state.file,Ln,Mod:format_error(Args)]), epp_parse_file(Epp, S#state{n_errors = S#state.n_errors + 1}, [Form | Forms]); - {eof,LastLine} -> - S#state{forms_or_bin = lists:reverse([{eof, LastLine} | Forms])} + {eof, _LastLine} = Eof -> + S#state{forms_or_bin = lists:reverse([Eof | Forms])} end. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% diff --git a/lib/stdlib/src/ms_transform.erl b/lib/stdlib/src/ms_transform.erl index 78b1de6e16..a249dea525 100644 --- a/lib/stdlib/src/ms_transform.erl +++ b/lib/stdlib/src/ms_transform.erl @@ -43,6 +43,7 @@ -define(ERR_GENREMOTECALL,22). -define(ERR_GENBINCONSTRUCT,23). -define(ERR_GENDISALLOWEDOP,24). +-define(WARN_SHADOW_VAR,50). -define(ERR_GUARDMATCH,?ERR_GENMATCH+?ERROR_BASE_GUARD). -define(ERR_BODYMATCH,?ERR_GENMATCH+?ERROR_BASE_BODY). -define(ERR_GUARDLOCALCALL,?ERR_GENLOCALCALL+?ERROR_BASE_GUARD). @@ -63,8 +64,13 @@ -define(ERR_BODYDISALLOWEDOP,?ERR_GENDISALLOWEDOP+?ERROR_BASE_BODY). %% -%% Called by compiler or ets/dbg:fun2ms when errors occur +%% Called by compiler or ets/dbg:fun2ms when errors/warnings occur %% +format_error({?WARN_SHADOW_VAR,Name}) -> + lists:flatten( + io_lib:format("variable ~p shadowed in ms_transform fun head", + [Name])); + format_error(?ERR_NOFUN) -> "Parameter of ets/dbg:fun2ms/1 is not a literal fun"; format_error(?ERR_ETS_HEAD) -> @@ -182,7 +188,7 @@ format_error(Else) -> %% transform_from_shell(Dialect, Clauses, BoundEnvironment) -> SaveFilename = setup_filename(), - case catch ms_clause_list(1,Clauses,Dialect) of + case catch ms_clause_list(1,Clauses,Dialect,gb_sets:new()) of {'EXIT',Reason} -> cleanup_filename(SaveFilename), exit(Reason); @@ -207,6 +213,7 @@ transform_from_shell(Dialect, Clauses, BoundEnvironment) -> %% parse_transform(Forms, _Options) -> SaveFilename = setup_filename(), + %io:format("Forms: ~p~n",[Forms]), case catch forms(Forms) of {'EXIT',Reason} -> cleanup_filename(SaveFilename), @@ -215,12 +222,31 @@ parse_transform(Forms, _Options) -> {error, [{cleanup_filename(SaveFilename), [{Line, ?MODULE, R}]}], []}; Else -> - cleanup_filename(SaveFilename), + %io:format("Transformed into: ~p~n",[Else]), + case get_warnings() of + [] -> + cleanup_filename(SaveFilename), + Else; + WL -> + FName = cleanup_filename(SaveFilename) , + WList = [ {FName, [{L, ?MODULE, R}]} || {L,R} <- WL ], + {warning, Else, WList} + end + end. + +get_warnings() -> + case get(warnings) of + undefined -> + []; + Else -> Else end. +add_warning(Line,R) -> + put(warnings,[{Line,R}| get_warnings()]). + setup_filename() -> - {erase(filename),erase(records)}. + {erase(filename),erase(records),erase(warnings)}. put_filename(Name) -> put(filename,Name). @@ -235,7 +261,7 @@ get_records() -> Else -> Else end. -cleanup_filename({Old,OldRec}) -> +cleanup_filename({Old,OldRec,OldWarnings}) -> Ret = case erase(filename) of undefined -> "TOP_LEVEL"; @@ -248,6 +274,12 @@ cleanup_filename({Old,OldRec}) -> Rec -> put(records,Rec) end, + case OldWarnings of + undefined -> + erase(warnings); + Warn -> + put(warnings,Warn) + end, case Old of undefined -> Ret; @@ -285,42 +317,77 @@ form({function,Line,Name0,Arity0,Clauses0}) -> form(AnyOther) -> AnyOther. function(Name, Arity, Clauses0) -> - Clauses1 = clauses(Clauses0), + {Clauses1,_} = clauses(Clauses0,gb_sets:new()), {Name,Arity,Clauses1}. -clauses([C0|Cs]) -> - C1 = clause(C0), - [C1|clauses(Cs)]; -clauses([]) -> []. -clause({clause,Line,H0,G0,B0}) -> - B1 = copy(B0), - {clause,Line,H0,G0,B1}. +clauses([C0|Cs],Bound) -> + {C1,Bound1} = clause(C0,Bound), + {C2,Bound2} = clauses(Cs,Bound1), + {[C1|C2],Bound2}; +clauses([],Bound) -> {[],Bound}. +clause({clause,Line,H0,G0,B0},Bound) -> + {H1,Bound1} = copy(H0,Bound), + {B1,Bound2} = copy(B0,Bound1), + {{clause,Line,H1,G0,B1},Bound2}. copy({call,Line,{remote,_Line2,{atom,_Line3,ets},{atom,_Line4,fun2ms}}, - As0}) -> - transform_call(ets,Line,As0); + As0},Bound) -> + {transform_call(ets,Line,As0,Bound),Bound}; copy({call,Line,{remote,_Line2,{record_field,_Line3, {atom,_Line4,''},{atom,_Line5,ets}}, - {atom,_Line6,fun2ms}}, As0}) -> + {atom,_Line6,fun2ms}}, As0},Bound) -> %% Packages... - transform_call(ets,Line,As0); + {transform_call(ets,Line,As0,Bound),Bound}; copy({call,Line,{remote,_Line2,{atom,_Line3,dbg},{atom,_Line4,fun2ms}}, - As0}) -> - transform_call(dbg,Line,As0); -copy(T) when is_tuple(T) -> - list_to_tuple(copy_list(tuple_to_list(T))); -copy(L) when is_list(L) -> - copy_list(L); -copy(AnyOther) -> - AnyOther. + As0},Bound) -> + {transform_call(dbg,Line,As0,Bound),Bound}; +copy({match,Line,A,B},Bound) -> + {B1,Bound1} = copy(B,Bound), + {A1,Bound2} = copy(A,Bound), + {{match,Line,A1,B1},gb_sets:union(Bound1,Bound2)}; +copy({var,_Line,'_'} = VarDef,Bound) -> + {VarDef,Bound}; +copy({var,_Line,Name} = VarDef,Bound) -> + Bound1 = gb_sets:add(Name,Bound), + {VarDef,Bound1}; +copy({'fun',Line,{clauses,Clauses}},Bound) -> % Dont export bindings from funs + {NewClauses,_IgnoredBindings} = copy_list(Clauses,Bound), + {{'fun',Line,{clauses,NewClauses}},Bound}; +copy({'case',Line,Of,ClausesList},Bound) -> % Dont export bindings from funs + {NewOf,NewBind0} = copy(Of,Bound), + {NewClausesList,NewBindings} = copy_case_clauses(ClausesList,NewBind0,[]), + {{'case',Line,NewOf,NewClausesList},NewBindings}; +copy(T,Bound) when is_tuple(T) -> + {L,Bound1} = copy_list(tuple_to_list(T),Bound), + {list_to_tuple(L),Bound1}; +copy(L,Bound) when is_list(L) -> + copy_list(L,Bound); +copy(AnyOther,Bound) -> + {AnyOther,Bound}. -copy_list([H|T]) -> - [copy(H)|copy_list(T)]; -copy_list([]) -> - []. +copy_case_clauses([],Bound,AddSets) -> + ReallyAdded = gb_sets:intersection(AddSets), + {[],gb_sets:union(Bound,ReallyAdded)}; +copy_case_clauses([{clause,Line,Match,Guard,Clauses}|T],Bound,AddSets) -> + {NewMatch,MatchBinds} = copy(Match,Bound), + {NewGuard,GuardBinds} = copy(Guard,MatchBinds), %% Really no new binds + {NewClauses,AllBinds} = copy(Clauses,GuardBinds), + %% To limit the setsizes, I subtract what I had before the case clause + %% and add it in the end + AddedBinds = gb_sets:subtract(AllBinds,Bound), + {NewTail,ExportedBindings} = + copy_case_clauses(T,Bound,[AddedBinds | AddSets]), + {[{clause,Line,NewMatch,NewGuard,NewClauses}|NewTail],ExportedBindings}. -transform_call(Type,_Line,[{'fun',Line2,{clauses, ClauseList}}]) -> - ms_clause_list(Line2, ClauseList,Type); -transform_call(_Type,Line,_NoAbstractFun) -> +copy_list([H|T],Bound) -> + {C1,Bound1} = copy(H,Bound), + {C2,Bound2} = copy_list(T,Bound1), + {[C1|C2],Bound2}; +copy_list([],Bound) -> + {[],Bound}. + +transform_call(Type,_Line,[{'fun',Line2,{clauses, ClauseList}}],Bound) -> + ms_clause_list(Line2, ClauseList,Type,Bound); +transform_call(_Type,Line,_NoAbstractFun,_) -> throw({error,Line,?ERR_NOFUN}). % Fixup semicolons in guards @@ -329,18 +396,19 @@ ms_clause_expand({clause, Line, Parameters, Guard = [_,_|_], Body}) -> ms_clause_expand(_Other) -> false. -ms_clause_list(Line,[H|T],Type) -> +ms_clause_list(Line,[H|T],Type,Bound) -> case ms_clause_expand(H) of NewHead when is_list(NewHead) -> - ms_clause_list(Line,NewHead ++ T, Type); + ms_clause_list(Line,NewHead ++ T, Type, Bound); false -> - {cons, Line, ms_clause(H,Type), ms_clause_list(Line, T,Type)} + {cons, Line, ms_clause(H, Type, Bound), + ms_clause_list(Line, T, Type, Bound)} end; -ms_clause_list(Line,[],_) -> +ms_clause_list(Line,[],_,_) -> {nil,Line}. -ms_clause({clause, Line, Parameters, Guards, Body},Type) -> +ms_clause({clause, Line, Parameters, Guards, Body},Type,Bound) -> check_type(Line,Parameters,Type), - {MSHead,Bindings} = transform_head(Parameters), + {MSHead,Bindings} = transform_head(Parameters,Bound), MSGuards = transform_guards(Line, Guards, Bindings), MSBody = transform_body(Line,Body,Bindings), {tuple, Line, [MSHead,MSGuards,MSBody]}. @@ -627,29 +695,31 @@ tg(Other,B) -> Element = io_lib:format("unknown element ~w", [Other]), throw({error,unknown,{?ERR_GENELEMENT+B#tgd.eb,Element}}). -transform_head([V]) -> +transform_head([V],OuterBound) -> Bind = cre_bind(), - {NewV,NewBind} = toplevel_head_match(V,Bind), - th(NewV,NewBind). + {NewV,NewBind} = toplevel_head_match(V,Bind,OuterBound), + th(NewV,NewBind,OuterBound). -toplevel_head_match({match,_,{var,_,VName},Expr},B) -> +toplevel_head_match({match,Line,{var,_,VName},Expr},B,OB) -> + warn_var_clash(Line,VName,OB), {Expr,new_bind({VName,'$_'},B)}; -toplevel_head_match({match,_,Expr,{var,_,VName}},B) -> +toplevel_head_match({match,Line,Expr,{var,_,VName}},B,OB) -> + warn_var_clash(Line,VName,OB), {Expr,new_bind({VName,'$_'},B)}; -toplevel_head_match(Other,B) -> +toplevel_head_match(Other,B,_OB) -> {Other,B}. -th({record,Line,RName,RFields},B) -> +th({record,Line,RName,RFields},B,OB) -> % youch... RDefs = get_records(), {KeyList0,NewB} = lists:foldl(fun({record_field,_,{atom,_,Key},Value}, {L,B0}) -> - {NV,B1} = th(Value,B0), + {NV,B1} = th(Value,B0,OB), {[{Key,NV}|L],B1}; ({record_field,_,{var,_,'_'},Value}, {L,B0}) -> - {NV,B1} = th(Value,B0), + {NV,B1} = th(Value,B0,OB), {[{{default},NV}|L],B1}; (_,_) -> throw({error,Line,{?ERR_HEADBADREC, @@ -692,9 +762,9 @@ th({record,Line,RName,RFields},B) -> _ -> throw({error,Line,{?ERR_HEADBADREC,RName}}) end; -th({match,Line,_,_},_) -> +th({match,Line,_,_},_,_) -> throw({error,Line,?ERR_HEADMATCH}); -th({atom,Line,A},B) -> +th({atom,Line,A},B,_OB) -> case atom_to_list(A) of [$$|NL] -> case (catch list_to_integer(NL)) of @@ -706,10 +776,11 @@ th({atom,Line,A},B) -> _ -> {{atom,Line,A},B} end; -th({bin_element,_Line0,{var, Line, A},_,_},_) -> +th({bin_element,_Line0,{var, Line, A},_,_},_,_) -> throw({error,Line,{?ERR_HEADBINMATCH,A}}); -th({var,Line,Name},B) -> +th({var,Line,Name},B,OB) -> + warn_var_clash(Line,Name,OB), case lkup_bind(Name,B) of undefined -> NewB = new_bind(Name,B), @@ -717,16 +788,24 @@ th({var,Line,Name},B) -> Trans -> {{atom,Line,Trans},B} end; -th([H|T],B) -> - {NH,NB} = th(H,B), - {NT,NNB} = th(T,NB), +th([H|T],B,OB) -> + {NH,NB} = th(H,B,OB), + {NT,NNB} = th(T,NB,OB), {[NH|NT],NNB}; -th(T,B) when is_tuple(T) -> - {L,NB} = th(tuple_to_list(T),B), +th(T,B,OB) when is_tuple(T) -> + {L,NB} = th(tuple_to_list(T),B,OB), {list_to_tuple(L),NB}; -th(Nonstruct,B) -> +th(Nonstruct,B,_OB) -> {Nonstruct,B}. +warn_var_clash(Line,Name,OuterBound) -> + case gb_sets:is_member(Name,OuterBound) of + true -> + add_warning(Line,{?WARN_SHADOW_VAR,Name}); + _ -> + ok + end. + %% Could be more efficient... check_multi_field(_, _, [], _) -> ok; diff --git a/lib/stdlib/src/otp_internal.erl b/lib/stdlib/src/otp_internal.erl index 1514414e48..5c52dfcbf0 100644 --- a/lib/stdlib/src/otp_internal.erl +++ b/lib/stdlib/src/otp_internal.erl @@ -361,6 +361,12 @@ obsolete_1(erlang, concat_binary, 1) -> obsolete_1(ssl, peercert, 2) -> {deprecated,"deprecated (will be removed in R15A); use ssl:peercert/1 and public_key:pkix_decode_cert/2 instead"}; +%% Added in R14B. +obsolete_1(public_key, pem_to_der, 1) -> + {deprecated,"deprecated (will be removed in R15A); use file:read_file/1 and public_key:pem_decode/1"}; +obsolete_1(public_key, decode_private_key, A) when A =:= 1; A =:= 2 -> + {deprecated,{public_key,pem_entry_decode,1},"R15A"}; + obsolete_1(_, _, _) -> no. diff --git a/lib/stdlib/src/timer.erl b/lib/stdlib/src/timer.erl index 6ee837c3e6..24e14caa69 100644 --- a/lib/stdlib/src/timer.erl +++ b/lib/stdlib/src/timer.erl @@ -22,7 +22,7 @@ send_after/3, send_after/2, exit_after/3, exit_after/2, kill_after/2, kill_after/1, apply_interval/4, send_interval/3, send_interval/2, - cancel/1, sleep/1, tc/3, now_diff/2, + cancel/1, sleep/1, tc/2, tc/3, now_diff/2, seconds/1, minutes/1, hours/1, hms/3]). -export([start_link/0, start/0, @@ -98,6 +98,17 @@ sleep(T) -> after T -> ok end. + +%% +%% Measure the execution time (in microseconds) for Fun(Args). +%% +-spec tc(function(), [_]) -> {time(), term()}. +tc(F, A) -> + Before = erlang:now(), + Val = (catch apply(F, A)), + After = erlang:now(), + {now_diff(After, Before), Val}. + %% %% Measure the execution time (in microseconds) for an MFA. %% diff --git a/lib/stdlib/test/ets_SUITE.erl b/lib/stdlib/test/ets_SUITE.erl index 13c87ca005..7f39dbe21f 100644 --- a/lib/stdlib/test/ets_SUITE.erl +++ b/lib/stdlib/test/ets_SUITE.erl @@ -33,7 +33,7 @@ -export([misc/1, dups/1, misc1/1, safe_fixtable/1, info/1, tab2list/1]). -export([files/1, tab2file/1, tab2file2/1, tab2file3/1, tabfile_ext1/1, tabfile_ext2/1, tabfile_ext3/1, tabfile_ext4/1]). --export([heavy/1, heavy_lookup/1, heavy_lookup_element/1]). +-export([heavy/1, heavy_lookup/1, heavy_lookup_element/1, heavy_concurrent/1]). -export([lookup_element/1, lookup_element_mult/1]). -export([fold/1]). -export([foldl_ordered/1, foldr_ordered/1, foldl/1, foldr/1, fold_empty/1]). @@ -63,7 +63,8 @@ meta_lookup_unnamed_read/1, meta_lookup_unnamed_write/1, meta_lookup_named_read/1, meta_lookup_named_write/1, meta_newdel_unnamed/1, meta_newdel_named/1]). --export([smp_insert/1, smp_fixed_delete/1, smp_unfix_fix/1, smp_select_delete/1, otp_8166/1]). +-export([smp_insert/1, smp_fixed_delete/1, smp_unfix_fix/1, smp_select_delete/1, + otp_8166/1, otp_8732/1]). -export([exit_large_table_owner/1, exit_many_large_table_owner/1, exit_many_tables_owner/1, @@ -89,9 +90,12 @@ match_delete_do/1, match_delete3_do/1, firstnext_do/1, slot_do/1, match1_do/1, match2_do/1, match_object_do/1, match_object2_do/1, misc1_do/1, safe_fixtable_do/1, info_do/1, dups_do/1, heavy_lookup_do/1, - heavy_lookup_element_do/1, member_do/1, otp_5340_do/1, otp_7665_do/1, meta_wb_do/1 + heavy_lookup_element_do/1, member_do/1, otp_5340_do/1, otp_7665_do/1, meta_wb_do/1, + do_heavy_concurrent/1 ]). +-export([t_select_reverse/1]). + -include("test_server.hrl"). init_per_testcase(Case, Config) -> @@ -126,10 +130,10 @@ all(suite) -> match_heavy, fold, member, t_delete_object, t_init_table, t_whitebox, t_delete_all_objects, t_insert_list, t_test_ms, - t_select_delete, t_ets_dets, memory, + t_select_delete, t_ets_dets, memory, t_select_reverse, t_bucket_disappears, select_fail,t_insert_new, t_repair_continuation, otp_5340, otp_6338, - otp_6842_select_1000, otp_7665, + otp_6842_select_1000, otp_7665, otp_8732, meta_wb, grow_shrink, grow_pseudo_deleted, shrink_pseudo_deleted, meta_smp, @@ -391,7 +395,7 @@ memory(Config) when is_list(Config) -> ?line erts_debug:set_internal_state(available_internal_state, true), ?line ok = chk_normal_tab_struct_size(), ?line L = [T1,T2,T3,T4] = fill_sets_int(1000), - ?line XRes1 = adjust_xmem(L, {16862,16072,16072,16078}), + ?line XRes1 = adjust_xmem(L, {13862,13072,13072,13078}), ?line Res1 = {?S(T1),?S(T2),?S(T3),?S(T4)}, ?line lists:foreach(fun(T) -> Before = ets:info(T,size), @@ -402,7 +406,7 @@ memory(Config) when is_list(Config) -> [Key, ets:info(T,type), Before, ets:info(T,size), Objs]) end, L), - ?line XRes2 = adjust_xmem(L, {16849,16060,16048,16054}), + ?line XRes2 = adjust_xmem(L, {13852,13063,13054,13060}), ?line Res2 = {?S(T1),?S(T2),?S(T3),?S(T4)}, ?line lists:foreach(fun(T) -> Before = ets:info(T,size), @@ -413,7 +417,7 @@ memory(Config) when is_list(Config) -> [Key, ets:info(T,type), Before, ets:info(T,size), Objs]) end, L), - ?line XRes3 = adjust_xmem(L, {16836,16048,16024,16030}), + ?line XRes3 = adjust_xmem(L, {13842,13054,13036,13042}), ?line Res3 = {?S(T1),?S(T2),?S(T3),?S(T4)}, ?line lists:foreach(fun(T) -> ?line ets:delete_all_objects(T) @@ -786,6 +790,67 @@ t_test_ms(Config) when is_list(Config) -> ?line true = (if is_list(String) -> true; true -> false end), ?line verify_etsmem(EtsMem). +t_select_reverse(doc) -> + ["Test the select reverse BIF's"]; +t_select_reverse(suite) -> + []; +t_select_reverse(Config) when is_list(Config) -> + ?line Table = ets:new(xxx, [ordered_set]), + ?line filltabint(Table,1000), + ?line A = lists:reverse(ets:select(Table,[{{'$1', '_'}, + [{'>', + {'rem', + '$1', 5}, + 2}], + ['$_']}])), + ?line A = ets:select_reverse(Table,[{{'$1', '_'}, + [{'>', + {'rem', + '$1', 5}, + 2}], + ['$_']}]), + ?line A = reverse_chunked(Table,[{{'$1', '_'}, + [{'>', + {'rem', + '$1', 5}, + 2}], + ['$_']}],3), + % A set/bag/duplicate_bag should get the same result regardless + % of select or select_reverse + ?line Table2 = ets:new(xxx, [set]), + ?line filltabint(Table2,1000), + ?line Table3 = ets:new(xxx, [bag]), + ?line filltabint(Table3,1000), + ?line Table4 = ets:new(xxx, [duplicate_bag]), + ?line filltabint(Table4,1000), + ?line lists:map(fun(Tab) -> + B = ets:select(Tab,[{{'$1', '_'}, + [{'>', + {'rem', + '$1', 5}, + 2}], + ['$_']}]), + B = ets:select_reverse(Tab,[{{'$1', '_'}, + [{'>', + {'rem', + '$1', 5}, + 2}], + ['$_']}]) + end,[Table2, Table3, Table4]), + ok. + + + +reverse_chunked(T,MS,N) -> + do_reverse_chunked(ets:select_reverse(T,MS,N),[]). + +do_reverse_chunked('$end_of_table',Acc) -> + lists:reverse(Acc); +do_reverse_chunked({L,C},Acc) -> + NewAcc = lists:reverse(L)++Acc, + do_reverse_chunked(ets:select_reverse(C), NewAcc). + + t_select_delete(doc) -> ["Test the ets:select_delete/2 and ets:select_count/2 BIF's"]; t_select_delete(suite) -> @@ -3877,7 +3942,7 @@ make_sub_binary(List, Num) when is_list(List) -> {_,B} = split_binary(Bin, N+1), B. -heavy(suite) -> [heavy_lookup, heavy_lookup_element]. +heavy(suite) -> [heavy_lookup, heavy_lookup_element, heavy_concurrent]. %% Lookup stuff like crazy... heavy_lookup(doc) -> ["Performs multiple lookups for every key ", @@ -3940,6 +4005,44 @@ do_lookup_element(Tab, N, M) -> end. +heavy_concurrent(_Config) -> + repeat_for_opts(do_heavy_concurrent). + +do_heavy_concurrent(Opts) -> + ?line Size = 20000, + ?line EtsMem = etsmem(), + ?line Tab = ets:new(blupp, [set, public, {keypos, 2} | Opts]), + ?line ok = fill_tab2(Tab, 0, Size), + ?line Procs = lists:map( + fun (N) -> + spawn_link( + fun () -> + do_heavy_concurrent_proc(Tab, Size, N) + end) + end, + lists:seq(1, 500)), + ?line lists:foreach(fun (P) -> + M = erlang:monitor(process, P), + receive + {'DOWN', M, process, P, _} -> + ok + end + end, + Procs), + ?line true = ets:delete(Tab), + ?line verify_etsmem(EtsMem). + +do_heavy_concurrent_proc(_Tab, 0, _Offs) -> + done; +do_heavy_concurrent_proc(Tab, N, Offs) when (N+Offs) rem 100 == 0 -> + Data = {"here", are, "S O M E ", data, "toooooooooooooooooo", insert, + make_ref(), make_ref(), make_ref()}, + true=ets:insert(Tab, {{self(),Data}, N}), + do_heavy_concurrent_proc(Tab, N-1, Offs); +do_heavy_concurrent_proc(Tab, N, Offs) -> + _ = ets:lookup(Tab, N), + do_heavy_concurrent_proc(Tab, N-1, Offs). + fold(suite) -> [foldl_ordered, foldr_ordered, foldl, foldr, fold_empty]. @@ -5010,8 +5113,14 @@ verify_table_load(T) -> end. - - +otp_8732(doc) -> ["ets:select on a tree with NIL key object"]; +otp_8732(Config) when is_list(Config) -> + Tab = ets:new(noname,[ordered_set]), + filltabstr(Tab,999), + ets:insert(Tab,{[],"nasty NIL object"}), + ?line [] = ets:match(Tab,{'_',nomatch}), %% Will hang if bug not fixed + ok. + smp_select_delete(suite) -> []; smp_select_delete(doc) -> @@ -5336,7 +5445,7 @@ only_if_smp(Schedulers, Func) -> %% Repeat test function with different combination of table options %% repeat_for_opts(F) -> - repeat_for_opts(F, [write_concurrency]). + repeat_for_opts(F, [write_concurrency, read_concurrency]). repeat_for_opts(F, OptGenList) when is_atom(F) -> repeat_for_opts(fun(Opts) -> ?MODULE:F(Opts) end, OptGenList); @@ -5356,6 +5465,7 @@ repeat_for_opts(F, [Atom | Tail], AccList) when is_atom(Atom) -> repeat_for_opts(F, [repeat_for_opts_atom2list(Atom) | Tail ], AccList). repeat_for_opts_atom2list(all_types) -> [set,ordered_set,bag,duplicate_bag]; -repeat_for_opts_atom2list(write_concurrency) -> [{write_concurrency,false},{write_concurrency,true}]. +repeat_for_opts_atom2list(write_concurrency) -> [{write_concurrency,false},{write_concurrency,true}]; +repeat_for_opts_atom2list(read_concurrency) -> [{read_concurrency,false},{read_concurrency,true}]. diff --git a/lib/stdlib/test/ms_transform_SUITE.erl b/lib/stdlib/test/ms_transform_SUITE.erl index 79a0a9af89..2d90d5b823 100644 --- a/lib/stdlib/test/ms_transform_SUITE.erl +++ b/lib/stdlib/test/ms_transform_SUITE.erl @@ -37,6 +37,7 @@ -export([andalso_orelse/1]). -export([float_1_function/1]). -export([action_function/1]). +-export([warnings/1]). -export([init_per_testcase/2, fin_per_testcase/2]). init_per_testcase(_Func, Config) -> @@ -50,8 +51,90 @@ fin_per_testcase(_Func, Config) -> all(suite) -> [from_shell,basic_ets,basic_dbg,records,record_index,multipass, bitsyntax, record_defaults, andalso_orelse, float_1_function, action_function, + warnings, top_match, old_guards, autoimported, semicolon]. +%% This may be subject to change +-define(WARN_NUMBER_SHADOW,50). +warnings(suite) -> + []; +warnings(doc) -> + ["Check that shadowed variables in fun head generate warning"]; +warnings(Config) when is_list(Config) -> + ?line setup(Config), + Prog = <<"A=5, " + "ets:fun2ms(fun({A,B}) " + " when is_integer(A) and (A+5 > B) -> " + " A andalso B " + " end)">>, + ?line [{_,[{_,ms_transform,{?WARN_NUMBER_SHADOW,'A'}}]}] = + compile_ww(Prog), + Prog2 = <<"C=5, " + "ets:fun2ms(fun({A,B} = C) " + " when is_integer(A) and (A+5 > B) -> " + " {A andalso B,C} " + " end)">>, + ?line [{_,[{_,ms_transform,{?WARN_NUMBER_SHADOW,'C'}}]}] = + compile_ww(Prog2), + Rec3 = <<"-record(a,{a,b,c,d=foppa}).">>, + Prog3 = <<"A=3,C=5, " + "ets:fun2ms(fun(#a{a = A, b = B} = C) " + " when is_integer(A) and (A+5 > B) -> " + " {A andalso B,C} " + " end)">>, + ?line [{_,[{_,ms_transform,{?WARN_NUMBER_SHADOW,'A'}}, + {_,ms_transform,{?WARN_NUMBER_SHADOW,'C'}}]}] = + compile_ww(Rec3,Prog3), + Rec4 = <<"-record(a,{a,b,c,d=foppa}).">>, + Prog4 = <<"A=3,C=5, " + "F = fun(B) -> B*3 end," + "erlang:display(F(A))," + "ets:fun2ms(fun(#a{a = A, b = B} = C) " + " when is_integer(A) and (A+5 > B) -> " + " {A andalso B,C} " + " end)">>, + ?line [{_,[{_,ms_transform,{?WARN_NUMBER_SHADOW,'A'}}, + {_,ms_transform,{?WARN_NUMBER_SHADOW,'C'}}]}] = + compile_ww(Rec4,Prog4), + Rec5 = <<"-record(a,{a,b,c,d=foppa}).">>, + Prog5 = <<"A=3,C=5, " + "F = fun(B) -> B*3 end," + "erlang:display(F(A))," + "B = ets:fun2ms(fun(#a{a = A, b = B} = C) " + " when is_integer(A) and (A+5 > B) -> " + " {A andalso B,C} " + " end)">>, + ?line [{_,[{_,ms_transform,{?WARN_NUMBER_SHADOW,'A'}}, + {_,ms_transform,{?WARN_NUMBER_SHADOW,'C'}}]}] = + compile_ww(Rec5,Prog5), + Prog6 = <<" X=bar, " + " A = case X of" + " foo ->" + " foo;" + " Y ->" + " ets:fun2ms(fun(Y) ->" % This is a warning + " 3*Y" + " end)" + " end," + " ets:fun2ms(fun(Y) ->" % Y out of "scope" here, so no warning + " {3*Y,A}" + " end)">>, + ?line [{_,[{_,ms_transform,{?WARN_NUMBER_SHADOW,'Y'}}]}] = + compile_ww(Prog6), + Prog7 = <<" X=bar, " + " A = case X of" + " foo ->" + " Y = foo;" + " Y ->" + " bar" + " end," + " ets:fun2ms(fun(Y) ->" % Y exported from case and safe, so warn + " {3*Y,A}" + " end)">>, + ?line [{_,[{_,ms_transform,{?WARN_NUMBER_SHADOW,'Y'}}]}] = + compile_ww(Prog7), + ok. + andalso_orelse(suite) -> []; andalso_orelse(doc) -> @@ -721,6 +804,24 @@ compile_and_run(Records,Expr) -> code:load_binary(tmp,FN,Bin), tmp:tmp(). +compile_ww(Expr) -> + compile_ww(<<>>,Expr). +compile_ww(Records,Expr) -> + Prog = << + "-module(tmp).\n", + "-include_lib(\"stdlib/include/ms_transform.hrl\").\n", + "-export([tmp/0]).\n", + Records/binary,"\n", + "tmp() ->\n", + Expr/binary,".\n">>, + FN=temp_name(), + file:write_file(FN,Prog), + {ok,Forms} = epp:parse_file(FN,"",""), + {ok,tmp,_Bin,Wlist} = compile:forms(Forms,[return_warnings, + nowarn_unused_vars, + nowarn_unused_record]), + Wlist. + do_eval(String) -> {done,{ok,T,_},[]} = erl_scan:tokens( [], diff --git a/lib/stdlib/test/timer_simple_SUITE.erl b/lib/stdlib/test/timer_simple_SUITE.erl index 021a22c61b..6aa2b7b945 100644 --- a/lib/stdlib/test/timer_simple_SUITE.erl +++ b/lib/stdlib/test/timer_simple_SUITE.erl @@ -224,11 +224,19 @@ cancel2(Config) when is_list(Config) -> tc(doc) -> "Test sleep/1 and tc/3."; tc(suite) -> []; tc(Config) when is_list(Config) -> - % This should both sleep and tc - ?line {Res, ok} = timer:tc(timer, sleep, [500]), - ?line ok = if - Res < 500*1000 -> {too_early, Res}; % Too early - Res > 800*1000 -> {too_late, Res}; % Too much time + % This should both sleep and tc/3 + ?line {Res1, ok} = timer:tc(timer, sleep, [500]), + ?line ok = if + Res1 < 500*1000 -> {too_early, Res1}; % Too early + Res1 > 800*1000 -> {too_late, Res1}; % Too much time + true -> ok + end, + + % This should both sleep and tc/2 + ?line {Res2, ok} = timer:tc(fun(T) -> timer:sleep(T) end, [500]), + ?line ok = if + Res2 < 500*1000 -> {too_early, Res2}; % Too early + Res2 > 800*1000 -> {too_late, Res2}; % Too much time true -> ok end, diff --git a/lib/stdlib/vsn.mk b/lib/stdlib/vsn.mk index 02ea6d9d68..1757d35160 100644 --- a/lib/stdlib/vsn.mk +++ b/lib/stdlib/vsn.mk @@ -1,20 +1 @@ -# -# %CopyrightBegin% -# -# Copyright Ericsson AB 1997-2010. All Rights Reserved. -# -# The contents of this file are subject to the Erlang Public License, -# Version 1.1, (the "License"); you may not use this file except in -# compliance with the License. You should have received a copy of the -# Erlang Public License along with this software. If not, it can be -# retrieved online at http://www.erlang.org/. -# -# Software distributed under the License is distributed on an "AS IS" -# basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See -# the License for the specific language governing rights and limitations -# under the License. -# -# %CopyrightEnd% -# - STDLIB_VSN = 1.17.1 diff --git a/lib/test_server/src/test_server_ctrl.erl b/lib/test_server/src/test_server_ctrl.erl index 1245c10a01..72f274d63a 100644 --- a/lib/test_server/src/test_server_ctrl.erl +++ b/lib/test_server/src/test_server_ctrl.erl @@ -151,10 +151,12 @@ %%% OPERATOR INTERFACE %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -export([add_spec/1, add_dir/2, add_dir/3]). --export([add_module/1, add_module/2, add_case/2, add_case/3, add_cases/2, - add_cases/3]). +-export([add_module/1, add_module/2, + add_conf/3, + add_case/2, add_case/3, add_cases/2, add_cases/3]). -export([add_dir_with_skip/3, add_dir_with_skip/4, add_tests_with_skip/3]). -export([add_module_with_skip/2, add_module_with_skip/3, + add_conf_with_skip/4, add_case_with_skip/3, add_case_with_skip/4, add_cases_with_skip/3, add_cases_with_skip/4]). -export([jobs/0, run_test/1, wait_finish/0, idle_notify/1, @@ -236,9 +238,16 @@ add_dir(Name, Dir, Pattern) -> add_module(Mod) when is_atom(Mod) -> add_job(atom_to_list(Mod), {Mod,all}). + add_module(Name, Mods) when is_list(Mods) -> add_job(cast_to_list(Name), lists:map(fun(Mod) -> {Mod,all} end, Mods)). +add_conf(Name, Mod, Conf) when is_tuple(Conf) -> + add_job(cast_to_list(Name), {Mod,[Conf]}); + +add_conf(Name, Mod, Confs) when is_list(Confs) -> + add_job(cast_to_list(Name), {Mod,Confs}). + add_case(Mod, Case) when is_atom(Mod), is_atom(Case) -> add_job(atom_to_list(Mod), {Mod,Case}). @@ -283,6 +292,12 @@ add_module_with_skip(Mod, Skip) when is_atom(Mod) -> add_module_with_skip(Name, Mods, Skip) when is_list(Mods) -> add_job(cast_to_list(Name), lists:map(fun(Mod) -> {Mod,all} end, Mods), Skip). +add_conf_with_skip(Name, Mod, Conf, Skip) when is_tuple(Conf) -> + add_job(cast_to_list(Name), {Mod,[Conf]}, Skip); + +add_conf_with_skip(Name, Mod, Confs, Skip) when is_list(Confs) -> + add_job(cast_to_list(Name), {Mod,Confs}, Skip). + add_case_with_skip(Mod, Case, Skip) when is_atom(Mod), is_atom(Case) -> add_job(atom_to_list(Mod), {Mod,Case}, Skip). @@ -1549,8 +1564,8 @@ temp_nodename([Chr|Base], Acc) -> %% of cases can not be calculated and NoOfCases = unknown. count_test_cases(TopCases, SkipCases) when is_list(TopCases) -> case collect_all_cases(TopCases, SkipCases) of - {error,_} -> - error; + {error,_Why} = Error -> + Error; TestSpec -> {get_suites(TestSpec, []), case remove_conf(TestSpec) of @@ -1656,22 +1671,31 @@ do_test_cases(TopCases, SkipCases, put(test_server_case_num, 0), TestSpec = add_init_and_end_per_suite(TestSpec0, undefined, undefined), + TI = get_target_info(), print(1, "Starting test~s", [print_if_known(N, {", ~w test cases",[N]}, {" (with repeated test cases)",[]})]), - test_server_sup:framework_call(report, [tests_start, - {get(test_server_name),N}]), - print(html, - "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 3.2 Final//EN\">\n" - "<!-- autogenerated by '"++atom_to_list(?MODULE)++"'. -->\n" - "<html>\n" - "<head><title>Test ~p results</title>\n" - "<meta http-equiv=\"cache-control\" content=\"no-cache\">\n" - "</head>\n" - "<body bgcolor=\"white\" text=\"black\" " - "link=\"blue\" vlink=\"purple\" alink=\"red\">" - "<h2>Results from test ~p</h2>\n", - [get(test_server_name),get(test_server_name)]), + Test = get(test_server_name), + test_server_sup:framework_call(report, [tests_start,{Test,N}]), + + Header = + case test_server_sup:framework_call(overview_html_header, [Test], "") of + "" -> + TestName = lists:flatten(io_lib:format("~p", [Test])), + ["<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 3.2 Final//EN\">\n", + "<!-- autogenerated by '", atom_to_list(?MODULE), "'. -->\n", + "<html>\n", + "<head><title>Test ", TestName, " results</title>\n", + "<meta http-equiv=\"cache-control\" content=\"no-cache\">\n", + "</head>\n", + "<body bgcolor=\"white\" text=\"black\" ", + "link=\"blue\" vlink=\"purple\" alink=\"red\">", + "<h2>Results from test ", TestName, "</h2>\n"]; + Html -> + ["<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 3.2 Final//EN\">\n", + "<!-- autogenerated by '", atom_to_list(?MODULE), "'. -->\n" | Html] + end, + print(html, Header, []), print_timestamp(html, "Test started at "), print(html, "<p>Host:<br>\n"), @@ -1702,7 +1726,7 @@ do_test_cases(TopCases, SkipCases, [?suitelog_name,?coverlog_name]), print(html,"<p>~s" "<p>\n" - "<table border=3 cellpadding=5>" + "<table bgcolor=\"white\" border=\"3\" cellpadding=\"5\">" "<tr><th>Num</th><th>Module</th><th>Case</th><th>Log</th>" "<th>Time</th><th>Result</th><th>Comment</th></tr>\n", [print_if_known(N, {"Suite contains ~p test cases.\n",[N]}, @@ -2052,10 +2076,6 @@ run_test_cases(TestSpec, Config, TimetrapData) -> html_convert_modules(TestSpec, Config), - %%! For readable tracing... - %%! Config1 = [{data_dir,""},{priv_dir,""},{nodes,[]}], - %%! run_test_cases_loop(TestSpec, [[]], TimetrapData, [], []), - run_test_cases_loop(TestSpec, [Config], TimetrapData, [], []), maybe_get_privdir(), @@ -3537,7 +3557,7 @@ run_test_case1(Ref, Num, Mod, Func, Args, RunInit, Where, case test_server_sup:framework_call(warn, [nodes], true) of true -> case catch controller_call(kill_slavenodes) of - {'EXIT',_}=Exit -> + {'EXIT',_} = Exit -> print(minor, "WARNING: There might be slavenodes left in the" " system. I tried to kill them, but I failed: ~p\n", @@ -4417,7 +4437,7 @@ collect_all_cases(Top, Skip) when is_list(Skip) -> Result = case collect_cases(Top, #cc{mod=[],skip=Skip}) of {ok,Cases,_St} -> Cases; - Other -> Other + Other -> Other end, Result. @@ -4429,9 +4449,9 @@ collect_cases([Case|Cs0], St0) -> case collect_cases(Cs0, St1) of {ok,FlatCases2,St} -> {ok,FlatCases1 ++ FlatCases2,St}; - {error,_Reason}=Error -> Error + {error,_Reason} = Error -> Error end; - {error,_Reason}=Error -> Error + {error,_Reason} = Error -> Error end; @@ -4467,39 +4487,55 @@ collect_cases({conf,Props,InitMF,CaseList,FinF}, St) when is_atom(FinF) -> Props1 -> collect_cases({conf,Props1,InitMF,CaseList,{St#cc.mod,FinF}}, St) end; -collect_cases({conf,Props,InitMF,CaseList,FinMF}, St0) -> - case collect_cases(CaseList, St0) of - {ok,[],_St}=Empty -> - Empty; - {ok,FlatCases,St} -> +collect_cases({conf,Props,InitMF,CaseList,FinMF} = Conf, St) -> + case init_props(Props) of + {error,_} -> + {ok,[],St}; + Props1 -> Ref = make_ref(), - case in_skip_list(InitMF, St#cc.skip) of - {true,Comment} -> + Skips = St#cc.skip, + case in_skip_list({St#cc.mod,Conf}, Skips) of + {true,Comment} -> % conf init skipped {ok,[{skip_case,{conf,Ref,InitMF,Comment}} | - FlatCases ++ [{conf,Ref,[],FinMF}]],St}; + [] ++ [{conf,Ref,[],FinMF}]],St}; + {true,Name,Comment} when is_atom(Name) -> % all cases skipped + {ok,[{skip_case,{{St#cc.mod,{group,Name}},Comment}}],St}; + {true,ToSkip,_} when is_list(ToSkip) -> % some cases skipped + case collect_cases(CaseList, + St#cc{skip=ToSkip++Skips}) of + {ok,[],_St} = Empty -> + Empty; + {ok,FlatCases,St1} -> + {ok,[{conf,Ref,Props1,InitMF} | + FlatCases ++ [{conf,Ref, + keep_name(Props1), + FinMF}]],St1#cc{skip=Skips}}; + {error,_Reason} = Error -> + Error + end; false -> - case init_props(Props) of - {error,_} -> - {ok,[],St}; - Props1 -> + case collect_cases(CaseList, St) of + {ok,[],_St} = Empty -> + Empty; + {ok,FlatCases,St1} -> {ok,[{conf,Ref,Props1,InitMF} | FlatCases ++ [{conf,Ref, keep_name(Props1), - FinMF}]],St} + FinMF}]],St1}; + {error,_Reason} = Error -> + Error end - end; - {error,_Reason}=Error -> - Error + end end; collect_cases({make,InitMFA,CaseList,FinMFA}, St0) -> case collect_cases(CaseList, St0) of - {ok,[],_St}=Empty -> Empty; + {ok,[],_St} = Empty -> Empty; {ok,FlatCases,St} -> Ref = make_ref(), {ok,[{make,Ref,InitMFA}|FlatCases ++ [{make,Ref,FinMFA}]],St}; - {error,_Reason}=Error -> Error + {error,_Reason} = Error -> Error end; collect_cases({Module, Cases}, St) when is_list(Cases) -> @@ -4517,8 +4553,11 @@ collect_cases({_Mod,_Case,_Args}=Spec, St) -> collect_case(Spec, St); collect_cases(Case, St) when is_atom(Case), is_atom(St#cc.mod) -> collect_case({St#cc.mod,Case}, St); -collect_cases(Other, _St) -> - {error,{bad_subtest_spec,Other}}. +collect_cases(Other, St) -> + {error,{bad_subtest_spec,St#cc.mod,Other}}. + +collect_case({Mod,{conf,_,_,_,_}=Conf}, St) -> + collect_case_invoke(Mod, Conf, [], St); collect_case(MFA, St) -> case in_skip_list(MFA, St#cc.skip) of @@ -4555,6 +4594,7 @@ collect_case_invoke(Mod, Case, MFA, St) -> collect_subcases(Mod, Case, MFA, St, Suite) -> case Suite of [] when Case == all -> {ok,[],St}; + [] when element(1, Case) == conf -> {ok,[],St}; [] -> {ok,[MFA],St}; %%%! --- START Kept for backwards compatibilty --- %%%! Requirements are not used @@ -4565,6 +4605,8 @@ collect_subcases(Mod, Case, MFA, St, Suite) -> %%%! --- END Kept for backwards compatibilty --- {Skip,Reason} when Skip==skip; Skip==skipped -> {ok,[{skip_case,{MFA,Reason}}],St}; + {error,Reason} -> + throw(Reason); SubCases -> collect_case_subcases(Mod, Case, SubCases, St) end. @@ -4626,6 +4668,47 @@ check_deny_req(Req, DenyList) -> false -> granted end. +in_skip_list({Mod,{conf,Props,InitMF,_CaseList,_FinMF}}, SkipList) -> + case in_skip_list(InitMF, SkipList) of + {true,_} = Yes -> + Yes; + _ -> + case proplists:get_value(name, Props) of + undefined -> + false; + Name -> + ToSkip = + lists:flatmap( + fun({M,{conf,SProps,_,SCaseList,_},Cmt}) when + M == Mod -> + case proplists:get_value(name, SProps) of + all -> + [{M,all,Cmt}]; + Name -> + case SCaseList of + all -> + [{M,all,Cmt}]; + _ -> + [{M,F,Cmt} || F <- SCaseList] + end; + _ -> + [] + end; + (_) -> + [] + end, SkipList), + case ToSkip of + [] -> + false; + _ -> + case lists:keysearch(all, 2, ToSkip) of + {value,{_,_,Cmt}} -> {true,Name,Cmt}; + _ -> {true,ToSkip,""} + end + end + end + end; + in_skip_list({Mod,Func,_Args}, SkipList) -> in_skip_list({Mod,Func}, SkipList); in_skip_list({Mod,Func}, [{Mod,Funcs,Comment}|SkipList]) when is_list(Funcs) -> diff --git a/lib/test_server/src/ts.erl b/lib/test_server/src/ts.erl index e23b891392..fcd955345f 100644 --- a/lib/test_server/src/ts.erl +++ b/lib/test_server/src/ts.erl @@ -71,7 +71,7 @@ %%% ts_erl_config Finds out information about the Erlang system, %%% for instance the location of erl_interface. %%% This works for either an installed OTP or an Erlang -%%% system running from Clearcase. +%%% system running in a git repository/source tree. %%% ts_make Interface to run the `make' program on Unix %%% and other platforms. %%% ts_make_erl A corrected version of the standar Erlang module diff --git a/lib/test_server/src/ts_erl_config.erl b/lib/test_server/src/ts_erl_config.erl index 14c36a2c35..640c8ddc9f 100644 --- a/lib/test_server/src/ts_erl_config.erl +++ b/lib/test_server/src/ts_erl_config.erl @@ -107,7 +107,7 @@ erts_lib(Vars,OsType) -> ErtsIncludeInternal, ErtsLib, ErtsLibInternal}; - {Type, Root, Target} when Type == clearcase; Type == srctree -> + {srctree, Root, Target} -> Erts = filename:join([Root, "erts"]), ErtsInclude = filename:join([Erts, "include"]), ErtsIncludeTarget = filename:join([ErtsInclude, Target]), @@ -146,7 +146,7 @@ erl_include(Vars) -> case erl_root(Vars) of {installed, Root} -> filename:join([Root, "usr", "include"]); - {Type, Root, Target} when Type == clearcase; Type == srctree -> + {srctree, Root, Target} -> filename:join([Root, "erts", "emulator", "beam"]) ++ " -I" ++ filename:join([Root, "erts", "emulator"]) ++ system_include(Root, Vars) @@ -179,7 +179,7 @@ erl_interface(Vars,OsType) -> {srctree, _Root, _Target} when OsType =:= vxworks -> {filename:join(Dir, "lib"), filename:join([Dir, "src"])}; - {Type, _Root, Target} when Type == clearcase; Type == srctree -> + {srctree, _Root, Target} -> {filename:join([Dir, "obj", Target]), filename:join([Dir, "src", Target])} end} @@ -246,7 +246,7 @@ ic(Vars, OsType) -> case erl_root(Vars) of {installed, _Root} -> filename:join([Dir, "priv", "lib"]); - {Type, _Root, Target} when Type == clearcase; Type == srctree -> + {srctree, _Root, Target} -> filename:join([Dir, "priv", "lib", Target]) end, filename:join(Dir, "include")} @@ -266,21 +266,6 @@ jinterface(Vars, _OsType) -> end, [{jinterface_classpath, filename:nativename(ClassPath)}|Vars]. -%% Unused! -% ig_vars(Vars) -> -% {Lib0, Incl} = -% case erl_root(Vars) of -% {installed, Root} -> -% Base = filename:join([Root, "usr"]), -% {filename:join([Base, "lib"]), -% filename:join([Base, "include"])}; -% {Type, Root, Target} when Type == clearcase; Type == srctree -> -% {filename:join([Root, "lib", "ig", "obj", Target]), -% filename:join([Root, "lib", "ig", "include"])} -% end, -% [{ig_libdir, filename:nativename(Lib0)}, -% {ig_include, filename:nativename(Incl)}|Vars]. - lib_dir(Vars, Lib) -> LibLibDir = case Lib of erts -> @@ -317,9 +302,6 @@ lib_dir(Vars, Lib) -> erl_root(Vars) -> Root = code:root_dir(), case ts_lib:erlang_type() of - {clearcase, _Version} -> - Target = get_var(target, Vars), - {clearcase, Root, Target}; {srctree, _Version} -> Target = get_var(target, Vars), {srctree, Root, Target}; diff --git a/lib/test_server/src/ts_install.erl b/lib/test_server/src/ts_install.erl index 94926eba80..bbbb7883db 100644 --- a/lib/test_server/src/ts_install.erl +++ b/lib/test_server/src/ts_install.erl @@ -1,19 +1,19 @@ %% %% %CopyrightBegin% -%% -%% Copyright Ericsson AB 1997-2009. All Rights Reserved. -%% +%% +%% Copyright Ericsson AB 1997-2010. All Rights Reserved. +%% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in %% compliance with the License. You should have received a copy of the %% Erlang Public License along with this software. If not, it can be %% retrieved online at http://www.erlang.org/. -%% +%% %% Software distributed under the License is distributed on an "AS IS" %% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See %% the License for the specific language governing rights and limitations %% under the License. -%% +%% %% %CopyrightEnd% %% -module(ts_install). @@ -175,15 +175,8 @@ get_testcase_callback() -> get_rsh_name() -> case os:getenv("ERL_RSH") of - false -> - case ts_lib:erlang_type() of - {clearcase, _} -> - "ctrsh"; - {_, _} -> - "rsh" - end; - Str -> - Str + false -> "rsh"; + Str -> Str end. platform_id(Vars) -> diff --git a/lib/test_server/src/ts_lib.erl b/lib/test_server/src/ts_lib.erl index 082c9e0519..c90f4e511b 100644 --- a/lib/test_server/src/ts_lib.erl +++ b/lib/test_server/src/ts_lib.erl @@ -1,19 +1,19 @@ %% %% %CopyrightBegin% -%% -%% Copyright Ericsson AB 1997-2009. All Rights Reserved. -%% +%% +%% Copyright Ericsson AB 1997-2010. All Rights Reserved. +%% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in %% compliance with the License. You should have received a copy of the %% Erlang Public License along with this software. If not, it can be %% retrieved online at http://www.erlang.org/. -%% +%% %% Software distributed under the License is distributed on an "AS IS" %% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See %% the License for the specific language governing rights and limitations %% under the License. -%% +%% %% %CopyrightEnd% %% -module(ts_lib). @@ -72,12 +72,10 @@ progress(Vars, Level, Format, Args) -> erlang_type() -> {_, Version} = init:script_id(), - RelDir = filename:join([code:root_dir(), "releases"]), % Only in installed - SysDir = filename:join([code:root_dir(), "system"]), % Nonexisting link/dir outside ClearCase - case {filelib:is_file(RelDir),filelib:is_file(SysDir)} of - {true,_} -> {otp, Version}; % installed OTP - {_,true} -> {clearcase, Version}; - _ -> {srctree, Version} + RelDir = filename:join(code:root_dir(), "releases"), % Only in installed + case filelib:is_file(RelDir) of + true -> {otp,Version}; % installed OTP + false -> {srctree,Version} % source code tree end. %% Upcases the first letter in a string. diff --git a/lib/test_server/vsn.mk b/lib/test_server/vsn.mk index ee3c957d59..4c3df28814 100644 --- a/lib/test_server/vsn.mk +++ b/lib/test_server/vsn.mk @@ -1,2 +1,2 @@ -TEST_SERVER_VSN = 3.4 +TEST_SERVER_VSN = 3.4.1 diff --git a/lib/tools/c_src/Makefile.in b/lib/tools/c_src/Makefile.in index e6b76e2238..65a7f5f424 100644 --- a/lib/tools/c_src/Makefile.in +++ b/lib/tools/c_src/Makefile.in @@ -128,12 +128,13 @@ EMEM_ERTS_LIB=erts_r$(TYPEMARKER) endif +EMEM_ETHR_LIBS=$(subst -l$(ETHR_LIB_NAME),-l$(ETHR_LIB_NAME)$(TYPEMARKER),$(subst -lerts_internal_r,-lerts_internal_r$(TYPEMARKER),$(ETHR_LIBS))) + EMEM_LIBS = $(LIBS) \ -L$(ERL_TOP)/erts/lib/$(TARGET) \ -L$(ERL_TOP)/erts/lib/internal/$(TARGET) \ -l$(EMEM_ERTS_LIB) \ - -l$(ETHR_LIB_NAME)$(TYPEMARKER) \ - $(ETHR_X_LIBS) + $(EMEM_ETHR_LIBS) EMEM_OBJS = $(addprefix $(EMEM_OBJ_DIR)/,$(notdir $(EMEM_SRCS:.c=.o))) diff --git a/lib/tools/c_src/erl_memory.c b/lib/tools/c_src/erl_memory.c index a0e139f059..872d55e789 100644 --- a/lib/tools/c_src/erl_memory.c +++ b/lib/tools/c_src/erl_memory.c @@ -1,22 +1,22 @@ -/* ``The contents of this file are subject to the Erlang Public License, +/* + * %CopyrightBegin% + * + * Copyright Ericsson AB 2003-2010. All Rights Reserved. + * + * The contents of this file are subject to the Erlang Public License, * Version 1.1, (the "License"); you may not use this file except in * compliance with the License. You should have received a copy of the * Erlang Public License along with this software. If not, it can be - * retrieved via the world wide web at http://www.erlang.org/. - * + * retrieved online at http://www.erlang.org/. + * * Software distributed under the License is distributed on an "AS IS" * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See * the License for the specific language governing rights and limitations * under the License. - * - * The Initial Developer of the Original Code is Ericsson Utvecklings AB. - * Portions created by Ericsson are Copyright 1999, Ericsson Utvecklings - * AB. All Rights Reserved.'' - * - * $Id$ + * + * %CopyrightEnd% */ - /* * Description: * @@ -281,17 +281,13 @@ mutex_destroy(ethr_mutex *mtx) static INLINE void mutex_lock(ethr_mutex *mtx) { - int res = ethr_mutex_lock(mtx); - if (res) - error_msg(res, "Mutex lock"); + ethr_mutex_lock(mtx); } static INLINE void mutex_unlock(ethr_mutex *mtx) { - int res = ethr_mutex_unlock(mtx); - if (res) - error_msg(res, "Mutex unlock"); + ethr_mutex_unlock(mtx); } static INLINE void @@ -314,16 +310,14 @@ static INLINE void cond_wait(ethr_cond *cnd, ethr_mutex *mtx) { int res = ethr_cond_wait(cnd, mtx); - if (res) + if (res != 0 && res != EINTR) error_msg(res, "Cond wait"); } static INLINE void cond_signal(ethr_cond *cnd) { - int res = ethr_cond_signal(cnd); - if (res) - error_msg(res, "Cond signal"); + ethr_cond_signal(cnd); } @@ -2774,7 +2768,7 @@ main(int argc, char *argv[]) exit(1); } - if (ethr_init(NULL) != 0) { + if (ethr_init(NULL) != 0 || ethr_late_init(NULL) != 0) { fprintf(stderr, "emem: failed to initialize thread package\n"); exit(1); } diff --git a/lib/tools/src/cover.erl b/lib/tools/src/cover.erl index 6501e05a6e..c4d1bd1d2f 100644 --- a/lib/tools/src/cover.erl +++ b/lib/tools/src/cover.erl @@ -2174,6 +2174,8 @@ escape_lt_and_gt1([$<|T],Acc) -> escape_lt_and_gt1(T,[$;,$t,$l,$&|Acc]); escape_lt_and_gt1([$>|T],Acc) -> escape_lt_and_gt1(T,[$;,$t,$g,$&|Acc]); +escape_lt_and_gt1([$&|T],Acc) -> + escape_lt_and_gt1(T,[$;,$p,$m,$a,$&|Acc]); escape_lt_and_gt1([],Acc) -> lists:reverse(Acc); escape_lt_and_gt1([H|T],Acc) -> diff --git a/lib/tools/vsn.mk b/lib/tools/vsn.mk index abe9a804f0..7a6f8c92a2 100644 --- a/lib/tools/vsn.mk +++ b/lib/tools/vsn.mk @@ -1,19 +1 @@ -# This is an -*-makefile-*- file. -# %CopyrightBegin% -# -# Copyright Ericsson AB 1997-2010. All Rights Reserved. -# -# The contents of this file are subject to the Erlang Public License, -# Version 1.1, (the "License"); you may not use this file except in -# compliance with the License. You should have received a copy of the -# Erlang Public License along with this software. If not, it can be -# retrieved online at http://www.erlang.org/. -# -# Software distributed under the License is distributed on an "AS IS" -# basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See -# the License for the specific language governing rights and limitations -# under the License. -# -# %CopyrightEnd% - TOOLS_VSN = 2.6.6 diff --git a/lib/tv/src/tv_pg_gridfcns.erl b/lib/tv/src/tv_pg_gridfcns.erl index ab88e2864f..3d23c8a69f 100644 --- a/lib/tv/src/tv_pg_gridfcns.erl +++ b/lib/tv/src/tv_pg_gridfcns.erl @@ -205,8 +205,8 @@ resize_grid(NewWidth, NewHeight, ProcVars) -> check_nof_cols(ColsShown, (NofColsShown - NofCols), ColFrameIds, ColIds, RowIds, NofRows, RowHeight, FgColor, BgColor ), - clear_fields(lists:nthtail(NofColsShown, NewColIds), - lists:nthtail(NofRowsShown, NewRowIds)), + clear_fields(safe_nthtail(NofColsShown, NewColIds), + safe_nthtail(NofRowsShown, NewRowIds)), RowsToUpdate = lists:sublist(NewRowIds, NofRowsShown), @@ -279,7 +279,7 @@ resize_grid_column(RealCol, VirtualCol, Xdiff, ProcVars) -> % Update the ColWidths list. TempColWidths = lists:sublist(ColWidths, VirtualCol - 1) ++ - [NewWidthOfCol | lists:nthtail(VirtualCol, ColWidths)], + [NewWidthOfCol | safe_nthtail(VirtualCol, ColWidths)], % Check the other columns, whether a new column has to be created. ColsShown = compute_cols_shown(FirstColShown, TempColWidths, GridWidth, @@ -455,8 +455,8 @@ scroll_grid_horizontally(NewFirstColShown, ProcVars) -> refresh_visible_rows(RowsToUpdate, NewFirstColShown, NofColsShown, RowDataList, ListAsStr), % Clear fields currently not visible. - clear_fields(lists:nthtail(NofColsShown, NewColIds), - lists:nthtail(NofRowsShown, NewRowIds)), + clear_fields(safe_nthtail(NofColsShown, NewColIds), + safe_nthtail(NofRowsShown, NewRowIds)), NewGridP = GridP#grid_params{nof_cols = NewNofCols, @@ -1565,7 +1565,7 @@ update_col_widths(ColsShown, ColWidths, FirstColShown, DefaultColWidth) -> if NecessaryNofVirtualCols > NofVirtualCols -> TailNo = NofVirtualCols - FirstColShown + 1, % Always >= 0 !!! - NewColWidths ++ lists:nthtail(TailNo, ColsShown); + NewColWidths ++ safe_nthtail(TailNo, ColsShown); true -> NewColWidths end. @@ -1653,7 +1653,7 @@ compute_cols_shown(FirstColShown, ColWidths, GridWidth, _NofCols, DefaultColWidt ColWidthsLength < FirstColShown -> []; true -> - lists:nthtail(FirstColShown - 1, ColWidths) + safe_nthtail(FirstColShown - 1, ColWidths) end, compute_cols_shown(UsedColWidths, GridWidth, DefaultColWidth). @@ -1894,3 +1894,21 @@ extract_ids_for_one_row(N, [ColIds | Tail]) -> %%%--------------------------------------------------------------------- %%% END of functions used to create the grid. %%%--------------------------------------------------------------------- + + +%%====================================================================== +%% Function: +%% +%% Return Value: +%% +%% Description: +%% +%% Parameters: +%%====================================================================== + + +safe_nthtail(_, []) -> []; +safe_nthtail(1, [_|T]) -> T; +safe_nthtail(N, [_|T]) when N > 1 -> + safe_nthtail(N - 1, T); +safe_nthtail(0, L) when is_list(L) -> L. diff --git a/lib/tv/vsn.mk b/lib/tv/vsn.mk index 93973489bc..d344c676a3 100644 --- a/lib/tv/vsn.mk +++ b/lib/tv/vsn.mk @@ -1,20 +1 @@ -# -# %CopyrightBegin% -# -# Copyright Ericsson AB 1997-2010. All Rights Reserved. -# -# The contents of this file are subject to the Erlang Public License, -# Version 1.1, (the "License"); you may not use this file except in -# compliance with the License. You should have received a copy of the -# Erlang Public License along with this software. If not, it can be -# retrieved online at http://www.erlang.org/. -# -# Software distributed under the License is distributed on an "AS IS" -# basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See -# the License for the specific language governing rights and limitations -# under the License. -# -# %CopyrightEnd% -# - TV_VSN = 2.1.4.5 diff --git a/lib/wx/.gitignore b/lib/wx/.gitignore new file mode 100644 index 0000000000..fd76f078d7 --- /dev/null +++ b/lib/wx/.gitignore @@ -0,0 +1,2 @@ +test_log_* +wx_test_case_info diff --git a/lib/wx/api_gen/wxapi.conf b/lib/wx/api_gen/wxapi.conf index c91a9d7fff..6bafda5b9d 100644 --- a/lib/wx/api_gen/wxapi.conf +++ b/lib/wx/api_gen/wxapi.conf @@ -902,8 +902,8 @@ ['wxTreeCtrl','~wxTreeCtrl','AddRoot','AppendItem', %% Not on Windows 'AssignButtonsImageList','GetButtonsImageList','SetButtonsImageList' 'AssignImageList','AssignStateImageList','Collapse','CollapseAndReset', - 'Create','Delete','DeleteAllItems','DeleteChildren',{'EditLabel',1}, - %'EndEditLabel', + 'Create','Delete','DeleteAllItems','DeleteChildren', + {'EditLabel', [{"textCtrlClass", [nowhere]}]}, %'EndEditLabel', 'EnsureVisible','Expand','GetBoundingRect', 'GetChildrenCount','GetCount','GetEditControl', {'GetFirstChild',[{"cookie", out}]}, {'GetNextChild',[{"cookie", [both]}]}, @@ -1740,6 +1740,11 @@ %% 'GetItemRect', 'SetItemRect', 'GetToolId', 'SetToolId' %% ]}. +{class, wxSystemSettings, object, [], + [ + 'GetColour','GetFont','GetMetric','GetScreenType' + ]}. + {class, wxAuiNotebookEvent, wxNotifyEvent, [{acc, [{old_selection, "GetOldSelection()"}, {selection, "GetSelection()"}, diff --git a/lib/wx/c_src/gen/wxe_derived_dest.h b/lib/wx/c_src/gen/wxe_derived_dest.h index 57b0faa2cb..ad46a98c90 100644 --- a/lib/wx/c_src/gen/wxe_derived_dest.h +++ b/lib/wx/c_src/gen/wxe_derived_dest.h @@ -736,7 +736,7 @@ void WxeApp::delete_object(void *ptr, wxeRefData *refd) { case 211: /* delete (wxFileDataObject *) ptr;These objects must be deleted by owner object */ break; case 212: /* delete (wxTextDataObject *) ptr;These objects must be deleted by owner object */ break; case 213: /* delete (wxBitmapDataObject *) ptr;These objects must be deleted by owner object */ break; - case 222: delete (wxLogNull *) ptr; break; + case 223: delete (wxLogNull *) ptr; break; default: delete (wxObject *) ptr; }} diff --git a/lib/wx/c_src/gen/wxe_events.cpp b/lib/wx/c_src/gen/wxe_events.cpp index a6857442c9..692eef858c 100644 --- a/lib/wx/c_src/gen/wxe_events.cpp +++ b/lib/wx/c_src/gen/wxe_events.cpp @@ -266,41 +266,41 @@ void initEventTable() {wxEVT_COMMAND_SPLITTER_DOUBLECLICKED, 217, "command_splitter_doubleclicked"}, {wxEVT_COMMAND_SPLITTER_UNSPLIT, 217, "command_splitter_unsplit"}, {wxEVT_COMMAND_HTML_LINK_CLICKED, 219, "command_html_link_clicked"}, - {wxEVT_COMMAND_AUINOTEBOOK_PAGE_CLOSE, 220, "command_auinotebook_page_close"}, - {wxEVT_COMMAND_AUINOTEBOOK_PAGE_CHANGED, 220, "command_auinotebook_page_changed"}, - {wxEVT_COMMAND_AUINOTEBOOK_PAGE_CHANGING, 220, "command_auinotebook_page_changing"}, - {wxEVT_COMMAND_AUINOTEBOOK_BUTTON, 220, "command_auinotebook_button"}, - {wxEVT_COMMAND_AUINOTEBOOK_BEGIN_DRAG, 220, "command_auinotebook_begin_drag"}, - {wxEVT_COMMAND_AUINOTEBOOK_END_DRAG, 220, "command_auinotebook_end_drag"}, - {wxEVT_COMMAND_AUINOTEBOOK_DRAG_MOTION, 220, "command_auinotebook_drag_motion"}, - {wxEVT_COMMAND_AUINOTEBOOK_ALLOW_DND, 220, "command_auinotebook_allow_dnd"}, + {wxEVT_COMMAND_AUINOTEBOOK_PAGE_CLOSE, 221, "command_auinotebook_page_close"}, + {wxEVT_COMMAND_AUINOTEBOOK_PAGE_CHANGED, 221, "command_auinotebook_page_changed"}, + {wxEVT_COMMAND_AUINOTEBOOK_PAGE_CHANGING, 221, "command_auinotebook_page_changing"}, + {wxEVT_COMMAND_AUINOTEBOOK_BUTTON, 221, "command_auinotebook_button"}, + {wxEVT_COMMAND_AUINOTEBOOK_BEGIN_DRAG, 221, "command_auinotebook_begin_drag"}, + {wxEVT_COMMAND_AUINOTEBOOK_END_DRAG, 221, "command_auinotebook_end_drag"}, + {wxEVT_COMMAND_AUINOTEBOOK_DRAG_MOTION, 221, "command_auinotebook_drag_motion"}, + {wxEVT_COMMAND_AUINOTEBOOK_ALLOW_DND, 221, "command_auinotebook_allow_dnd"}, #if wxCHECK_VERSION(2,8,5) - {wxEVT_COMMAND_AUINOTEBOOK_TAB_MIDDLE_DOWN, 220, "command_auinotebook_tab_middle_down"}, + {wxEVT_COMMAND_AUINOTEBOOK_TAB_MIDDLE_DOWN, 221, "command_auinotebook_tab_middle_down"}, #endif #if wxCHECK_VERSION(2,8,5) - {wxEVT_COMMAND_AUINOTEBOOK_TAB_MIDDLE_UP, 220, "command_auinotebook_tab_middle_up"}, + {wxEVT_COMMAND_AUINOTEBOOK_TAB_MIDDLE_UP, 221, "command_auinotebook_tab_middle_up"}, #endif #if wxCHECK_VERSION(2,8,5) - {wxEVT_COMMAND_AUINOTEBOOK_TAB_RIGHT_DOWN, 220, "command_auinotebook_tab_right_down"}, + {wxEVT_COMMAND_AUINOTEBOOK_TAB_RIGHT_DOWN, 221, "command_auinotebook_tab_right_down"}, #endif #if wxCHECK_VERSION(2,8,5) - {wxEVT_COMMAND_AUINOTEBOOK_TAB_RIGHT_UP, 220, "command_auinotebook_tab_right_up"}, + {wxEVT_COMMAND_AUINOTEBOOK_TAB_RIGHT_UP, 221, "command_auinotebook_tab_right_up"}, #endif #if wxCHECK_VERSION(2,8,5) - {wxEVT_COMMAND_AUINOTEBOOK_PAGE_CLOSED, 220, "command_auinotebook_page_closed"}, + {wxEVT_COMMAND_AUINOTEBOOK_PAGE_CLOSED, 221, "command_auinotebook_page_closed"}, #endif #if wxCHECK_VERSION(2,8,5) - {wxEVT_COMMAND_AUINOTEBOOK_DRAG_DONE, 220, "command_auinotebook_drag_done"}, + {wxEVT_COMMAND_AUINOTEBOOK_DRAG_DONE, 221, "command_auinotebook_drag_done"}, #endif #if wxCHECK_VERSION(2,8,5) - {wxEVT_COMMAND_AUINOTEBOOK_BG_DCLICK, 220, "command_auinotebook_bg_dclick"}, + {wxEVT_COMMAND_AUINOTEBOOK_BG_DCLICK, 221, "command_auinotebook_bg_dclick"}, #endif - {wxEVT_AUI_PANE_BUTTON, 221, "aui_pane_button"}, - {wxEVT_AUI_PANE_CLOSE, 221, "aui_pane_close"}, - {wxEVT_AUI_PANE_MAXIMIZE, 221, "aui_pane_maximize"}, - {wxEVT_AUI_PANE_RESTORE, 221, "aui_pane_restore"}, - {wxEVT_AUI_RENDER, 221, "aui_render"}, - {wxEVT_AUI_FIND_MANAGER, 221, "aui_find_manager"}, + {wxEVT_AUI_PANE_BUTTON, 222, "aui_pane_button"}, + {wxEVT_AUI_PANE_CLOSE, 222, "aui_pane_close"}, + {wxEVT_AUI_PANE_MAXIMIZE, 222, "aui_pane_maximize"}, + {wxEVT_AUI_PANE_RESTORE, 222, "aui_pane_restore"}, + {wxEVT_AUI_RENDER, 222, "aui_render"}, + {wxEVT_AUI_FIND_MANAGER, 222, "aui_find_manager"}, {-1, 0, } }; for(int i=0; event_types[i].ev_type != -1; i++) { @@ -778,7 +778,7 @@ case 219: {// wxHtmlLinkEvent rt.addTupleCount(3); break; } -case 220: {// wxAuiNotebookEvent +case 221: {// wxAuiNotebookEvent wxAuiNotebookEvent * ev = (wxAuiNotebookEvent *) event; wxAuiNotebook * GetDragSource = ev->GetDragSource(); evClass = (char*)"wxAuiNotebookEvent"; @@ -790,7 +790,7 @@ case 220: {// wxAuiNotebookEvent rt.addTupleCount(5); break; } -case 221: {// wxAuiManagerEvent +case 222: {// wxAuiManagerEvent wxAuiManagerEvent * ev = (wxAuiManagerEvent *) event; wxAuiManager * GetManager = ev->GetManager(); wxAuiPaneInfo * GetPane = ev->GetPane(); diff --git a/lib/wx/c_src/gen/wxe_funcs.cpp b/lib/wx/c_src/gen/wxe_funcs.cpp index fd496c2ccc..8c056bbb91 100644 --- a/lib/wx/c_src/gen/wxe_funcs.cpp +++ b/lib/wx/c_src/gen/wxe_funcs.cpp @@ -18501,6 +18501,15 @@ case wxTreeCtrl_DeleteChildren: { // wxTreeCtrl::DeleteChildren This->DeleteChildren(item); break; } +case wxTreeCtrl_EditLabel: { // wxTreeCtrl::EditLabel + wxTreeCtrl *This = (wxTreeCtrl *) getPtr(bp,memenv); bp += 4; + bp += 4; /* Align */ + wxTreeItemId item = wxTreeItemId((void *) *(wxUint64 *) bp); bp += 8; + if(!This) throw wxe_badarg(0); + wxTextCtrl * Result = (wxTextCtrl*)This->EditLabel(item); + rt.addRef(getRef((void *)Result,memenv), "wxTextCtrl"); + break; +} case wxTreeCtrl_EnsureVisible: { // wxTreeCtrl::EnsureVisible wxTreeCtrl *This = (wxTreeCtrl *) getPtr(bp,memenv); bp += 4; bp += 4; /* Align */ @@ -30976,6 +30985,36 @@ case wxHtmlLinkEvent_GetLinkInfo: { // wxHtmlLinkEvent::GetLinkInfo rt.add(Result); break; } +case wxSystemSettings_GetColour: { // wxSystemSettings::GetColour + wxSystemColour index = *(wxSystemColour *) bp; bp += 4;; + wxColour Result = wxSystemSettings::GetColour((wxSystemColour) index); + rt.add(Result); + break; +} +case wxSystemSettings_GetFont: { // wxSystemSettings::GetFont + wxSystemFont index = *(wxSystemFont *) bp; bp += 4;; + wxFont * Result = new wxFont(wxSystemSettings::GetFont((wxSystemFont) index)); newPtr((void *) Result,3, memenv);; + rt.addRef(getRef((void *)Result,memenv), "wxFont"); + break; +} +case wxSystemSettings_GetMetric: { // wxSystemSettings::GetMetric + wxWindow * win=NULL; + wxSystemMetric index = *(wxSystemMetric *) bp; bp += 4;; + bp += 4; /* Align */ + while( * (int*) bp) { switch (* (int*) bp) { + case 1: {bp += 4; +win = (wxWindow *) getPtr(bp,memenv); bp += 4; + } break; + }}; + int Result = wxSystemSettings::GetMetric((wxSystemMetric) index,win); + rt.addInt(Result); + break; +} +case wxSystemSettings_GetScreenType: { // wxSystemSettings::GetScreenType + int Result = wxSystemSettings::GetScreenType(); + rt.addInt(Result); + break; +} case wxAuiNotebookEvent_SetSelection: { // wxAuiNotebookEvent::SetSelection wxAuiNotebookEvent *This = (wxAuiNotebookEvent *) getPtr(bp,memenv); bp += 4; int * s = (int *) bp; bp += 4; @@ -31110,7 +31149,7 @@ case wxAuiManagerEvent_CanVeto: { // wxAuiManagerEvent::CanVeto } case wxLogNull_new: { // wxLogNull::wxLogNull wxLogNull * Result = new wxLogNull(); - newPtr((void *) Result, 222, memenv); + newPtr((void *) Result, 223, memenv); rt.addRef(getRef((void *)Result,memenv), "wxLogNull"); break; } diff --git a/lib/wx/c_src/gen/wxe_macros.h b/lib/wx/c_src/gen/wxe_macros.h index 415b7f0b29..4fb76f960b 100644 --- a/lib/wx/c_src/gen/wxe_macros.h +++ b/lib/wx/c_src/gen/wxe_macros.h @@ -1882,1444 +1882,1449 @@ #define wxTreeCtrl_Delete 2007 #define wxTreeCtrl_DeleteAllItems 2008 #define wxTreeCtrl_DeleteChildren 2009 -#define wxTreeCtrl_EnsureVisible 2010 -#define wxTreeCtrl_Expand 2011 -#define wxTreeCtrl_GetBoundingRect 2012 -#define wxTreeCtrl_GetChildrenCount 2014 -#define wxTreeCtrl_GetCount 2015 -#define wxTreeCtrl_GetEditControl 2016 -#define wxTreeCtrl_GetFirstChild 2017 -#define wxTreeCtrl_GetNextChild 2018 -#define wxTreeCtrl_GetFirstVisibleItem 2019 -#define wxTreeCtrl_GetImageList 2020 -#define wxTreeCtrl_GetIndent 2021 -#define wxTreeCtrl_GetItemBackgroundColour 2022 -#define wxTreeCtrl_GetItemData 2023 -#define wxTreeCtrl_GetItemFont 2024 -#define wxTreeCtrl_GetItemImage_1 2025 -#define wxTreeCtrl_GetItemImage_2 2026 -#define wxTreeCtrl_GetItemText 2027 -#define wxTreeCtrl_GetItemTextColour 2028 -#define wxTreeCtrl_GetLastChild 2029 -#define wxTreeCtrl_GetNextSibling 2030 -#define wxTreeCtrl_GetNextVisible 2031 -#define wxTreeCtrl_GetItemParent 2032 -#define wxTreeCtrl_GetPrevSibling 2033 -#define wxTreeCtrl_GetPrevVisible 2034 -#define wxTreeCtrl_GetRootItem 2035 -#define wxTreeCtrl_GetSelection 2036 -#define wxTreeCtrl_GetSelections 2037 -#define wxTreeCtrl_GetStateImageList 2038 -#define wxTreeCtrl_HitTest 2039 -#define wxTreeCtrl_InsertItem 2041 -#define wxTreeCtrl_IsBold 2042 -#define wxTreeCtrl_IsExpanded 2043 -#define wxTreeCtrl_IsSelected 2044 -#define wxTreeCtrl_IsVisible 2045 -#define wxTreeCtrl_ItemHasChildren 2046 -#define wxTreeCtrl_PrependItem 2047 -#define wxTreeCtrl_ScrollTo 2048 -#define wxTreeCtrl_SelectItem_1 2049 -#define wxTreeCtrl_SelectItem_2 2050 -#define wxTreeCtrl_SetIndent 2051 -#define wxTreeCtrl_SetImageList 2052 -#define wxTreeCtrl_SetItemBackgroundColour 2053 -#define wxTreeCtrl_SetItemBold 2054 -#define wxTreeCtrl_SetItemData 2055 -#define wxTreeCtrl_SetItemDropHighlight 2056 -#define wxTreeCtrl_SetItemFont 2057 -#define wxTreeCtrl_SetItemHasChildren 2058 -#define wxTreeCtrl_SetItemImage_2 2059 -#define wxTreeCtrl_SetItemImage_3 2060 -#define wxTreeCtrl_SetItemText 2061 -#define wxTreeCtrl_SetItemTextColour 2062 -#define wxTreeCtrl_SetStateImageList 2063 -#define wxTreeCtrl_SetWindowStyle 2064 -#define wxTreeCtrl_SortChildren 2065 -#define wxTreeCtrl_Toggle 2066 -#define wxTreeCtrl_ToggleItemSelection 2067 -#define wxTreeCtrl_Unselect 2068 -#define wxTreeCtrl_UnselectAll 2069 -#define wxTreeCtrl_UnselectItem 2070 -#define wxScrollBar_new_0 2071 -#define wxScrollBar_new_3 2072 -#define wxScrollBar_destruct 2073 -#define wxScrollBar_Create 2074 -#define wxScrollBar_GetRange 2075 -#define wxScrollBar_GetPageSize 2076 -#define wxScrollBar_GetThumbPosition 2077 -#define wxScrollBar_GetThumbSize 2078 -#define wxScrollBar_SetThumbPosition 2079 -#define wxScrollBar_SetScrollbar 2080 -#define wxSpinButton_new_2 2082 -#define wxSpinButton_new_0 2083 -#define wxSpinButton_Create 2084 -#define wxSpinButton_GetMax 2085 -#define wxSpinButton_GetMin 2086 -#define wxSpinButton_GetValue 2087 -#define wxSpinButton_SetRange 2088 -#define wxSpinButton_SetValue 2089 -#define wxSpinButton_destroy 2090 -#define wxSpinCtrl_new_0 2091 -#define wxSpinCtrl_new_2 2092 -#define wxSpinCtrl_Create 2094 -#define wxSpinCtrl_SetValue_1_1 2097 -#define wxSpinCtrl_SetValue_1_0 2098 -#define wxSpinCtrl_GetValue 2100 -#define wxSpinCtrl_SetRange 2102 -#define wxSpinCtrl_SetSelection 2103 -#define wxSpinCtrl_GetMin 2105 -#define wxSpinCtrl_GetMax 2107 -#define wxSpinCtrl_destroy 2108 -#define wxStaticText_new_0 2109 -#define wxStaticText_new_4 2110 -#define wxStaticText_Create 2111 -#define wxStaticText_GetLabel 2112 -#define wxStaticText_SetLabel 2113 -#define wxStaticText_Wrap 2114 -#define wxStaticText_destroy 2115 -#define wxStaticBitmap_new_0 2116 -#define wxStaticBitmap_new_4 2117 -#define wxStaticBitmap_Create 2118 -#define wxStaticBitmap_GetBitmap 2119 -#define wxStaticBitmap_SetBitmap 2120 -#define wxStaticBitmap_destroy 2121 -#define wxRadioBox_new 2122 -#define wxRadioBox_destruct 2124 -#define wxRadioBox_Create 2125 -#define wxRadioBox_Enable_2 2126 -#define wxRadioBox_Enable_1 2127 -#define wxRadioBox_GetSelection 2128 -#define wxRadioBox_GetString 2129 -#define wxRadioBox_SetSelection 2130 -#define wxRadioBox_Show_2 2131 -#define wxRadioBox_Show_1 2132 -#define wxRadioBox_GetColumnCount 2133 -#define wxRadioBox_GetItemHelpText 2134 -#define wxRadioBox_GetItemToolTip 2135 -#define wxRadioBox_GetItemFromPoint 2137 -#define wxRadioBox_GetRowCount 2138 -#define wxRadioBox_IsItemEnabled 2139 -#define wxRadioBox_IsItemShown 2140 -#define wxRadioBox_SetItemHelpText 2141 -#define wxRadioBox_SetItemToolTip 2142 -#define wxRadioButton_new_0 2143 -#define wxRadioButton_new_4 2144 -#define wxRadioButton_Create 2145 -#define wxRadioButton_GetValue 2146 -#define wxRadioButton_SetValue 2147 -#define wxRadioButton_destroy 2148 -#define wxSlider_new_6 2150 -#define wxSlider_new_0 2151 -#define wxSlider_Create 2152 -#define wxSlider_GetLineSize 2153 -#define wxSlider_GetMax 2154 -#define wxSlider_GetMin 2155 -#define wxSlider_GetPageSize 2156 -#define wxSlider_GetThumbLength 2157 -#define wxSlider_GetValue 2158 -#define wxSlider_SetLineSize 2159 -#define wxSlider_SetPageSize 2160 -#define wxSlider_SetRange 2161 -#define wxSlider_SetThumbLength 2162 -#define wxSlider_SetValue 2163 -#define wxSlider_destroy 2164 -#define wxDialog_new_4 2166 -#define wxDialog_new_0 2167 -#define wxDialog_destruct 2169 -#define wxDialog_Create 2170 -#define wxDialog_CreateButtonSizer 2171 -#define wxDialog_CreateStdDialogButtonSizer 2172 -#define wxDialog_EndModal 2173 -#define wxDialog_GetAffirmativeId 2174 -#define wxDialog_GetReturnCode 2175 -#define wxDialog_IsModal 2176 -#define wxDialog_SetAffirmativeId 2177 -#define wxDialog_SetReturnCode 2178 -#define wxDialog_Show 2179 -#define wxDialog_ShowModal 2180 -#define wxColourDialog_new_0 2181 -#define wxColourDialog_new_2 2182 -#define wxColourDialog_destruct 2183 -#define wxColourDialog_Create 2184 -#define wxColourDialog_GetColourData 2185 -#define wxColourData_new_0 2186 -#define wxColourData_new_1 2187 -#define wxColourData_destruct 2188 -#define wxColourData_GetChooseFull 2189 -#define wxColourData_GetColour 2190 -#define wxColourData_GetCustomColour 2192 -#define wxColourData_SetChooseFull 2193 -#define wxColourData_SetColour 2194 -#define wxColourData_SetCustomColour 2195 -#define wxPalette_new_0 2196 -#define wxPalette_new_4 2197 -#define wxPalette_destruct 2199 -#define wxPalette_Create 2200 -#define wxPalette_GetColoursCount 2201 -#define wxPalette_GetPixel 2202 -#define wxPalette_GetRGB 2203 -#define wxPalette_IsOk 2204 -#define wxDirDialog_new 2208 -#define wxDirDialog_destruct 2209 -#define wxDirDialog_GetPath 2210 -#define wxDirDialog_GetMessage 2211 -#define wxDirDialog_SetMessage 2212 -#define wxDirDialog_SetPath 2213 -#define wxFileDialog_new 2217 -#define wxFileDialog_destruct 2218 -#define wxFileDialog_GetDirectory 2219 -#define wxFileDialog_GetFilename 2220 -#define wxFileDialog_GetFilenames 2221 -#define wxFileDialog_GetFilterIndex 2222 -#define wxFileDialog_GetMessage 2223 -#define wxFileDialog_GetPath 2224 -#define wxFileDialog_GetPaths 2225 -#define wxFileDialog_GetWildcard 2226 -#define wxFileDialog_SetDirectory 2227 -#define wxFileDialog_SetFilename 2228 -#define wxFileDialog_SetFilterIndex 2229 -#define wxFileDialog_SetMessage 2230 -#define wxFileDialog_SetPath 2231 -#define wxFileDialog_SetWildcard 2232 -#define wxPickerBase_SetInternalMargin 2233 -#define wxPickerBase_GetInternalMargin 2234 -#define wxPickerBase_SetTextCtrlProportion 2235 -#define wxPickerBase_SetPickerCtrlProportion 2236 -#define wxPickerBase_GetTextCtrlProportion 2237 -#define wxPickerBase_GetPickerCtrlProportion 2238 -#define wxPickerBase_HasTextCtrl 2239 -#define wxPickerBase_GetTextCtrl 2240 -#define wxPickerBase_IsTextCtrlGrowable 2241 -#define wxPickerBase_SetPickerCtrlGrowable 2242 -#define wxPickerBase_SetTextCtrlGrowable 2243 -#define wxPickerBase_IsPickerCtrlGrowable 2244 -#define wxFilePickerCtrl_new_0 2245 -#define wxFilePickerCtrl_new_3 2246 -#define wxFilePickerCtrl_Create 2247 -#define wxFilePickerCtrl_GetPath 2248 -#define wxFilePickerCtrl_SetPath 2249 -#define wxFilePickerCtrl_destroy 2250 -#define wxDirPickerCtrl_new_0 2251 -#define wxDirPickerCtrl_new_3 2252 -#define wxDirPickerCtrl_Create 2253 -#define wxDirPickerCtrl_GetPath 2254 -#define wxDirPickerCtrl_SetPath 2255 -#define wxDirPickerCtrl_destroy 2256 -#define wxColourPickerCtrl_new_0 2257 -#define wxColourPickerCtrl_new_3 2258 -#define wxColourPickerCtrl_Create 2259 -#define wxColourPickerCtrl_GetColour 2260 -#define wxColourPickerCtrl_SetColour_1_1 2261 -#define wxColourPickerCtrl_SetColour_1_0 2262 -#define wxColourPickerCtrl_destroy 2263 -#define wxDatePickerCtrl_new_0 2264 -#define wxDatePickerCtrl_new_3 2265 -#define wxDatePickerCtrl_GetRange 2266 -#define wxDatePickerCtrl_GetValue 2267 -#define wxDatePickerCtrl_SetRange 2268 -#define wxDatePickerCtrl_SetValue 2269 -#define wxDatePickerCtrl_destroy 2270 -#define wxFontPickerCtrl_new_0 2271 -#define wxFontPickerCtrl_new_3 2272 -#define wxFontPickerCtrl_Create 2273 -#define wxFontPickerCtrl_GetSelectedFont 2274 -#define wxFontPickerCtrl_SetSelectedFont 2275 -#define wxFontPickerCtrl_GetMaxPointSize 2276 -#define wxFontPickerCtrl_SetMaxPointSize 2277 -#define wxFontPickerCtrl_destroy 2278 -#define wxFindReplaceDialog_new_0 2281 -#define wxFindReplaceDialog_new_4 2282 -#define wxFindReplaceDialog_destruct 2283 -#define wxFindReplaceDialog_Create 2284 -#define wxFindReplaceDialog_GetData 2285 -#define wxFindReplaceData_new_0 2286 -#define wxFindReplaceData_new_1 2287 -#define wxFindReplaceData_GetFindString 2288 -#define wxFindReplaceData_GetReplaceString 2289 -#define wxFindReplaceData_GetFlags 2290 -#define wxFindReplaceData_SetFlags 2291 -#define wxFindReplaceData_SetFindString 2292 -#define wxFindReplaceData_SetReplaceString 2293 -#define wxFindReplaceData_destroy 2294 -#define wxMultiChoiceDialog_new_0 2295 -#define wxMultiChoiceDialog_new_5 2297 -#define wxMultiChoiceDialog_GetSelections 2298 -#define wxMultiChoiceDialog_SetSelections 2299 -#define wxMultiChoiceDialog_destroy 2300 -#define wxSingleChoiceDialog_new_0 2301 -#define wxSingleChoiceDialog_new_5 2303 -#define wxSingleChoiceDialog_GetSelection 2304 -#define wxSingleChoiceDialog_GetStringSelection 2305 -#define wxSingleChoiceDialog_SetSelection 2306 -#define wxSingleChoiceDialog_destroy 2307 -#define wxTextEntryDialog_new 2308 -#define wxTextEntryDialog_GetValue 2309 -#define wxTextEntryDialog_SetValue 2310 -#define wxTextEntryDialog_destroy 2311 -#define wxPasswordEntryDialog_new 2312 -#define wxPasswordEntryDialog_destroy 2313 -#define wxFontData_new_0 2314 -#define wxFontData_new_1 2315 -#define wxFontData_destruct 2316 -#define wxFontData_EnableEffects 2317 -#define wxFontData_GetAllowSymbols 2318 -#define wxFontData_GetColour 2319 -#define wxFontData_GetChosenFont 2320 -#define wxFontData_GetEnableEffects 2321 -#define wxFontData_GetInitialFont 2322 -#define wxFontData_GetShowHelp 2323 -#define wxFontData_SetAllowSymbols 2324 -#define wxFontData_SetChosenFont 2325 -#define wxFontData_SetColour 2326 -#define wxFontData_SetInitialFont 2327 -#define wxFontData_SetRange 2328 -#define wxFontData_SetShowHelp 2329 -#define wxFontDialog_new_0 2333 -#define wxFontDialog_new_2 2335 -#define wxFontDialog_Create 2337 -#define wxFontDialog_GetFontData 2338 -#define wxFontDialog_destroy 2340 -#define wxProgressDialog_new 2341 -#define wxProgressDialog_destruct 2342 -#define wxProgressDialog_Resume 2343 -#define wxProgressDialog_Update_2 2344 -#define wxProgressDialog_Update_0 2345 -#define wxMessageDialog_new 2346 -#define wxMessageDialog_destruct 2347 -#define wxPageSetupDialog_new 2348 -#define wxPageSetupDialog_destruct 2349 -#define wxPageSetupDialog_GetPageSetupData 2350 -#define wxPageSetupDialog_ShowModal 2351 -#define wxPageSetupDialogData_new_0 2352 -#define wxPageSetupDialogData_new_1_0 2353 -#define wxPageSetupDialogData_new_1_1 2354 -#define wxPageSetupDialogData_destruct 2355 -#define wxPageSetupDialogData_EnableHelp 2356 -#define wxPageSetupDialogData_EnableMargins 2357 -#define wxPageSetupDialogData_EnableOrientation 2358 -#define wxPageSetupDialogData_EnablePaper 2359 -#define wxPageSetupDialogData_EnablePrinter 2360 -#define wxPageSetupDialogData_GetDefaultMinMargins 2361 -#define wxPageSetupDialogData_GetEnableMargins 2362 -#define wxPageSetupDialogData_GetEnableOrientation 2363 -#define wxPageSetupDialogData_GetEnablePaper 2364 -#define wxPageSetupDialogData_GetEnablePrinter 2365 -#define wxPageSetupDialogData_GetEnableHelp 2366 -#define wxPageSetupDialogData_GetDefaultInfo 2367 -#define wxPageSetupDialogData_GetMarginTopLeft 2368 -#define wxPageSetupDialogData_GetMarginBottomRight 2369 -#define wxPageSetupDialogData_GetMinMarginTopLeft 2370 -#define wxPageSetupDialogData_GetMinMarginBottomRight 2371 -#define wxPageSetupDialogData_GetPaperId 2372 -#define wxPageSetupDialogData_GetPaperSize 2373 -#define wxPageSetupDialogData_GetPrintData 2375 -#define wxPageSetupDialogData_IsOk 2376 -#define wxPageSetupDialogData_SetDefaultInfo 2377 -#define wxPageSetupDialogData_SetDefaultMinMargins 2378 -#define wxPageSetupDialogData_SetMarginTopLeft 2379 -#define wxPageSetupDialogData_SetMarginBottomRight 2380 -#define wxPageSetupDialogData_SetMinMarginTopLeft 2381 -#define wxPageSetupDialogData_SetMinMarginBottomRight 2382 -#define wxPageSetupDialogData_SetPaperId 2383 -#define wxPageSetupDialogData_SetPaperSize_1_1 2384 -#define wxPageSetupDialogData_SetPaperSize_1_0 2385 -#define wxPageSetupDialogData_SetPrintData 2386 -#define wxPrintDialog_new_2_0 2387 -#define wxPrintDialog_new_2_1 2388 -#define wxPrintDialog_destruct 2389 -#define wxPrintDialog_GetPrintDialogData 2390 -#define wxPrintDialog_GetPrintDC 2391 -#define wxPrintDialogData_new_0 2392 -#define wxPrintDialogData_new_1_1 2393 -#define wxPrintDialogData_new_1_0 2394 -#define wxPrintDialogData_destruct 2395 -#define wxPrintDialogData_EnableHelp 2396 -#define wxPrintDialogData_EnablePageNumbers 2397 -#define wxPrintDialogData_EnablePrintToFile 2398 -#define wxPrintDialogData_EnableSelection 2399 -#define wxPrintDialogData_GetAllPages 2400 -#define wxPrintDialogData_GetCollate 2401 -#define wxPrintDialogData_GetFromPage 2402 -#define wxPrintDialogData_GetMaxPage 2403 -#define wxPrintDialogData_GetMinPage 2404 -#define wxPrintDialogData_GetNoCopies 2405 -#define wxPrintDialogData_GetPrintData 2406 -#define wxPrintDialogData_GetPrintToFile 2407 -#define wxPrintDialogData_GetSelection 2408 -#define wxPrintDialogData_GetToPage 2409 -#define wxPrintDialogData_IsOk 2410 -#define wxPrintDialogData_SetCollate 2411 -#define wxPrintDialogData_SetFromPage 2412 -#define wxPrintDialogData_SetMaxPage 2413 -#define wxPrintDialogData_SetMinPage 2414 -#define wxPrintDialogData_SetNoCopies 2415 -#define wxPrintDialogData_SetPrintData 2416 -#define wxPrintDialogData_SetPrintToFile 2417 -#define wxPrintDialogData_SetSelection 2418 -#define wxPrintDialogData_SetToPage 2419 -#define wxPrintData_new_0 2420 -#define wxPrintData_new_1 2421 -#define wxPrintData_destruct 2422 -#define wxPrintData_GetCollate 2423 -#define wxPrintData_GetBin 2424 -#define wxPrintData_GetColour 2425 -#define wxPrintData_GetDuplex 2426 -#define wxPrintData_GetNoCopies 2427 -#define wxPrintData_GetOrientation 2428 -#define wxPrintData_GetPaperId 2429 -#define wxPrintData_GetPrinterName 2430 -#define wxPrintData_GetQuality 2431 -#define wxPrintData_IsOk 2432 -#define wxPrintData_SetBin 2433 -#define wxPrintData_SetCollate 2434 -#define wxPrintData_SetColour 2435 -#define wxPrintData_SetDuplex 2436 -#define wxPrintData_SetNoCopies 2437 -#define wxPrintData_SetOrientation 2438 -#define wxPrintData_SetPaperId 2439 -#define wxPrintData_SetPrinterName 2440 -#define wxPrintData_SetQuality 2441 -#define wxPrintPreview_new_2 2444 -#define wxPrintPreview_new_3 2445 -#define wxPrintPreview_destruct 2447 -#define wxPrintPreview_GetCanvas 2448 -#define wxPrintPreview_GetCurrentPage 2449 -#define wxPrintPreview_GetFrame 2450 -#define wxPrintPreview_GetMaxPage 2451 -#define wxPrintPreview_GetMinPage 2452 -#define wxPrintPreview_GetPrintout 2453 -#define wxPrintPreview_GetPrintoutForPrinting 2454 -#define wxPrintPreview_IsOk 2455 -#define wxPrintPreview_PaintPage 2456 -#define wxPrintPreview_Print 2457 -#define wxPrintPreview_RenderPage 2458 -#define wxPrintPreview_SetCanvas 2459 -#define wxPrintPreview_SetCurrentPage 2460 -#define wxPrintPreview_SetFrame 2461 -#define wxPrintPreview_SetPrintout 2462 -#define wxPrintPreview_SetZoom 2463 -#define wxPreviewFrame_new 2464 -#define wxPreviewFrame_destruct 2465 -#define wxPreviewFrame_CreateControlBar 2466 -#define wxPreviewFrame_CreateCanvas 2467 -#define wxPreviewFrame_Initialize 2468 -#define wxPreviewFrame_OnCloseWindow 2469 -#define wxPreviewControlBar_new 2470 -#define wxPreviewControlBar_destruct 2471 -#define wxPreviewControlBar_CreateButtons 2472 -#define wxPreviewControlBar_GetPrintPreview 2473 -#define wxPreviewControlBar_GetZoomControl 2474 -#define wxPreviewControlBar_SetZoomControl 2475 -#define wxPrinter_new 2477 -#define wxPrinter_CreateAbortWindow 2478 -#define wxPrinter_GetAbort 2479 -#define wxPrinter_GetLastError 2480 -#define wxPrinter_GetPrintDialogData 2481 -#define wxPrinter_Print 2482 -#define wxPrinter_PrintDialog 2483 -#define wxPrinter_ReportError 2484 -#define wxPrinter_Setup 2485 -#define wxPrinter_destroy 2486 -#define wxXmlResource_new_1 2487 -#define wxXmlResource_new_2 2488 -#define wxXmlResource_destruct 2489 -#define wxXmlResource_AttachUnknownControl 2490 -#define wxXmlResource_ClearHandlers 2491 -#define wxXmlResource_CompareVersion 2492 -#define wxXmlResource_Get 2493 -#define wxXmlResource_GetFlags 2494 -#define wxXmlResource_GetVersion 2495 -#define wxXmlResource_GetXRCID 2496 -#define wxXmlResource_InitAllHandlers 2497 -#define wxXmlResource_Load 2498 -#define wxXmlResource_LoadBitmap 2499 -#define wxXmlResource_LoadDialog_2 2500 -#define wxXmlResource_LoadDialog_3 2501 -#define wxXmlResource_LoadFrame_2 2502 -#define wxXmlResource_LoadFrame_3 2503 -#define wxXmlResource_LoadIcon 2504 -#define wxXmlResource_LoadMenu 2505 -#define wxXmlResource_LoadMenuBar_2 2506 -#define wxXmlResource_LoadMenuBar_1 2507 -#define wxXmlResource_LoadPanel_2 2508 -#define wxXmlResource_LoadPanel_3 2509 -#define wxXmlResource_LoadToolBar 2510 -#define wxXmlResource_Set 2511 -#define wxXmlResource_SetFlags 2512 -#define wxXmlResource_Unload 2513 -#define wxXmlResource_xrcctrl 2514 -#define wxHtmlEasyPrinting_new 2515 -#define wxHtmlEasyPrinting_destruct 2516 -#define wxHtmlEasyPrinting_GetPrintData 2517 -#define wxHtmlEasyPrinting_GetPageSetupData 2518 -#define wxHtmlEasyPrinting_PreviewFile 2519 -#define wxHtmlEasyPrinting_PreviewText 2520 -#define wxHtmlEasyPrinting_PrintFile 2521 -#define wxHtmlEasyPrinting_PrintText 2522 -#define wxHtmlEasyPrinting_PageSetup 2523 -#define wxHtmlEasyPrinting_SetFonts 2524 -#define wxHtmlEasyPrinting_SetHeader 2525 -#define wxHtmlEasyPrinting_SetFooter 2526 -#define wxGLCanvas_new_2 2528 -#define wxGLCanvas_new_3_1 2529 -#define wxGLCanvas_new_3_0 2530 -#define wxGLCanvas_GetContext 2531 -#define wxGLCanvas_SetCurrent 2533 -#define wxGLCanvas_SwapBuffers 2534 -#define wxGLCanvas_destroy 2535 -#define wxAuiManager_new 2536 -#define wxAuiManager_destruct 2537 -#define wxAuiManager_AddPane_2_1 2538 -#define wxAuiManager_AddPane_3 2539 -#define wxAuiManager_AddPane_2_0 2540 -#define wxAuiManager_DetachPane 2541 -#define wxAuiManager_GetAllPanes 2542 -#define wxAuiManager_GetArtProvider 2543 -#define wxAuiManager_GetDockSizeConstraint 2544 -#define wxAuiManager_GetFlags 2545 -#define wxAuiManager_GetManagedWindow 2546 -#define wxAuiManager_GetManager 2547 -#define wxAuiManager_GetPane_1_1 2548 -#define wxAuiManager_GetPane_1_0 2549 -#define wxAuiManager_HideHint 2550 -#define wxAuiManager_InsertPane 2551 -#define wxAuiManager_LoadPaneInfo 2552 -#define wxAuiManager_LoadPerspective 2553 -#define wxAuiManager_SavePaneInfo 2554 -#define wxAuiManager_SavePerspective 2555 -#define wxAuiManager_SetArtProvider 2556 -#define wxAuiManager_SetDockSizeConstraint 2557 -#define wxAuiManager_SetFlags 2558 -#define wxAuiManager_SetManagedWindow 2559 -#define wxAuiManager_ShowHint 2560 -#define wxAuiManager_UnInit 2561 -#define wxAuiManager_Update 2562 -#define wxAuiPaneInfo_new_0 2563 -#define wxAuiPaneInfo_new_1 2564 -#define wxAuiPaneInfo_destruct 2565 -#define wxAuiPaneInfo_BestSize_1 2566 -#define wxAuiPaneInfo_BestSize_2 2567 -#define wxAuiPaneInfo_Bottom 2568 -#define wxAuiPaneInfo_BottomDockable 2569 -#define wxAuiPaneInfo_Caption 2570 -#define wxAuiPaneInfo_CaptionVisible 2571 -#define wxAuiPaneInfo_Centre 2572 -#define wxAuiPaneInfo_CentrePane 2573 -#define wxAuiPaneInfo_CloseButton 2574 -#define wxAuiPaneInfo_DefaultPane 2575 -#define wxAuiPaneInfo_DestroyOnClose 2576 -#define wxAuiPaneInfo_Direction 2577 -#define wxAuiPaneInfo_Dock 2578 -#define wxAuiPaneInfo_Dockable 2579 -#define wxAuiPaneInfo_Fixed 2580 -#define wxAuiPaneInfo_Float 2581 -#define wxAuiPaneInfo_Floatable 2582 -#define wxAuiPaneInfo_FloatingPosition_1 2583 -#define wxAuiPaneInfo_FloatingPosition_2 2584 -#define wxAuiPaneInfo_FloatingSize_1 2585 -#define wxAuiPaneInfo_FloatingSize_2 2586 -#define wxAuiPaneInfo_Gripper 2587 -#define wxAuiPaneInfo_GripperTop 2588 -#define wxAuiPaneInfo_HasBorder 2589 -#define wxAuiPaneInfo_HasCaption 2590 -#define wxAuiPaneInfo_HasCloseButton 2591 -#define wxAuiPaneInfo_HasFlag 2592 -#define wxAuiPaneInfo_HasGripper 2593 -#define wxAuiPaneInfo_HasGripperTop 2594 -#define wxAuiPaneInfo_HasMaximizeButton 2595 -#define wxAuiPaneInfo_HasMinimizeButton 2596 -#define wxAuiPaneInfo_HasPinButton 2597 -#define wxAuiPaneInfo_Hide 2598 -#define wxAuiPaneInfo_IsBottomDockable 2599 -#define wxAuiPaneInfo_IsDocked 2600 -#define wxAuiPaneInfo_IsFixed 2601 -#define wxAuiPaneInfo_IsFloatable 2602 -#define wxAuiPaneInfo_IsFloating 2603 -#define wxAuiPaneInfo_IsLeftDockable 2604 -#define wxAuiPaneInfo_IsMovable 2605 -#define wxAuiPaneInfo_IsOk 2606 -#define wxAuiPaneInfo_IsResizable 2607 -#define wxAuiPaneInfo_IsRightDockable 2608 -#define wxAuiPaneInfo_IsShown 2609 -#define wxAuiPaneInfo_IsToolbar 2610 -#define wxAuiPaneInfo_IsTopDockable 2611 -#define wxAuiPaneInfo_Layer 2612 -#define wxAuiPaneInfo_Left 2613 -#define wxAuiPaneInfo_LeftDockable 2614 -#define wxAuiPaneInfo_MaxSize_1 2615 -#define wxAuiPaneInfo_MaxSize_2 2616 -#define wxAuiPaneInfo_MaximizeButton 2617 -#define wxAuiPaneInfo_MinSize_1 2618 -#define wxAuiPaneInfo_MinSize_2 2619 -#define wxAuiPaneInfo_MinimizeButton 2620 -#define wxAuiPaneInfo_Movable 2621 -#define wxAuiPaneInfo_Name 2622 -#define wxAuiPaneInfo_PaneBorder 2623 -#define wxAuiPaneInfo_PinButton 2624 -#define wxAuiPaneInfo_Position 2625 -#define wxAuiPaneInfo_Resizable 2626 -#define wxAuiPaneInfo_Right 2627 -#define wxAuiPaneInfo_RightDockable 2628 -#define wxAuiPaneInfo_Row 2629 -#define wxAuiPaneInfo_SafeSet 2630 -#define wxAuiPaneInfo_SetFlag 2631 -#define wxAuiPaneInfo_Show 2632 -#define wxAuiPaneInfo_ToolbarPane 2633 -#define wxAuiPaneInfo_Top 2634 -#define wxAuiPaneInfo_TopDockable 2635 -#define wxAuiPaneInfo_Window 2636 -#define wxAuiNotebook_new_0 2637 -#define wxAuiNotebook_new_2 2638 -#define wxAuiNotebook_AddPage 2639 -#define wxAuiNotebook_Create 2640 -#define wxAuiNotebook_DeletePage 2641 -#define wxAuiNotebook_GetArtProvider 2642 -#define wxAuiNotebook_GetPage 2643 -#define wxAuiNotebook_GetPageBitmap 2644 -#define wxAuiNotebook_GetPageCount 2645 -#define wxAuiNotebook_GetPageIndex 2646 -#define wxAuiNotebook_GetPageText 2647 -#define wxAuiNotebook_GetSelection 2648 -#define wxAuiNotebook_InsertPage 2649 -#define wxAuiNotebook_RemovePage 2650 -#define wxAuiNotebook_SetArtProvider 2651 -#define wxAuiNotebook_SetFont 2652 -#define wxAuiNotebook_SetPageBitmap 2653 -#define wxAuiNotebook_SetPageText 2654 -#define wxAuiNotebook_SetSelection 2655 -#define wxAuiNotebook_SetTabCtrlHeight 2656 -#define wxAuiNotebook_SetUniformBitmapSize 2657 -#define wxAuiNotebook_destroy 2658 -#define wxMDIParentFrame_new_0 2659 -#define wxMDIParentFrame_new_4 2660 -#define wxMDIParentFrame_destruct 2661 -#define wxMDIParentFrame_ActivateNext 2662 -#define wxMDIParentFrame_ActivatePrevious 2663 -#define wxMDIParentFrame_ArrangeIcons 2664 -#define wxMDIParentFrame_Cascade 2665 -#define wxMDIParentFrame_Create 2666 -#define wxMDIParentFrame_GetActiveChild 2667 -#define wxMDIParentFrame_GetClientWindow 2668 -#define wxMDIParentFrame_Tile 2669 -#define wxMDIChildFrame_new_0 2670 -#define wxMDIChildFrame_new_4 2671 -#define wxMDIChildFrame_destruct 2672 -#define wxMDIChildFrame_Activate 2673 -#define wxMDIChildFrame_Create 2674 -#define wxMDIChildFrame_Maximize 2675 -#define wxMDIChildFrame_Restore 2676 -#define wxMDIClientWindow_new_0 2677 -#define wxMDIClientWindow_new_2 2678 -#define wxMDIClientWindow_destruct 2679 -#define wxMDIClientWindow_CreateClient 2680 -#define wxLayoutAlgorithm_new 2681 -#define wxLayoutAlgorithm_LayoutFrame 2682 -#define wxLayoutAlgorithm_LayoutMDIFrame 2683 -#define wxLayoutAlgorithm_LayoutWindow 2684 -#define wxLayoutAlgorithm_destroy 2685 -#define wxEvent_GetId 2686 -#define wxEvent_GetSkipped 2687 -#define wxEvent_GetTimestamp 2688 -#define wxEvent_IsCommandEvent 2689 -#define wxEvent_ResumePropagation 2690 -#define wxEvent_ShouldPropagate 2691 -#define wxEvent_Skip 2692 -#define wxEvent_StopPropagation 2693 -#define wxCommandEvent_getClientData 2694 -#define wxCommandEvent_GetExtraLong 2695 -#define wxCommandEvent_GetInt 2696 -#define wxCommandEvent_GetSelection 2697 -#define wxCommandEvent_GetString 2698 -#define wxCommandEvent_IsChecked 2699 -#define wxCommandEvent_IsSelection 2700 -#define wxCommandEvent_SetInt 2701 -#define wxCommandEvent_SetString 2702 -#define wxScrollEvent_GetOrientation 2703 -#define wxScrollEvent_GetPosition 2704 -#define wxScrollWinEvent_GetOrientation 2705 -#define wxScrollWinEvent_GetPosition 2706 -#define wxMouseEvent_AltDown 2707 -#define wxMouseEvent_Button 2708 -#define wxMouseEvent_ButtonDClick 2709 -#define wxMouseEvent_ButtonDown 2710 -#define wxMouseEvent_ButtonUp 2711 -#define wxMouseEvent_CmdDown 2712 -#define wxMouseEvent_ControlDown 2713 -#define wxMouseEvent_Dragging 2714 -#define wxMouseEvent_Entering 2715 -#define wxMouseEvent_GetButton 2716 -#define wxMouseEvent_GetPosition 2719 -#define wxMouseEvent_GetLogicalPosition 2720 -#define wxMouseEvent_GetLinesPerAction 2721 -#define wxMouseEvent_GetWheelRotation 2722 -#define wxMouseEvent_GetWheelDelta 2723 -#define wxMouseEvent_GetX 2724 -#define wxMouseEvent_GetY 2725 -#define wxMouseEvent_IsButton 2726 -#define wxMouseEvent_IsPageScroll 2727 -#define wxMouseEvent_Leaving 2728 -#define wxMouseEvent_LeftDClick 2729 -#define wxMouseEvent_LeftDown 2730 -#define wxMouseEvent_LeftIsDown 2731 -#define wxMouseEvent_LeftUp 2732 -#define wxMouseEvent_MetaDown 2733 -#define wxMouseEvent_MiddleDClick 2734 -#define wxMouseEvent_MiddleDown 2735 -#define wxMouseEvent_MiddleIsDown 2736 -#define wxMouseEvent_MiddleUp 2737 -#define wxMouseEvent_Moving 2738 -#define wxMouseEvent_RightDClick 2739 -#define wxMouseEvent_RightDown 2740 -#define wxMouseEvent_RightIsDown 2741 -#define wxMouseEvent_RightUp 2742 -#define wxMouseEvent_ShiftDown 2743 -#define wxSetCursorEvent_GetCursor 2744 -#define wxSetCursorEvent_GetX 2745 -#define wxSetCursorEvent_GetY 2746 -#define wxSetCursorEvent_HasCursor 2747 -#define wxSetCursorEvent_SetCursor 2748 -#define wxKeyEvent_AltDown 2749 -#define wxKeyEvent_CmdDown 2750 -#define wxKeyEvent_ControlDown 2751 -#define wxKeyEvent_GetKeyCode 2752 -#define wxKeyEvent_GetModifiers 2753 -#define wxKeyEvent_GetPosition 2756 -#define wxKeyEvent_GetRawKeyCode 2757 -#define wxKeyEvent_GetRawKeyFlags 2758 -#define wxKeyEvent_GetUnicodeKey 2759 -#define wxKeyEvent_GetX 2760 -#define wxKeyEvent_GetY 2761 -#define wxKeyEvent_HasModifiers 2762 -#define wxKeyEvent_MetaDown 2763 -#define wxKeyEvent_ShiftDown 2764 -#define wxSizeEvent_GetSize 2765 -#define wxMoveEvent_GetPosition 2766 -#define wxEraseEvent_GetDC 2767 -#define wxFocusEvent_GetWindow 2768 -#define wxChildFocusEvent_GetWindow 2769 -#define wxMenuEvent_GetMenu 2770 -#define wxMenuEvent_GetMenuId 2771 -#define wxMenuEvent_IsPopup 2772 -#define wxCloseEvent_CanVeto 2773 -#define wxCloseEvent_GetLoggingOff 2774 -#define wxCloseEvent_SetCanVeto 2775 -#define wxCloseEvent_SetLoggingOff 2776 -#define wxCloseEvent_Veto 2777 -#define wxShowEvent_SetShow 2778 -#define wxShowEvent_GetShow 2779 -#define wxIconizeEvent_Iconized 2780 -#define wxJoystickEvent_ButtonDown 2781 -#define wxJoystickEvent_ButtonIsDown 2782 -#define wxJoystickEvent_ButtonUp 2783 -#define wxJoystickEvent_GetButtonChange 2784 -#define wxJoystickEvent_GetButtonState 2785 -#define wxJoystickEvent_GetJoystick 2786 -#define wxJoystickEvent_GetPosition 2787 -#define wxJoystickEvent_GetZPosition 2788 -#define wxJoystickEvent_IsButton 2789 -#define wxJoystickEvent_IsMove 2790 -#define wxJoystickEvent_IsZMove 2791 -#define wxUpdateUIEvent_CanUpdate 2792 -#define wxUpdateUIEvent_Check 2793 -#define wxUpdateUIEvent_Enable 2794 -#define wxUpdateUIEvent_Show 2795 -#define wxUpdateUIEvent_GetChecked 2796 -#define wxUpdateUIEvent_GetEnabled 2797 -#define wxUpdateUIEvent_GetShown 2798 -#define wxUpdateUIEvent_GetSetChecked 2799 -#define wxUpdateUIEvent_GetSetEnabled 2800 -#define wxUpdateUIEvent_GetSetShown 2801 -#define wxUpdateUIEvent_GetSetText 2802 -#define wxUpdateUIEvent_GetText 2803 -#define wxUpdateUIEvent_GetMode 2804 -#define wxUpdateUIEvent_GetUpdateInterval 2805 -#define wxUpdateUIEvent_ResetUpdateTime 2806 -#define wxUpdateUIEvent_SetMode 2807 -#define wxUpdateUIEvent_SetText 2808 -#define wxUpdateUIEvent_SetUpdateInterval 2809 -#define wxMouseCaptureChangedEvent_GetCapturedWindow 2810 -#define wxPaletteChangedEvent_SetChangedWindow 2811 -#define wxPaletteChangedEvent_GetChangedWindow 2812 -#define wxQueryNewPaletteEvent_SetPaletteRealized 2813 -#define wxQueryNewPaletteEvent_GetPaletteRealized 2814 -#define wxNavigationKeyEvent_GetDirection 2815 -#define wxNavigationKeyEvent_SetDirection 2816 -#define wxNavigationKeyEvent_IsWindowChange 2817 -#define wxNavigationKeyEvent_SetWindowChange 2818 -#define wxNavigationKeyEvent_IsFromTab 2819 -#define wxNavigationKeyEvent_SetFromTab 2820 -#define wxNavigationKeyEvent_GetCurrentFocus 2821 -#define wxNavigationKeyEvent_SetCurrentFocus 2822 -#define wxHelpEvent_GetOrigin 2823 -#define wxHelpEvent_GetPosition 2824 -#define wxHelpEvent_SetOrigin 2825 -#define wxHelpEvent_SetPosition 2826 -#define wxContextMenuEvent_GetPosition 2827 -#define wxContextMenuEvent_SetPosition 2828 -#define wxIdleEvent_CanSend 2829 -#define wxIdleEvent_GetMode 2830 -#define wxIdleEvent_RequestMore 2831 -#define wxIdleEvent_MoreRequested 2832 -#define wxIdleEvent_SetMode 2833 -#define wxGridEvent_AltDown 2834 -#define wxGridEvent_ControlDown 2835 -#define wxGridEvent_GetCol 2836 -#define wxGridEvent_GetPosition 2837 -#define wxGridEvent_GetRow 2838 -#define wxGridEvent_MetaDown 2839 -#define wxGridEvent_Selecting 2840 -#define wxGridEvent_ShiftDown 2841 -#define wxNotifyEvent_Allow 2842 -#define wxNotifyEvent_IsAllowed 2843 -#define wxNotifyEvent_Veto 2844 -#define wxSashEvent_GetEdge 2845 -#define wxSashEvent_GetDragRect 2846 -#define wxSashEvent_GetDragStatus 2847 -#define wxListEvent_GetCacheFrom 2848 -#define wxListEvent_GetCacheTo 2849 -#define wxListEvent_GetKeyCode 2850 -#define wxListEvent_GetIndex 2851 -#define wxListEvent_GetColumn 2852 -#define wxListEvent_GetPoint 2853 -#define wxListEvent_GetLabel 2854 -#define wxListEvent_GetText 2855 -#define wxListEvent_GetImage 2856 -#define wxListEvent_GetData 2857 -#define wxListEvent_GetMask 2858 -#define wxListEvent_GetItem 2859 -#define wxListEvent_IsEditCancelled 2860 -#define wxDateEvent_GetDate 2861 -#define wxCalendarEvent_GetWeekDay 2862 -#define wxFileDirPickerEvent_GetPath 2863 -#define wxColourPickerEvent_GetColour 2864 -#define wxFontPickerEvent_GetFont 2865 -#define wxStyledTextEvent_GetPosition 2866 -#define wxStyledTextEvent_GetKey 2867 -#define wxStyledTextEvent_GetModifiers 2868 -#define wxStyledTextEvent_GetModificationType 2869 -#define wxStyledTextEvent_GetText 2870 -#define wxStyledTextEvent_GetLength 2871 -#define wxStyledTextEvent_GetLinesAdded 2872 -#define wxStyledTextEvent_GetLine 2873 -#define wxStyledTextEvent_GetFoldLevelNow 2874 -#define wxStyledTextEvent_GetFoldLevelPrev 2875 -#define wxStyledTextEvent_GetMargin 2876 -#define wxStyledTextEvent_GetMessage 2877 -#define wxStyledTextEvent_GetWParam 2878 -#define wxStyledTextEvent_GetLParam 2879 -#define wxStyledTextEvent_GetListType 2880 -#define wxStyledTextEvent_GetX 2881 -#define wxStyledTextEvent_GetY 2882 -#define wxStyledTextEvent_GetDragText 2883 -#define wxStyledTextEvent_GetDragAllowMove 2884 -#define wxStyledTextEvent_GetDragResult 2885 -#define wxStyledTextEvent_GetShift 2886 -#define wxStyledTextEvent_GetControl 2887 -#define wxStyledTextEvent_GetAlt 2888 -#define utils_wxGetKeyState 2889 -#define utils_wxGetMousePosition 2890 -#define utils_wxGetMouseState 2891 -#define utils_wxSetDetectableAutoRepeat 2892 -#define utils_wxBell 2893 -#define utils_wxFindMenuItemId 2894 -#define utils_wxGenericFindWindowAtPoint 2895 -#define utils_wxFindWindowAtPoint 2896 -#define utils_wxBeginBusyCursor 2897 -#define utils_wxEndBusyCursor 2898 -#define utils_wxIsBusy 2899 -#define utils_wxShutdown 2900 -#define utils_wxShell 2901 -#define utils_wxLaunchDefaultBrowser 2902 -#define utils_wxGetEmailAddress 2903 -#define utils_wxGetUserId 2904 -#define utils_wxGetHomeDir 2905 -#define utils_wxNewId 2906 -#define utils_wxRegisterId 2907 -#define utils_wxGetCurrentId 2908 -#define utils_wxGetOsDescription 2909 -#define utils_wxIsPlatformLittleEndian 2910 -#define utils_wxIsPlatform64Bit 2911 -#define wxPrintout_new 2912 -#define wxPrintout_destruct 2913 -#define wxPrintout_GetDC 2914 -#define wxPrintout_GetPageSizeMM 2915 -#define wxPrintout_GetPageSizePixels 2916 -#define wxPrintout_GetPaperRectPixels 2917 -#define wxPrintout_GetPPIPrinter 2918 -#define wxPrintout_GetPPIScreen 2919 -#define wxPrintout_GetTitle 2920 -#define wxPrintout_IsPreview 2921 -#define wxPrintout_FitThisSizeToPaper 2922 -#define wxPrintout_FitThisSizeToPage 2923 -#define wxPrintout_FitThisSizeToPageMargins 2924 -#define wxPrintout_MapScreenSizeToPaper 2925 -#define wxPrintout_MapScreenSizeToPage 2926 -#define wxPrintout_MapScreenSizeToPageMargins 2927 -#define wxPrintout_MapScreenSizeToDevice 2928 -#define wxPrintout_GetLogicalPaperRect 2929 -#define wxPrintout_GetLogicalPageRect 2930 -#define wxPrintout_GetLogicalPageMarginsRect 2931 -#define wxPrintout_SetLogicalOrigin 2932 -#define wxPrintout_OffsetLogicalOrigin 2933 -#define wxStyledTextCtrl_new_2 2934 -#define wxStyledTextCtrl_new_0 2935 -#define wxStyledTextCtrl_destruct 2936 -#define wxStyledTextCtrl_Create 2937 -#define wxStyledTextCtrl_AddText 2938 -#define wxStyledTextCtrl_AddStyledText 2939 -#define wxStyledTextCtrl_InsertText 2940 -#define wxStyledTextCtrl_ClearAll 2941 -#define wxStyledTextCtrl_ClearDocumentStyle 2942 -#define wxStyledTextCtrl_GetLength 2943 -#define wxStyledTextCtrl_GetCharAt 2944 -#define wxStyledTextCtrl_GetCurrentPos 2945 -#define wxStyledTextCtrl_GetAnchor 2946 -#define wxStyledTextCtrl_GetStyleAt 2947 -#define wxStyledTextCtrl_Redo 2948 -#define wxStyledTextCtrl_SetUndoCollection 2949 -#define wxStyledTextCtrl_SelectAll 2950 -#define wxStyledTextCtrl_SetSavePoint 2951 -#define wxStyledTextCtrl_GetStyledText 2952 -#define wxStyledTextCtrl_CanRedo 2953 -#define wxStyledTextCtrl_MarkerLineFromHandle 2954 -#define wxStyledTextCtrl_MarkerDeleteHandle 2955 -#define wxStyledTextCtrl_GetUndoCollection 2956 -#define wxStyledTextCtrl_GetViewWhiteSpace 2957 -#define wxStyledTextCtrl_SetViewWhiteSpace 2958 -#define wxStyledTextCtrl_PositionFromPoint 2959 -#define wxStyledTextCtrl_PositionFromPointClose 2960 -#define wxStyledTextCtrl_GotoLine 2961 -#define wxStyledTextCtrl_GotoPos 2962 -#define wxStyledTextCtrl_SetAnchor 2963 -#define wxStyledTextCtrl_GetCurLine 2964 -#define wxStyledTextCtrl_GetEndStyled 2965 -#define wxStyledTextCtrl_ConvertEOLs 2966 -#define wxStyledTextCtrl_GetEOLMode 2967 -#define wxStyledTextCtrl_SetEOLMode 2968 -#define wxStyledTextCtrl_StartStyling 2969 -#define wxStyledTextCtrl_SetStyling 2970 -#define wxStyledTextCtrl_GetBufferedDraw 2971 -#define wxStyledTextCtrl_SetBufferedDraw 2972 -#define wxStyledTextCtrl_SetTabWidth 2973 -#define wxStyledTextCtrl_GetTabWidth 2974 -#define wxStyledTextCtrl_SetCodePage 2975 -#define wxStyledTextCtrl_MarkerDefine 2976 -#define wxStyledTextCtrl_MarkerSetForeground 2977 -#define wxStyledTextCtrl_MarkerSetBackground 2978 -#define wxStyledTextCtrl_MarkerAdd 2979 -#define wxStyledTextCtrl_MarkerDelete 2980 -#define wxStyledTextCtrl_MarkerDeleteAll 2981 -#define wxStyledTextCtrl_MarkerGet 2982 -#define wxStyledTextCtrl_MarkerNext 2983 -#define wxStyledTextCtrl_MarkerPrevious 2984 -#define wxStyledTextCtrl_MarkerDefineBitmap 2985 -#define wxStyledTextCtrl_MarkerAddSet 2986 -#define wxStyledTextCtrl_MarkerSetAlpha 2987 -#define wxStyledTextCtrl_SetMarginType 2988 -#define wxStyledTextCtrl_GetMarginType 2989 -#define wxStyledTextCtrl_SetMarginWidth 2990 -#define wxStyledTextCtrl_GetMarginWidth 2991 -#define wxStyledTextCtrl_SetMarginMask 2992 -#define wxStyledTextCtrl_GetMarginMask 2993 -#define wxStyledTextCtrl_SetMarginSensitive 2994 -#define wxStyledTextCtrl_GetMarginSensitive 2995 -#define wxStyledTextCtrl_StyleClearAll 2996 -#define wxStyledTextCtrl_StyleSetForeground 2997 -#define wxStyledTextCtrl_StyleSetBackground 2998 -#define wxStyledTextCtrl_StyleSetBold 2999 -#define wxStyledTextCtrl_StyleSetItalic 3000 -#define wxStyledTextCtrl_StyleSetSize 3001 -#define wxStyledTextCtrl_StyleSetFaceName 3002 -#define wxStyledTextCtrl_StyleSetEOLFilled 3003 -#define wxStyledTextCtrl_StyleResetDefault 3004 -#define wxStyledTextCtrl_StyleSetUnderline 3005 -#define wxStyledTextCtrl_StyleSetCase 3006 -#define wxStyledTextCtrl_StyleSetHotSpot 3007 -#define wxStyledTextCtrl_SetSelForeground 3008 -#define wxStyledTextCtrl_SetSelBackground 3009 -#define wxStyledTextCtrl_GetSelAlpha 3010 -#define wxStyledTextCtrl_SetSelAlpha 3011 -#define wxStyledTextCtrl_SetCaretForeground 3012 -#define wxStyledTextCtrl_CmdKeyAssign 3013 -#define wxStyledTextCtrl_CmdKeyClear 3014 -#define wxStyledTextCtrl_CmdKeyClearAll 3015 -#define wxStyledTextCtrl_SetStyleBytes 3016 -#define wxStyledTextCtrl_StyleSetVisible 3017 -#define wxStyledTextCtrl_GetCaretPeriod 3018 -#define wxStyledTextCtrl_SetCaretPeriod 3019 -#define wxStyledTextCtrl_SetWordChars 3020 -#define wxStyledTextCtrl_BeginUndoAction 3021 -#define wxStyledTextCtrl_EndUndoAction 3022 -#define wxStyledTextCtrl_IndicatorSetStyle 3023 -#define wxStyledTextCtrl_IndicatorGetStyle 3024 -#define wxStyledTextCtrl_IndicatorSetForeground 3025 -#define wxStyledTextCtrl_IndicatorGetForeground 3026 -#define wxStyledTextCtrl_SetWhitespaceForeground 3027 -#define wxStyledTextCtrl_SetWhitespaceBackground 3028 -#define wxStyledTextCtrl_GetStyleBits 3029 -#define wxStyledTextCtrl_SetLineState 3030 -#define wxStyledTextCtrl_GetLineState 3031 -#define wxStyledTextCtrl_GetMaxLineState 3032 -#define wxStyledTextCtrl_GetCaretLineVisible 3033 -#define wxStyledTextCtrl_SetCaretLineVisible 3034 -#define wxStyledTextCtrl_GetCaretLineBackground 3035 -#define wxStyledTextCtrl_SetCaretLineBackground 3036 -#define wxStyledTextCtrl_AutoCompShow 3037 -#define wxStyledTextCtrl_AutoCompCancel 3038 -#define wxStyledTextCtrl_AutoCompActive 3039 -#define wxStyledTextCtrl_AutoCompPosStart 3040 -#define wxStyledTextCtrl_AutoCompComplete 3041 -#define wxStyledTextCtrl_AutoCompStops 3042 -#define wxStyledTextCtrl_AutoCompSetSeparator 3043 -#define wxStyledTextCtrl_AutoCompGetSeparator 3044 -#define wxStyledTextCtrl_AutoCompSelect 3045 -#define wxStyledTextCtrl_AutoCompSetCancelAtStart 3046 -#define wxStyledTextCtrl_AutoCompGetCancelAtStart 3047 -#define wxStyledTextCtrl_AutoCompSetFillUps 3048 -#define wxStyledTextCtrl_AutoCompSetChooseSingle 3049 -#define wxStyledTextCtrl_AutoCompGetChooseSingle 3050 -#define wxStyledTextCtrl_AutoCompSetIgnoreCase 3051 -#define wxStyledTextCtrl_AutoCompGetIgnoreCase 3052 -#define wxStyledTextCtrl_UserListShow 3053 -#define wxStyledTextCtrl_AutoCompSetAutoHide 3054 -#define wxStyledTextCtrl_AutoCompGetAutoHide 3055 -#define wxStyledTextCtrl_AutoCompSetDropRestOfWord 3056 -#define wxStyledTextCtrl_AutoCompGetDropRestOfWord 3057 -#define wxStyledTextCtrl_RegisterImage 3058 -#define wxStyledTextCtrl_ClearRegisteredImages 3059 -#define wxStyledTextCtrl_AutoCompGetTypeSeparator 3060 -#define wxStyledTextCtrl_AutoCompSetTypeSeparator 3061 -#define wxStyledTextCtrl_AutoCompSetMaxWidth 3062 -#define wxStyledTextCtrl_AutoCompGetMaxWidth 3063 -#define wxStyledTextCtrl_AutoCompSetMaxHeight 3064 -#define wxStyledTextCtrl_AutoCompGetMaxHeight 3065 -#define wxStyledTextCtrl_SetIndent 3066 -#define wxStyledTextCtrl_GetIndent 3067 -#define wxStyledTextCtrl_SetUseTabs 3068 -#define wxStyledTextCtrl_GetUseTabs 3069 -#define wxStyledTextCtrl_SetLineIndentation 3070 -#define wxStyledTextCtrl_GetLineIndentation 3071 -#define wxStyledTextCtrl_GetLineIndentPosition 3072 -#define wxStyledTextCtrl_GetColumn 3073 -#define wxStyledTextCtrl_SetUseHorizontalScrollBar 3074 -#define wxStyledTextCtrl_GetUseHorizontalScrollBar 3075 -#define wxStyledTextCtrl_SetIndentationGuides 3076 -#define wxStyledTextCtrl_GetIndentationGuides 3077 -#define wxStyledTextCtrl_SetHighlightGuide 3078 -#define wxStyledTextCtrl_GetHighlightGuide 3079 -#define wxStyledTextCtrl_GetLineEndPosition 3080 -#define wxStyledTextCtrl_GetCodePage 3081 -#define wxStyledTextCtrl_GetCaretForeground 3082 -#define wxStyledTextCtrl_GetReadOnly 3083 -#define wxStyledTextCtrl_SetCurrentPos 3084 -#define wxStyledTextCtrl_SetSelectionStart 3085 -#define wxStyledTextCtrl_GetSelectionStart 3086 -#define wxStyledTextCtrl_SetSelectionEnd 3087 -#define wxStyledTextCtrl_GetSelectionEnd 3088 -#define wxStyledTextCtrl_SetPrintMagnification 3089 -#define wxStyledTextCtrl_GetPrintMagnification 3090 -#define wxStyledTextCtrl_SetPrintColourMode 3091 -#define wxStyledTextCtrl_GetPrintColourMode 3092 -#define wxStyledTextCtrl_FindText 3093 -#define wxStyledTextCtrl_FormatRange 3094 -#define wxStyledTextCtrl_GetFirstVisibleLine 3095 -#define wxStyledTextCtrl_GetLine 3096 -#define wxStyledTextCtrl_GetLineCount 3097 -#define wxStyledTextCtrl_SetMarginLeft 3098 -#define wxStyledTextCtrl_GetMarginLeft 3099 -#define wxStyledTextCtrl_SetMarginRight 3100 -#define wxStyledTextCtrl_GetMarginRight 3101 -#define wxStyledTextCtrl_GetModify 3102 -#define wxStyledTextCtrl_SetSelection 3103 -#define wxStyledTextCtrl_GetSelectedText 3104 -#define wxStyledTextCtrl_GetTextRange 3105 -#define wxStyledTextCtrl_HideSelection 3106 -#define wxStyledTextCtrl_LineFromPosition 3107 -#define wxStyledTextCtrl_PositionFromLine 3108 -#define wxStyledTextCtrl_LineScroll 3109 -#define wxStyledTextCtrl_EnsureCaretVisible 3110 -#define wxStyledTextCtrl_ReplaceSelection 3111 -#define wxStyledTextCtrl_SetReadOnly 3112 -#define wxStyledTextCtrl_CanPaste 3113 -#define wxStyledTextCtrl_CanUndo 3114 -#define wxStyledTextCtrl_EmptyUndoBuffer 3115 -#define wxStyledTextCtrl_Undo 3116 -#define wxStyledTextCtrl_Cut 3117 -#define wxStyledTextCtrl_Copy 3118 -#define wxStyledTextCtrl_Paste 3119 -#define wxStyledTextCtrl_Clear 3120 -#define wxStyledTextCtrl_SetText 3121 -#define wxStyledTextCtrl_GetText 3122 -#define wxStyledTextCtrl_GetTextLength 3123 -#define wxStyledTextCtrl_GetOvertype 3124 -#define wxStyledTextCtrl_SetCaretWidth 3125 -#define wxStyledTextCtrl_GetCaretWidth 3126 -#define wxStyledTextCtrl_SetTargetStart 3127 -#define wxStyledTextCtrl_GetTargetStart 3128 -#define wxStyledTextCtrl_SetTargetEnd 3129 -#define wxStyledTextCtrl_GetTargetEnd 3130 -#define wxStyledTextCtrl_ReplaceTarget 3131 -#define wxStyledTextCtrl_SearchInTarget 3132 -#define wxStyledTextCtrl_SetSearchFlags 3133 -#define wxStyledTextCtrl_GetSearchFlags 3134 -#define wxStyledTextCtrl_CallTipShow 3135 -#define wxStyledTextCtrl_CallTipCancel 3136 -#define wxStyledTextCtrl_CallTipActive 3137 -#define wxStyledTextCtrl_CallTipPosAtStart 3138 -#define wxStyledTextCtrl_CallTipSetHighlight 3139 -#define wxStyledTextCtrl_CallTipSetBackground 3140 -#define wxStyledTextCtrl_CallTipSetForeground 3141 -#define wxStyledTextCtrl_CallTipSetForegroundHighlight 3142 -#define wxStyledTextCtrl_CallTipUseStyle 3143 -#define wxStyledTextCtrl_VisibleFromDocLine 3144 -#define wxStyledTextCtrl_DocLineFromVisible 3145 -#define wxStyledTextCtrl_WrapCount 3146 -#define wxStyledTextCtrl_SetFoldLevel 3147 -#define wxStyledTextCtrl_GetFoldLevel 3148 -#define wxStyledTextCtrl_GetLastChild 3149 -#define wxStyledTextCtrl_GetFoldParent 3150 -#define wxStyledTextCtrl_ShowLines 3151 -#define wxStyledTextCtrl_HideLines 3152 -#define wxStyledTextCtrl_GetLineVisible 3153 -#define wxStyledTextCtrl_SetFoldExpanded 3154 -#define wxStyledTextCtrl_GetFoldExpanded 3155 -#define wxStyledTextCtrl_ToggleFold 3156 -#define wxStyledTextCtrl_EnsureVisible 3157 -#define wxStyledTextCtrl_SetFoldFlags 3158 -#define wxStyledTextCtrl_EnsureVisibleEnforcePolicy 3159 -#define wxStyledTextCtrl_SetTabIndents 3160 -#define wxStyledTextCtrl_GetTabIndents 3161 -#define wxStyledTextCtrl_SetBackSpaceUnIndents 3162 -#define wxStyledTextCtrl_GetBackSpaceUnIndents 3163 -#define wxStyledTextCtrl_SetMouseDwellTime 3164 -#define wxStyledTextCtrl_GetMouseDwellTime 3165 -#define wxStyledTextCtrl_WordStartPosition 3166 -#define wxStyledTextCtrl_WordEndPosition 3167 -#define wxStyledTextCtrl_SetWrapMode 3168 -#define wxStyledTextCtrl_GetWrapMode 3169 -#define wxStyledTextCtrl_SetWrapVisualFlags 3170 -#define wxStyledTextCtrl_GetWrapVisualFlags 3171 -#define wxStyledTextCtrl_SetWrapVisualFlagsLocation 3172 -#define wxStyledTextCtrl_GetWrapVisualFlagsLocation 3173 -#define wxStyledTextCtrl_SetWrapStartIndent 3174 -#define wxStyledTextCtrl_GetWrapStartIndent 3175 -#define wxStyledTextCtrl_SetLayoutCache 3176 -#define wxStyledTextCtrl_GetLayoutCache 3177 -#define wxStyledTextCtrl_SetScrollWidth 3178 -#define wxStyledTextCtrl_GetScrollWidth 3179 -#define wxStyledTextCtrl_TextWidth 3180 -#define wxStyledTextCtrl_GetEndAtLastLine 3181 -#define wxStyledTextCtrl_TextHeight 3182 -#define wxStyledTextCtrl_SetUseVerticalScrollBar 3183 -#define wxStyledTextCtrl_GetUseVerticalScrollBar 3184 -#define wxStyledTextCtrl_AppendText 3185 -#define wxStyledTextCtrl_GetTwoPhaseDraw 3186 -#define wxStyledTextCtrl_SetTwoPhaseDraw 3187 -#define wxStyledTextCtrl_TargetFromSelection 3188 -#define wxStyledTextCtrl_LinesJoin 3189 -#define wxStyledTextCtrl_LinesSplit 3190 -#define wxStyledTextCtrl_SetFoldMarginColour 3191 -#define wxStyledTextCtrl_SetFoldMarginHiColour 3192 -#define wxStyledTextCtrl_LineDown 3193 -#define wxStyledTextCtrl_LineDownExtend 3194 -#define wxStyledTextCtrl_LineUp 3195 -#define wxStyledTextCtrl_LineUpExtend 3196 -#define wxStyledTextCtrl_CharLeft 3197 -#define wxStyledTextCtrl_CharLeftExtend 3198 -#define wxStyledTextCtrl_CharRight 3199 -#define wxStyledTextCtrl_CharRightExtend 3200 -#define wxStyledTextCtrl_WordLeft 3201 -#define wxStyledTextCtrl_WordLeftExtend 3202 -#define wxStyledTextCtrl_WordRight 3203 -#define wxStyledTextCtrl_WordRightExtend 3204 -#define wxStyledTextCtrl_Home 3205 -#define wxStyledTextCtrl_HomeExtend 3206 -#define wxStyledTextCtrl_LineEnd 3207 -#define wxStyledTextCtrl_LineEndExtend 3208 -#define wxStyledTextCtrl_DocumentStart 3209 -#define wxStyledTextCtrl_DocumentStartExtend 3210 -#define wxStyledTextCtrl_DocumentEnd 3211 -#define wxStyledTextCtrl_DocumentEndExtend 3212 -#define wxStyledTextCtrl_PageUp 3213 -#define wxStyledTextCtrl_PageUpExtend 3214 -#define wxStyledTextCtrl_PageDown 3215 -#define wxStyledTextCtrl_PageDownExtend 3216 -#define wxStyledTextCtrl_EditToggleOvertype 3217 -#define wxStyledTextCtrl_Cancel 3218 -#define wxStyledTextCtrl_DeleteBack 3219 -#define wxStyledTextCtrl_Tab 3220 -#define wxStyledTextCtrl_BackTab 3221 -#define wxStyledTextCtrl_NewLine 3222 -#define wxStyledTextCtrl_FormFeed 3223 -#define wxStyledTextCtrl_VCHome 3224 -#define wxStyledTextCtrl_VCHomeExtend 3225 -#define wxStyledTextCtrl_ZoomIn 3226 -#define wxStyledTextCtrl_ZoomOut 3227 -#define wxStyledTextCtrl_DelWordLeft 3228 -#define wxStyledTextCtrl_DelWordRight 3229 -#define wxStyledTextCtrl_LineCut 3230 -#define wxStyledTextCtrl_LineDelete 3231 -#define wxStyledTextCtrl_LineTranspose 3232 -#define wxStyledTextCtrl_LineDuplicate 3233 -#define wxStyledTextCtrl_LowerCase 3234 -#define wxStyledTextCtrl_UpperCase 3235 -#define wxStyledTextCtrl_LineScrollDown 3236 -#define wxStyledTextCtrl_LineScrollUp 3237 -#define wxStyledTextCtrl_DeleteBackNotLine 3238 -#define wxStyledTextCtrl_HomeDisplay 3239 -#define wxStyledTextCtrl_HomeDisplayExtend 3240 -#define wxStyledTextCtrl_LineEndDisplay 3241 -#define wxStyledTextCtrl_LineEndDisplayExtend 3242 -#define wxStyledTextCtrl_HomeWrapExtend 3243 -#define wxStyledTextCtrl_LineEndWrap 3244 -#define wxStyledTextCtrl_LineEndWrapExtend 3245 -#define wxStyledTextCtrl_VCHomeWrap 3246 -#define wxStyledTextCtrl_VCHomeWrapExtend 3247 -#define wxStyledTextCtrl_LineCopy 3248 -#define wxStyledTextCtrl_MoveCaretInsideView 3249 -#define wxStyledTextCtrl_LineLength 3250 -#define wxStyledTextCtrl_BraceHighlight 3251 -#define wxStyledTextCtrl_BraceBadLight 3252 -#define wxStyledTextCtrl_BraceMatch 3253 -#define wxStyledTextCtrl_GetViewEOL 3254 -#define wxStyledTextCtrl_SetViewEOL 3255 -#define wxStyledTextCtrl_SetModEventMask 3256 -#define wxStyledTextCtrl_GetEdgeColumn 3257 -#define wxStyledTextCtrl_SetEdgeColumn 3258 -#define wxStyledTextCtrl_GetEdgeMode 3259 -#define wxStyledTextCtrl_GetEdgeColour 3260 -#define wxStyledTextCtrl_SetEdgeColour 3261 -#define wxStyledTextCtrl_SearchAnchor 3262 -#define wxStyledTextCtrl_SearchNext 3263 -#define wxStyledTextCtrl_SearchPrev 3264 -#define wxStyledTextCtrl_LinesOnScreen 3265 -#define wxStyledTextCtrl_UsePopUp 3266 -#define wxStyledTextCtrl_SelectionIsRectangle 3267 -#define wxStyledTextCtrl_SetZoom 3268 -#define wxStyledTextCtrl_GetZoom 3269 -#define wxStyledTextCtrl_GetModEventMask 3270 -#define wxStyledTextCtrl_SetSTCFocus 3271 -#define wxStyledTextCtrl_GetSTCFocus 3272 -#define wxStyledTextCtrl_SetStatus 3273 -#define wxStyledTextCtrl_GetStatus 3274 -#define wxStyledTextCtrl_SetMouseDownCaptures 3275 -#define wxStyledTextCtrl_GetMouseDownCaptures 3276 -#define wxStyledTextCtrl_SetSTCCursor 3277 -#define wxStyledTextCtrl_GetSTCCursor 3278 -#define wxStyledTextCtrl_SetControlCharSymbol 3279 -#define wxStyledTextCtrl_GetControlCharSymbol 3280 -#define wxStyledTextCtrl_WordPartLeft 3281 -#define wxStyledTextCtrl_WordPartLeftExtend 3282 -#define wxStyledTextCtrl_WordPartRight 3283 -#define wxStyledTextCtrl_WordPartRightExtend 3284 -#define wxStyledTextCtrl_SetVisiblePolicy 3285 -#define wxStyledTextCtrl_DelLineLeft 3286 -#define wxStyledTextCtrl_DelLineRight 3287 -#define wxStyledTextCtrl_GetXOffset 3288 -#define wxStyledTextCtrl_ChooseCaretX 3289 -#define wxStyledTextCtrl_SetXCaretPolicy 3290 -#define wxStyledTextCtrl_SetYCaretPolicy 3291 -#define wxStyledTextCtrl_GetPrintWrapMode 3292 -#define wxStyledTextCtrl_SetHotspotActiveForeground 3293 -#define wxStyledTextCtrl_SetHotspotActiveBackground 3294 -#define wxStyledTextCtrl_SetHotspotActiveUnderline 3295 -#define wxStyledTextCtrl_SetHotspotSingleLine 3296 -#define wxStyledTextCtrl_ParaDownExtend 3297 -#define wxStyledTextCtrl_ParaUp 3298 -#define wxStyledTextCtrl_ParaUpExtend 3299 -#define wxStyledTextCtrl_PositionBefore 3300 -#define wxStyledTextCtrl_PositionAfter 3301 -#define wxStyledTextCtrl_CopyRange 3302 -#define wxStyledTextCtrl_CopyText 3303 -#define wxStyledTextCtrl_SetSelectionMode 3304 -#define wxStyledTextCtrl_GetSelectionMode 3305 -#define wxStyledTextCtrl_LineDownRectExtend 3306 -#define wxStyledTextCtrl_LineUpRectExtend 3307 -#define wxStyledTextCtrl_CharLeftRectExtend 3308 -#define wxStyledTextCtrl_CharRightRectExtend 3309 -#define wxStyledTextCtrl_HomeRectExtend 3310 -#define wxStyledTextCtrl_VCHomeRectExtend 3311 -#define wxStyledTextCtrl_LineEndRectExtend 3312 -#define wxStyledTextCtrl_PageUpRectExtend 3313 -#define wxStyledTextCtrl_PageDownRectExtend 3314 -#define wxStyledTextCtrl_StutteredPageUp 3315 -#define wxStyledTextCtrl_StutteredPageUpExtend 3316 -#define wxStyledTextCtrl_StutteredPageDown 3317 -#define wxStyledTextCtrl_StutteredPageDownExtend 3318 -#define wxStyledTextCtrl_WordLeftEnd 3319 -#define wxStyledTextCtrl_WordLeftEndExtend 3320 -#define wxStyledTextCtrl_WordRightEnd 3321 -#define wxStyledTextCtrl_WordRightEndExtend 3322 -#define wxStyledTextCtrl_SetWhitespaceChars 3323 -#define wxStyledTextCtrl_SetCharsDefault 3324 -#define wxStyledTextCtrl_AutoCompGetCurrent 3325 -#define wxStyledTextCtrl_Allocate 3326 -#define wxStyledTextCtrl_FindColumn 3327 -#define wxStyledTextCtrl_GetCaretSticky 3328 -#define wxStyledTextCtrl_SetCaretSticky 3329 -#define wxStyledTextCtrl_ToggleCaretSticky 3330 -#define wxStyledTextCtrl_SetPasteConvertEndings 3331 -#define wxStyledTextCtrl_GetPasteConvertEndings 3332 -#define wxStyledTextCtrl_SelectionDuplicate 3333 -#define wxStyledTextCtrl_SetCaretLineBackAlpha 3334 -#define wxStyledTextCtrl_GetCaretLineBackAlpha 3335 -#define wxStyledTextCtrl_StartRecord 3336 -#define wxStyledTextCtrl_StopRecord 3337 -#define wxStyledTextCtrl_SetLexer 3338 -#define wxStyledTextCtrl_GetLexer 3339 -#define wxStyledTextCtrl_Colourise 3340 -#define wxStyledTextCtrl_SetProperty 3341 -#define wxStyledTextCtrl_SetKeyWords 3342 -#define wxStyledTextCtrl_SetLexerLanguage 3343 -#define wxStyledTextCtrl_GetProperty 3344 -#define wxStyledTextCtrl_GetStyleBitsNeeded 3345 -#define wxStyledTextCtrl_GetCurrentLine 3346 -#define wxStyledTextCtrl_StyleSetSpec 3347 -#define wxStyledTextCtrl_StyleSetFont 3348 -#define wxStyledTextCtrl_StyleSetFontAttr 3349 -#define wxStyledTextCtrl_StyleSetCharacterSet 3350 -#define wxStyledTextCtrl_StyleSetFontEncoding 3351 -#define wxStyledTextCtrl_CmdKeyExecute 3352 -#define wxStyledTextCtrl_SetMargins 3353 -#define wxStyledTextCtrl_GetSelection 3354 -#define wxStyledTextCtrl_PointFromPosition 3355 -#define wxStyledTextCtrl_ScrollToLine 3356 -#define wxStyledTextCtrl_ScrollToColumn 3357 -#define wxStyledTextCtrl_SendMsg 3358 -#define wxStyledTextCtrl_SetVScrollBar 3359 -#define wxStyledTextCtrl_SetHScrollBar 3360 -#define wxStyledTextCtrl_GetLastKeydownProcessed 3361 -#define wxStyledTextCtrl_SetLastKeydownProcessed 3362 -#define wxStyledTextCtrl_SaveFile 3363 -#define wxStyledTextCtrl_LoadFile 3364 -#define wxStyledTextCtrl_DoDragOver 3365 -#define wxStyledTextCtrl_DoDropText 3366 -#define wxStyledTextCtrl_GetUseAntiAliasing 3367 -#define wxStyledTextCtrl_AddTextRaw 3368 -#define wxStyledTextCtrl_InsertTextRaw 3369 -#define wxStyledTextCtrl_GetCurLineRaw 3370 -#define wxStyledTextCtrl_GetLineRaw 3371 -#define wxStyledTextCtrl_GetSelectedTextRaw 3372 -#define wxStyledTextCtrl_GetTextRangeRaw 3373 -#define wxStyledTextCtrl_SetTextRaw 3374 -#define wxStyledTextCtrl_GetTextRaw 3375 -#define wxStyledTextCtrl_AppendTextRaw 3376 -#define wxArtProvider_GetBitmap 3377 -#define wxArtProvider_GetIcon 3378 -#define wxTreeEvent_GetKeyCode 3379 -#define wxTreeEvent_GetItem 3380 -#define wxTreeEvent_GetKeyEvent 3381 -#define wxTreeEvent_GetLabel 3382 -#define wxTreeEvent_GetOldItem 3383 -#define wxTreeEvent_GetPoint 3384 -#define wxTreeEvent_IsEditCancelled 3385 -#define wxTreeEvent_SetToolTip 3386 -#define wxNotebookEvent_GetOldSelection 3387 -#define wxNotebookEvent_GetSelection 3388 -#define wxNotebookEvent_SetOldSelection 3389 -#define wxNotebookEvent_SetSelection 3390 -#define wxFileDataObject_new 3391 -#define wxFileDataObject_AddFile 3392 -#define wxFileDataObject_GetFilenames 3393 -#define wxFileDataObject_destroy 3394 -#define wxTextDataObject_new 3395 -#define wxTextDataObject_GetTextLength 3396 -#define wxTextDataObject_GetText 3397 -#define wxTextDataObject_SetText 3398 -#define wxTextDataObject_destroy 3399 -#define wxBitmapDataObject_new_1_1 3400 -#define wxBitmapDataObject_new_1_0 3401 -#define wxBitmapDataObject_GetBitmap 3402 -#define wxBitmapDataObject_SetBitmap 3403 -#define wxBitmapDataObject_destroy 3404 -#define wxClipboard_new 3406 -#define wxClipboard_destruct 3407 -#define wxClipboard_AddData 3408 -#define wxClipboard_Clear 3409 -#define wxClipboard_Close 3410 -#define wxClipboard_Flush 3411 -#define wxClipboard_GetData 3412 -#define wxClipboard_IsOpened 3413 -#define wxClipboard_Open 3414 -#define wxClipboard_SetData 3415 -#define wxClipboard_UsePrimarySelection 3417 -#define wxClipboard_IsSupported 3418 -#define wxClipboard_Get 3419 -#define wxSpinEvent_GetPosition 3420 -#define wxSpinEvent_SetPosition 3421 -#define wxSplitterWindow_new_0 3422 -#define wxSplitterWindow_new_2 3423 -#define wxSplitterWindow_destruct 3424 -#define wxSplitterWindow_Create 3425 -#define wxSplitterWindow_GetMinimumPaneSize 3426 -#define wxSplitterWindow_GetSashGravity 3427 -#define wxSplitterWindow_GetSashPosition 3428 -#define wxSplitterWindow_GetSplitMode 3429 -#define wxSplitterWindow_GetWindow1 3430 -#define wxSplitterWindow_GetWindow2 3431 -#define wxSplitterWindow_Initialize 3432 -#define wxSplitterWindow_IsSplit 3433 -#define wxSplitterWindow_ReplaceWindow 3434 -#define wxSplitterWindow_SetSashGravity 3435 -#define wxSplitterWindow_SetSashPosition 3436 -#define wxSplitterWindow_SetSashSize 3437 -#define wxSplitterWindow_SetMinimumPaneSize 3438 -#define wxSplitterWindow_SetSplitMode 3439 -#define wxSplitterWindow_SplitHorizontally 3440 -#define wxSplitterWindow_SplitVertically 3441 -#define wxSplitterWindow_Unsplit 3442 -#define wxSplitterWindow_UpdateSize 3443 -#define wxSplitterEvent_GetSashPosition 3444 -#define wxSplitterEvent_GetX 3445 -#define wxSplitterEvent_GetY 3446 -#define wxSplitterEvent_GetWindowBeingRemoved 3447 -#define wxSplitterEvent_SetSashPosition 3448 -#define wxHtmlWindow_new_0 3449 -#define wxHtmlWindow_new_2 3450 -#define wxHtmlWindow_AppendToPage 3451 -#define wxHtmlWindow_GetOpenedAnchor 3452 -#define wxHtmlWindow_GetOpenedPage 3453 -#define wxHtmlWindow_GetOpenedPageTitle 3454 -#define wxHtmlWindow_GetRelatedFrame 3455 -#define wxHtmlWindow_HistoryBack 3456 -#define wxHtmlWindow_HistoryCanBack 3457 -#define wxHtmlWindow_HistoryCanForward 3458 -#define wxHtmlWindow_HistoryClear 3459 -#define wxHtmlWindow_HistoryForward 3460 -#define wxHtmlWindow_LoadFile 3461 -#define wxHtmlWindow_LoadPage 3462 -#define wxHtmlWindow_SelectAll 3463 -#define wxHtmlWindow_SelectionToText 3464 -#define wxHtmlWindow_SelectLine 3465 -#define wxHtmlWindow_SelectWord 3466 -#define wxHtmlWindow_SetBorders 3467 -#define wxHtmlWindow_SetFonts 3468 -#define wxHtmlWindow_SetPage 3469 -#define wxHtmlWindow_SetRelatedFrame 3470 -#define wxHtmlWindow_SetRelatedStatusBar 3471 -#define wxHtmlWindow_ToText 3472 -#define wxHtmlWindow_destroy 3473 -#define wxHtmlLinkEvent_GetLinkInfo 3474 -#define wxAuiNotebookEvent_SetSelection 3475 -#define wxAuiNotebookEvent_GetSelection 3476 -#define wxAuiNotebookEvent_SetOldSelection 3477 -#define wxAuiNotebookEvent_GetOldSelection 3478 -#define wxAuiNotebookEvent_SetDragSource 3479 -#define wxAuiNotebookEvent_GetDragSource 3480 -#define wxAuiManagerEvent_SetManager 3481 -#define wxAuiManagerEvent_GetManager 3482 -#define wxAuiManagerEvent_SetPane 3483 -#define wxAuiManagerEvent_GetPane 3484 -#define wxAuiManagerEvent_SetButton 3485 -#define wxAuiManagerEvent_GetButton 3486 -#define wxAuiManagerEvent_SetDC 3487 -#define wxAuiManagerEvent_GetDC 3488 -#define wxAuiManagerEvent_Veto 3489 -#define wxAuiManagerEvent_GetVeto 3490 -#define wxAuiManagerEvent_SetCanVeto 3491 -#define wxAuiManagerEvent_CanVeto 3492 -#define wxLogNull_new 3493 -#define wxLogNull_destroy 3494 +#define wxTreeCtrl_EditLabel 2010 +#define wxTreeCtrl_EnsureVisible 2011 +#define wxTreeCtrl_Expand 2012 +#define wxTreeCtrl_GetBoundingRect 2013 +#define wxTreeCtrl_GetChildrenCount 2015 +#define wxTreeCtrl_GetCount 2016 +#define wxTreeCtrl_GetEditControl 2017 +#define wxTreeCtrl_GetFirstChild 2018 +#define wxTreeCtrl_GetNextChild 2019 +#define wxTreeCtrl_GetFirstVisibleItem 2020 +#define wxTreeCtrl_GetImageList 2021 +#define wxTreeCtrl_GetIndent 2022 +#define wxTreeCtrl_GetItemBackgroundColour 2023 +#define wxTreeCtrl_GetItemData 2024 +#define wxTreeCtrl_GetItemFont 2025 +#define wxTreeCtrl_GetItemImage_1 2026 +#define wxTreeCtrl_GetItemImage_2 2027 +#define wxTreeCtrl_GetItemText 2028 +#define wxTreeCtrl_GetItemTextColour 2029 +#define wxTreeCtrl_GetLastChild 2030 +#define wxTreeCtrl_GetNextSibling 2031 +#define wxTreeCtrl_GetNextVisible 2032 +#define wxTreeCtrl_GetItemParent 2033 +#define wxTreeCtrl_GetPrevSibling 2034 +#define wxTreeCtrl_GetPrevVisible 2035 +#define wxTreeCtrl_GetRootItem 2036 +#define wxTreeCtrl_GetSelection 2037 +#define wxTreeCtrl_GetSelections 2038 +#define wxTreeCtrl_GetStateImageList 2039 +#define wxTreeCtrl_HitTest 2040 +#define wxTreeCtrl_InsertItem 2042 +#define wxTreeCtrl_IsBold 2043 +#define wxTreeCtrl_IsExpanded 2044 +#define wxTreeCtrl_IsSelected 2045 +#define wxTreeCtrl_IsVisible 2046 +#define wxTreeCtrl_ItemHasChildren 2047 +#define wxTreeCtrl_PrependItem 2048 +#define wxTreeCtrl_ScrollTo 2049 +#define wxTreeCtrl_SelectItem_1 2050 +#define wxTreeCtrl_SelectItem_2 2051 +#define wxTreeCtrl_SetIndent 2052 +#define wxTreeCtrl_SetImageList 2053 +#define wxTreeCtrl_SetItemBackgroundColour 2054 +#define wxTreeCtrl_SetItemBold 2055 +#define wxTreeCtrl_SetItemData 2056 +#define wxTreeCtrl_SetItemDropHighlight 2057 +#define wxTreeCtrl_SetItemFont 2058 +#define wxTreeCtrl_SetItemHasChildren 2059 +#define wxTreeCtrl_SetItemImage_2 2060 +#define wxTreeCtrl_SetItemImage_3 2061 +#define wxTreeCtrl_SetItemText 2062 +#define wxTreeCtrl_SetItemTextColour 2063 +#define wxTreeCtrl_SetStateImageList 2064 +#define wxTreeCtrl_SetWindowStyle 2065 +#define wxTreeCtrl_SortChildren 2066 +#define wxTreeCtrl_Toggle 2067 +#define wxTreeCtrl_ToggleItemSelection 2068 +#define wxTreeCtrl_Unselect 2069 +#define wxTreeCtrl_UnselectAll 2070 +#define wxTreeCtrl_UnselectItem 2071 +#define wxScrollBar_new_0 2072 +#define wxScrollBar_new_3 2073 +#define wxScrollBar_destruct 2074 +#define wxScrollBar_Create 2075 +#define wxScrollBar_GetRange 2076 +#define wxScrollBar_GetPageSize 2077 +#define wxScrollBar_GetThumbPosition 2078 +#define wxScrollBar_GetThumbSize 2079 +#define wxScrollBar_SetThumbPosition 2080 +#define wxScrollBar_SetScrollbar 2081 +#define wxSpinButton_new_2 2083 +#define wxSpinButton_new_0 2084 +#define wxSpinButton_Create 2085 +#define wxSpinButton_GetMax 2086 +#define wxSpinButton_GetMin 2087 +#define wxSpinButton_GetValue 2088 +#define wxSpinButton_SetRange 2089 +#define wxSpinButton_SetValue 2090 +#define wxSpinButton_destroy 2091 +#define wxSpinCtrl_new_0 2092 +#define wxSpinCtrl_new_2 2093 +#define wxSpinCtrl_Create 2095 +#define wxSpinCtrl_SetValue_1_1 2098 +#define wxSpinCtrl_SetValue_1_0 2099 +#define wxSpinCtrl_GetValue 2101 +#define wxSpinCtrl_SetRange 2103 +#define wxSpinCtrl_SetSelection 2104 +#define wxSpinCtrl_GetMin 2106 +#define wxSpinCtrl_GetMax 2108 +#define wxSpinCtrl_destroy 2109 +#define wxStaticText_new_0 2110 +#define wxStaticText_new_4 2111 +#define wxStaticText_Create 2112 +#define wxStaticText_GetLabel 2113 +#define wxStaticText_SetLabel 2114 +#define wxStaticText_Wrap 2115 +#define wxStaticText_destroy 2116 +#define wxStaticBitmap_new_0 2117 +#define wxStaticBitmap_new_4 2118 +#define wxStaticBitmap_Create 2119 +#define wxStaticBitmap_GetBitmap 2120 +#define wxStaticBitmap_SetBitmap 2121 +#define wxStaticBitmap_destroy 2122 +#define wxRadioBox_new 2123 +#define wxRadioBox_destruct 2125 +#define wxRadioBox_Create 2126 +#define wxRadioBox_Enable_2 2127 +#define wxRadioBox_Enable_1 2128 +#define wxRadioBox_GetSelection 2129 +#define wxRadioBox_GetString 2130 +#define wxRadioBox_SetSelection 2131 +#define wxRadioBox_Show_2 2132 +#define wxRadioBox_Show_1 2133 +#define wxRadioBox_GetColumnCount 2134 +#define wxRadioBox_GetItemHelpText 2135 +#define wxRadioBox_GetItemToolTip 2136 +#define wxRadioBox_GetItemFromPoint 2138 +#define wxRadioBox_GetRowCount 2139 +#define wxRadioBox_IsItemEnabled 2140 +#define wxRadioBox_IsItemShown 2141 +#define wxRadioBox_SetItemHelpText 2142 +#define wxRadioBox_SetItemToolTip 2143 +#define wxRadioButton_new_0 2144 +#define wxRadioButton_new_4 2145 +#define wxRadioButton_Create 2146 +#define wxRadioButton_GetValue 2147 +#define wxRadioButton_SetValue 2148 +#define wxRadioButton_destroy 2149 +#define wxSlider_new_6 2151 +#define wxSlider_new_0 2152 +#define wxSlider_Create 2153 +#define wxSlider_GetLineSize 2154 +#define wxSlider_GetMax 2155 +#define wxSlider_GetMin 2156 +#define wxSlider_GetPageSize 2157 +#define wxSlider_GetThumbLength 2158 +#define wxSlider_GetValue 2159 +#define wxSlider_SetLineSize 2160 +#define wxSlider_SetPageSize 2161 +#define wxSlider_SetRange 2162 +#define wxSlider_SetThumbLength 2163 +#define wxSlider_SetValue 2164 +#define wxSlider_destroy 2165 +#define wxDialog_new_4 2167 +#define wxDialog_new_0 2168 +#define wxDialog_destruct 2170 +#define wxDialog_Create 2171 +#define wxDialog_CreateButtonSizer 2172 +#define wxDialog_CreateStdDialogButtonSizer 2173 +#define wxDialog_EndModal 2174 +#define wxDialog_GetAffirmativeId 2175 +#define wxDialog_GetReturnCode 2176 +#define wxDialog_IsModal 2177 +#define wxDialog_SetAffirmativeId 2178 +#define wxDialog_SetReturnCode 2179 +#define wxDialog_Show 2180 +#define wxDialog_ShowModal 2181 +#define wxColourDialog_new_0 2182 +#define wxColourDialog_new_2 2183 +#define wxColourDialog_destruct 2184 +#define wxColourDialog_Create 2185 +#define wxColourDialog_GetColourData 2186 +#define wxColourData_new_0 2187 +#define wxColourData_new_1 2188 +#define wxColourData_destruct 2189 +#define wxColourData_GetChooseFull 2190 +#define wxColourData_GetColour 2191 +#define wxColourData_GetCustomColour 2193 +#define wxColourData_SetChooseFull 2194 +#define wxColourData_SetColour 2195 +#define wxColourData_SetCustomColour 2196 +#define wxPalette_new_0 2197 +#define wxPalette_new_4 2198 +#define wxPalette_destruct 2200 +#define wxPalette_Create 2201 +#define wxPalette_GetColoursCount 2202 +#define wxPalette_GetPixel 2203 +#define wxPalette_GetRGB 2204 +#define wxPalette_IsOk 2205 +#define wxDirDialog_new 2209 +#define wxDirDialog_destruct 2210 +#define wxDirDialog_GetPath 2211 +#define wxDirDialog_GetMessage 2212 +#define wxDirDialog_SetMessage 2213 +#define wxDirDialog_SetPath 2214 +#define wxFileDialog_new 2218 +#define wxFileDialog_destruct 2219 +#define wxFileDialog_GetDirectory 2220 +#define wxFileDialog_GetFilename 2221 +#define wxFileDialog_GetFilenames 2222 +#define wxFileDialog_GetFilterIndex 2223 +#define wxFileDialog_GetMessage 2224 +#define wxFileDialog_GetPath 2225 +#define wxFileDialog_GetPaths 2226 +#define wxFileDialog_GetWildcard 2227 +#define wxFileDialog_SetDirectory 2228 +#define wxFileDialog_SetFilename 2229 +#define wxFileDialog_SetFilterIndex 2230 +#define wxFileDialog_SetMessage 2231 +#define wxFileDialog_SetPath 2232 +#define wxFileDialog_SetWildcard 2233 +#define wxPickerBase_SetInternalMargin 2234 +#define wxPickerBase_GetInternalMargin 2235 +#define wxPickerBase_SetTextCtrlProportion 2236 +#define wxPickerBase_SetPickerCtrlProportion 2237 +#define wxPickerBase_GetTextCtrlProportion 2238 +#define wxPickerBase_GetPickerCtrlProportion 2239 +#define wxPickerBase_HasTextCtrl 2240 +#define wxPickerBase_GetTextCtrl 2241 +#define wxPickerBase_IsTextCtrlGrowable 2242 +#define wxPickerBase_SetPickerCtrlGrowable 2243 +#define wxPickerBase_SetTextCtrlGrowable 2244 +#define wxPickerBase_IsPickerCtrlGrowable 2245 +#define wxFilePickerCtrl_new_0 2246 +#define wxFilePickerCtrl_new_3 2247 +#define wxFilePickerCtrl_Create 2248 +#define wxFilePickerCtrl_GetPath 2249 +#define wxFilePickerCtrl_SetPath 2250 +#define wxFilePickerCtrl_destroy 2251 +#define wxDirPickerCtrl_new_0 2252 +#define wxDirPickerCtrl_new_3 2253 +#define wxDirPickerCtrl_Create 2254 +#define wxDirPickerCtrl_GetPath 2255 +#define wxDirPickerCtrl_SetPath 2256 +#define wxDirPickerCtrl_destroy 2257 +#define wxColourPickerCtrl_new_0 2258 +#define wxColourPickerCtrl_new_3 2259 +#define wxColourPickerCtrl_Create 2260 +#define wxColourPickerCtrl_GetColour 2261 +#define wxColourPickerCtrl_SetColour_1_1 2262 +#define wxColourPickerCtrl_SetColour_1_0 2263 +#define wxColourPickerCtrl_destroy 2264 +#define wxDatePickerCtrl_new_0 2265 +#define wxDatePickerCtrl_new_3 2266 +#define wxDatePickerCtrl_GetRange 2267 +#define wxDatePickerCtrl_GetValue 2268 +#define wxDatePickerCtrl_SetRange 2269 +#define wxDatePickerCtrl_SetValue 2270 +#define wxDatePickerCtrl_destroy 2271 +#define wxFontPickerCtrl_new_0 2272 +#define wxFontPickerCtrl_new_3 2273 +#define wxFontPickerCtrl_Create 2274 +#define wxFontPickerCtrl_GetSelectedFont 2275 +#define wxFontPickerCtrl_SetSelectedFont 2276 +#define wxFontPickerCtrl_GetMaxPointSize 2277 +#define wxFontPickerCtrl_SetMaxPointSize 2278 +#define wxFontPickerCtrl_destroy 2279 +#define wxFindReplaceDialog_new_0 2282 +#define wxFindReplaceDialog_new_4 2283 +#define wxFindReplaceDialog_destruct 2284 +#define wxFindReplaceDialog_Create 2285 +#define wxFindReplaceDialog_GetData 2286 +#define wxFindReplaceData_new_0 2287 +#define wxFindReplaceData_new_1 2288 +#define wxFindReplaceData_GetFindString 2289 +#define wxFindReplaceData_GetReplaceString 2290 +#define wxFindReplaceData_GetFlags 2291 +#define wxFindReplaceData_SetFlags 2292 +#define wxFindReplaceData_SetFindString 2293 +#define wxFindReplaceData_SetReplaceString 2294 +#define wxFindReplaceData_destroy 2295 +#define wxMultiChoiceDialog_new_0 2296 +#define wxMultiChoiceDialog_new_5 2298 +#define wxMultiChoiceDialog_GetSelections 2299 +#define wxMultiChoiceDialog_SetSelections 2300 +#define wxMultiChoiceDialog_destroy 2301 +#define wxSingleChoiceDialog_new_0 2302 +#define wxSingleChoiceDialog_new_5 2304 +#define wxSingleChoiceDialog_GetSelection 2305 +#define wxSingleChoiceDialog_GetStringSelection 2306 +#define wxSingleChoiceDialog_SetSelection 2307 +#define wxSingleChoiceDialog_destroy 2308 +#define wxTextEntryDialog_new 2309 +#define wxTextEntryDialog_GetValue 2310 +#define wxTextEntryDialog_SetValue 2311 +#define wxTextEntryDialog_destroy 2312 +#define wxPasswordEntryDialog_new 2313 +#define wxPasswordEntryDialog_destroy 2314 +#define wxFontData_new_0 2315 +#define wxFontData_new_1 2316 +#define wxFontData_destruct 2317 +#define wxFontData_EnableEffects 2318 +#define wxFontData_GetAllowSymbols 2319 +#define wxFontData_GetColour 2320 +#define wxFontData_GetChosenFont 2321 +#define wxFontData_GetEnableEffects 2322 +#define wxFontData_GetInitialFont 2323 +#define wxFontData_GetShowHelp 2324 +#define wxFontData_SetAllowSymbols 2325 +#define wxFontData_SetChosenFont 2326 +#define wxFontData_SetColour 2327 +#define wxFontData_SetInitialFont 2328 +#define wxFontData_SetRange 2329 +#define wxFontData_SetShowHelp 2330 +#define wxFontDialog_new_0 2334 +#define wxFontDialog_new_2 2336 +#define wxFontDialog_Create 2338 +#define wxFontDialog_GetFontData 2339 +#define wxFontDialog_destroy 2341 +#define wxProgressDialog_new 2342 +#define wxProgressDialog_destruct 2343 +#define wxProgressDialog_Resume 2344 +#define wxProgressDialog_Update_2 2345 +#define wxProgressDialog_Update_0 2346 +#define wxMessageDialog_new 2347 +#define wxMessageDialog_destruct 2348 +#define wxPageSetupDialog_new 2349 +#define wxPageSetupDialog_destruct 2350 +#define wxPageSetupDialog_GetPageSetupData 2351 +#define wxPageSetupDialog_ShowModal 2352 +#define wxPageSetupDialogData_new_0 2353 +#define wxPageSetupDialogData_new_1_0 2354 +#define wxPageSetupDialogData_new_1_1 2355 +#define wxPageSetupDialogData_destruct 2356 +#define wxPageSetupDialogData_EnableHelp 2357 +#define wxPageSetupDialogData_EnableMargins 2358 +#define wxPageSetupDialogData_EnableOrientation 2359 +#define wxPageSetupDialogData_EnablePaper 2360 +#define wxPageSetupDialogData_EnablePrinter 2361 +#define wxPageSetupDialogData_GetDefaultMinMargins 2362 +#define wxPageSetupDialogData_GetEnableMargins 2363 +#define wxPageSetupDialogData_GetEnableOrientation 2364 +#define wxPageSetupDialogData_GetEnablePaper 2365 +#define wxPageSetupDialogData_GetEnablePrinter 2366 +#define wxPageSetupDialogData_GetEnableHelp 2367 +#define wxPageSetupDialogData_GetDefaultInfo 2368 +#define wxPageSetupDialogData_GetMarginTopLeft 2369 +#define wxPageSetupDialogData_GetMarginBottomRight 2370 +#define wxPageSetupDialogData_GetMinMarginTopLeft 2371 +#define wxPageSetupDialogData_GetMinMarginBottomRight 2372 +#define wxPageSetupDialogData_GetPaperId 2373 +#define wxPageSetupDialogData_GetPaperSize 2374 +#define wxPageSetupDialogData_GetPrintData 2376 +#define wxPageSetupDialogData_IsOk 2377 +#define wxPageSetupDialogData_SetDefaultInfo 2378 +#define wxPageSetupDialogData_SetDefaultMinMargins 2379 +#define wxPageSetupDialogData_SetMarginTopLeft 2380 +#define wxPageSetupDialogData_SetMarginBottomRight 2381 +#define wxPageSetupDialogData_SetMinMarginTopLeft 2382 +#define wxPageSetupDialogData_SetMinMarginBottomRight 2383 +#define wxPageSetupDialogData_SetPaperId 2384 +#define wxPageSetupDialogData_SetPaperSize_1_1 2385 +#define wxPageSetupDialogData_SetPaperSize_1_0 2386 +#define wxPageSetupDialogData_SetPrintData 2387 +#define wxPrintDialog_new_2_0 2388 +#define wxPrintDialog_new_2_1 2389 +#define wxPrintDialog_destruct 2390 +#define wxPrintDialog_GetPrintDialogData 2391 +#define wxPrintDialog_GetPrintDC 2392 +#define wxPrintDialogData_new_0 2393 +#define wxPrintDialogData_new_1_1 2394 +#define wxPrintDialogData_new_1_0 2395 +#define wxPrintDialogData_destruct 2396 +#define wxPrintDialogData_EnableHelp 2397 +#define wxPrintDialogData_EnablePageNumbers 2398 +#define wxPrintDialogData_EnablePrintToFile 2399 +#define wxPrintDialogData_EnableSelection 2400 +#define wxPrintDialogData_GetAllPages 2401 +#define wxPrintDialogData_GetCollate 2402 +#define wxPrintDialogData_GetFromPage 2403 +#define wxPrintDialogData_GetMaxPage 2404 +#define wxPrintDialogData_GetMinPage 2405 +#define wxPrintDialogData_GetNoCopies 2406 +#define wxPrintDialogData_GetPrintData 2407 +#define wxPrintDialogData_GetPrintToFile 2408 +#define wxPrintDialogData_GetSelection 2409 +#define wxPrintDialogData_GetToPage 2410 +#define wxPrintDialogData_IsOk 2411 +#define wxPrintDialogData_SetCollate 2412 +#define wxPrintDialogData_SetFromPage 2413 +#define wxPrintDialogData_SetMaxPage 2414 +#define wxPrintDialogData_SetMinPage 2415 +#define wxPrintDialogData_SetNoCopies 2416 +#define wxPrintDialogData_SetPrintData 2417 +#define wxPrintDialogData_SetPrintToFile 2418 +#define wxPrintDialogData_SetSelection 2419 +#define wxPrintDialogData_SetToPage 2420 +#define wxPrintData_new_0 2421 +#define wxPrintData_new_1 2422 +#define wxPrintData_destruct 2423 +#define wxPrintData_GetCollate 2424 +#define wxPrintData_GetBin 2425 +#define wxPrintData_GetColour 2426 +#define wxPrintData_GetDuplex 2427 +#define wxPrintData_GetNoCopies 2428 +#define wxPrintData_GetOrientation 2429 +#define wxPrintData_GetPaperId 2430 +#define wxPrintData_GetPrinterName 2431 +#define wxPrintData_GetQuality 2432 +#define wxPrintData_IsOk 2433 +#define wxPrintData_SetBin 2434 +#define wxPrintData_SetCollate 2435 +#define wxPrintData_SetColour 2436 +#define wxPrintData_SetDuplex 2437 +#define wxPrintData_SetNoCopies 2438 +#define wxPrintData_SetOrientation 2439 +#define wxPrintData_SetPaperId 2440 +#define wxPrintData_SetPrinterName 2441 +#define wxPrintData_SetQuality 2442 +#define wxPrintPreview_new_2 2445 +#define wxPrintPreview_new_3 2446 +#define wxPrintPreview_destruct 2448 +#define wxPrintPreview_GetCanvas 2449 +#define wxPrintPreview_GetCurrentPage 2450 +#define wxPrintPreview_GetFrame 2451 +#define wxPrintPreview_GetMaxPage 2452 +#define wxPrintPreview_GetMinPage 2453 +#define wxPrintPreview_GetPrintout 2454 +#define wxPrintPreview_GetPrintoutForPrinting 2455 +#define wxPrintPreview_IsOk 2456 +#define wxPrintPreview_PaintPage 2457 +#define wxPrintPreview_Print 2458 +#define wxPrintPreview_RenderPage 2459 +#define wxPrintPreview_SetCanvas 2460 +#define wxPrintPreview_SetCurrentPage 2461 +#define wxPrintPreview_SetFrame 2462 +#define wxPrintPreview_SetPrintout 2463 +#define wxPrintPreview_SetZoom 2464 +#define wxPreviewFrame_new 2465 +#define wxPreviewFrame_destruct 2466 +#define wxPreviewFrame_CreateControlBar 2467 +#define wxPreviewFrame_CreateCanvas 2468 +#define wxPreviewFrame_Initialize 2469 +#define wxPreviewFrame_OnCloseWindow 2470 +#define wxPreviewControlBar_new 2471 +#define wxPreviewControlBar_destruct 2472 +#define wxPreviewControlBar_CreateButtons 2473 +#define wxPreviewControlBar_GetPrintPreview 2474 +#define wxPreviewControlBar_GetZoomControl 2475 +#define wxPreviewControlBar_SetZoomControl 2476 +#define wxPrinter_new 2478 +#define wxPrinter_CreateAbortWindow 2479 +#define wxPrinter_GetAbort 2480 +#define wxPrinter_GetLastError 2481 +#define wxPrinter_GetPrintDialogData 2482 +#define wxPrinter_Print 2483 +#define wxPrinter_PrintDialog 2484 +#define wxPrinter_ReportError 2485 +#define wxPrinter_Setup 2486 +#define wxPrinter_destroy 2487 +#define wxXmlResource_new_1 2488 +#define wxXmlResource_new_2 2489 +#define wxXmlResource_destruct 2490 +#define wxXmlResource_AttachUnknownControl 2491 +#define wxXmlResource_ClearHandlers 2492 +#define wxXmlResource_CompareVersion 2493 +#define wxXmlResource_Get 2494 +#define wxXmlResource_GetFlags 2495 +#define wxXmlResource_GetVersion 2496 +#define wxXmlResource_GetXRCID 2497 +#define wxXmlResource_InitAllHandlers 2498 +#define wxXmlResource_Load 2499 +#define wxXmlResource_LoadBitmap 2500 +#define wxXmlResource_LoadDialog_2 2501 +#define wxXmlResource_LoadDialog_3 2502 +#define wxXmlResource_LoadFrame_2 2503 +#define wxXmlResource_LoadFrame_3 2504 +#define wxXmlResource_LoadIcon 2505 +#define wxXmlResource_LoadMenu 2506 +#define wxXmlResource_LoadMenuBar_2 2507 +#define wxXmlResource_LoadMenuBar_1 2508 +#define wxXmlResource_LoadPanel_2 2509 +#define wxXmlResource_LoadPanel_3 2510 +#define wxXmlResource_LoadToolBar 2511 +#define wxXmlResource_Set 2512 +#define wxXmlResource_SetFlags 2513 +#define wxXmlResource_Unload 2514 +#define wxXmlResource_xrcctrl 2515 +#define wxHtmlEasyPrinting_new 2516 +#define wxHtmlEasyPrinting_destruct 2517 +#define wxHtmlEasyPrinting_GetPrintData 2518 +#define wxHtmlEasyPrinting_GetPageSetupData 2519 +#define wxHtmlEasyPrinting_PreviewFile 2520 +#define wxHtmlEasyPrinting_PreviewText 2521 +#define wxHtmlEasyPrinting_PrintFile 2522 +#define wxHtmlEasyPrinting_PrintText 2523 +#define wxHtmlEasyPrinting_PageSetup 2524 +#define wxHtmlEasyPrinting_SetFonts 2525 +#define wxHtmlEasyPrinting_SetHeader 2526 +#define wxHtmlEasyPrinting_SetFooter 2527 +#define wxGLCanvas_new_2 2529 +#define wxGLCanvas_new_3_1 2530 +#define wxGLCanvas_new_3_0 2531 +#define wxGLCanvas_GetContext 2532 +#define wxGLCanvas_SetCurrent 2534 +#define wxGLCanvas_SwapBuffers 2535 +#define wxGLCanvas_destroy 2536 +#define wxAuiManager_new 2537 +#define wxAuiManager_destruct 2538 +#define wxAuiManager_AddPane_2_1 2539 +#define wxAuiManager_AddPane_3 2540 +#define wxAuiManager_AddPane_2_0 2541 +#define wxAuiManager_DetachPane 2542 +#define wxAuiManager_GetAllPanes 2543 +#define wxAuiManager_GetArtProvider 2544 +#define wxAuiManager_GetDockSizeConstraint 2545 +#define wxAuiManager_GetFlags 2546 +#define wxAuiManager_GetManagedWindow 2547 +#define wxAuiManager_GetManager 2548 +#define wxAuiManager_GetPane_1_1 2549 +#define wxAuiManager_GetPane_1_0 2550 +#define wxAuiManager_HideHint 2551 +#define wxAuiManager_InsertPane 2552 +#define wxAuiManager_LoadPaneInfo 2553 +#define wxAuiManager_LoadPerspective 2554 +#define wxAuiManager_SavePaneInfo 2555 +#define wxAuiManager_SavePerspective 2556 +#define wxAuiManager_SetArtProvider 2557 +#define wxAuiManager_SetDockSizeConstraint 2558 +#define wxAuiManager_SetFlags 2559 +#define wxAuiManager_SetManagedWindow 2560 +#define wxAuiManager_ShowHint 2561 +#define wxAuiManager_UnInit 2562 +#define wxAuiManager_Update 2563 +#define wxAuiPaneInfo_new_0 2564 +#define wxAuiPaneInfo_new_1 2565 +#define wxAuiPaneInfo_destruct 2566 +#define wxAuiPaneInfo_BestSize_1 2567 +#define wxAuiPaneInfo_BestSize_2 2568 +#define wxAuiPaneInfo_Bottom 2569 +#define wxAuiPaneInfo_BottomDockable 2570 +#define wxAuiPaneInfo_Caption 2571 +#define wxAuiPaneInfo_CaptionVisible 2572 +#define wxAuiPaneInfo_Centre 2573 +#define wxAuiPaneInfo_CentrePane 2574 +#define wxAuiPaneInfo_CloseButton 2575 +#define wxAuiPaneInfo_DefaultPane 2576 +#define wxAuiPaneInfo_DestroyOnClose 2577 +#define wxAuiPaneInfo_Direction 2578 +#define wxAuiPaneInfo_Dock 2579 +#define wxAuiPaneInfo_Dockable 2580 +#define wxAuiPaneInfo_Fixed 2581 +#define wxAuiPaneInfo_Float 2582 +#define wxAuiPaneInfo_Floatable 2583 +#define wxAuiPaneInfo_FloatingPosition_1 2584 +#define wxAuiPaneInfo_FloatingPosition_2 2585 +#define wxAuiPaneInfo_FloatingSize_1 2586 +#define wxAuiPaneInfo_FloatingSize_2 2587 +#define wxAuiPaneInfo_Gripper 2588 +#define wxAuiPaneInfo_GripperTop 2589 +#define wxAuiPaneInfo_HasBorder 2590 +#define wxAuiPaneInfo_HasCaption 2591 +#define wxAuiPaneInfo_HasCloseButton 2592 +#define wxAuiPaneInfo_HasFlag 2593 +#define wxAuiPaneInfo_HasGripper 2594 +#define wxAuiPaneInfo_HasGripperTop 2595 +#define wxAuiPaneInfo_HasMaximizeButton 2596 +#define wxAuiPaneInfo_HasMinimizeButton 2597 +#define wxAuiPaneInfo_HasPinButton 2598 +#define wxAuiPaneInfo_Hide 2599 +#define wxAuiPaneInfo_IsBottomDockable 2600 +#define wxAuiPaneInfo_IsDocked 2601 +#define wxAuiPaneInfo_IsFixed 2602 +#define wxAuiPaneInfo_IsFloatable 2603 +#define wxAuiPaneInfo_IsFloating 2604 +#define wxAuiPaneInfo_IsLeftDockable 2605 +#define wxAuiPaneInfo_IsMovable 2606 +#define wxAuiPaneInfo_IsOk 2607 +#define wxAuiPaneInfo_IsResizable 2608 +#define wxAuiPaneInfo_IsRightDockable 2609 +#define wxAuiPaneInfo_IsShown 2610 +#define wxAuiPaneInfo_IsToolbar 2611 +#define wxAuiPaneInfo_IsTopDockable 2612 +#define wxAuiPaneInfo_Layer 2613 +#define wxAuiPaneInfo_Left 2614 +#define wxAuiPaneInfo_LeftDockable 2615 +#define wxAuiPaneInfo_MaxSize_1 2616 +#define wxAuiPaneInfo_MaxSize_2 2617 +#define wxAuiPaneInfo_MaximizeButton 2618 +#define wxAuiPaneInfo_MinSize_1 2619 +#define wxAuiPaneInfo_MinSize_2 2620 +#define wxAuiPaneInfo_MinimizeButton 2621 +#define wxAuiPaneInfo_Movable 2622 +#define wxAuiPaneInfo_Name 2623 +#define wxAuiPaneInfo_PaneBorder 2624 +#define wxAuiPaneInfo_PinButton 2625 +#define wxAuiPaneInfo_Position 2626 +#define wxAuiPaneInfo_Resizable 2627 +#define wxAuiPaneInfo_Right 2628 +#define wxAuiPaneInfo_RightDockable 2629 +#define wxAuiPaneInfo_Row 2630 +#define wxAuiPaneInfo_SafeSet 2631 +#define wxAuiPaneInfo_SetFlag 2632 +#define wxAuiPaneInfo_Show 2633 +#define wxAuiPaneInfo_ToolbarPane 2634 +#define wxAuiPaneInfo_Top 2635 +#define wxAuiPaneInfo_TopDockable 2636 +#define wxAuiPaneInfo_Window 2637 +#define wxAuiNotebook_new_0 2638 +#define wxAuiNotebook_new_2 2639 +#define wxAuiNotebook_AddPage 2640 +#define wxAuiNotebook_Create 2641 +#define wxAuiNotebook_DeletePage 2642 +#define wxAuiNotebook_GetArtProvider 2643 +#define wxAuiNotebook_GetPage 2644 +#define wxAuiNotebook_GetPageBitmap 2645 +#define wxAuiNotebook_GetPageCount 2646 +#define wxAuiNotebook_GetPageIndex 2647 +#define wxAuiNotebook_GetPageText 2648 +#define wxAuiNotebook_GetSelection 2649 +#define wxAuiNotebook_InsertPage 2650 +#define wxAuiNotebook_RemovePage 2651 +#define wxAuiNotebook_SetArtProvider 2652 +#define wxAuiNotebook_SetFont 2653 +#define wxAuiNotebook_SetPageBitmap 2654 +#define wxAuiNotebook_SetPageText 2655 +#define wxAuiNotebook_SetSelection 2656 +#define wxAuiNotebook_SetTabCtrlHeight 2657 +#define wxAuiNotebook_SetUniformBitmapSize 2658 +#define wxAuiNotebook_destroy 2659 +#define wxMDIParentFrame_new_0 2660 +#define wxMDIParentFrame_new_4 2661 +#define wxMDIParentFrame_destruct 2662 +#define wxMDIParentFrame_ActivateNext 2663 +#define wxMDIParentFrame_ActivatePrevious 2664 +#define wxMDIParentFrame_ArrangeIcons 2665 +#define wxMDIParentFrame_Cascade 2666 +#define wxMDIParentFrame_Create 2667 +#define wxMDIParentFrame_GetActiveChild 2668 +#define wxMDIParentFrame_GetClientWindow 2669 +#define wxMDIParentFrame_Tile 2670 +#define wxMDIChildFrame_new_0 2671 +#define wxMDIChildFrame_new_4 2672 +#define wxMDIChildFrame_destruct 2673 +#define wxMDIChildFrame_Activate 2674 +#define wxMDIChildFrame_Create 2675 +#define wxMDIChildFrame_Maximize 2676 +#define wxMDIChildFrame_Restore 2677 +#define wxMDIClientWindow_new_0 2678 +#define wxMDIClientWindow_new_2 2679 +#define wxMDIClientWindow_destruct 2680 +#define wxMDIClientWindow_CreateClient 2681 +#define wxLayoutAlgorithm_new 2682 +#define wxLayoutAlgorithm_LayoutFrame 2683 +#define wxLayoutAlgorithm_LayoutMDIFrame 2684 +#define wxLayoutAlgorithm_LayoutWindow 2685 +#define wxLayoutAlgorithm_destroy 2686 +#define wxEvent_GetId 2687 +#define wxEvent_GetSkipped 2688 +#define wxEvent_GetTimestamp 2689 +#define wxEvent_IsCommandEvent 2690 +#define wxEvent_ResumePropagation 2691 +#define wxEvent_ShouldPropagate 2692 +#define wxEvent_Skip 2693 +#define wxEvent_StopPropagation 2694 +#define wxCommandEvent_getClientData 2695 +#define wxCommandEvent_GetExtraLong 2696 +#define wxCommandEvent_GetInt 2697 +#define wxCommandEvent_GetSelection 2698 +#define wxCommandEvent_GetString 2699 +#define wxCommandEvent_IsChecked 2700 +#define wxCommandEvent_IsSelection 2701 +#define wxCommandEvent_SetInt 2702 +#define wxCommandEvent_SetString 2703 +#define wxScrollEvent_GetOrientation 2704 +#define wxScrollEvent_GetPosition 2705 +#define wxScrollWinEvent_GetOrientation 2706 +#define wxScrollWinEvent_GetPosition 2707 +#define wxMouseEvent_AltDown 2708 +#define wxMouseEvent_Button 2709 +#define wxMouseEvent_ButtonDClick 2710 +#define wxMouseEvent_ButtonDown 2711 +#define wxMouseEvent_ButtonUp 2712 +#define wxMouseEvent_CmdDown 2713 +#define wxMouseEvent_ControlDown 2714 +#define wxMouseEvent_Dragging 2715 +#define wxMouseEvent_Entering 2716 +#define wxMouseEvent_GetButton 2717 +#define wxMouseEvent_GetPosition 2720 +#define wxMouseEvent_GetLogicalPosition 2721 +#define wxMouseEvent_GetLinesPerAction 2722 +#define wxMouseEvent_GetWheelRotation 2723 +#define wxMouseEvent_GetWheelDelta 2724 +#define wxMouseEvent_GetX 2725 +#define wxMouseEvent_GetY 2726 +#define wxMouseEvent_IsButton 2727 +#define wxMouseEvent_IsPageScroll 2728 +#define wxMouseEvent_Leaving 2729 +#define wxMouseEvent_LeftDClick 2730 +#define wxMouseEvent_LeftDown 2731 +#define wxMouseEvent_LeftIsDown 2732 +#define wxMouseEvent_LeftUp 2733 +#define wxMouseEvent_MetaDown 2734 +#define wxMouseEvent_MiddleDClick 2735 +#define wxMouseEvent_MiddleDown 2736 +#define wxMouseEvent_MiddleIsDown 2737 +#define wxMouseEvent_MiddleUp 2738 +#define wxMouseEvent_Moving 2739 +#define wxMouseEvent_RightDClick 2740 +#define wxMouseEvent_RightDown 2741 +#define wxMouseEvent_RightIsDown 2742 +#define wxMouseEvent_RightUp 2743 +#define wxMouseEvent_ShiftDown 2744 +#define wxSetCursorEvent_GetCursor 2745 +#define wxSetCursorEvent_GetX 2746 +#define wxSetCursorEvent_GetY 2747 +#define wxSetCursorEvent_HasCursor 2748 +#define wxSetCursorEvent_SetCursor 2749 +#define wxKeyEvent_AltDown 2750 +#define wxKeyEvent_CmdDown 2751 +#define wxKeyEvent_ControlDown 2752 +#define wxKeyEvent_GetKeyCode 2753 +#define wxKeyEvent_GetModifiers 2754 +#define wxKeyEvent_GetPosition 2757 +#define wxKeyEvent_GetRawKeyCode 2758 +#define wxKeyEvent_GetRawKeyFlags 2759 +#define wxKeyEvent_GetUnicodeKey 2760 +#define wxKeyEvent_GetX 2761 +#define wxKeyEvent_GetY 2762 +#define wxKeyEvent_HasModifiers 2763 +#define wxKeyEvent_MetaDown 2764 +#define wxKeyEvent_ShiftDown 2765 +#define wxSizeEvent_GetSize 2766 +#define wxMoveEvent_GetPosition 2767 +#define wxEraseEvent_GetDC 2768 +#define wxFocusEvent_GetWindow 2769 +#define wxChildFocusEvent_GetWindow 2770 +#define wxMenuEvent_GetMenu 2771 +#define wxMenuEvent_GetMenuId 2772 +#define wxMenuEvent_IsPopup 2773 +#define wxCloseEvent_CanVeto 2774 +#define wxCloseEvent_GetLoggingOff 2775 +#define wxCloseEvent_SetCanVeto 2776 +#define wxCloseEvent_SetLoggingOff 2777 +#define wxCloseEvent_Veto 2778 +#define wxShowEvent_SetShow 2779 +#define wxShowEvent_GetShow 2780 +#define wxIconizeEvent_Iconized 2781 +#define wxJoystickEvent_ButtonDown 2782 +#define wxJoystickEvent_ButtonIsDown 2783 +#define wxJoystickEvent_ButtonUp 2784 +#define wxJoystickEvent_GetButtonChange 2785 +#define wxJoystickEvent_GetButtonState 2786 +#define wxJoystickEvent_GetJoystick 2787 +#define wxJoystickEvent_GetPosition 2788 +#define wxJoystickEvent_GetZPosition 2789 +#define wxJoystickEvent_IsButton 2790 +#define wxJoystickEvent_IsMove 2791 +#define wxJoystickEvent_IsZMove 2792 +#define wxUpdateUIEvent_CanUpdate 2793 +#define wxUpdateUIEvent_Check 2794 +#define wxUpdateUIEvent_Enable 2795 +#define wxUpdateUIEvent_Show 2796 +#define wxUpdateUIEvent_GetChecked 2797 +#define wxUpdateUIEvent_GetEnabled 2798 +#define wxUpdateUIEvent_GetShown 2799 +#define wxUpdateUIEvent_GetSetChecked 2800 +#define wxUpdateUIEvent_GetSetEnabled 2801 +#define wxUpdateUIEvent_GetSetShown 2802 +#define wxUpdateUIEvent_GetSetText 2803 +#define wxUpdateUIEvent_GetText 2804 +#define wxUpdateUIEvent_GetMode 2805 +#define wxUpdateUIEvent_GetUpdateInterval 2806 +#define wxUpdateUIEvent_ResetUpdateTime 2807 +#define wxUpdateUIEvent_SetMode 2808 +#define wxUpdateUIEvent_SetText 2809 +#define wxUpdateUIEvent_SetUpdateInterval 2810 +#define wxMouseCaptureChangedEvent_GetCapturedWindow 2811 +#define wxPaletteChangedEvent_SetChangedWindow 2812 +#define wxPaletteChangedEvent_GetChangedWindow 2813 +#define wxQueryNewPaletteEvent_SetPaletteRealized 2814 +#define wxQueryNewPaletteEvent_GetPaletteRealized 2815 +#define wxNavigationKeyEvent_GetDirection 2816 +#define wxNavigationKeyEvent_SetDirection 2817 +#define wxNavigationKeyEvent_IsWindowChange 2818 +#define wxNavigationKeyEvent_SetWindowChange 2819 +#define wxNavigationKeyEvent_IsFromTab 2820 +#define wxNavigationKeyEvent_SetFromTab 2821 +#define wxNavigationKeyEvent_GetCurrentFocus 2822 +#define wxNavigationKeyEvent_SetCurrentFocus 2823 +#define wxHelpEvent_GetOrigin 2824 +#define wxHelpEvent_GetPosition 2825 +#define wxHelpEvent_SetOrigin 2826 +#define wxHelpEvent_SetPosition 2827 +#define wxContextMenuEvent_GetPosition 2828 +#define wxContextMenuEvent_SetPosition 2829 +#define wxIdleEvent_CanSend 2830 +#define wxIdleEvent_GetMode 2831 +#define wxIdleEvent_RequestMore 2832 +#define wxIdleEvent_MoreRequested 2833 +#define wxIdleEvent_SetMode 2834 +#define wxGridEvent_AltDown 2835 +#define wxGridEvent_ControlDown 2836 +#define wxGridEvent_GetCol 2837 +#define wxGridEvent_GetPosition 2838 +#define wxGridEvent_GetRow 2839 +#define wxGridEvent_MetaDown 2840 +#define wxGridEvent_Selecting 2841 +#define wxGridEvent_ShiftDown 2842 +#define wxNotifyEvent_Allow 2843 +#define wxNotifyEvent_IsAllowed 2844 +#define wxNotifyEvent_Veto 2845 +#define wxSashEvent_GetEdge 2846 +#define wxSashEvent_GetDragRect 2847 +#define wxSashEvent_GetDragStatus 2848 +#define wxListEvent_GetCacheFrom 2849 +#define wxListEvent_GetCacheTo 2850 +#define wxListEvent_GetKeyCode 2851 +#define wxListEvent_GetIndex 2852 +#define wxListEvent_GetColumn 2853 +#define wxListEvent_GetPoint 2854 +#define wxListEvent_GetLabel 2855 +#define wxListEvent_GetText 2856 +#define wxListEvent_GetImage 2857 +#define wxListEvent_GetData 2858 +#define wxListEvent_GetMask 2859 +#define wxListEvent_GetItem 2860 +#define wxListEvent_IsEditCancelled 2861 +#define wxDateEvent_GetDate 2862 +#define wxCalendarEvent_GetWeekDay 2863 +#define wxFileDirPickerEvent_GetPath 2864 +#define wxColourPickerEvent_GetColour 2865 +#define wxFontPickerEvent_GetFont 2866 +#define wxStyledTextEvent_GetPosition 2867 +#define wxStyledTextEvent_GetKey 2868 +#define wxStyledTextEvent_GetModifiers 2869 +#define wxStyledTextEvent_GetModificationType 2870 +#define wxStyledTextEvent_GetText 2871 +#define wxStyledTextEvent_GetLength 2872 +#define wxStyledTextEvent_GetLinesAdded 2873 +#define wxStyledTextEvent_GetLine 2874 +#define wxStyledTextEvent_GetFoldLevelNow 2875 +#define wxStyledTextEvent_GetFoldLevelPrev 2876 +#define wxStyledTextEvent_GetMargin 2877 +#define wxStyledTextEvent_GetMessage 2878 +#define wxStyledTextEvent_GetWParam 2879 +#define wxStyledTextEvent_GetLParam 2880 +#define wxStyledTextEvent_GetListType 2881 +#define wxStyledTextEvent_GetX 2882 +#define wxStyledTextEvent_GetY 2883 +#define wxStyledTextEvent_GetDragText 2884 +#define wxStyledTextEvent_GetDragAllowMove 2885 +#define wxStyledTextEvent_GetDragResult 2886 +#define wxStyledTextEvent_GetShift 2887 +#define wxStyledTextEvent_GetControl 2888 +#define wxStyledTextEvent_GetAlt 2889 +#define utils_wxGetKeyState 2890 +#define utils_wxGetMousePosition 2891 +#define utils_wxGetMouseState 2892 +#define utils_wxSetDetectableAutoRepeat 2893 +#define utils_wxBell 2894 +#define utils_wxFindMenuItemId 2895 +#define utils_wxGenericFindWindowAtPoint 2896 +#define utils_wxFindWindowAtPoint 2897 +#define utils_wxBeginBusyCursor 2898 +#define utils_wxEndBusyCursor 2899 +#define utils_wxIsBusy 2900 +#define utils_wxShutdown 2901 +#define utils_wxShell 2902 +#define utils_wxLaunchDefaultBrowser 2903 +#define utils_wxGetEmailAddress 2904 +#define utils_wxGetUserId 2905 +#define utils_wxGetHomeDir 2906 +#define utils_wxNewId 2907 +#define utils_wxRegisterId 2908 +#define utils_wxGetCurrentId 2909 +#define utils_wxGetOsDescription 2910 +#define utils_wxIsPlatformLittleEndian 2911 +#define utils_wxIsPlatform64Bit 2912 +#define wxPrintout_new 2913 +#define wxPrintout_destruct 2914 +#define wxPrintout_GetDC 2915 +#define wxPrintout_GetPageSizeMM 2916 +#define wxPrintout_GetPageSizePixels 2917 +#define wxPrintout_GetPaperRectPixels 2918 +#define wxPrintout_GetPPIPrinter 2919 +#define wxPrintout_GetPPIScreen 2920 +#define wxPrintout_GetTitle 2921 +#define wxPrintout_IsPreview 2922 +#define wxPrintout_FitThisSizeToPaper 2923 +#define wxPrintout_FitThisSizeToPage 2924 +#define wxPrintout_FitThisSizeToPageMargins 2925 +#define wxPrintout_MapScreenSizeToPaper 2926 +#define wxPrintout_MapScreenSizeToPage 2927 +#define wxPrintout_MapScreenSizeToPageMargins 2928 +#define wxPrintout_MapScreenSizeToDevice 2929 +#define wxPrintout_GetLogicalPaperRect 2930 +#define wxPrintout_GetLogicalPageRect 2931 +#define wxPrintout_GetLogicalPageMarginsRect 2932 +#define wxPrintout_SetLogicalOrigin 2933 +#define wxPrintout_OffsetLogicalOrigin 2934 +#define wxStyledTextCtrl_new_2 2935 +#define wxStyledTextCtrl_new_0 2936 +#define wxStyledTextCtrl_destruct 2937 +#define wxStyledTextCtrl_Create 2938 +#define wxStyledTextCtrl_AddText 2939 +#define wxStyledTextCtrl_AddStyledText 2940 +#define wxStyledTextCtrl_InsertText 2941 +#define wxStyledTextCtrl_ClearAll 2942 +#define wxStyledTextCtrl_ClearDocumentStyle 2943 +#define wxStyledTextCtrl_GetLength 2944 +#define wxStyledTextCtrl_GetCharAt 2945 +#define wxStyledTextCtrl_GetCurrentPos 2946 +#define wxStyledTextCtrl_GetAnchor 2947 +#define wxStyledTextCtrl_GetStyleAt 2948 +#define wxStyledTextCtrl_Redo 2949 +#define wxStyledTextCtrl_SetUndoCollection 2950 +#define wxStyledTextCtrl_SelectAll 2951 +#define wxStyledTextCtrl_SetSavePoint 2952 +#define wxStyledTextCtrl_GetStyledText 2953 +#define wxStyledTextCtrl_CanRedo 2954 +#define wxStyledTextCtrl_MarkerLineFromHandle 2955 +#define wxStyledTextCtrl_MarkerDeleteHandle 2956 +#define wxStyledTextCtrl_GetUndoCollection 2957 +#define wxStyledTextCtrl_GetViewWhiteSpace 2958 +#define wxStyledTextCtrl_SetViewWhiteSpace 2959 +#define wxStyledTextCtrl_PositionFromPoint 2960 +#define wxStyledTextCtrl_PositionFromPointClose 2961 +#define wxStyledTextCtrl_GotoLine 2962 +#define wxStyledTextCtrl_GotoPos 2963 +#define wxStyledTextCtrl_SetAnchor 2964 +#define wxStyledTextCtrl_GetCurLine 2965 +#define wxStyledTextCtrl_GetEndStyled 2966 +#define wxStyledTextCtrl_ConvertEOLs 2967 +#define wxStyledTextCtrl_GetEOLMode 2968 +#define wxStyledTextCtrl_SetEOLMode 2969 +#define wxStyledTextCtrl_StartStyling 2970 +#define wxStyledTextCtrl_SetStyling 2971 +#define wxStyledTextCtrl_GetBufferedDraw 2972 +#define wxStyledTextCtrl_SetBufferedDraw 2973 +#define wxStyledTextCtrl_SetTabWidth 2974 +#define wxStyledTextCtrl_GetTabWidth 2975 +#define wxStyledTextCtrl_SetCodePage 2976 +#define wxStyledTextCtrl_MarkerDefine 2977 +#define wxStyledTextCtrl_MarkerSetForeground 2978 +#define wxStyledTextCtrl_MarkerSetBackground 2979 +#define wxStyledTextCtrl_MarkerAdd 2980 +#define wxStyledTextCtrl_MarkerDelete 2981 +#define wxStyledTextCtrl_MarkerDeleteAll 2982 +#define wxStyledTextCtrl_MarkerGet 2983 +#define wxStyledTextCtrl_MarkerNext 2984 +#define wxStyledTextCtrl_MarkerPrevious 2985 +#define wxStyledTextCtrl_MarkerDefineBitmap 2986 +#define wxStyledTextCtrl_MarkerAddSet 2987 +#define wxStyledTextCtrl_MarkerSetAlpha 2988 +#define wxStyledTextCtrl_SetMarginType 2989 +#define wxStyledTextCtrl_GetMarginType 2990 +#define wxStyledTextCtrl_SetMarginWidth 2991 +#define wxStyledTextCtrl_GetMarginWidth 2992 +#define wxStyledTextCtrl_SetMarginMask 2993 +#define wxStyledTextCtrl_GetMarginMask 2994 +#define wxStyledTextCtrl_SetMarginSensitive 2995 +#define wxStyledTextCtrl_GetMarginSensitive 2996 +#define wxStyledTextCtrl_StyleClearAll 2997 +#define wxStyledTextCtrl_StyleSetForeground 2998 +#define wxStyledTextCtrl_StyleSetBackground 2999 +#define wxStyledTextCtrl_StyleSetBold 3000 +#define wxStyledTextCtrl_StyleSetItalic 3001 +#define wxStyledTextCtrl_StyleSetSize 3002 +#define wxStyledTextCtrl_StyleSetFaceName 3003 +#define wxStyledTextCtrl_StyleSetEOLFilled 3004 +#define wxStyledTextCtrl_StyleResetDefault 3005 +#define wxStyledTextCtrl_StyleSetUnderline 3006 +#define wxStyledTextCtrl_StyleSetCase 3007 +#define wxStyledTextCtrl_StyleSetHotSpot 3008 +#define wxStyledTextCtrl_SetSelForeground 3009 +#define wxStyledTextCtrl_SetSelBackground 3010 +#define wxStyledTextCtrl_GetSelAlpha 3011 +#define wxStyledTextCtrl_SetSelAlpha 3012 +#define wxStyledTextCtrl_SetCaretForeground 3013 +#define wxStyledTextCtrl_CmdKeyAssign 3014 +#define wxStyledTextCtrl_CmdKeyClear 3015 +#define wxStyledTextCtrl_CmdKeyClearAll 3016 +#define wxStyledTextCtrl_SetStyleBytes 3017 +#define wxStyledTextCtrl_StyleSetVisible 3018 +#define wxStyledTextCtrl_GetCaretPeriod 3019 +#define wxStyledTextCtrl_SetCaretPeriod 3020 +#define wxStyledTextCtrl_SetWordChars 3021 +#define wxStyledTextCtrl_BeginUndoAction 3022 +#define wxStyledTextCtrl_EndUndoAction 3023 +#define wxStyledTextCtrl_IndicatorSetStyle 3024 +#define wxStyledTextCtrl_IndicatorGetStyle 3025 +#define wxStyledTextCtrl_IndicatorSetForeground 3026 +#define wxStyledTextCtrl_IndicatorGetForeground 3027 +#define wxStyledTextCtrl_SetWhitespaceForeground 3028 +#define wxStyledTextCtrl_SetWhitespaceBackground 3029 +#define wxStyledTextCtrl_GetStyleBits 3030 +#define wxStyledTextCtrl_SetLineState 3031 +#define wxStyledTextCtrl_GetLineState 3032 +#define wxStyledTextCtrl_GetMaxLineState 3033 +#define wxStyledTextCtrl_GetCaretLineVisible 3034 +#define wxStyledTextCtrl_SetCaretLineVisible 3035 +#define wxStyledTextCtrl_GetCaretLineBackground 3036 +#define wxStyledTextCtrl_SetCaretLineBackground 3037 +#define wxStyledTextCtrl_AutoCompShow 3038 +#define wxStyledTextCtrl_AutoCompCancel 3039 +#define wxStyledTextCtrl_AutoCompActive 3040 +#define wxStyledTextCtrl_AutoCompPosStart 3041 +#define wxStyledTextCtrl_AutoCompComplete 3042 +#define wxStyledTextCtrl_AutoCompStops 3043 +#define wxStyledTextCtrl_AutoCompSetSeparator 3044 +#define wxStyledTextCtrl_AutoCompGetSeparator 3045 +#define wxStyledTextCtrl_AutoCompSelect 3046 +#define wxStyledTextCtrl_AutoCompSetCancelAtStart 3047 +#define wxStyledTextCtrl_AutoCompGetCancelAtStart 3048 +#define wxStyledTextCtrl_AutoCompSetFillUps 3049 +#define wxStyledTextCtrl_AutoCompSetChooseSingle 3050 +#define wxStyledTextCtrl_AutoCompGetChooseSingle 3051 +#define wxStyledTextCtrl_AutoCompSetIgnoreCase 3052 +#define wxStyledTextCtrl_AutoCompGetIgnoreCase 3053 +#define wxStyledTextCtrl_UserListShow 3054 +#define wxStyledTextCtrl_AutoCompSetAutoHide 3055 +#define wxStyledTextCtrl_AutoCompGetAutoHide 3056 +#define wxStyledTextCtrl_AutoCompSetDropRestOfWord 3057 +#define wxStyledTextCtrl_AutoCompGetDropRestOfWord 3058 +#define wxStyledTextCtrl_RegisterImage 3059 +#define wxStyledTextCtrl_ClearRegisteredImages 3060 +#define wxStyledTextCtrl_AutoCompGetTypeSeparator 3061 +#define wxStyledTextCtrl_AutoCompSetTypeSeparator 3062 +#define wxStyledTextCtrl_AutoCompSetMaxWidth 3063 +#define wxStyledTextCtrl_AutoCompGetMaxWidth 3064 +#define wxStyledTextCtrl_AutoCompSetMaxHeight 3065 +#define wxStyledTextCtrl_AutoCompGetMaxHeight 3066 +#define wxStyledTextCtrl_SetIndent 3067 +#define wxStyledTextCtrl_GetIndent 3068 +#define wxStyledTextCtrl_SetUseTabs 3069 +#define wxStyledTextCtrl_GetUseTabs 3070 +#define wxStyledTextCtrl_SetLineIndentation 3071 +#define wxStyledTextCtrl_GetLineIndentation 3072 +#define wxStyledTextCtrl_GetLineIndentPosition 3073 +#define wxStyledTextCtrl_GetColumn 3074 +#define wxStyledTextCtrl_SetUseHorizontalScrollBar 3075 +#define wxStyledTextCtrl_GetUseHorizontalScrollBar 3076 +#define wxStyledTextCtrl_SetIndentationGuides 3077 +#define wxStyledTextCtrl_GetIndentationGuides 3078 +#define wxStyledTextCtrl_SetHighlightGuide 3079 +#define wxStyledTextCtrl_GetHighlightGuide 3080 +#define wxStyledTextCtrl_GetLineEndPosition 3081 +#define wxStyledTextCtrl_GetCodePage 3082 +#define wxStyledTextCtrl_GetCaretForeground 3083 +#define wxStyledTextCtrl_GetReadOnly 3084 +#define wxStyledTextCtrl_SetCurrentPos 3085 +#define wxStyledTextCtrl_SetSelectionStart 3086 +#define wxStyledTextCtrl_GetSelectionStart 3087 +#define wxStyledTextCtrl_SetSelectionEnd 3088 +#define wxStyledTextCtrl_GetSelectionEnd 3089 +#define wxStyledTextCtrl_SetPrintMagnification 3090 +#define wxStyledTextCtrl_GetPrintMagnification 3091 +#define wxStyledTextCtrl_SetPrintColourMode 3092 +#define wxStyledTextCtrl_GetPrintColourMode 3093 +#define wxStyledTextCtrl_FindText 3094 +#define wxStyledTextCtrl_FormatRange 3095 +#define wxStyledTextCtrl_GetFirstVisibleLine 3096 +#define wxStyledTextCtrl_GetLine 3097 +#define wxStyledTextCtrl_GetLineCount 3098 +#define wxStyledTextCtrl_SetMarginLeft 3099 +#define wxStyledTextCtrl_GetMarginLeft 3100 +#define wxStyledTextCtrl_SetMarginRight 3101 +#define wxStyledTextCtrl_GetMarginRight 3102 +#define wxStyledTextCtrl_GetModify 3103 +#define wxStyledTextCtrl_SetSelection 3104 +#define wxStyledTextCtrl_GetSelectedText 3105 +#define wxStyledTextCtrl_GetTextRange 3106 +#define wxStyledTextCtrl_HideSelection 3107 +#define wxStyledTextCtrl_LineFromPosition 3108 +#define wxStyledTextCtrl_PositionFromLine 3109 +#define wxStyledTextCtrl_LineScroll 3110 +#define wxStyledTextCtrl_EnsureCaretVisible 3111 +#define wxStyledTextCtrl_ReplaceSelection 3112 +#define wxStyledTextCtrl_SetReadOnly 3113 +#define wxStyledTextCtrl_CanPaste 3114 +#define wxStyledTextCtrl_CanUndo 3115 +#define wxStyledTextCtrl_EmptyUndoBuffer 3116 +#define wxStyledTextCtrl_Undo 3117 +#define wxStyledTextCtrl_Cut 3118 +#define wxStyledTextCtrl_Copy 3119 +#define wxStyledTextCtrl_Paste 3120 +#define wxStyledTextCtrl_Clear 3121 +#define wxStyledTextCtrl_SetText 3122 +#define wxStyledTextCtrl_GetText 3123 +#define wxStyledTextCtrl_GetTextLength 3124 +#define wxStyledTextCtrl_GetOvertype 3125 +#define wxStyledTextCtrl_SetCaretWidth 3126 +#define wxStyledTextCtrl_GetCaretWidth 3127 +#define wxStyledTextCtrl_SetTargetStart 3128 +#define wxStyledTextCtrl_GetTargetStart 3129 +#define wxStyledTextCtrl_SetTargetEnd 3130 +#define wxStyledTextCtrl_GetTargetEnd 3131 +#define wxStyledTextCtrl_ReplaceTarget 3132 +#define wxStyledTextCtrl_SearchInTarget 3133 +#define wxStyledTextCtrl_SetSearchFlags 3134 +#define wxStyledTextCtrl_GetSearchFlags 3135 +#define wxStyledTextCtrl_CallTipShow 3136 +#define wxStyledTextCtrl_CallTipCancel 3137 +#define wxStyledTextCtrl_CallTipActive 3138 +#define wxStyledTextCtrl_CallTipPosAtStart 3139 +#define wxStyledTextCtrl_CallTipSetHighlight 3140 +#define wxStyledTextCtrl_CallTipSetBackground 3141 +#define wxStyledTextCtrl_CallTipSetForeground 3142 +#define wxStyledTextCtrl_CallTipSetForegroundHighlight 3143 +#define wxStyledTextCtrl_CallTipUseStyle 3144 +#define wxStyledTextCtrl_VisibleFromDocLine 3145 +#define wxStyledTextCtrl_DocLineFromVisible 3146 +#define wxStyledTextCtrl_WrapCount 3147 +#define wxStyledTextCtrl_SetFoldLevel 3148 +#define wxStyledTextCtrl_GetFoldLevel 3149 +#define wxStyledTextCtrl_GetLastChild 3150 +#define wxStyledTextCtrl_GetFoldParent 3151 +#define wxStyledTextCtrl_ShowLines 3152 +#define wxStyledTextCtrl_HideLines 3153 +#define wxStyledTextCtrl_GetLineVisible 3154 +#define wxStyledTextCtrl_SetFoldExpanded 3155 +#define wxStyledTextCtrl_GetFoldExpanded 3156 +#define wxStyledTextCtrl_ToggleFold 3157 +#define wxStyledTextCtrl_EnsureVisible 3158 +#define wxStyledTextCtrl_SetFoldFlags 3159 +#define wxStyledTextCtrl_EnsureVisibleEnforcePolicy 3160 +#define wxStyledTextCtrl_SetTabIndents 3161 +#define wxStyledTextCtrl_GetTabIndents 3162 +#define wxStyledTextCtrl_SetBackSpaceUnIndents 3163 +#define wxStyledTextCtrl_GetBackSpaceUnIndents 3164 +#define wxStyledTextCtrl_SetMouseDwellTime 3165 +#define wxStyledTextCtrl_GetMouseDwellTime 3166 +#define wxStyledTextCtrl_WordStartPosition 3167 +#define wxStyledTextCtrl_WordEndPosition 3168 +#define wxStyledTextCtrl_SetWrapMode 3169 +#define wxStyledTextCtrl_GetWrapMode 3170 +#define wxStyledTextCtrl_SetWrapVisualFlags 3171 +#define wxStyledTextCtrl_GetWrapVisualFlags 3172 +#define wxStyledTextCtrl_SetWrapVisualFlagsLocation 3173 +#define wxStyledTextCtrl_GetWrapVisualFlagsLocation 3174 +#define wxStyledTextCtrl_SetWrapStartIndent 3175 +#define wxStyledTextCtrl_GetWrapStartIndent 3176 +#define wxStyledTextCtrl_SetLayoutCache 3177 +#define wxStyledTextCtrl_GetLayoutCache 3178 +#define wxStyledTextCtrl_SetScrollWidth 3179 +#define wxStyledTextCtrl_GetScrollWidth 3180 +#define wxStyledTextCtrl_TextWidth 3181 +#define wxStyledTextCtrl_GetEndAtLastLine 3182 +#define wxStyledTextCtrl_TextHeight 3183 +#define wxStyledTextCtrl_SetUseVerticalScrollBar 3184 +#define wxStyledTextCtrl_GetUseVerticalScrollBar 3185 +#define wxStyledTextCtrl_AppendText 3186 +#define wxStyledTextCtrl_GetTwoPhaseDraw 3187 +#define wxStyledTextCtrl_SetTwoPhaseDraw 3188 +#define wxStyledTextCtrl_TargetFromSelection 3189 +#define wxStyledTextCtrl_LinesJoin 3190 +#define wxStyledTextCtrl_LinesSplit 3191 +#define wxStyledTextCtrl_SetFoldMarginColour 3192 +#define wxStyledTextCtrl_SetFoldMarginHiColour 3193 +#define wxStyledTextCtrl_LineDown 3194 +#define wxStyledTextCtrl_LineDownExtend 3195 +#define wxStyledTextCtrl_LineUp 3196 +#define wxStyledTextCtrl_LineUpExtend 3197 +#define wxStyledTextCtrl_CharLeft 3198 +#define wxStyledTextCtrl_CharLeftExtend 3199 +#define wxStyledTextCtrl_CharRight 3200 +#define wxStyledTextCtrl_CharRightExtend 3201 +#define wxStyledTextCtrl_WordLeft 3202 +#define wxStyledTextCtrl_WordLeftExtend 3203 +#define wxStyledTextCtrl_WordRight 3204 +#define wxStyledTextCtrl_WordRightExtend 3205 +#define wxStyledTextCtrl_Home 3206 +#define wxStyledTextCtrl_HomeExtend 3207 +#define wxStyledTextCtrl_LineEnd 3208 +#define wxStyledTextCtrl_LineEndExtend 3209 +#define wxStyledTextCtrl_DocumentStart 3210 +#define wxStyledTextCtrl_DocumentStartExtend 3211 +#define wxStyledTextCtrl_DocumentEnd 3212 +#define wxStyledTextCtrl_DocumentEndExtend 3213 +#define wxStyledTextCtrl_PageUp 3214 +#define wxStyledTextCtrl_PageUpExtend 3215 +#define wxStyledTextCtrl_PageDown 3216 +#define wxStyledTextCtrl_PageDownExtend 3217 +#define wxStyledTextCtrl_EditToggleOvertype 3218 +#define wxStyledTextCtrl_Cancel 3219 +#define wxStyledTextCtrl_DeleteBack 3220 +#define wxStyledTextCtrl_Tab 3221 +#define wxStyledTextCtrl_BackTab 3222 +#define wxStyledTextCtrl_NewLine 3223 +#define wxStyledTextCtrl_FormFeed 3224 +#define wxStyledTextCtrl_VCHome 3225 +#define wxStyledTextCtrl_VCHomeExtend 3226 +#define wxStyledTextCtrl_ZoomIn 3227 +#define wxStyledTextCtrl_ZoomOut 3228 +#define wxStyledTextCtrl_DelWordLeft 3229 +#define wxStyledTextCtrl_DelWordRight 3230 +#define wxStyledTextCtrl_LineCut 3231 +#define wxStyledTextCtrl_LineDelete 3232 +#define wxStyledTextCtrl_LineTranspose 3233 +#define wxStyledTextCtrl_LineDuplicate 3234 +#define wxStyledTextCtrl_LowerCase 3235 +#define wxStyledTextCtrl_UpperCase 3236 +#define wxStyledTextCtrl_LineScrollDown 3237 +#define wxStyledTextCtrl_LineScrollUp 3238 +#define wxStyledTextCtrl_DeleteBackNotLine 3239 +#define wxStyledTextCtrl_HomeDisplay 3240 +#define wxStyledTextCtrl_HomeDisplayExtend 3241 +#define wxStyledTextCtrl_LineEndDisplay 3242 +#define wxStyledTextCtrl_LineEndDisplayExtend 3243 +#define wxStyledTextCtrl_HomeWrapExtend 3244 +#define wxStyledTextCtrl_LineEndWrap 3245 +#define wxStyledTextCtrl_LineEndWrapExtend 3246 +#define wxStyledTextCtrl_VCHomeWrap 3247 +#define wxStyledTextCtrl_VCHomeWrapExtend 3248 +#define wxStyledTextCtrl_LineCopy 3249 +#define wxStyledTextCtrl_MoveCaretInsideView 3250 +#define wxStyledTextCtrl_LineLength 3251 +#define wxStyledTextCtrl_BraceHighlight 3252 +#define wxStyledTextCtrl_BraceBadLight 3253 +#define wxStyledTextCtrl_BraceMatch 3254 +#define wxStyledTextCtrl_GetViewEOL 3255 +#define wxStyledTextCtrl_SetViewEOL 3256 +#define wxStyledTextCtrl_SetModEventMask 3257 +#define wxStyledTextCtrl_GetEdgeColumn 3258 +#define wxStyledTextCtrl_SetEdgeColumn 3259 +#define wxStyledTextCtrl_GetEdgeMode 3260 +#define wxStyledTextCtrl_GetEdgeColour 3261 +#define wxStyledTextCtrl_SetEdgeColour 3262 +#define wxStyledTextCtrl_SearchAnchor 3263 +#define wxStyledTextCtrl_SearchNext 3264 +#define wxStyledTextCtrl_SearchPrev 3265 +#define wxStyledTextCtrl_LinesOnScreen 3266 +#define wxStyledTextCtrl_UsePopUp 3267 +#define wxStyledTextCtrl_SelectionIsRectangle 3268 +#define wxStyledTextCtrl_SetZoom 3269 +#define wxStyledTextCtrl_GetZoom 3270 +#define wxStyledTextCtrl_GetModEventMask 3271 +#define wxStyledTextCtrl_SetSTCFocus 3272 +#define wxStyledTextCtrl_GetSTCFocus 3273 +#define wxStyledTextCtrl_SetStatus 3274 +#define wxStyledTextCtrl_GetStatus 3275 +#define wxStyledTextCtrl_SetMouseDownCaptures 3276 +#define wxStyledTextCtrl_GetMouseDownCaptures 3277 +#define wxStyledTextCtrl_SetSTCCursor 3278 +#define wxStyledTextCtrl_GetSTCCursor 3279 +#define wxStyledTextCtrl_SetControlCharSymbol 3280 +#define wxStyledTextCtrl_GetControlCharSymbol 3281 +#define wxStyledTextCtrl_WordPartLeft 3282 +#define wxStyledTextCtrl_WordPartLeftExtend 3283 +#define wxStyledTextCtrl_WordPartRight 3284 +#define wxStyledTextCtrl_WordPartRightExtend 3285 +#define wxStyledTextCtrl_SetVisiblePolicy 3286 +#define wxStyledTextCtrl_DelLineLeft 3287 +#define wxStyledTextCtrl_DelLineRight 3288 +#define wxStyledTextCtrl_GetXOffset 3289 +#define wxStyledTextCtrl_ChooseCaretX 3290 +#define wxStyledTextCtrl_SetXCaretPolicy 3291 +#define wxStyledTextCtrl_SetYCaretPolicy 3292 +#define wxStyledTextCtrl_GetPrintWrapMode 3293 +#define wxStyledTextCtrl_SetHotspotActiveForeground 3294 +#define wxStyledTextCtrl_SetHotspotActiveBackground 3295 +#define wxStyledTextCtrl_SetHotspotActiveUnderline 3296 +#define wxStyledTextCtrl_SetHotspotSingleLine 3297 +#define wxStyledTextCtrl_ParaDownExtend 3298 +#define wxStyledTextCtrl_ParaUp 3299 +#define wxStyledTextCtrl_ParaUpExtend 3300 +#define wxStyledTextCtrl_PositionBefore 3301 +#define wxStyledTextCtrl_PositionAfter 3302 +#define wxStyledTextCtrl_CopyRange 3303 +#define wxStyledTextCtrl_CopyText 3304 +#define wxStyledTextCtrl_SetSelectionMode 3305 +#define wxStyledTextCtrl_GetSelectionMode 3306 +#define wxStyledTextCtrl_LineDownRectExtend 3307 +#define wxStyledTextCtrl_LineUpRectExtend 3308 +#define wxStyledTextCtrl_CharLeftRectExtend 3309 +#define wxStyledTextCtrl_CharRightRectExtend 3310 +#define wxStyledTextCtrl_HomeRectExtend 3311 +#define wxStyledTextCtrl_VCHomeRectExtend 3312 +#define wxStyledTextCtrl_LineEndRectExtend 3313 +#define wxStyledTextCtrl_PageUpRectExtend 3314 +#define wxStyledTextCtrl_PageDownRectExtend 3315 +#define wxStyledTextCtrl_StutteredPageUp 3316 +#define wxStyledTextCtrl_StutteredPageUpExtend 3317 +#define wxStyledTextCtrl_StutteredPageDown 3318 +#define wxStyledTextCtrl_StutteredPageDownExtend 3319 +#define wxStyledTextCtrl_WordLeftEnd 3320 +#define wxStyledTextCtrl_WordLeftEndExtend 3321 +#define wxStyledTextCtrl_WordRightEnd 3322 +#define wxStyledTextCtrl_WordRightEndExtend 3323 +#define wxStyledTextCtrl_SetWhitespaceChars 3324 +#define wxStyledTextCtrl_SetCharsDefault 3325 +#define wxStyledTextCtrl_AutoCompGetCurrent 3326 +#define wxStyledTextCtrl_Allocate 3327 +#define wxStyledTextCtrl_FindColumn 3328 +#define wxStyledTextCtrl_GetCaretSticky 3329 +#define wxStyledTextCtrl_SetCaretSticky 3330 +#define wxStyledTextCtrl_ToggleCaretSticky 3331 +#define wxStyledTextCtrl_SetPasteConvertEndings 3332 +#define wxStyledTextCtrl_GetPasteConvertEndings 3333 +#define wxStyledTextCtrl_SelectionDuplicate 3334 +#define wxStyledTextCtrl_SetCaretLineBackAlpha 3335 +#define wxStyledTextCtrl_GetCaretLineBackAlpha 3336 +#define wxStyledTextCtrl_StartRecord 3337 +#define wxStyledTextCtrl_StopRecord 3338 +#define wxStyledTextCtrl_SetLexer 3339 +#define wxStyledTextCtrl_GetLexer 3340 +#define wxStyledTextCtrl_Colourise 3341 +#define wxStyledTextCtrl_SetProperty 3342 +#define wxStyledTextCtrl_SetKeyWords 3343 +#define wxStyledTextCtrl_SetLexerLanguage 3344 +#define wxStyledTextCtrl_GetProperty 3345 +#define wxStyledTextCtrl_GetStyleBitsNeeded 3346 +#define wxStyledTextCtrl_GetCurrentLine 3347 +#define wxStyledTextCtrl_StyleSetSpec 3348 +#define wxStyledTextCtrl_StyleSetFont 3349 +#define wxStyledTextCtrl_StyleSetFontAttr 3350 +#define wxStyledTextCtrl_StyleSetCharacterSet 3351 +#define wxStyledTextCtrl_StyleSetFontEncoding 3352 +#define wxStyledTextCtrl_CmdKeyExecute 3353 +#define wxStyledTextCtrl_SetMargins 3354 +#define wxStyledTextCtrl_GetSelection 3355 +#define wxStyledTextCtrl_PointFromPosition 3356 +#define wxStyledTextCtrl_ScrollToLine 3357 +#define wxStyledTextCtrl_ScrollToColumn 3358 +#define wxStyledTextCtrl_SendMsg 3359 +#define wxStyledTextCtrl_SetVScrollBar 3360 +#define wxStyledTextCtrl_SetHScrollBar 3361 +#define wxStyledTextCtrl_GetLastKeydownProcessed 3362 +#define wxStyledTextCtrl_SetLastKeydownProcessed 3363 +#define wxStyledTextCtrl_SaveFile 3364 +#define wxStyledTextCtrl_LoadFile 3365 +#define wxStyledTextCtrl_DoDragOver 3366 +#define wxStyledTextCtrl_DoDropText 3367 +#define wxStyledTextCtrl_GetUseAntiAliasing 3368 +#define wxStyledTextCtrl_AddTextRaw 3369 +#define wxStyledTextCtrl_InsertTextRaw 3370 +#define wxStyledTextCtrl_GetCurLineRaw 3371 +#define wxStyledTextCtrl_GetLineRaw 3372 +#define wxStyledTextCtrl_GetSelectedTextRaw 3373 +#define wxStyledTextCtrl_GetTextRangeRaw 3374 +#define wxStyledTextCtrl_SetTextRaw 3375 +#define wxStyledTextCtrl_GetTextRaw 3376 +#define wxStyledTextCtrl_AppendTextRaw 3377 +#define wxArtProvider_GetBitmap 3378 +#define wxArtProvider_GetIcon 3379 +#define wxTreeEvent_GetKeyCode 3380 +#define wxTreeEvent_GetItem 3381 +#define wxTreeEvent_GetKeyEvent 3382 +#define wxTreeEvent_GetLabel 3383 +#define wxTreeEvent_GetOldItem 3384 +#define wxTreeEvent_GetPoint 3385 +#define wxTreeEvent_IsEditCancelled 3386 +#define wxTreeEvent_SetToolTip 3387 +#define wxNotebookEvent_GetOldSelection 3388 +#define wxNotebookEvent_GetSelection 3389 +#define wxNotebookEvent_SetOldSelection 3390 +#define wxNotebookEvent_SetSelection 3391 +#define wxFileDataObject_new 3392 +#define wxFileDataObject_AddFile 3393 +#define wxFileDataObject_GetFilenames 3394 +#define wxFileDataObject_destroy 3395 +#define wxTextDataObject_new 3396 +#define wxTextDataObject_GetTextLength 3397 +#define wxTextDataObject_GetText 3398 +#define wxTextDataObject_SetText 3399 +#define wxTextDataObject_destroy 3400 +#define wxBitmapDataObject_new_1_1 3401 +#define wxBitmapDataObject_new_1_0 3402 +#define wxBitmapDataObject_GetBitmap 3403 +#define wxBitmapDataObject_SetBitmap 3404 +#define wxBitmapDataObject_destroy 3405 +#define wxClipboard_new 3407 +#define wxClipboard_destruct 3408 +#define wxClipboard_AddData 3409 +#define wxClipboard_Clear 3410 +#define wxClipboard_Close 3411 +#define wxClipboard_Flush 3412 +#define wxClipboard_GetData 3413 +#define wxClipboard_IsOpened 3414 +#define wxClipboard_Open 3415 +#define wxClipboard_SetData 3416 +#define wxClipboard_UsePrimarySelection 3418 +#define wxClipboard_IsSupported 3419 +#define wxClipboard_Get 3420 +#define wxSpinEvent_GetPosition 3421 +#define wxSpinEvent_SetPosition 3422 +#define wxSplitterWindow_new_0 3423 +#define wxSplitterWindow_new_2 3424 +#define wxSplitterWindow_destruct 3425 +#define wxSplitterWindow_Create 3426 +#define wxSplitterWindow_GetMinimumPaneSize 3427 +#define wxSplitterWindow_GetSashGravity 3428 +#define wxSplitterWindow_GetSashPosition 3429 +#define wxSplitterWindow_GetSplitMode 3430 +#define wxSplitterWindow_GetWindow1 3431 +#define wxSplitterWindow_GetWindow2 3432 +#define wxSplitterWindow_Initialize 3433 +#define wxSplitterWindow_IsSplit 3434 +#define wxSplitterWindow_ReplaceWindow 3435 +#define wxSplitterWindow_SetSashGravity 3436 +#define wxSplitterWindow_SetSashPosition 3437 +#define wxSplitterWindow_SetSashSize 3438 +#define wxSplitterWindow_SetMinimumPaneSize 3439 +#define wxSplitterWindow_SetSplitMode 3440 +#define wxSplitterWindow_SplitHorizontally 3441 +#define wxSplitterWindow_SplitVertically 3442 +#define wxSplitterWindow_Unsplit 3443 +#define wxSplitterWindow_UpdateSize 3444 +#define wxSplitterEvent_GetSashPosition 3445 +#define wxSplitterEvent_GetX 3446 +#define wxSplitterEvent_GetY 3447 +#define wxSplitterEvent_GetWindowBeingRemoved 3448 +#define wxSplitterEvent_SetSashPosition 3449 +#define wxHtmlWindow_new_0 3450 +#define wxHtmlWindow_new_2 3451 +#define wxHtmlWindow_AppendToPage 3452 +#define wxHtmlWindow_GetOpenedAnchor 3453 +#define wxHtmlWindow_GetOpenedPage 3454 +#define wxHtmlWindow_GetOpenedPageTitle 3455 +#define wxHtmlWindow_GetRelatedFrame 3456 +#define wxHtmlWindow_HistoryBack 3457 +#define wxHtmlWindow_HistoryCanBack 3458 +#define wxHtmlWindow_HistoryCanForward 3459 +#define wxHtmlWindow_HistoryClear 3460 +#define wxHtmlWindow_HistoryForward 3461 +#define wxHtmlWindow_LoadFile 3462 +#define wxHtmlWindow_LoadPage 3463 +#define wxHtmlWindow_SelectAll 3464 +#define wxHtmlWindow_SelectionToText 3465 +#define wxHtmlWindow_SelectLine 3466 +#define wxHtmlWindow_SelectWord 3467 +#define wxHtmlWindow_SetBorders 3468 +#define wxHtmlWindow_SetFonts 3469 +#define wxHtmlWindow_SetPage 3470 +#define wxHtmlWindow_SetRelatedFrame 3471 +#define wxHtmlWindow_SetRelatedStatusBar 3472 +#define wxHtmlWindow_ToText 3473 +#define wxHtmlWindow_destroy 3474 +#define wxHtmlLinkEvent_GetLinkInfo 3475 +#define wxSystemSettings_GetColour 3476 +#define wxSystemSettings_GetFont 3477 +#define wxSystemSettings_GetMetric 3478 +#define wxSystemSettings_GetScreenType 3479 +#define wxAuiNotebookEvent_SetSelection 3480 +#define wxAuiNotebookEvent_GetSelection 3481 +#define wxAuiNotebookEvent_SetOldSelection 3482 +#define wxAuiNotebookEvent_GetOldSelection 3483 +#define wxAuiNotebookEvent_SetDragSource 3484 +#define wxAuiNotebookEvent_GetDragSource 3485 +#define wxAuiManagerEvent_SetManager 3486 +#define wxAuiManagerEvent_GetManager 3487 +#define wxAuiManagerEvent_SetPane 3488 +#define wxAuiManagerEvent_GetPane 3489 +#define wxAuiManagerEvent_SetButton 3490 +#define wxAuiManagerEvent_GetButton 3491 +#define wxAuiManagerEvent_SetDC 3492 +#define wxAuiManagerEvent_GetDC 3493 +#define wxAuiManagerEvent_Veto 3494 +#define wxAuiManagerEvent_GetVeto 3495 +#define wxAuiManagerEvent_SetCanVeto 3496 +#define wxAuiManagerEvent_CanVeto 3497 +#define wxLogNull_new 3498 +#define wxLogNull_destroy 3499 diff --git a/lib/wx/c_src/wxe_impl.cpp b/lib/wx/c_src/wxe_impl.cpp index 528a08e654..6d2926ce4e 100644 --- a/lib/wx/c_src/wxe_impl.cpp +++ b/lib/wx/c_src/wxe_impl.cpp @@ -411,7 +411,7 @@ void WxeApp::dispatch_cb(wxList * batch, wxList * temp, ErlDrvTermData process) if(event->caller == process || // Callbacks from CB process only event->op == WXE_CB_START || // Recursive event callback allow // Allow connect_cb during CB i.e. msg from wxe_server. - event->caller == memenv->owner) + (memenv && event->caller == memenv->owner)) { switch(event->op) { case WXE_BATCH_END: @@ -669,7 +669,7 @@ void WxeApp::clearPtr(void * ptr) { send_msg("debug", &msg); } - if(refd->pid != -1) { + if(((int) refd->pid) != -1) { // Send terminate pid to owner wxeReturn rt = wxeReturn(WXE_DRV_PORT,refd->memenv->owner, false); rt.addAtom("_wxe_destroy_"); diff --git a/lib/wx/src/gen/wxTreeCtrl.erl b/lib/wx/src/gen/wxTreeCtrl.erl index 4fcbb9366e..e3fe4c9612 100644 --- a/lib/wx/src/gen/wxTreeCtrl.erl +++ b/lib/wx/src/gen/wxTreeCtrl.erl @@ -35,7 +35,7 @@ -include("wxe.hrl"). -export([addRoot/2,addRoot/3,appendItem/3,appendItem/4,assignImageList/2,assignStateImageList/2, collapse/2,collapseAndReset/2,create/2,create/3,delete/2,deleteAllItems/1, - deleteChildren/2,destroy/1,ensureVisible/2,expand/2,getBoundingRect/3, + deleteChildren/2,destroy/1,editLabel/2,ensureVisible/2,expand/2,getBoundingRect/3, getBoundingRect/4,getChildrenCount/2,getChildrenCount/3,getCount/1, getEditControl/1,getFirstChild/2,getFirstVisibleItem/1,getImageList/1, getIndent/1,getItemBackgroundColour/2,getItemData/2,getItemFont/2, @@ -243,6 +243,14 @@ deleteChildren(#wx_ref{type=ThisT,ref=ThisRef},Item) wxe_util:cast(?wxTreeCtrl_DeleteChildren, <<ThisRef:32/?UI,0:32,Item:64/?UI>>). +%% @spec (This::wxTreeCtrl(), Item::integer()) -> wxTextCtrl:wxTextCtrl() +%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxtreectrl.html#wxtreectrleditlabel">external documentation</a>. +editLabel(#wx_ref{type=ThisT,ref=ThisRef},Item) + when is_integer(Item) -> + ?CLASS(ThisT,wxTreeCtrl), + wxe_util:call(?wxTreeCtrl_EditLabel, + <<ThisRef:32/?UI,0:32,Item:64/?UI>>). + %% @spec (This::wxTreeCtrl(), Item::integer()) -> ok %% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxtreectrl.html#wxtreectrlensurevisible">external documentation</a>. ensureVisible(#wx_ref{type=ThisT,ref=ThisRef},Item) diff --git a/lib/wx/src/gen/wxe_debug.hrl b/lib/wx/src/gen/wxe_debug.hrl index a3416b75c8..3edfa73599 100644 --- a/lib/wx/src/gen/wxe_debug.hrl +++ b/lib/wx/src/gen/wxe_debug.hrl @@ -1837,1445 +1837,1450 @@ wxdebug_table() -> {2007, {wxTreeCtrl, delete, 1}}, {2008, {wxTreeCtrl, deleteAllItems, 0}}, {2009, {wxTreeCtrl, deleteChildren, 1}}, - {2010, {wxTreeCtrl, ensureVisible, 1}}, - {2011, {wxTreeCtrl, expand, 1}}, - {2012, {wxTreeCtrl, getBoundingRect, 3}}, - {2014, {wxTreeCtrl, getChildrenCount, 2}}, - {2015, {wxTreeCtrl, getCount, 0}}, - {2016, {wxTreeCtrl, getEditControl, 0}}, - {2017, {wxTreeCtrl, getFirstChild, 2}}, - {2018, {wxTreeCtrl, getNextChild, 2}}, - {2019, {wxTreeCtrl, getFirstVisibleItem, 0}}, - {2020, {wxTreeCtrl, getImageList, 0}}, - {2021, {wxTreeCtrl, getIndent, 0}}, - {2022, {wxTreeCtrl, getItemBackgroundColour, 1}}, - {2023, {wxTreeCtrl, getItemData, 1}}, - {2024, {wxTreeCtrl, getItemFont, 1}}, - {2025, {wxTreeCtrl, getItemImage_1, 1}}, - {2026, {wxTreeCtrl, getItemImage_2, 2}}, - {2027, {wxTreeCtrl, getItemText, 1}}, - {2028, {wxTreeCtrl, getItemTextColour, 1}}, - {2029, {wxTreeCtrl, getLastChild, 1}}, - {2030, {wxTreeCtrl, getNextSibling, 1}}, - {2031, {wxTreeCtrl, getNextVisible, 1}}, - {2032, {wxTreeCtrl, getItemParent, 1}}, - {2033, {wxTreeCtrl, getPrevSibling, 1}}, - {2034, {wxTreeCtrl, getPrevVisible, 1}}, - {2035, {wxTreeCtrl, getRootItem, 0}}, - {2036, {wxTreeCtrl, getSelection, 0}}, - {2037, {wxTreeCtrl, getSelections, 1}}, - {2038, {wxTreeCtrl, getStateImageList, 0}}, - {2039, {wxTreeCtrl, hitTest, 1}}, - {2041, {wxTreeCtrl, insertItem, 4}}, - {2042, {wxTreeCtrl, isBold, 1}}, - {2043, {wxTreeCtrl, isExpanded, 1}}, - {2044, {wxTreeCtrl, isSelected, 1}}, - {2045, {wxTreeCtrl, isVisible, 1}}, - {2046, {wxTreeCtrl, itemHasChildren, 1}}, - {2047, {wxTreeCtrl, prependItem, 3}}, - {2048, {wxTreeCtrl, scrollTo, 1}}, - {2049, {wxTreeCtrl, selectItem_1, 1}}, - {2050, {wxTreeCtrl, selectItem_2, 2}}, - {2051, {wxTreeCtrl, setIndent, 1}}, - {2052, {wxTreeCtrl, setImageList, 1}}, - {2053, {wxTreeCtrl, setItemBackgroundColour, 2}}, - {2054, {wxTreeCtrl, setItemBold, 2}}, - {2055, {wxTreeCtrl, setItemData, 2}}, - {2056, {wxTreeCtrl, setItemDropHighlight, 2}}, - {2057, {wxTreeCtrl, setItemFont, 2}}, - {2058, {wxTreeCtrl, setItemHasChildren, 2}}, - {2059, {wxTreeCtrl, setItemImage_2, 2}}, - {2060, {wxTreeCtrl, setItemImage_3, 3}}, - {2061, {wxTreeCtrl, setItemText, 2}}, - {2062, {wxTreeCtrl, setItemTextColour, 2}}, - {2063, {wxTreeCtrl, setStateImageList, 1}}, - {2064, {wxTreeCtrl, setWindowStyle, 1}}, - {2065, {wxTreeCtrl, sortChildren, 1}}, - {2066, {wxTreeCtrl, toggle, 1}}, - {2067, {wxTreeCtrl, toggleItemSelection, 1}}, - {2068, {wxTreeCtrl, unselect, 0}}, - {2069, {wxTreeCtrl, unselectAll, 0}}, - {2070, {wxTreeCtrl, unselectItem, 1}}, - {2071, {wxScrollBar, new_0, 0}}, - {2072, {wxScrollBar, new_3, 3}}, - {2073, {wxScrollBar, destruct, 0}}, - {2074, {wxScrollBar, create, 3}}, - {2075, {wxScrollBar, getRange, 0}}, - {2076, {wxScrollBar, getPageSize, 0}}, - {2077, {wxScrollBar, getThumbPosition, 0}}, - {2078, {wxScrollBar, getThumbSize, 0}}, - {2079, {wxScrollBar, setThumbPosition, 1}}, - {2080, {wxScrollBar, setScrollbar, 5}}, - {2082, {wxSpinButton, new_2, 2}}, - {2083, {wxSpinButton, new_0, 0}}, - {2084, {wxSpinButton, create, 2}}, - {2085, {wxSpinButton, getMax, 0}}, - {2086, {wxSpinButton, getMin, 0}}, - {2087, {wxSpinButton, getValue, 0}}, - {2088, {wxSpinButton, setRange, 2}}, - {2089, {wxSpinButton, setValue, 1}}, - {2090, {wxSpinButton, 'Destroy', undefined}}, - {2091, {wxSpinCtrl, new_0, 0}}, - {2092, {wxSpinCtrl, new_2, 2}}, - {2094, {wxSpinCtrl, create, 2}}, - {2097, {wxSpinCtrl, setValue_1_1, 1}}, - {2098, {wxSpinCtrl, setValue_1_0, 1}}, - {2100, {wxSpinCtrl, getValue, 0}}, - {2102, {wxSpinCtrl, setRange, 2}}, - {2103, {wxSpinCtrl, setSelection, 2}}, - {2105, {wxSpinCtrl, getMin, 0}}, - {2107, {wxSpinCtrl, getMax, 0}}, - {2108, {wxSpinCtrl, 'Destroy', undefined}}, - {2109, {wxStaticText, new_0, 0}}, - {2110, {wxStaticText, new_4, 4}}, - {2111, {wxStaticText, create, 4}}, - {2112, {wxStaticText, getLabel, 0}}, - {2113, {wxStaticText, setLabel, 1}}, - {2114, {wxStaticText, wrap, 1}}, - {2115, {wxStaticText, 'Destroy', undefined}}, - {2116, {wxStaticBitmap, new_0, 0}}, - {2117, {wxStaticBitmap, new_4, 4}}, - {2118, {wxStaticBitmap, create, 4}}, - {2119, {wxStaticBitmap, getBitmap, 0}}, - {2120, {wxStaticBitmap, setBitmap, 1}}, - {2121, {wxStaticBitmap, 'Destroy', undefined}}, - {2122, {wxRadioBox, new, 7}}, - {2124, {wxRadioBox, destruct, 0}}, - {2125, {wxRadioBox, create, 7}}, - {2126, {wxRadioBox, enable_2, 2}}, - {2127, {wxRadioBox, enable_1, 1}}, - {2128, {wxRadioBox, getSelection, 0}}, - {2129, {wxRadioBox, getString, 1}}, - {2130, {wxRadioBox, setSelection, 1}}, - {2131, {wxRadioBox, show_2, 2}}, - {2132, {wxRadioBox, show_1, 1}}, - {2133, {wxRadioBox, getColumnCount, 0}}, - {2134, {wxRadioBox, getItemHelpText, 1}}, - {2135, {wxRadioBox, getItemToolTip, 1}}, - {2137, {wxRadioBox, getItemFromPoint, 1}}, - {2138, {wxRadioBox, getRowCount, 0}}, - {2139, {wxRadioBox, isItemEnabled, 1}}, - {2140, {wxRadioBox, isItemShown, 1}}, - {2141, {wxRadioBox, setItemHelpText, 2}}, - {2142, {wxRadioBox, setItemToolTip, 2}}, - {2143, {wxRadioButton, new_0, 0}}, - {2144, {wxRadioButton, new_4, 4}}, - {2145, {wxRadioButton, create, 4}}, - {2146, {wxRadioButton, getValue, 0}}, - {2147, {wxRadioButton, setValue, 1}}, - {2148, {wxRadioButton, 'Destroy', undefined}}, - {2150, {wxSlider, new_6, 6}}, - {2151, {wxSlider, new_0, 0}}, - {2152, {wxSlider, create, 6}}, - {2153, {wxSlider, getLineSize, 0}}, - {2154, {wxSlider, getMax, 0}}, - {2155, {wxSlider, getMin, 0}}, - {2156, {wxSlider, getPageSize, 0}}, - {2157, {wxSlider, getThumbLength, 0}}, - {2158, {wxSlider, getValue, 0}}, - {2159, {wxSlider, setLineSize, 1}}, - {2160, {wxSlider, setPageSize, 1}}, - {2161, {wxSlider, setRange, 2}}, - {2162, {wxSlider, setThumbLength, 1}}, - {2163, {wxSlider, setValue, 1}}, - {2164, {wxSlider, 'Destroy', undefined}}, - {2166, {wxDialog, new_4, 4}}, - {2167, {wxDialog, new_0, 0}}, - {2169, {wxDialog, destruct, 0}}, - {2170, {wxDialog, create, 4}}, - {2171, {wxDialog, createButtonSizer, 1}}, - {2172, {wxDialog, createStdDialogButtonSizer, 1}}, - {2173, {wxDialog, endModal, 1}}, - {2174, {wxDialog, getAffirmativeId, 0}}, - {2175, {wxDialog, getReturnCode, 0}}, - {2176, {wxDialog, isModal, 0}}, - {2177, {wxDialog, setAffirmativeId, 1}}, - {2178, {wxDialog, setReturnCode, 1}}, - {2179, {wxDialog, show, 1}}, - {2180, {wxDialog, showModal, 0}}, - {2181, {wxColourDialog, new_0, 0}}, - {2182, {wxColourDialog, new_2, 2}}, - {2183, {wxColourDialog, destruct, 0}}, - {2184, {wxColourDialog, create, 2}}, - {2185, {wxColourDialog, getColourData, 0}}, - {2186, {wxColourData, new_0, 0}}, - {2187, {wxColourData, new_1, 1}}, - {2188, {wxColourData, destruct, 0}}, - {2189, {wxColourData, getChooseFull, 0}}, - {2190, {wxColourData, getColour, 0}}, - {2192, {wxColourData, getCustomColour, 1}}, - {2193, {wxColourData, setChooseFull, 1}}, - {2194, {wxColourData, setColour, 1}}, - {2195, {wxColourData, setCustomColour, 2}}, - {2196, {wxPalette, new_0, 0}}, - {2197, {wxPalette, new_4, 4}}, - {2199, {wxPalette, destruct, 0}}, - {2200, {wxPalette, create, 4}}, - {2201, {wxPalette, getColoursCount, 0}}, - {2202, {wxPalette, getPixel, 3}}, - {2203, {wxPalette, getRGB, 4}}, - {2204, {wxPalette, isOk, 0}}, - {2208, {wxDirDialog, new, 2}}, - {2209, {wxDirDialog, destruct, 0}}, - {2210, {wxDirDialog, getPath, 0}}, - {2211, {wxDirDialog, getMessage, 0}}, - {2212, {wxDirDialog, setMessage, 1}}, - {2213, {wxDirDialog, setPath, 1}}, - {2217, {wxFileDialog, new, 2}}, - {2218, {wxFileDialog, destruct, 0}}, - {2219, {wxFileDialog, getDirectory, 0}}, - {2220, {wxFileDialog, getFilename, 0}}, - {2221, {wxFileDialog, getFilenames, 1}}, - {2222, {wxFileDialog, getFilterIndex, 0}}, - {2223, {wxFileDialog, getMessage, 0}}, - {2224, {wxFileDialog, getPath, 0}}, - {2225, {wxFileDialog, getPaths, 1}}, - {2226, {wxFileDialog, getWildcard, 0}}, - {2227, {wxFileDialog, setDirectory, 1}}, - {2228, {wxFileDialog, setFilename, 1}}, - {2229, {wxFileDialog, setFilterIndex, 1}}, - {2230, {wxFileDialog, setMessage, 1}}, - {2231, {wxFileDialog, setPath, 1}}, - {2232, {wxFileDialog, setWildcard, 1}}, - {2233, {wxPickerBase, setInternalMargin, 1}}, - {2234, {wxPickerBase, getInternalMargin, 0}}, - {2235, {wxPickerBase, setTextCtrlProportion, 1}}, - {2236, {wxPickerBase, setPickerCtrlProportion, 1}}, - {2237, {wxPickerBase, getTextCtrlProportion, 0}}, - {2238, {wxPickerBase, getPickerCtrlProportion, 0}}, - {2239, {wxPickerBase, hasTextCtrl, 0}}, - {2240, {wxPickerBase, getTextCtrl, 0}}, - {2241, {wxPickerBase, isTextCtrlGrowable, 0}}, - {2242, {wxPickerBase, setPickerCtrlGrowable, 1}}, - {2243, {wxPickerBase, setTextCtrlGrowable, 1}}, - {2244, {wxPickerBase, isPickerCtrlGrowable, 0}}, - {2245, {wxFilePickerCtrl, new_0, 0}}, - {2246, {wxFilePickerCtrl, new_3, 3}}, - {2247, {wxFilePickerCtrl, create, 3}}, - {2248, {wxFilePickerCtrl, getPath, 0}}, - {2249, {wxFilePickerCtrl, setPath, 1}}, - {2250, {wxFilePickerCtrl, 'Destroy', undefined}}, - {2251, {wxDirPickerCtrl, new_0, 0}}, - {2252, {wxDirPickerCtrl, new_3, 3}}, - {2253, {wxDirPickerCtrl, create, 3}}, - {2254, {wxDirPickerCtrl, getPath, 0}}, - {2255, {wxDirPickerCtrl, setPath, 1}}, - {2256, {wxDirPickerCtrl, 'Destroy', undefined}}, - {2257, {wxColourPickerCtrl, new_0, 0}}, - {2258, {wxColourPickerCtrl, new_3, 3}}, - {2259, {wxColourPickerCtrl, create, 3}}, - {2260, {wxColourPickerCtrl, getColour, 0}}, - {2261, {wxColourPickerCtrl, setColour_1_1, 1}}, - {2262, {wxColourPickerCtrl, setColour_1_0, 1}}, - {2263, {wxColourPickerCtrl, 'Destroy', undefined}}, - {2264, {wxDatePickerCtrl, new_0, 0}}, - {2265, {wxDatePickerCtrl, new_3, 3}}, - {2266, {wxDatePickerCtrl, getRange, 2}}, - {2267, {wxDatePickerCtrl, getValue, 0}}, - {2268, {wxDatePickerCtrl, setRange, 2}}, - {2269, {wxDatePickerCtrl, setValue, 1}}, - {2270, {wxDatePickerCtrl, 'Destroy', undefined}}, - {2271, {wxFontPickerCtrl, new_0, 0}}, - {2272, {wxFontPickerCtrl, new_3, 3}}, - {2273, {wxFontPickerCtrl, create, 3}}, - {2274, {wxFontPickerCtrl, getSelectedFont, 0}}, - {2275, {wxFontPickerCtrl, setSelectedFont, 1}}, - {2276, {wxFontPickerCtrl, getMaxPointSize, 0}}, - {2277, {wxFontPickerCtrl, setMaxPointSize, 1}}, - {2278, {wxFontPickerCtrl, 'Destroy', undefined}}, - {2281, {wxFindReplaceDialog, new_0, 0}}, - {2282, {wxFindReplaceDialog, new_4, 4}}, - {2283, {wxFindReplaceDialog, destruct, 0}}, - {2284, {wxFindReplaceDialog, create, 4}}, - {2285, {wxFindReplaceDialog, getData, 0}}, - {2286, {wxFindReplaceData, new_0, 0}}, - {2287, {wxFindReplaceData, new_1, 1}}, - {2288, {wxFindReplaceData, getFindString, 0}}, - {2289, {wxFindReplaceData, getReplaceString, 0}}, - {2290, {wxFindReplaceData, getFlags, 0}}, - {2291, {wxFindReplaceData, setFlags, 1}}, - {2292, {wxFindReplaceData, setFindString, 1}}, - {2293, {wxFindReplaceData, setReplaceString, 1}}, - {2294, {wxFindReplaceData, 'Destroy', undefined}}, - {2295, {wxMultiChoiceDialog, new_0, 0}}, - {2297, {wxMultiChoiceDialog, new_5, 5}}, - {2298, {wxMultiChoiceDialog, getSelections, 0}}, - {2299, {wxMultiChoiceDialog, setSelections, 1}}, - {2300, {wxMultiChoiceDialog, 'Destroy', undefined}}, - {2301, {wxSingleChoiceDialog, new_0, 0}}, - {2303, {wxSingleChoiceDialog, new_5, 5}}, - {2304, {wxSingleChoiceDialog, getSelection, 0}}, - {2305, {wxSingleChoiceDialog, getStringSelection, 0}}, - {2306, {wxSingleChoiceDialog, setSelection, 1}}, - {2307, {wxSingleChoiceDialog, 'Destroy', undefined}}, - {2308, {wxTextEntryDialog, new, 3}}, - {2309, {wxTextEntryDialog, getValue, 0}}, - {2310, {wxTextEntryDialog, setValue, 1}}, - {2311, {wxTextEntryDialog, 'Destroy', undefined}}, - {2312, {wxPasswordEntryDialog, new, 3}}, - {2313, {wxPasswordEntryDialog, 'Destroy', undefined}}, - {2314, {wxFontData, new_0, 0}}, - {2315, {wxFontData, new_1, 1}}, - {2316, {wxFontData, destruct, 0}}, - {2317, {wxFontData, enableEffects, 1}}, - {2318, {wxFontData, getAllowSymbols, 0}}, - {2319, {wxFontData, getColour, 0}}, - {2320, {wxFontData, getChosenFont, 0}}, - {2321, {wxFontData, getEnableEffects, 0}}, - {2322, {wxFontData, getInitialFont, 0}}, - {2323, {wxFontData, getShowHelp, 0}}, - {2324, {wxFontData, setAllowSymbols, 1}}, - {2325, {wxFontData, setChosenFont, 1}}, - {2326, {wxFontData, setColour, 1}}, - {2327, {wxFontData, setInitialFont, 1}}, - {2328, {wxFontData, setRange, 2}}, - {2329, {wxFontData, setShowHelp, 1}}, - {2333, {wxFontDialog, new_0, 0}}, - {2335, {wxFontDialog, new_2, 2}}, - {2337, {wxFontDialog, create, 2}}, - {2338, {wxFontDialog, getFontData, 0}}, - {2340, {wxFontDialog, 'Destroy', undefined}}, - {2341, {wxProgressDialog, new, 3}}, - {2342, {wxProgressDialog, destruct, 0}}, - {2343, {wxProgressDialog, resume, 0}}, - {2344, {wxProgressDialog, update_2, 2}}, - {2345, {wxProgressDialog, update_0, 0}}, - {2346, {wxMessageDialog, new, 3}}, - {2347, {wxMessageDialog, destruct, 0}}, - {2348, {wxPageSetupDialog, new, 2}}, - {2349, {wxPageSetupDialog, destruct, 0}}, - {2350, {wxPageSetupDialog, getPageSetupData, 0}}, - {2351, {wxPageSetupDialog, showModal, 0}}, - {2352, {wxPageSetupDialogData, new_0, 0}}, - {2353, {wxPageSetupDialogData, new_1_0, 1}}, - {2354, {wxPageSetupDialogData, new_1_1, 1}}, - {2355, {wxPageSetupDialogData, destruct, 0}}, - {2356, {wxPageSetupDialogData, enableHelp, 1}}, - {2357, {wxPageSetupDialogData, enableMargins, 1}}, - {2358, {wxPageSetupDialogData, enableOrientation, 1}}, - {2359, {wxPageSetupDialogData, enablePaper, 1}}, - {2360, {wxPageSetupDialogData, enablePrinter, 1}}, - {2361, {wxPageSetupDialogData, getDefaultMinMargins, 0}}, - {2362, {wxPageSetupDialogData, getEnableMargins, 0}}, - {2363, {wxPageSetupDialogData, getEnableOrientation, 0}}, - {2364, {wxPageSetupDialogData, getEnablePaper, 0}}, - {2365, {wxPageSetupDialogData, getEnablePrinter, 0}}, - {2366, {wxPageSetupDialogData, getEnableHelp, 0}}, - {2367, {wxPageSetupDialogData, getDefaultInfo, 0}}, - {2368, {wxPageSetupDialogData, getMarginTopLeft, 0}}, - {2369, {wxPageSetupDialogData, getMarginBottomRight, 0}}, - {2370, {wxPageSetupDialogData, getMinMarginTopLeft, 0}}, - {2371, {wxPageSetupDialogData, getMinMarginBottomRight, 0}}, - {2372, {wxPageSetupDialogData, getPaperId, 0}}, - {2373, {wxPageSetupDialogData, getPaperSize, 0}}, - {2375, {wxPageSetupDialogData, getPrintData, 0}}, - {2376, {wxPageSetupDialogData, isOk, 0}}, - {2377, {wxPageSetupDialogData, setDefaultInfo, 1}}, - {2378, {wxPageSetupDialogData, setDefaultMinMargins, 1}}, - {2379, {wxPageSetupDialogData, setMarginTopLeft, 1}}, - {2380, {wxPageSetupDialogData, setMarginBottomRight, 1}}, - {2381, {wxPageSetupDialogData, setMinMarginTopLeft, 1}}, - {2382, {wxPageSetupDialogData, setMinMarginBottomRight, 1}}, - {2383, {wxPageSetupDialogData, setPaperId, 1}}, - {2384, {wxPageSetupDialogData, setPaperSize_1_1, 1}}, - {2385, {wxPageSetupDialogData, setPaperSize_1_0, 1}}, - {2386, {wxPageSetupDialogData, setPrintData, 1}}, - {2387, {wxPrintDialog, new_2_0, 2}}, - {2388, {wxPrintDialog, new_2_1, 2}}, - {2389, {wxPrintDialog, destruct, 0}}, - {2390, {wxPrintDialog, getPrintDialogData, 0}}, - {2391, {wxPrintDialog, getPrintDC, 0}}, - {2392, {wxPrintDialogData, new_0, 0}}, - {2393, {wxPrintDialogData, new_1_1, 1}}, - {2394, {wxPrintDialogData, new_1_0, 1}}, - {2395, {wxPrintDialogData, destruct, 0}}, - {2396, {wxPrintDialogData, enableHelp, 1}}, - {2397, {wxPrintDialogData, enablePageNumbers, 1}}, - {2398, {wxPrintDialogData, enablePrintToFile, 1}}, - {2399, {wxPrintDialogData, enableSelection, 1}}, - {2400, {wxPrintDialogData, getAllPages, 0}}, - {2401, {wxPrintDialogData, getCollate, 0}}, - {2402, {wxPrintDialogData, getFromPage, 0}}, - {2403, {wxPrintDialogData, getMaxPage, 0}}, - {2404, {wxPrintDialogData, getMinPage, 0}}, - {2405, {wxPrintDialogData, getNoCopies, 0}}, - {2406, {wxPrintDialogData, getPrintData, 0}}, - {2407, {wxPrintDialogData, getPrintToFile, 0}}, - {2408, {wxPrintDialogData, getSelection, 0}}, - {2409, {wxPrintDialogData, getToPage, 0}}, - {2410, {wxPrintDialogData, isOk, 0}}, - {2411, {wxPrintDialogData, setCollate, 1}}, - {2412, {wxPrintDialogData, setFromPage, 1}}, - {2413, {wxPrintDialogData, setMaxPage, 1}}, - {2414, {wxPrintDialogData, setMinPage, 1}}, - {2415, {wxPrintDialogData, setNoCopies, 1}}, - {2416, {wxPrintDialogData, setPrintData, 1}}, - {2417, {wxPrintDialogData, setPrintToFile, 1}}, - {2418, {wxPrintDialogData, setSelection, 1}}, - {2419, {wxPrintDialogData, setToPage, 1}}, - {2420, {wxPrintData, new_0, 0}}, - {2421, {wxPrintData, new_1, 1}}, - {2422, {wxPrintData, destruct, 0}}, - {2423, {wxPrintData, getCollate, 0}}, - {2424, {wxPrintData, getBin, 0}}, - {2425, {wxPrintData, getColour, 0}}, - {2426, {wxPrintData, getDuplex, 0}}, - {2427, {wxPrintData, getNoCopies, 0}}, - {2428, {wxPrintData, getOrientation, 0}}, - {2429, {wxPrintData, getPaperId, 0}}, - {2430, {wxPrintData, getPrinterName, 0}}, - {2431, {wxPrintData, getQuality, 0}}, - {2432, {wxPrintData, isOk, 0}}, - {2433, {wxPrintData, setBin, 1}}, - {2434, {wxPrintData, setCollate, 1}}, - {2435, {wxPrintData, setColour, 1}}, - {2436, {wxPrintData, setDuplex, 1}}, - {2437, {wxPrintData, setNoCopies, 1}}, - {2438, {wxPrintData, setOrientation, 1}}, - {2439, {wxPrintData, setPaperId, 1}}, - {2440, {wxPrintData, setPrinterName, 1}}, - {2441, {wxPrintData, setQuality, 1}}, - {2444, {wxPrintPreview, new_2, 2}}, - {2445, {wxPrintPreview, new_3, 3}}, - {2447, {wxPrintPreview, destruct, 0}}, - {2448, {wxPrintPreview, getCanvas, 0}}, - {2449, {wxPrintPreview, getCurrentPage, 0}}, - {2450, {wxPrintPreview, getFrame, 0}}, - {2451, {wxPrintPreview, getMaxPage, 0}}, - {2452, {wxPrintPreview, getMinPage, 0}}, - {2453, {wxPrintPreview, getPrintout, 0}}, - {2454, {wxPrintPreview, getPrintoutForPrinting, 0}}, - {2455, {wxPrintPreview, isOk, 0}}, - {2456, {wxPrintPreview, paintPage, 2}}, - {2457, {wxPrintPreview, print, 1}}, - {2458, {wxPrintPreview, renderPage, 1}}, - {2459, {wxPrintPreview, setCanvas, 1}}, - {2460, {wxPrintPreview, setCurrentPage, 1}}, - {2461, {wxPrintPreview, setFrame, 1}}, - {2462, {wxPrintPreview, setPrintout, 1}}, - {2463, {wxPrintPreview, setZoom, 1}}, - {2464, {wxPreviewFrame, new, 3}}, - {2465, {wxPreviewFrame, destruct, 0}}, - {2466, {wxPreviewFrame, createControlBar, 0}}, - {2467, {wxPreviewFrame, createCanvas, 0}}, - {2468, {wxPreviewFrame, initialize, 0}}, - {2469, {wxPreviewFrame, onCloseWindow, 1}}, - {2470, {wxPreviewControlBar, new, 4}}, - {2471, {wxPreviewControlBar, destruct, 0}}, - {2472, {wxPreviewControlBar, createButtons, 0}}, - {2473, {wxPreviewControlBar, getPrintPreview, 0}}, - {2474, {wxPreviewControlBar, getZoomControl, 0}}, - {2475, {wxPreviewControlBar, setZoomControl, 1}}, - {2477, {wxPrinter, new, 1}}, - {2478, {wxPrinter, createAbortWindow, 2}}, - {2479, {wxPrinter, getAbort, 0}}, - {2480, {wxPrinter, getLastError, 0}}, - {2481, {wxPrinter, getPrintDialogData, 0}}, - {2482, {wxPrinter, print, 3}}, - {2483, {wxPrinter, printDialog, 1}}, - {2484, {wxPrinter, reportError, 3}}, - {2485, {wxPrinter, setup, 1}}, - {2486, {wxPrinter, 'Destroy', undefined}}, - {2487, {wxXmlResource, new_1, 1}}, - {2488, {wxXmlResource, new_2, 2}}, - {2489, {wxXmlResource, destruct, 0}}, - {2490, {wxXmlResource, attachUnknownControl, 3}}, - {2491, {wxXmlResource, clearHandlers, 0}}, - {2492, {wxXmlResource, compareVersion, 4}}, - {2493, {wxXmlResource, get, 0}}, - {2494, {wxXmlResource, getFlags, 0}}, - {2495, {wxXmlResource, getVersion, 0}}, - {2496, {wxXmlResource, getXRCID, 2}}, - {2497, {wxXmlResource, initAllHandlers, 0}}, - {2498, {wxXmlResource, load, 1}}, - {2499, {wxXmlResource, loadBitmap, 1}}, - {2500, {wxXmlResource, loadDialog_2, 2}}, - {2501, {wxXmlResource, loadDialog_3, 3}}, - {2502, {wxXmlResource, loadFrame_2, 2}}, - {2503, {wxXmlResource, loadFrame_3, 3}}, - {2504, {wxXmlResource, loadIcon, 1}}, - {2505, {wxXmlResource, loadMenu, 1}}, - {2506, {wxXmlResource, loadMenuBar_2, 2}}, - {2507, {wxXmlResource, loadMenuBar_1, 1}}, - {2508, {wxXmlResource, loadPanel_2, 2}}, - {2509, {wxXmlResource, loadPanel_3, 3}}, - {2510, {wxXmlResource, loadToolBar, 2}}, - {2511, {wxXmlResource, set, 1}}, - {2512, {wxXmlResource, setFlags, 1}}, - {2513, {wxXmlResource, unload, 1}}, - {2514, {wxXmlResource, xrcctrl, 3}}, - {2515, {wxHtmlEasyPrinting, new, 1}}, - {2516, {wxHtmlEasyPrinting, destruct, 0}}, - {2517, {wxHtmlEasyPrinting, getPrintData, 0}}, - {2518, {wxHtmlEasyPrinting, getPageSetupData, 0}}, - {2519, {wxHtmlEasyPrinting, previewFile, 1}}, - {2520, {wxHtmlEasyPrinting, previewText, 2}}, - {2521, {wxHtmlEasyPrinting, printFile, 1}}, - {2522, {wxHtmlEasyPrinting, printText, 2}}, - {2523, {wxHtmlEasyPrinting, pageSetup, 0}}, - {2524, {wxHtmlEasyPrinting, setFonts, 3}}, - {2525, {wxHtmlEasyPrinting, setHeader, 2}}, - {2526, {wxHtmlEasyPrinting, setFooter, 2}}, - {2528, {wxGLCanvas, new_2, 2}}, - {2529, {wxGLCanvas, new_3_1, 3}}, - {2530, {wxGLCanvas, new_3_0, 3}}, - {2531, {wxGLCanvas, getContext, 0}}, - {2533, {wxGLCanvas, setCurrent, 0}}, - {2534, {wxGLCanvas, swapBuffers, 0}}, - {2535, {wxGLCanvas, 'Destroy', undefined}}, - {2536, {wxAuiManager, new, 1}}, - {2537, {wxAuiManager, destruct, 0}}, - {2538, {wxAuiManager, addPane_2_1, 2}}, - {2539, {wxAuiManager, addPane_3, 3}}, - {2540, {wxAuiManager, addPane_2_0, 2}}, - {2541, {wxAuiManager, detachPane, 1}}, - {2542, {wxAuiManager, getAllPanes, 0}}, - {2543, {wxAuiManager, getArtProvider, 0}}, - {2544, {wxAuiManager, getDockSizeConstraint, 2}}, - {2545, {wxAuiManager, getFlags, 0}}, - {2546, {wxAuiManager, getManagedWindow, 0}}, - {2547, {wxAuiManager, getManager, 1}}, - {2548, {wxAuiManager, getPane_1_1, 1}}, - {2549, {wxAuiManager, getPane_1_0, 1}}, - {2550, {wxAuiManager, hideHint, 0}}, - {2551, {wxAuiManager, insertPane, 3}}, - {2552, {wxAuiManager, loadPaneInfo, 2}}, - {2553, {wxAuiManager, loadPerspective, 2}}, - {2554, {wxAuiManager, savePaneInfo, 1}}, - {2555, {wxAuiManager, savePerspective, 0}}, - {2556, {wxAuiManager, setArtProvider, 1}}, - {2557, {wxAuiManager, setDockSizeConstraint, 2}}, - {2558, {wxAuiManager, setFlags, 1}}, - {2559, {wxAuiManager, setManagedWindow, 1}}, - {2560, {wxAuiManager, showHint, 1}}, - {2561, {wxAuiManager, unInit, 0}}, - {2562, {wxAuiManager, update, 0}}, - {2563, {wxAuiPaneInfo, new_0, 0}}, - {2564, {wxAuiPaneInfo, new_1, 1}}, - {2565, {wxAuiPaneInfo, destruct, 0}}, - {2566, {wxAuiPaneInfo, bestSize_1, 1}}, - {2567, {wxAuiPaneInfo, bestSize_2, 2}}, - {2568, {wxAuiPaneInfo, bottom, 0}}, - {2569, {wxAuiPaneInfo, bottomDockable, 1}}, - {2570, {wxAuiPaneInfo, caption, 1}}, - {2571, {wxAuiPaneInfo, captionVisible, 1}}, - {2572, {wxAuiPaneInfo, centre, 0}}, - {2573, {wxAuiPaneInfo, centrePane, 0}}, - {2574, {wxAuiPaneInfo, closeButton, 1}}, - {2575, {wxAuiPaneInfo, defaultPane, 0}}, - {2576, {wxAuiPaneInfo, destroyOnClose, 1}}, - {2577, {wxAuiPaneInfo, direction, 1}}, - {2578, {wxAuiPaneInfo, dock, 0}}, - {2579, {wxAuiPaneInfo, dockable, 1}}, - {2580, {wxAuiPaneInfo, fixed, 0}}, - {2581, {wxAuiPaneInfo, float, 0}}, - {2582, {wxAuiPaneInfo, floatable, 1}}, - {2583, {wxAuiPaneInfo, floatingPosition_1, 1}}, - {2584, {wxAuiPaneInfo, floatingPosition_2, 2}}, - {2585, {wxAuiPaneInfo, floatingSize_1, 1}}, - {2586, {wxAuiPaneInfo, floatingSize_2, 2}}, - {2587, {wxAuiPaneInfo, gripper, 1}}, - {2588, {wxAuiPaneInfo, gripperTop, 1}}, - {2589, {wxAuiPaneInfo, hasBorder, 0}}, - {2590, {wxAuiPaneInfo, hasCaption, 0}}, - {2591, {wxAuiPaneInfo, hasCloseButton, 0}}, - {2592, {wxAuiPaneInfo, hasFlag, 1}}, - {2593, {wxAuiPaneInfo, hasGripper, 0}}, - {2594, {wxAuiPaneInfo, hasGripperTop, 0}}, - {2595, {wxAuiPaneInfo, hasMaximizeButton, 0}}, - {2596, {wxAuiPaneInfo, hasMinimizeButton, 0}}, - {2597, {wxAuiPaneInfo, hasPinButton, 0}}, - {2598, {wxAuiPaneInfo, hide, 0}}, - {2599, {wxAuiPaneInfo, isBottomDockable, 0}}, - {2600, {wxAuiPaneInfo, isDocked, 0}}, - {2601, {wxAuiPaneInfo, isFixed, 0}}, - {2602, {wxAuiPaneInfo, isFloatable, 0}}, - {2603, {wxAuiPaneInfo, isFloating, 0}}, - {2604, {wxAuiPaneInfo, isLeftDockable, 0}}, - {2605, {wxAuiPaneInfo, isMovable, 0}}, - {2606, {wxAuiPaneInfo, isOk, 0}}, - {2607, {wxAuiPaneInfo, isResizable, 0}}, - {2608, {wxAuiPaneInfo, isRightDockable, 0}}, - {2609, {wxAuiPaneInfo, isShown, 0}}, - {2610, {wxAuiPaneInfo, isToolbar, 0}}, - {2611, {wxAuiPaneInfo, isTopDockable, 0}}, - {2612, {wxAuiPaneInfo, layer, 1}}, - {2613, {wxAuiPaneInfo, left, 0}}, - {2614, {wxAuiPaneInfo, leftDockable, 1}}, - {2615, {wxAuiPaneInfo, maxSize_1, 1}}, - {2616, {wxAuiPaneInfo, maxSize_2, 2}}, - {2617, {wxAuiPaneInfo, maximizeButton, 1}}, - {2618, {wxAuiPaneInfo, minSize_1, 1}}, - {2619, {wxAuiPaneInfo, minSize_2, 2}}, - {2620, {wxAuiPaneInfo, minimizeButton, 1}}, - {2621, {wxAuiPaneInfo, movable, 1}}, - {2622, {wxAuiPaneInfo, name, 1}}, - {2623, {wxAuiPaneInfo, paneBorder, 1}}, - {2624, {wxAuiPaneInfo, pinButton, 1}}, - {2625, {wxAuiPaneInfo, position, 1}}, - {2626, {wxAuiPaneInfo, resizable, 1}}, - {2627, {wxAuiPaneInfo, right, 0}}, - {2628, {wxAuiPaneInfo, rightDockable, 1}}, - {2629, {wxAuiPaneInfo, row, 1}}, - {2630, {wxAuiPaneInfo, safeSet, 1}}, - {2631, {wxAuiPaneInfo, setFlag, 2}}, - {2632, {wxAuiPaneInfo, show, 1}}, - {2633, {wxAuiPaneInfo, toolbarPane, 0}}, - {2634, {wxAuiPaneInfo, top, 0}}, - {2635, {wxAuiPaneInfo, topDockable, 1}}, - {2636, {wxAuiPaneInfo, window, 1}}, - {2637, {wxAuiNotebook, new_0, 0}}, - {2638, {wxAuiNotebook, new_2, 2}}, - {2639, {wxAuiNotebook, addPage, 3}}, - {2640, {wxAuiNotebook, create, 2}}, - {2641, {wxAuiNotebook, deletePage, 1}}, - {2642, {wxAuiNotebook, getArtProvider, 0}}, - {2643, {wxAuiNotebook, getPage, 1}}, - {2644, {wxAuiNotebook, getPageBitmap, 1}}, - {2645, {wxAuiNotebook, getPageCount, 0}}, - {2646, {wxAuiNotebook, getPageIndex, 1}}, - {2647, {wxAuiNotebook, getPageText, 1}}, - {2648, {wxAuiNotebook, getSelection, 0}}, - {2649, {wxAuiNotebook, insertPage, 4}}, - {2650, {wxAuiNotebook, removePage, 1}}, - {2651, {wxAuiNotebook, setArtProvider, 1}}, - {2652, {wxAuiNotebook, setFont, 1}}, - {2653, {wxAuiNotebook, setPageBitmap, 2}}, - {2654, {wxAuiNotebook, setPageText, 2}}, - {2655, {wxAuiNotebook, setSelection, 1}}, - {2656, {wxAuiNotebook, setTabCtrlHeight, 1}}, - {2657, {wxAuiNotebook, setUniformBitmapSize, 1}}, - {2658, {wxAuiNotebook, 'Destroy', undefined}}, - {2659, {wxMDIParentFrame, new_0, 0}}, - {2660, {wxMDIParentFrame, new_4, 4}}, - {2661, {wxMDIParentFrame, destruct, 0}}, - {2662, {wxMDIParentFrame, activateNext, 0}}, - {2663, {wxMDIParentFrame, activatePrevious, 0}}, - {2664, {wxMDIParentFrame, arrangeIcons, 0}}, - {2665, {wxMDIParentFrame, cascade, 0}}, - {2666, {wxMDIParentFrame, create, 4}}, - {2667, {wxMDIParentFrame, getActiveChild, 0}}, - {2668, {wxMDIParentFrame, getClientWindow, 0}}, - {2669, {wxMDIParentFrame, tile, 1}}, - {2670, {wxMDIChildFrame, new_0, 0}}, - {2671, {wxMDIChildFrame, new_4, 4}}, - {2672, {wxMDIChildFrame, destruct, 0}}, - {2673, {wxMDIChildFrame, activate, 0}}, - {2674, {wxMDIChildFrame, create, 4}}, - {2675, {wxMDIChildFrame, maximize, 1}}, - {2676, {wxMDIChildFrame, restore, 0}}, - {2677, {wxMDIClientWindow, new_0, 0}}, - {2678, {wxMDIClientWindow, new_2, 2}}, - {2679, {wxMDIClientWindow, destruct, 0}}, - {2680, {wxMDIClientWindow, createClient, 2}}, - {2681, {wxLayoutAlgorithm, new, 0}}, - {2682, {wxLayoutAlgorithm, layoutFrame, 2}}, - {2683, {wxLayoutAlgorithm, layoutMDIFrame, 2}}, - {2684, {wxLayoutAlgorithm, layoutWindow, 2}}, - {2685, {wxLayoutAlgorithm, 'Destroy', undefined}}, - {2686, {wxEvent, getId, 0}}, - {2687, {wxEvent, getSkipped, 0}}, - {2688, {wxEvent, getTimestamp, 0}}, - {2689, {wxEvent, isCommandEvent, 0}}, - {2690, {wxEvent, resumePropagation, 1}}, - {2691, {wxEvent, shouldPropagate, 0}}, - {2692, {wxEvent, skip, 1}}, - {2693, {wxEvent, stopPropagation, 0}}, - {2694, {wxCommandEvent, getClientData, 0}}, - {2695, {wxCommandEvent, getExtraLong, 0}}, - {2696, {wxCommandEvent, getInt, 0}}, - {2697, {wxCommandEvent, getSelection, 0}}, - {2698, {wxCommandEvent, getString, 0}}, - {2699, {wxCommandEvent, isChecked, 0}}, - {2700, {wxCommandEvent, isSelection, 0}}, - {2701, {wxCommandEvent, setInt, 1}}, - {2702, {wxCommandEvent, setString, 1}}, - {2703, {wxScrollEvent, getOrientation, 0}}, - {2704, {wxScrollEvent, getPosition, 0}}, - {2705, {wxScrollWinEvent, getOrientation, 0}}, - {2706, {wxScrollWinEvent, getPosition, 0}}, - {2707, {wxMouseEvent, altDown, 0}}, - {2708, {wxMouseEvent, button, 1}}, - {2709, {wxMouseEvent, buttonDClick, 1}}, - {2710, {wxMouseEvent, buttonDown, 1}}, - {2711, {wxMouseEvent, buttonUp, 1}}, - {2712, {wxMouseEvent, cmdDown, 0}}, - {2713, {wxMouseEvent, controlDown, 0}}, - {2714, {wxMouseEvent, dragging, 0}}, - {2715, {wxMouseEvent, entering, 0}}, - {2716, {wxMouseEvent, getButton, 0}}, - {2719, {wxMouseEvent, getPosition, 0}}, - {2720, {wxMouseEvent, getLogicalPosition, 1}}, - {2721, {wxMouseEvent, getLinesPerAction, 0}}, - {2722, {wxMouseEvent, getWheelRotation, 0}}, - {2723, {wxMouseEvent, getWheelDelta, 0}}, - {2724, {wxMouseEvent, getX, 0}}, - {2725, {wxMouseEvent, getY, 0}}, - {2726, {wxMouseEvent, isButton, 0}}, - {2727, {wxMouseEvent, isPageScroll, 0}}, - {2728, {wxMouseEvent, leaving, 0}}, - {2729, {wxMouseEvent, leftDClick, 0}}, - {2730, {wxMouseEvent, leftDown, 0}}, - {2731, {wxMouseEvent, leftIsDown, 0}}, - {2732, {wxMouseEvent, leftUp, 0}}, - {2733, {wxMouseEvent, metaDown, 0}}, - {2734, {wxMouseEvent, middleDClick, 0}}, - {2735, {wxMouseEvent, middleDown, 0}}, - {2736, {wxMouseEvent, middleIsDown, 0}}, - {2737, {wxMouseEvent, middleUp, 0}}, - {2738, {wxMouseEvent, moving, 0}}, - {2739, {wxMouseEvent, rightDClick, 0}}, - {2740, {wxMouseEvent, rightDown, 0}}, - {2741, {wxMouseEvent, rightIsDown, 0}}, - {2742, {wxMouseEvent, rightUp, 0}}, - {2743, {wxMouseEvent, shiftDown, 0}}, - {2744, {wxSetCursorEvent, getCursor, 0}}, - {2745, {wxSetCursorEvent, getX, 0}}, - {2746, {wxSetCursorEvent, getY, 0}}, - {2747, {wxSetCursorEvent, hasCursor, 0}}, - {2748, {wxSetCursorEvent, setCursor, 1}}, - {2749, {wxKeyEvent, altDown, 0}}, - {2750, {wxKeyEvent, cmdDown, 0}}, - {2751, {wxKeyEvent, controlDown, 0}}, - {2752, {wxKeyEvent, getKeyCode, 0}}, - {2753, {wxKeyEvent, getModifiers, 0}}, - {2756, {wxKeyEvent, getPosition, 0}}, - {2757, {wxKeyEvent, getRawKeyCode, 0}}, - {2758, {wxKeyEvent, getRawKeyFlags, 0}}, - {2759, {wxKeyEvent, getUnicodeKey, 0}}, - {2760, {wxKeyEvent, getX, 0}}, - {2761, {wxKeyEvent, getY, 0}}, - {2762, {wxKeyEvent, hasModifiers, 0}}, - {2763, {wxKeyEvent, metaDown, 0}}, - {2764, {wxKeyEvent, shiftDown, 0}}, - {2765, {wxSizeEvent, getSize, 0}}, - {2766, {wxMoveEvent, getPosition, 0}}, - {2767, {wxEraseEvent, getDC, 0}}, - {2768, {wxFocusEvent, getWindow, 0}}, - {2769, {wxChildFocusEvent, getWindow, 0}}, - {2770, {wxMenuEvent, getMenu, 0}}, - {2771, {wxMenuEvent, getMenuId, 0}}, - {2772, {wxMenuEvent, isPopup, 0}}, - {2773, {wxCloseEvent, canVeto, 0}}, - {2774, {wxCloseEvent, getLoggingOff, 0}}, - {2775, {wxCloseEvent, setCanVeto, 1}}, - {2776, {wxCloseEvent, setLoggingOff, 1}}, - {2777, {wxCloseEvent, veto, 1}}, - {2778, {wxShowEvent, setShow, 1}}, - {2779, {wxShowEvent, getShow, 0}}, - {2780, {wxIconizeEvent, iconized, 0}}, - {2781, {wxJoystickEvent, buttonDown, 1}}, - {2782, {wxJoystickEvent, buttonIsDown, 1}}, - {2783, {wxJoystickEvent, buttonUp, 1}}, - {2784, {wxJoystickEvent, getButtonChange, 0}}, - {2785, {wxJoystickEvent, getButtonState, 0}}, - {2786, {wxJoystickEvent, getJoystick, 0}}, - {2787, {wxJoystickEvent, getPosition, 0}}, - {2788, {wxJoystickEvent, getZPosition, 0}}, - {2789, {wxJoystickEvent, isButton, 0}}, - {2790, {wxJoystickEvent, isMove, 0}}, - {2791, {wxJoystickEvent, isZMove, 0}}, - {2792, {wxUpdateUIEvent, canUpdate, 1}}, - {2793, {wxUpdateUIEvent, check, 1}}, - {2794, {wxUpdateUIEvent, enable, 1}}, - {2795, {wxUpdateUIEvent, show, 1}}, - {2796, {wxUpdateUIEvent, getChecked, 0}}, - {2797, {wxUpdateUIEvent, getEnabled, 0}}, - {2798, {wxUpdateUIEvent, getShown, 0}}, - {2799, {wxUpdateUIEvent, getSetChecked, 0}}, - {2800, {wxUpdateUIEvent, getSetEnabled, 0}}, - {2801, {wxUpdateUIEvent, getSetShown, 0}}, - {2802, {wxUpdateUIEvent, getSetText, 0}}, - {2803, {wxUpdateUIEvent, getText, 0}}, - {2804, {wxUpdateUIEvent, getMode, 0}}, - {2805, {wxUpdateUIEvent, getUpdateInterval, 0}}, - {2806, {wxUpdateUIEvent, resetUpdateTime, 0}}, - {2807, {wxUpdateUIEvent, setMode, 1}}, - {2808, {wxUpdateUIEvent, setText, 1}}, - {2809, {wxUpdateUIEvent, setUpdateInterval, 1}}, - {2810, {wxMouseCaptureChangedEvent, getCapturedWindow, 0}}, - {2811, {wxPaletteChangedEvent, setChangedWindow, 1}}, - {2812, {wxPaletteChangedEvent, getChangedWindow, 0}}, - {2813, {wxQueryNewPaletteEvent, setPaletteRealized, 1}}, - {2814, {wxQueryNewPaletteEvent, getPaletteRealized, 0}}, - {2815, {wxNavigationKeyEvent, getDirection, 0}}, - {2816, {wxNavigationKeyEvent, setDirection, 1}}, - {2817, {wxNavigationKeyEvent, isWindowChange, 0}}, - {2818, {wxNavigationKeyEvent, setWindowChange, 1}}, - {2819, {wxNavigationKeyEvent, isFromTab, 0}}, - {2820, {wxNavigationKeyEvent, setFromTab, 1}}, - {2821, {wxNavigationKeyEvent, getCurrentFocus, 0}}, - {2822, {wxNavigationKeyEvent, setCurrentFocus, 1}}, - {2823, {wxHelpEvent, getOrigin, 0}}, - {2824, {wxHelpEvent, getPosition, 0}}, - {2825, {wxHelpEvent, setOrigin, 1}}, - {2826, {wxHelpEvent, setPosition, 1}}, - {2827, {wxContextMenuEvent, getPosition, 0}}, - {2828, {wxContextMenuEvent, setPosition, 1}}, - {2829, {wxIdleEvent, canSend, 1}}, - {2830, {wxIdleEvent, getMode, 0}}, - {2831, {wxIdleEvent, requestMore, 1}}, - {2832, {wxIdleEvent, moreRequested, 0}}, - {2833, {wxIdleEvent, setMode, 1}}, - {2834, {wxGridEvent, altDown, 0}}, - {2835, {wxGridEvent, controlDown, 0}}, - {2836, {wxGridEvent, getCol, 0}}, - {2837, {wxGridEvent, getPosition, 0}}, - {2838, {wxGridEvent, getRow, 0}}, - {2839, {wxGridEvent, metaDown, 0}}, - {2840, {wxGridEvent, selecting, 0}}, - {2841, {wxGridEvent, shiftDown, 0}}, - {2842, {wxNotifyEvent, allow, 0}}, - {2843, {wxNotifyEvent, isAllowed, 0}}, - {2844, {wxNotifyEvent, veto, 0}}, - {2845, {wxSashEvent, getEdge, 0}}, - {2846, {wxSashEvent, getDragRect, 0}}, - {2847, {wxSashEvent, getDragStatus, 0}}, - {2848, {wxListEvent, getCacheFrom, 0}}, - {2849, {wxListEvent, getCacheTo, 0}}, - {2850, {wxListEvent, getKeyCode, 0}}, - {2851, {wxListEvent, getIndex, 0}}, - {2852, {wxListEvent, getColumn, 0}}, - {2853, {wxListEvent, getPoint, 0}}, - {2854, {wxListEvent, getLabel, 0}}, - {2855, {wxListEvent, getText, 0}}, - {2856, {wxListEvent, getImage, 0}}, - {2857, {wxListEvent, getData, 0}}, - {2858, {wxListEvent, getMask, 0}}, - {2859, {wxListEvent, getItem, 0}}, - {2860, {wxListEvent, isEditCancelled, 0}}, - {2861, {wxDateEvent, getDate, 0}}, - {2862, {wxCalendarEvent, getWeekDay, 0}}, - {2863, {wxFileDirPickerEvent, getPath, 0}}, - {2864, {wxColourPickerEvent, getColour, 0}}, - {2865, {wxFontPickerEvent, getFont, 0}}, - {2866, {wxStyledTextEvent, getPosition, 0}}, - {2867, {wxStyledTextEvent, getKey, 0}}, - {2868, {wxStyledTextEvent, getModifiers, 0}}, - {2869, {wxStyledTextEvent, getModificationType, 0}}, - {2870, {wxStyledTextEvent, getText, 0}}, - {2871, {wxStyledTextEvent, getLength, 0}}, - {2872, {wxStyledTextEvent, getLinesAdded, 0}}, - {2873, {wxStyledTextEvent, getLine, 0}}, - {2874, {wxStyledTextEvent, getFoldLevelNow, 0}}, - {2875, {wxStyledTextEvent, getFoldLevelPrev, 0}}, - {2876, {wxStyledTextEvent, getMargin, 0}}, - {2877, {wxStyledTextEvent, getMessage, 0}}, - {2878, {wxStyledTextEvent, getWParam, 0}}, - {2879, {wxStyledTextEvent, getLParam, 0}}, - {2880, {wxStyledTextEvent, getListType, 0}}, - {2881, {wxStyledTextEvent, getX, 0}}, - {2882, {wxStyledTextEvent, getY, 0}}, - {2883, {wxStyledTextEvent, getDragText, 0}}, - {2884, {wxStyledTextEvent, getDragAllowMove, 0}}, - {2885, {wxStyledTextEvent, getDragResult, 0}}, - {2886, {wxStyledTextEvent, getShift, 0}}, - {2887, {wxStyledTextEvent, getControl, 0}}, - {2888, {wxStyledTextEvent, getAlt, 0}}, - {2889, {utils, getKeyState, 1}}, - {2890, {utils, getMousePosition, 2}}, - {2891, {utils, getMouseState, 0}}, - {2892, {utils, setDetectableAutoRepeat, 1}}, - {2893, {utils, bell, 0}}, - {2894, {utils, findMenuItemId, 3}}, - {2895, {utils, genericFindWindowAtPoint, 1}}, - {2896, {utils, findWindowAtPoint, 1}}, - {2897, {utils, beginBusyCursor, 1}}, - {2898, {utils, endBusyCursor, 0}}, - {2899, {utils, isBusy, 0}}, - {2900, {utils, shutdown, 1}}, - {2901, {utils, shell, 1}}, - {2902, {utils, launchDefaultBrowser, 2}}, - {2903, {utils, getEmailAddress, 0}}, - {2904, {utils, getUserId, 0}}, - {2905, {utils, getHomeDir, 0}}, - {2906, {utils, newId, 0}}, - {2907, {utils, registerId, 1}}, - {2908, {utils, getCurrentId, 0}}, - {2909, {utils, getOsDescription, 0}}, - {2910, {utils, isPlatformLittleEndian, 0}}, - {2911, {utils, isPlatform64Bit, 0}}, - {2912, {wxPrintout, new, 1}}, - {2913, {wxPrintout, destruct, 0}}, - {2914, {wxPrintout, getDC, 0}}, - {2915, {wxPrintout, getPageSizeMM, 2}}, - {2916, {wxPrintout, getPageSizePixels, 2}}, - {2917, {wxPrintout, getPaperRectPixels, 0}}, - {2918, {wxPrintout, getPPIPrinter, 2}}, - {2919, {wxPrintout, getPPIScreen, 2}}, - {2920, {wxPrintout, getTitle, 0}}, - {2921, {wxPrintout, isPreview, 0}}, - {2922, {wxPrintout, fitThisSizeToPaper, 1}}, - {2923, {wxPrintout, fitThisSizeToPage, 1}}, - {2924, {wxPrintout, fitThisSizeToPageMargins, 2}}, - {2925, {wxPrintout, mapScreenSizeToPaper, 0}}, - {2926, {wxPrintout, mapScreenSizeToPage, 0}}, - {2927, {wxPrintout, mapScreenSizeToPageMargins, 1}}, - {2928, {wxPrintout, mapScreenSizeToDevice, 0}}, - {2929, {wxPrintout, getLogicalPaperRect, 0}}, - {2930, {wxPrintout, getLogicalPageRect, 0}}, - {2931, {wxPrintout, getLogicalPageMarginsRect, 1}}, - {2932, {wxPrintout, setLogicalOrigin, 2}}, - {2933, {wxPrintout, offsetLogicalOrigin, 2}}, - {2934, {wxStyledTextCtrl, new_2, 2}}, - {2935, {wxStyledTextCtrl, new_0, 0}}, - {2936, {wxStyledTextCtrl, destruct, 0}}, - {2937, {wxStyledTextCtrl, create, 2}}, - {2938, {wxStyledTextCtrl, addText, 1}}, - {2939, {wxStyledTextCtrl, addStyledText, 1}}, - {2940, {wxStyledTextCtrl, insertText, 2}}, - {2941, {wxStyledTextCtrl, clearAll, 0}}, - {2942, {wxStyledTextCtrl, clearDocumentStyle, 0}}, - {2943, {wxStyledTextCtrl, getLength, 0}}, - {2944, {wxStyledTextCtrl, getCharAt, 1}}, - {2945, {wxStyledTextCtrl, getCurrentPos, 0}}, - {2946, {wxStyledTextCtrl, getAnchor, 0}}, - {2947, {wxStyledTextCtrl, getStyleAt, 1}}, - {2948, {wxStyledTextCtrl, redo, 0}}, - {2949, {wxStyledTextCtrl, setUndoCollection, 1}}, - {2950, {wxStyledTextCtrl, selectAll, 0}}, - {2951, {wxStyledTextCtrl, setSavePoint, 0}}, - {2952, {wxStyledTextCtrl, getStyledText, 2}}, - {2953, {wxStyledTextCtrl, canRedo, 0}}, - {2954, {wxStyledTextCtrl, markerLineFromHandle, 1}}, - {2955, {wxStyledTextCtrl, markerDeleteHandle, 1}}, - {2956, {wxStyledTextCtrl, getUndoCollection, 0}}, - {2957, {wxStyledTextCtrl, getViewWhiteSpace, 0}}, - {2958, {wxStyledTextCtrl, setViewWhiteSpace, 1}}, - {2959, {wxStyledTextCtrl, positionFromPoint, 1}}, - {2960, {wxStyledTextCtrl, positionFromPointClose, 2}}, - {2961, {wxStyledTextCtrl, gotoLine, 1}}, - {2962, {wxStyledTextCtrl, gotoPos, 1}}, - {2963, {wxStyledTextCtrl, setAnchor, 1}}, - {2964, {wxStyledTextCtrl, getCurLine, 1}}, - {2965, {wxStyledTextCtrl, getEndStyled, 0}}, - {2966, {wxStyledTextCtrl, convertEOLs, 1}}, - {2967, {wxStyledTextCtrl, getEOLMode, 0}}, - {2968, {wxStyledTextCtrl, setEOLMode, 1}}, - {2969, {wxStyledTextCtrl, startStyling, 2}}, - {2970, {wxStyledTextCtrl, setStyling, 2}}, - {2971, {wxStyledTextCtrl, getBufferedDraw, 0}}, - {2972, {wxStyledTextCtrl, setBufferedDraw, 1}}, - {2973, {wxStyledTextCtrl, setTabWidth, 1}}, - {2974, {wxStyledTextCtrl, getTabWidth, 0}}, - {2975, {wxStyledTextCtrl, setCodePage, 1}}, - {2976, {wxStyledTextCtrl, markerDefine, 3}}, - {2977, {wxStyledTextCtrl, markerSetForeground, 2}}, - {2978, {wxStyledTextCtrl, markerSetBackground, 2}}, - {2979, {wxStyledTextCtrl, markerAdd, 2}}, - {2980, {wxStyledTextCtrl, markerDelete, 2}}, - {2981, {wxStyledTextCtrl, markerDeleteAll, 1}}, - {2982, {wxStyledTextCtrl, markerGet, 1}}, - {2983, {wxStyledTextCtrl, markerNext, 2}}, - {2984, {wxStyledTextCtrl, markerPrevious, 2}}, - {2985, {wxStyledTextCtrl, markerDefineBitmap, 2}}, - {2986, {wxStyledTextCtrl, markerAddSet, 2}}, - {2987, {wxStyledTextCtrl, markerSetAlpha, 2}}, - {2988, {wxStyledTextCtrl, setMarginType, 2}}, - {2989, {wxStyledTextCtrl, getMarginType, 1}}, - {2990, {wxStyledTextCtrl, setMarginWidth, 2}}, - {2991, {wxStyledTextCtrl, getMarginWidth, 1}}, - {2992, {wxStyledTextCtrl, setMarginMask, 2}}, - {2993, {wxStyledTextCtrl, getMarginMask, 1}}, - {2994, {wxStyledTextCtrl, setMarginSensitive, 2}}, - {2995, {wxStyledTextCtrl, getMarginSensitive, 1}}, - {2996, {wxStyledTextCtrl, styleClearAll, 0}}, - {2997, {wxStyledTextCtrl, styleSetForeground, 2}}, - {2998, {wxStyledTextCtrl, styleSetBackground, 2}}, - {2999, {wxStyledTextCtrl, styleSetBold, 2}}, - {3000, {wxStyledTextCtrl, styleSetItalic, 2}}, - {3001, {wxStyledTextCtrl, styleSetSize, 2}}, - {3002, {wxStyledTextCtrl, styleSetFaceName, 2}}, - {3003, {wxStyledTextCtrl, styleSetEOLFilled, 2}}, - {3004, {wxStyledTextCtrl, styleResetDefault, 0}}, - {3005, {wxStyledTextCtrl, styleSetUnderline, 2}}, - {3006, {wxStyledTextCtrl, styleSetCase, 2}}, - {3007, {wxStyledTextCtrl, styleSetHotSpot, 2}}, - {3008, {wxStyledTextCtrl, setSelForeground, 2}}, - {3009, {wxStyledTextCtrl, setSelBackground, 2}}, - {3010, {wxStyledTextCtrl, getSelAlpha, 0}}, - {3011, {wxStyledTextCtrl, setSelAlpha, 1}}, - {3012, {wxStyledTextCtrl, setCaretForeground, 1}}, - {3013, {wxStyledTextCtrl, cmdKeyAssign, 3}}, - {3014, {wxStyledTextCtrl, cmdKeyClear, 2}}, - {3015, {wxStyledTextCtrl, cmdKeyClearAll, 0}}, - {3016, {wxStyledTextCtrl, setStyleBytes, 2}}, - {3017, {wxStyledTextCtrl, styleSetVisible, 2}}, - {3018, {wxStyledTextCtrl, getCaretPeriod, 0}}, - {3019, {wxStyledTextCtrl, setCaretPeriod, 1}}, - {3020, {wxStyledTextCtrl, setWordChars, 1}}, - {3021, {wxStyledTextCtrl, beginUndoAction, 0}}, - {3022, {wxStyledTextCtrl, endUndoAction, 0}}, - {3023, {wxStyledTextCtrl, indicatorSetStyle, 2}}, - {3024, {wxStyledTextCtrl, indicatorGetStyle, 1}}, - {3025, {wxStyledTextCtrl, indicatorSetForeground, 2}}, - {3026, {wxStyledTextCtrl, indicatorGetForeground, 1}}, - {3027, {wxStyledTextCtrl, setWhitespaceForeground, 2}}, - {3028, {wxStyledTextCtrl, setWhitespaceBackground, 2}}, - {3029, {wxStyledTextCtrl, getStyleBits, 0}}, - {3030, {wxStyledTextCtrl, setLineState, 2}}, - {3031, {wxStyledTextCtrl, getLineState, 1}}, - {3032, {wxStyledTextCtrl, getMaxLineState, 0}}, - {3033, {wxStyledTextCtrl, getCaretLineVisible, 0}}, - {3034, {wxStyledTextCtrl, setCaretLineVisible, 1}}, - {3035, {wxStyledTextCtrl, getCaretLineBackground, 0}}, - {3036, {wxStyledTextCtrl, setCaretLineBackground, 1}}, - {3037, {wxStyledTextCtrl, autoCompShow, 2}}, - {3038, {wxStyledTextCtrl, autoCompCancel, 0}}, - {3039, {wxStyledTextCtrl, autoCompActive, 0}}, - {3040, {wxStyledTextCtrl, autoCompPosStart, 0}}, - {3041, {wxStyledTextCtrl, autoCompComplete, 0}}, - {3042, {wxStyledTextCtrl, autoCompStops, 1}}, - {3043, {wxStyledTextCtrl, autoCompSetSeparator, 1}}, - {3044, {wxStyledTextCtrl, autoCompGetSeparator, 0}}, - {3045, {wxStyledTextCtrl, autoCompSelect, 1}}, - {3046, {wxStyledTextCtrl, autoCompSetCancelAtStart, 1}}, - {3047, {wxStyledTextCtrl, autoCompGetCancelAtStart, 0}}, - {3048, {wxStyledTextCtrl, autoCompSetFillUps, 1}}, - {3049, {wxStyledTextCtrl, autoCompSetChooseSingle, 1}}, - {3050, {wxStyledTextCtrl, autoCompGetChooseSingle, 0}}, - {3051, {wxStyledTextCtrl, autoCompSetIgnoreCase, 1}}, - {3052, {wxStyledTextCtrl, autoCompGetIgnoreCase, 0}}, - {3053, {wxStyledTextCtrl, userListShow, 2}}, - {3054, {wxStyledTextCtrl, autoCompSetAutoHide, 1}}, - {3055, {wxStyledTextCtrl, autoCompGetAutoHide, 0}}, - {3056, {wxStyledTextCtrl, autoCompSetDropRestOfWord, 1}}, - {3057, {wxStyledTextCtrl, autoCompGetDropRestOfWord, 0}}, - {3058, {wxStyledTextCtrl, registerImage, 2}}, - {3059, {wxStyledTextCtrl, clearRegisteredImages, 0}}, - {3060, {wxStyledTextCtrl, autoCompGetTypeSeparator, 0}}, - {3061, {wxStyledTextCtrl, autoCompSetTypeSeparator, 1}}, - {3062, {wxStyledTextCtrl, autoCompSetMaxWidth, 1}}, - {3063, {wxStyledTextCtrl, autoCompGetMaxWidth, 0}}, - {3064, {wxStyledTextCtrl, autoCompSetMaxHeight, 1}}, - {3065, {wxStyledTextCtrl, autoCompGetMaxHeight, 0}}, - {3066, {wxStyledTextCtrl, setIndent, 1}}, - {3067, {wxStyledTextCtrl, getIndent, 0}}, - {3068, {wxStyledTextCtrl, setUseTabs, 1}}, - {3069, {wxStyledTextCtrl, getUseTabs, 0}}, - {3070, {wxStyledTextCtrl, setLineIndentation, 2}}, - {3071, {wxStyledTextCtrl, getLineIndentation, 1}}, - {3072, {wxStyledTextCtrl, getLineIndentPosition, 1}}, - {3073, {wxStyledTextCtrl, getColumn, 1}}, - {3074, {wxStyledTextCtrl, setUseHorizontalScrollBar, 1}}, - {3075, {wxStyledTextCtrl, getUseHorizontalScrollBar, 0}}, - {3076, {wxStyledTextCtrl, setIndentationGuides, 1}}, - {3077, {wxStyledTextCtrl, getIndentationGuides, 0}}, - {3078, {wxStyledTextCtrl, setHighlightGuide, 1}}, - {3079, {wxStyledTextCtrl, getHighlightGuide, 0}}, - {3080, {wxStyledTextCtrl, getLineEndPosition, 1}}, - {3081, {wxStyledTextCtrl, getCodePage, 0}}, - {3082, {wxStyledTextCtrl, getCaretForeground, 0}}, - {3083, {wxStyledTextCtrl, getReadOnly, 0}}, - {3084, {wxStyledTextCtrl, setCurrentPos, 1}}, - {3085, {wxStyledTextCtrl, setSelectionStart, 1}}, - {3086, {wxStyledTextCtrl, getSelectionStart, 0}}, - {3087, {wxStyledTextCtrl, setSelectionEnd, 1}}, - {3088, {wxStyledTextCtrl, getSelectionEnd, 0}}, - {3089, {wxStyledTextCtrl, setPrintMagnification, 1}}, - {3090, {wxStyledTextCtrl, getPrintMagnification, 0}}, - {3091, {wxStyledTextCtrl, setPrintColourMode, 1}}, - {3092, {wxStyledTextCtrl, getPrintColourMode, 0}}, - {3093, {wxStyledTextCtrl, findText, 4}}, - {3094, {wxStyledTextCtrl, formatRange, 7}}, - {3095, {wxStyledTextCtrl, getFirstVisibleLine, 0}}, - {3096, {wxStyledTextCtrl, getLine, 1}}, - {3097, {wxStyledTextCtrl, getLineCount, 0}}, - {3098, {wxStyledTextCtrl, setMarginLeft, 1}}, - {3099, {wxStyledTextCtrl, getMarginLeft, 0}}, - {3100, {wxStyledTextCtrl, setMarginRight, 1}}, - {3101, {wxStyledTextCtrl, getMarginRight, 0}}, - {3102, {wxStyledTextCtrl, getModify, 0}}, - {3103, {wxStyledTextCtrl, setSelection, 2}}, - {3104, {wxStyledTextCtrl, getSelectedText, 0}}, - {3105, {wxStyledTextCtrl, getTextRange, 2}}, - {3106, {wxStyledTextCtrl, hideSelection, 1}}, - {3107, {wxStyledTextCtrl, lineFromPosition, 1}}, - {3108, {wxStyledTextCtrl, positionFromLine, 1}}, - {3109, {wxStyledTextCtrl, lineScroll, 2}}, - {3110, {wxStyledTextCtrl, ensureCaretVisible, 0}}, - {3111, {wxStyledTextCtrl, replaceSelection, 1}}, - {3112, {wxStyledTextCtrl, setReadOnly, 1}}, - {3113, {wxStyledTextCtrl, canPaste, 0}}, - {3114, {wxStyledTextCtrl, canUndo, 0}}, - {3115, {wxStyledTextCtrl, emptyUndoBuffer, 0}}, - {3116, {wxStyledTextCtrl, undo, 0}}, - {3117, {wxStyledTextCtrl, cut, 0}}, - {3118, {wxStyledTextCtrl, copy, 0}}, - {3119, {wxStyledTextCtrl, paste, 0}}, - {3120, {wxStyledTextCtrl, clear, 0}}, - {3121, {wxStyledTextCtrl, setText, 1}}, - {3122, {wxStyledTextCtrl, getText, 0}}, - {3123, {wxStyledTextCtrl, getTextLength, 0}}, - {3124, {wxStyledTextCtrl, getOvertype, 0}}, - {3125, {wxStyledTextCtrl, setCaretWidth, 1}}, - {3126, {wxStyledTextCtrl, getCaretWidth, 0}}, - {3127, {wxStyledTextCtrl, setTargetStart, 1}}, - {3128, {wxStyledTextCtrl, getTargetStart, 0}}, - {3129, {wxStyledTextCtrl, setTargetEnd, 1}}, - {3130, {wxStyledTextCtrl, getTargetEnd, 0}}, - {3131, {wxStyledTextCtrl, replaceTarget, 1}}, - {3132, {wxStyledTextCtrl, searchInTarget, 1}}, - {3133, {wxStyledTextCtrl, setSearchFlags, 1}}, - {3134, {wxStyledTextCtrl, getSearchFlags, 0}}, - {3135, {wxStyledTextCtrl, callTipShow, 2}}, - {3136, {wxStyledTextCtrl, callTipCancel, 0}}, - {3137, {wxStyledTextCtrl, callTipActive, 0}}, - {3138, {wxStyledTextCtrl, callTipPosAtStart, 0}}, - {3139, {wxStyledTextCtrl, callTipSetHighlight, 2}}, - {3140, {wxStyledTextCtrl, callTipSetBackground, 1}}, - {3141, {wxStyledTextCtrl, callTipSetForeground, 1}}, - {3142, {wxStyledTextCtrl, callTipSetForegroundHighlight, 1}}, - {3143, {wxStyledTextCtrl, callTipUseStyle, 1}}, - {3144, {wxStyledTextCtrl, visibleFromDocLine, 1}}, - {3145, {wxStyledTextCtrl, docLineFromVisible, 1}}, - {3146, {wxStyledTextCtrl, wrapCount, 1}}, - {3147, {wxStyledTextCtrl, setFoldLevel, 2}}, - {3148, {wxStyledTextCtrl, getFoldLevel, 1}}, - {3149, {wxStyledTextCtrl, getLastChild, 2}}, - {3150, {wxStyledTextCtrl, getFoldParent, 1}}, - {3151, {wxStyledTextCtrl, showLines, 2}}, - {3152, {wxStyledTextCtrl, hideLines, 2}}, - {3153, {wxStyledTextCtrl, getLineVisible, 1}}, - {3154, {wxStyledTextCtrl, setFoldExpanded, 2}}, - {3155, {wxStyledTextCtrl, getFoldExpanded, 1}}, - {3156, {wxStyledTextCtrl, toggleFold, 1}}, - {3157, {wxStyledTextCtrl, ensureVisible, 1}}, - {3158, {wxStyledTextCtrl, setFoldFlags, 1}}, - {3159, {wxStyledTextCtrl, ensureVisibleEnforcePolicy, 1}}, - {3160, {wxStyledTextCtrl, setTabIndents, 1}}, - {3161, {wxStyledTextCtrl, getTabIndents, 0}}, - {3162, {wxStyledTextCtrl, setBackSpaceUnIndents, 1}}, - {3163, {wxStyledTextCtrl, getBackSpaceUnIndents, 0}}, - {3164, {wxStyledTextCtrl, setMouseDwellTime, 1}}, - {3165, {wxStyledTextCtrl, getMouseDwellTime, 0}}, - {3166, {wxStyledTextCtrl, wordStartPosition, 2}}, - {3167, {wxStyledTextCtrl, wordEndPosition, 2}}, - {3168, {wxStyledTextCtrl, setWrapMode, 1}}, - {3169, {wxStyledTextCtrl, getWrapMode, 0}}, - {3170, {wxStyledTextCtrl, setWrapVisualFlags, 1}}, - {3171, {wxStyledTextCtrl, getWrapVisualFlags, 0}}, - {3172, {wxStyledTextCtrl, setWrapVisualFlagsLocation, 1}}, - {3173, {wxStyledTextCtrl, getWrapVisualFlagsLocation, 0}}, - {3174, {wxStyledTextCtrl, setWrapStartIndent, 1}}, - {3175, {wxStyledTextCtrl, getWrapStartIndent, 0}}, - {3176, {wxStyledTextCtrl, setLayoutCache, 1}}, - {3177, {wxStyledTextCtrl, getLayoutCache, 0}}, - {3178, {wxStyledTextCtrl, setScrollWidth, 1}}, - {3179, {wxStyledTextCtrl, getScrollWidth, 0}}, - {3180, {wxStyledTextCtrl, textWidth, 2}}, - {3181, {wxStyledTextCtrl, getEndAtLastLine, 0}}, - {3182, {wxStyledTextCtrl, textHeight, 1}}, - {3183, {wxStyledTextCtrl, setUseVerticalScrollBar, 1}}, - {3184, {wxStyledTextCtrl, getUseVerticalScrollBar, 0}}, - {3185, {wxStyledTextCtrl, appendText, 1}}, - {3186, {wxStyledTextCtrl, getTwoPhaseDraw, 0}}, - {3187, {wxStyledTextCtrl, setTwoPhaseDraw, 1}}, - {3188, {wxStyledTextCtrl, targetFromSelection, 0}}, - {3189, {wxStyledTextCtrl, linesJoin, 0}}, - {3190, {wxStyledTextCtrl, linesSplit, 1}}, - {3191, {wxStyledTextCtrl, setFoldMarginColour, 2}}, - {3192, {wxStyledTextCtrl, setFoldMarginHiColour, 2}}, - {3193, {wxStyledTextCtrl, lineDown, 0}}, - {3194, {wxStyledTextCtrl, lineDownExtend, 0}}, - {3195, {wxStyledTextCtrl, lineUp, 0}}, - {3196, {wxStyledTextCtrl, lineUpExtend, 0}}, - {3197, {wxStyledTextCtrl, charLeft, 0}}, - {3198, {wxStyledTextCtrl, charLeftExtend, 0}}, - {3199, {wxStyledTextCtrl, charRight, 0}}, - {3200, {wxStyledTextCtrl, charRightExtend, 0}}, - {3201, {wxStyledTextCtrl, wordLeft, 0}}, - {3202, {wxStyledTextCtrl, wordLeftExtend, 0}}, - {3203, {wxStyledTextCtrl, wordRight, 0}}, - {3204, {wxStyledTextCtrl, wordRightExtend, 0}}, - {3205, {wxStyledTextCtrl, home, 0}}, - {3206, {wxStyledTextCtrl, homeExtend, 0}}, - {3207, {wxStyledTextCtrl, lineEnd, 0}}, - {3208, {wxStyledTextCtrl, lineEndExtend, 0}}, - {3209, {wxStyledTextCtrl, documentStart, 0}}, - {3210, {wxStyledTextCtrl, documentStartExtend, 0}}, - {3211, {wxStyledTextCtrl, documentEnd, 0}}, - {3212, {wxStyledTextCtrl, documentEndExtend, 0}}, - {3213, {wxStyledTextCtrl, pageUp, 0}}, - {3214, {wxStyledTextCtrl, pageUpExtend, 0}}, - {3215, {wxStyledTextCtrl, pageDown, 0}}, - {3216, {wxStyledTextCtrl, pageDownExtend, 0}}, - {3217, {wxStyledTextCtrl, editToggleOvertype, 0}}, - {3218, {wxStyledTextCtrl, cancel, 0}}, - {3219, {wxStyledTextCtrl, deleteBack, 0}}, - {3220, {wxStyledTextCtrl, tab, 0}}, - {3221, {wxStyledTextCtrl, backTab, 0}}, - {3222, {wxStyledTextCtrl, newLine, 0}}, - {3223, {wxStyledTextCtrl, formFeed, 0}}, - {3224, {wxStyledTextCtrl, vCHome, 0}}, - {3225, {wxStyledTextCtrl, vCHomeExtend, 0}}, - {3226, {wxStyledTextCtrl, zoomIn, 0}}, - {3227, {wxStyledTextCtrl, zoomOut, 0}}, - {3228, {wxStyledTextCtrl, delWordLeft, 0}}, - {3229, {wxStyledTextCtrl, delWordRight, 0}}, - {3230, {wxStyledTextCtrl, lineCut, 0}}, - {3231, {wxStyledTextCtrl, lineDelete, 0}}, - {3232, {wxStyledTextCtrl, lineTranspose, 0}}, - {3233, {wxStyledTextCtrl, lineDuplicate, 0}}, - {3234, {wxStyledTextCtrl, lowerCase, 0}}, - {3235, {wxStyledTextCtrl, upperCase, 0}}, - {3236, {wxStyledTextCtrl, lineScrollDown, 0}}, - {3237, {wxStyledTextCtrl, lineScrollUp, 0}}, - {3238, {wxStyledTextCtrl, deleteBackNotLine, 0}}, - {3239, {wxStyledTextCtrl, homeDisplay, 0}}, - {3240, {wxStyledTextCtrl, homeDisplayExtend, 0}}, - {3241, {wxStyledTextCtrl, lineEndDisplay, 0}}, - {3242, {wxStyledTextCtrl, lineEndDisplayExtend, 0}}, - {3243, {wxStyledTextCtrl, homeWrapExtend, 0}}, - {3244, {wxStyledTextCtrl, lineEndWrap, 0}}, - {3245, {wxStyledTextCtrl, lineEndWrapExtend, 0}}, - {3246, {wxStyledTextCtrl, vCHomeWrap, 0}}, - {3247, {wxStyledTextCtrl, vCHomeWrapExtend, 0}}, - {3248, {wxStyledTextCtrl, lineCopy, 0}}, - {3249, {wxStyledTextCtrl, moveCaretInsideView, 0}}, - {3250, {wxStyledTextCtrl, lineLength, 1}}, - {3251, {wxStyledTextCtrl, braceHighlight, 2}}, - {3252, {wxStyledTextCtrl, braceBadLight, 1}}, - {3253, {wxStyledTextCtrl, braceMatch, 1}}, - {3254, {wxStyledTextCtrl, getViewEOL, 0}}, - {3255, {wxStyledTextCtrl, setViewEOL, 1}}, - {3256, {wxStyledTextCtrl, setModEventMask, 1}}, - {3257, {wxStyledTextCtrl, getEdgeColumn, 0}}, - {3258, {wxStyledTextCtrl, setEdgeColumn, 1}}, - {3259, {wxStyledTextCtrl, getEdgeMode, 0}}, - {3260, {wxStyledTextCtrl, getEdgeColour, 0}}, - {3261, {wxStyledTextCtrl, setEdgeColour, 1}}, - {3262, {wxStyledTextCtrl, searchAnchor, 0}}, - {3263, {wxStyledTextCtrl, searchNext, 2}}, - {3264, {wxStyledTextCtrl, searchPrev, 2}}, - {3265, {wxStyledTextCtrl, linesOnScreen, 0}}, - {3266, {wxStyledTextCtrl, usePopUp, 1}}, - {3267, {wxStyledTextCtrl, selectionIsRectangle, 0}}, - {3268, {wxStyledTextCtrl, setZoom, 1}}, - {3269, {wxStyledTextCtrl, getZoom, 0}}, - {3270, {wxStyledTextCtrl, getModEventMask, 0}}, - {3271, {wxStyledTextCtrl, setSTCFocus, 1}}, - {3272, {wxStyledTextCtrl, getSTCFocus, 0}}, - {3273, {wxStyledTextCtrl, setStatus, 1}}, - {3274, {wxStyledTextCtrl, getStatus, 0}}, - {3275, {wxStyledTextCtrl, setMouseDownCaptures, 1}}, - {3276, {wxStyledTextCtrl, getMouseDownCaptures, 0}}, - {3277, {wxStyledTextCtrl, setSTCCursor, 1}}, - {3278, {wxStyledTextCtrl, getSTCCursor, 0}}, - {3279, {wxStyledTextCtrl, setControlCharSymbol, 1}}, - {3280, {wxStyledTextCtrl, getControlCharSymbol, 0}}, - {3281, {wxStyledTextCtrl, wordPartLeft, 0}}, - {3282, {wxStyledTextCtrl, wordPartLeftExtend, 0}}, - {3283, {wxStyledTextCtrl, wordPartRight, 0}}, - {3284, {wxStyledTextCtrl, wordPartRightExtend, 0}}, - {3285, {wxStyledTextCtrl, setVisiblePolicy, 2}}, - {3286, {wxStyledTextCtrl, delLineLeft, 0}}, - {3287, {wxStyledTextCtrl, delLineRight, 0}}, - {3288, {wxStyledTextCtrl, getXOffset, 0}}, - {3289, {wxStyledTextCtrl, chooseCaretX, 0}}, - {3290, {wxStyledTextCtrl, setXCaretPolicy, 2}}, - {3291, {wxStyledTextCtrl, setYCaretPolicy, 2}}, - {3292, {wxStyledTextCtrl, getPrintWrapMode, 0}}, - {3293, {wxStyledTextCtrl, setHotspotActiveForeground, 2}}, - {3294, {wxStyledTextCtrl, setHotspotActiveBackground, 2}}, - {3295, {wxStyledTextCtrl, setHotspotActiveUnderline, 1}}, - {3296, {wxStyledTextCtrl, setHotspotSingleLine, 1}}, - {3297, {wxStyledTextCtrl, paraDownExtend, 0}}, - {3298, {wxStyledTextCtrl, paraUp, 0}}, - {3299, {wxStyledTextCtrl, paraUpExtend, 0}}, - {3300, {wxStyledTextCtrl, positionBefore, 1}}, - {3301, {wxStyledTextCtrl, positionAfter, 1}}, - {3302, {wxStyledTextCtrl, copyRange, 2}}, - {3303, {wxStyledTextCtrl, copyText, 2}}, - {3304, {wxStyledTextCtrl, setSelectionMode, 1}}, - {3305, {wxStyledTextCtrl, getSelectionMode, 0}}, - {3306, {wxStyledTextCtrl, lineDownRectExtend, 0}}, - {3307, {wxStyledTextCtrl, lineUpRectExtend, 0}}, - {3308, {wxStyledTextCtrl, charLeftRectExtend, 0}}, - {3309, {wxStyledTextCtrl, charRightRectExtend, 0}}, - {3310, {wxStyledTextCtrl, homeRectExtend, 0}}, - {3311, {wxStyledTextCtrl, vCHomeRectExtend, 0}}, - {3312, {wxStyledTextCtrl, lineEndRectExtend, 0}}, - {3313, {wxStyledTextCtrl, pageUpRectExtend, 0}}, - {3314, {wxStyledTextCtrl, pageDownRectExtend, 0}}, - {3315, {wxStyledTextCtrl, stutteredPageUp, 0}}, - {3316, {wxStyledTextCtrl, stutteredPageUpExtend, 0}}, - {3317, {wxStyledTextCtrl, stutteredPageDown, 0}}, - {3318, {wxStyledTextCtrl, stutteredPageDownExtend, 0}}, - {3319, {wxStyledTextCtrl, wordLeftEnd, 0}}, - {3320, {wxStyledTextCtrl, wordLeftEndExtend, 0}}, - {3321, {wxStyledTextCtrl, wordRightEnd, 0}}, - {3322, {wxStyledTextCtrl, wordRightEndExtend, 0}}, - {3323, {wxStyledTextCtrl, setWhitespaceChars, 1}}, - {3324, {wxStyledTextCtrl, setCharsDefault, 0}}, - {3325, {wxStyledTextCtrl, autoCompGetCurrent, 0}}, - {3326, {wxStyledTextCtrl, allocate, 1}}, - {3327, {wxStyledTextCtrl, findColumn, 2}}, - {3328, {wxStyledTextCtrl, getCaretSticky, 0}}, - {3329, {wxStyledTextCtrl, setCaretSticky, 1}}, - {3330, {wxStyledTextCtrl, toggleCaretSticky, 0}}, - {3331, {wxStyledTextCtrl, setPasteConvertEndings, 1}}, - {3332, {wxStyledTextCtrl, getPasteConvertEndings, 0}}, - {3333, {wxStyledTextCtrl, selectionDuplicate, 0}}, - {3334, {wxStyledTextCtrl, setCaretLineBackAlpha, 1}}, - {3335, {wxStyledTextCtrl, getCaretLineBackAlpha, 0}}, - {3336, {wxStyledTextCtrl, startRecord, 0}}, - {3337, {wxStyledTextCtrl, stopRecord, 0}}, - {3338, {wxStyledTextCtrl, setLexer, 1}}, - {3339, {wxStyledTextCtrl, getLexer, 0}}, - {3340, {wxStyledTextCtrl, colourise, 2}}, - {3341, {wxStyledTextCtrl, setProperty, 2}}, - {3342, {wxStyledTextCtrl, setKeyWords, 2}}, - {3343, {wxStyledTextCtrl, setLexerLanguage, 1}}, - {3344, {wxStyledTextCtrl, getProperty, 1}}, - {3345, {wxStyledTextCtrl, getStyleBitsNeeded, 0}}, - {3346, {wxStyledTextCtrl, getCurrentLine, 0}}, - {3347, {wxStyledTextCtrl, styleSetSpec, 2}}, - {3348, {wxStyledTextCtrl, styleSetFont, 2}}, - {3349, {wxStyledTextCtrl, styleSetFontAttr, 7}}, - {3350, {wxStyledTextCtrl, styleSetCharacterSet, 2}}, - {3351, {wxStyledTextCtrl, styleSetFontEncoding, 2}}, - {3352, {wxStyledTextCtrl, cmdKeyExecute, 1}}, - {3353, {wxStyledTextCtrl, setMargins, 2}}, - {3354, {wxStyledTextCtrl, getSelection, 2}}, - {3355, {wxStyledTextCtrl, pointFromPosition, 1}}, - {3356, {wxStyledTextCtrl, scrollToLine, 1}}, - {3357, {wxStyledTextCtrl, scrollToColumn, 1}}, - {3358, {wxStyledTextCtrl, sendMsg, 2}}, - {3359, {wxStyledTextCtrl, setVScrollBar, 1}}, - {3360, {wxStyledTextCtrl, setHScrollBar, 1}}, - {3361, {wxStyledTextCtrl, getLastKeydownProcessed, 0}}, - {3362, {wxStyledTextCtrl, setLastKeydownProcessed, 1}}, - {3363, {wxStyledTextCtrl, saveFile, 1}}, - {3364, {wxStyledTextCtrl, loadFile, 1}}, - {3365, {wxStyledTextCtrl, doDragOver, 3}}, - {3366, {wxStyledTextCtrl, doDropText, 3}}, - {3367, {wxStyledTextCtrl, getUseAntiAliasing, 0}}, - {3368, {wxStyledTextCtrl, addTextRaw, 1}}, - {3369, {wxStyledTextCtrl, insertTextRaw, 2}}, - {3370, {wxStyledTextCtrl, getCurLineRaw, 1}}, - {3371, {wxStyledTextCtrl, getLineRaw, 1}}, - {3372, {wxStyledTextCtrl, getSelectedTextRaw, 0}}, - {3373, {wxStyledTextCtrl, getTextRangeRaw, 2}}, - {3374, {wxStyledTextCtrl, setTextRaw, 1}}, - {3375, {wxStyledTextCtrl, getTextRaw, 0}}, - {3376, {wxStyledTextCtrl, appendTextRaw, 1}}, - {3377, {wxArtProvider, getBitmap, 2}}, - {3378, {wxArtProvider, getIcon, 2}}, - {3379, {wxTreeEvent, getKeyCode, 0}}, - {3380, {wxTreeEvent, getItem, 0}}, - {3381, {wxTreeEvent, getKeyEvent, 0}}, - {3382, {wxTreeEvent, getLabel, 0}}, - {3383, {wxTreeEvent, getOldItem, 0}}, - {3384, {wxTreeEvent, getPoint, 0}}, - {3385, {wxTreeEvent, isEditCancelled, 0}}, - {3386, {wxTreeEvent, setToolTip, 1}}, - {3387, {wxNotebookEvent, getOldSelection, 0}}, - {3388, {wxNotebookEvent, getSelection, 0}}, - {3389, {wxNotebookEvent, setOldSelection, 1}}, - {3390, {wxNotebookEvent, setSelection, 1}}, - {3391, {wxFileDataObject, new, 0}}, - {3392, {wxFileDataObject, addFile, 1}}, - {3393, {wxFileDataObject, getFilenames, 0}}, - {3394, {wxFileDataObject, 'Destroy', undefined}}, - {3395, {wxTextDataObject, new, 1}}, - {3396, {wxTextDataObject, getTextLength, 0}}, - {3397, {wxTextDataObject, getText, 0}}, - {3398, {wxTextDataObject, setText, 1}}, - {3399, {wxTextDataObject, 'Destroy', undefined}}, - {3400, {wxBitmapDataObject, new_1_1, 1}}, - {3401, {wxBitmapDataObject, new_1_0, 1}}, - {3402, {wxBitmapDataObject, getBitmap, 0}}, - {3403, {wxBitmapDataObject, setBitmap, 1}}, - {3404, {wxBitmapDataObject, 'Destroy', undefined}}, - {3406, {wxClipboard, new, 0}}, - {3407, {wxClipboard, destruct, 0}}, - {3408, {wxClipboard, addData, 1}}, - {3409, {wxClipboard, clear, 0}}, - {3410, {wxClipboard, close, 0}}, - {3411, {wxClipboard, flush, 0}}, - {3412, {wxClipboard, getData, 1}}, - {3413, {wxClipboard, isOpened, 0}}, - {3414, {wxClipboard, open, 0}}, - {3415, {wxClipboard, setData, 1}}, - {3417, {wxClipboard, usePrimarySelection, 1}}, - {3418, {wxClipboard, isSupported, 1}}, - {3419, {wxClipboard, get, 0}}, - {3420, {wxSpinEvent, getPosition, 0}}, - {3421, {wxSpinEvent, setPosition, 1}}, - {3422, {wxSplitterWindow, new_0, 0}}, - {3423, {wxSplitterWindow, new_2, 2}}, - {3424, {wxSplitterWindow, destruct, 0}}, - {3425, {wxSplitterWindow, create, 2}}, - {3426, {wxSplitterWindow, getMinimumPaneSize, 0}}, - {3427, {wxSplitterWindow, getSashGravity, 0}}, - {3428, {wxSplitterWindow, getSashPosition, 0}}, - {3429, {wxSplitterWindow, getSplitMode, 0}}, - {3430, {wxSplitterWindow, getWindow1, 0}}, - {3431, {wxSplitterWindow, getWindow2, 0}}, - {3432, {wxSplitterWindow, initialize, 1}}, - {3433, {wxSplitterWindow, isSplit, 0}}, - {3434, {wxSplitterWindow, replaceWindow, 2}}, - {3435, {wxSplitterWindow, setSashGravity, 1}}, - {3436, {wxSplitterWindow, setSashPosition, 2}}, - {3437, {wxSplitterWindow, setSashSize, 1}}, - {3438, {wxSplitterWindow, setMinimumPaneSize, 1}}, - {3439, {wxSplitterWindow, setSplitMode, 1}}, - {3440, {wxSplitterWindow, splitHorizontally, 3}}, - {3441, {wxSplitterWindow, splitVertically, 3}}, - {3442, {wxSplitterWindow, unsplit, 1}}, - {3443, {wxSplitterWindow, updateSize, 0}}, - {3444, {wxSplitterEvent, getSashPosition, 0}}, - {3445, {wxSplitterEvent, getX, 0}}, - {3446, {wxSplitterEvent, getY, 0}}, - {3447, {wxSplitterEvent, getWindowBeingRemoved, 0}}, - {3448, {wxSplitterEvent, setSashPosition, 1}}, - {3449, {wxHtmlWindow, new_0, 0}}, - {3450, {wxHtmlWindow, new_2, 2}}, - {3451, {wxHtmlWindow, appendToPage, 1}}, - {3452, {wxHtmlWindow, getOpenedAnchor, 0}}, - {3453, {wxHtmlWindow, getOpenedPage, 0}}, - {3454, {wxHtmlWindow, getOpenedPageTitle, 0}}, - {3455, {wxHtmlWindow, getRelatedFrame, 0}}, - {3456, {wxHtmlWindow, historyBack, 0}}, - {3457, {wxHtmlWindow, historyCanBack, 0}}, - {3458, {wxHtmlWindow, historyCanForward, 0}}, - {3459, {wxHtmlWindow, historyClear, 0}}, - {3460, {wxHtmlWindow, historyForward, 0}}, - {3461, {wxHtmlWindow, loadFile, 1}}, - {3462, {wxHtmlWindow, loadPage, 1}}, - {3463, {wxHtmlWindow, selectAll, 0}}, - {3464, {wxHtmlWindow, selectionToText, 0}}, - {3465, {wxHtmlWindow, selectLine, 1}}, - {3466, {wxHtmlWindow, selectWord, 1}}, - {3467, {wxHtmlWindow, setBorders, 1}}, - {3468, {wxHtmlWindow, setFonts, 3}}, - {3469, {wxHtmlWindow, setPage, 1}}, - {3470, {wxHtmlWindow, setRelatedFrame, 2}}, - {3471, {wxHtmlWindow, setRelatedStatusBar, 1}}, - {3472, {wxHtmlWindow, toText, 0}}, - {3473, {wxHtmlWindow, 'Destroy', undefined}}, - {3474, {wxHtmlLinkEvent, getLinkInfo, 0}}, - {3475, {wxAuiNotebookEvent, setSelection, 1}}, - {3476, {wxAuiNotebookEvent, getSelection, 0}}, - {3477, {wxAuiNotebookEvent, setOldSelection, 1}}, - {3478, {wxAuiNotebookEvent, getOldSelection, 0}}, - {3479, {wxAuiNotebookEvent, setDragSource, 1}}, - {3480, {wxAuiNotebookEvent, getDragSource, 0}}, - {3481, {wxAuiManagerEvent, setManager, 1}}, - {3482, {wxAuiManagerEvent, getManager, 0}}, - {3483, {wxAuiManagerEvent, setPane, 1}}, - {3484, {wxAuiManagerEvent, getPane, 0}}, - {3485, {wxAuiManagerEvent, setButton, 1}}, - {3486, {wxAuiManagerEvent, getButton, 0}}, - {3487, {wxAuiManagerEvent, setDC, 1}}, - {3488, {wxAuiManagerEvent, getDC, 0}}, - {3489, {wxAuiManagerEvent, veto, 1}}, - {3490, {wxAuiManagerEvent, getVeto, 0}}, - {3491, {wxAuiManagerEvent, setCanVeto, 1}}, - {3492, {wxAuiManagerEvent, canVeto, 0}}, - {3493, {wxLogNull, new, 0}}, - {3494, {wxLogNull, 'Destroy', undefined}}, + {2010, {wxTreeCtrl, editLabel, 1}}, + {2011, {wxTreeCtrl, ensureVisible, 1}}, + {2012, {wxTreeCtrl, expand, 1}}, + {2013, {wxTreeCtrl, getBoundingRect, 3}}, + {2015, {wxTreeCtrl, getChildrenCount, 2}}, + {2016, {wxTreeCtrl, getCount, 0}}, + {2017, {wxTreeCtrl, getEditControl, 0}}, + {2018, {wxTreeCtrl, getFirstChild, 2}}, + {2019, {wxTreeCtrl, getNextChild, 2}}, + {2020, {wxTreeCtrl, getFirstVisibleItem, 0}}, + {2021, {wxTreeCtrl, getImageList, 0}}, + {2022, {wxTreeCtrl, getIndent, 0}}, + {2023, {wxTreeCtrl, getItemBackgroundColour, 1}}, + {2024, {wxTreeCtrl, getItemData, 1}}, + {2025, {wxTreeCtrl, getItemFont, 1}}, + {2026, {wxTreeCtrl, getItemImage_1, 1}}, + {2027, {wxTreeCtrl, getItemImage_2, 2}}, + {2028, {wxTreeCtrl, getItemText, 1}}, + {2029, {wxTreeCtrl, getItemTextColour, 1}}, + {2030, {wxTreeCtrl, getLastChild, 1}}, + {2031, {wxTreeCtrl, getNextSibling, 1}}, + {2032, {wxTreeCtrl, getNextVisible, 1}}, + {2033, {wxTreeCtrl, getItemParent, 1}}, + {2034, {wxTreeCtrl, getPrevSibling, 1}}, + {2035, {wxTreeCtrl, getPrevVisible, 1}}, + {2036, {wxTreeCtrl, getRootItem, 0}}, + {2037, {wxTreeCtrl, getSelection, 0}}, + {2038, {wxTreeCtrl, getSelections, 1}}, + {2039, {wxTreeCtrl, getStateImageList, 0}}, + {2040, {wxTreeCtrl, hitTest, 1}}, + {2042, {wxTreeCtrl, insertItem, 4}}, + {2043, {wxTreeCtrl, isBold, 1}}, + {2044, {wxTreeCtrl, isExpanded, 1}}, + {2045, {wxTreeCtrl, isSelected, 1}}, + {2046, {wxTreeCtrl, isVisible, 1}}, + {2047, {wxTreeCtrl, itemHasChildren, 1}}, + {2048, {wxTreeCtrl, prependItem, 3}}, + {2049, {wxTreeCtrl, scrollTo, 1}}, + {2050, {wxTreeCtrl, selectItem_1, 1}}, + {2051, {wxTreeCtrl, selectItem_2, 2}}, + {2052, {wxTreeCtrl, setIndent, 1}}, + {2053, {wxTreeCtrl, setImageList, 1}}, + {2054, {wxTreeCtrl, setItemBackgroundColour, 2}}, + {2055, {wxTreeCtrl, setItemBold, 2}}, + {2056, {wxTreeCtrl, setItemData, 2}}, + {2057, {wxTreeCtrl, setItemDropHighlight, 2}}, + {2058, {wxTreeCtrl, setItemFont, 2}}, + {2059, {wxTreeCtrl, setItemHasChildren, 2}}, + {2060, {wxTreeCtrl, setItemImage_2, 2}}, + {2061, {wxTreeCtrl, setItemImage_3, 3}}, + {2062, {wxTreeCtrl, setItemText, 2}}, + {2063, {wxTreeCtrl, setItemTextColour, 2}}, + {2064, {wxTreeCtrl, setStateImageList, 1}}, + {2065, {wxTreeCtrl, setWindowStyle, 1}}, + {2066, {wxTreeCtrl, sortChildren, 1}}, + {2067, {wxTreeCtrl, toggle, 1}}, + {2068, {wxTreeCtrl, toggleItemSelection, 1}}, + {2069, {wxTreeCtrl, unselect, 0}}, + {2070, {wxTreeCtrl, unselectAll, 0}}, + {2071, {wxTreeCtrl, unselectItem, 1}}, + {2072, {wxScrollBar, new_0, 0}}, + {2073, {wxScrollBar, new_3, 3}}, + {2074, {wxScrollBar, destruct, 0}}, + {2075, {wxScrollBar, create, 3}}, + {2076, {wxScrollBar, getRange, 0}}, + {2077, {wxScrollBar, getPageSize, 0}}, + {2078, {wxScrollBar, getThumbPosition, 0}}, + {2079, {wxScrollBar, getThumbSize, 0}}, + {2080, {wxScrollBar, setThumbPosition, 1}}, + {2081, {wxScrollBar, setScrollbar, 5}}, + {2083, {wxSpinButton, new_2, 2}}, + {2084, {wxSpinButton, new_0, 0}}, + {2085, {wxSpinButton, create, 2}}, + {2086, {wxSpinButton, getMax, 0}}, + {2087, {wxSpinButton, getMin, 0}}, + {2088, {wxSpinButton, getValue, 0}}, + {2089, {wxSpinButton, setRange, 2}}, + {2090, {wxSpinButton, setValue, 1}}, + {2091, {wxSpinButton, 'Destroy', undefined}}, + {2092, {wxSpinCtrl, new_0, 0}}, + {2093, {wxSpinCtrl, new_2, 2}}, + {2095, {wxSpinCtrl, create, 2}}, + {2098, {wxSpinCtrl, setValue_1_1, 1}}, + {2099, {wxSpinCtrl, setValue_1_0, 1}}, + {2101, {wxSpinCtrl, getValue, 0}}, + {2103, {wxSpinCtrl, setRange, 2}}, + {2104, {wxSpinCtrl, setSelection, 2}}, + {2106, {wxSpinCtrl, getMin, 0}}, + {2108, {wxSpinCtrl, getMax, 0}}, + {2109, {wxSpinCtrl, 'Destroy', undefined}}, + {2110, {wxStaticText, new_0, 0}}, + {2111, {wxStaticText, new_4, 4}}, + {2112, {wxStaticText, create, 4}}, + {2113, {wxStaticText, getLabel, 0}}, + {2114, {wxStaticText, setLabel, 1}}, + {2115, {wxStaticText, wrap, 1}}, + {2116, {wxStaticText, 'Destroy', undefined}}, + {2117, {wxStaticBitmap, new_0, 0}}, + {2118, {wxStaticBitmap, new_4, 4}}, + {2119, {wxStaticBitmap, create, 4}}, + {2120, {wxStaticBitmap, getBitmap, 0}}, + {2121, {wxStaticBitmap, setBitmap, 1}}, + {2122, {wxStaticBitmap, 'Destroy', undefined}}, + {2123, {wxRadioBox, new, 7}}, + {2125, {wxRadioBox, destruct, 0}}, + {2126, {wxRadioBox, create, 7}}, + {2127, {wxRadioBox, enable_2, 2}}, + {2128, {wxRadioBox, enable_1, 1}}, + {2129, {wxRadioBox, getSelection, 0}}, + {2130, {wxRadioBox, getString, 1}}, + {2131, {wxRadioBox, setSelection, 1}}, + {2132, {wxRadioBox, show_2, 2}}, + {2133, {wxRadioBox, show_1, 1}}, + {2134, {wxRadioBox, getColumnCount, 0}}, + {2135, {wxRadioBox, getItemHelpText, 1}}, + {2136, {wxRadioBox, getItemToolTip, 1}}, + {2138, {wxRadioBox, getItemFromPoint, 1}}, + {2139, {wxRadioBox, getRowCount, 0}}, + {2140, {wxRadioBox, isItemEnabled, 1}}, + {2141, {wxRadioBox, isItemShown, 1}}, + {2142, {wxRadioBox, setItemHelpText, 2}}, + {2143, {wxRadioBox, setItemToolTip, 2}}, + {2144, {wxRadioButton, new_0, 0}}, + {2145, {wxRadioButton, new_4, 4}}, + {2146, {wxRadioButton, create, 4}}, + {2147, {wxRadioButton, getValue, 0}}, + {2148, {wxRadioButton, setValue, 1}}, + {2149, {wxRadioButton, 'Destroy', undefined}}, + {2151, {wxSlider, new_6, 6}}, + {2152, {wxSlider, new_0, 0}}, + {2153, {wxSlider, create, 6}}, + {2154, {wxSlider, getLineSize, 0}}, + {2155, {wxSlider, getMax, 0}}, + {2156, {wxSlider, getMin, 0}}, + {2157, {wxSlider, getPageSize, 0}}, + {2158, {wxSlider, getThumbLength, 0}}, + {2159, {wxSlider, getValue, 0}}, + {2160, {wxSlider, setLineSize, 1}}, + {2161, {wxSlider, setPageSize, 1}}, + {2162, {wxSlider, setRange, 2}}, + {2163, {wxSlider, setThumbLength, 1}}, + {2164, {wxSlider, setValue, 1}}, + {2165, {wxSlider, 'Destroy', undefined}}, + {2167, {wxDialog, new_4, 4}}, + {2168, {wxDialog, new_0, 0}}, + {2170, {wxDialog, destruct, 0}}, + {2171, {wxDialog, create, 4}}, + {2172, {wxDialog, createButtonSizer, 1}}, + {2173, {wxDialog, createStdDialogButtonSizer, 1}}, + {2174, {wxDialog, endModal, 1}}, + {2175, {wxDialog, getAffirmativeId, 0}}, + {2176, {wxDialog, getReturnCode, 0}}, + {2177, {wxDialog, isModal, 0}}, + {2178, {wxDialog, setAffirmativeId, 1}}, + {2179, {wxDialog, setReturnCode, 1}}, + {2180, {wxDialog, show, 1}}, + {2181, {wxDialog, showModal, 0}}, + {2182, {wxColourDialog, new_0, 0}}, + {2183, {wxColourDialog, new_2, 2}}, + {2184, {wxColourDialog, destruct, 0}}, + {2185, {wxColourDialog, create, 2}}, + {2186, {wxColourDialog, getColourData, 0}}, + {2187, {wxColourData, new_0, 0}}, + {2188, {wxColourData, new_1, 1}}, + {2189, {wxColourData, destruct, 0}}, + {2190, {wxColourData, getChooseFull, 0}}, + {2191, {wxColourData, getColour, 0}}, + {2193, {wxColourData, getCustomColour, 1}}, + {2194, {wxColourData, setChooseFull, 1}}, + {2195, {wxColourData, setColour, 1}}, + {2196, {wxColourData, setCustomColour, 2}}, + {2197, {wxPalette, new_0, 0}}, + {2198, {wxPalette, new_4, 4}}, + {2200, {wxPalette, destruct, 0}}, + {2201, {wxPalette, create, 4}}, + {2202, {wxPalette, getColoursCount, 0}}, + {2203, {wxPalette, getPixel, 3}}, + {2204, {wxPalette, getRGB, 4}}, + {2205, {wxPalette, isOk, 0}}, + {2209, {wxDirDialog, new, 2}}, + {2210, {wxDirDialog, destruct, 0}}, + {2211, {wxDirDialog, getPath, 0}}, + {2212, {wxDirDialog, getMessage, 0}}, + {2213, {wxDirDialog, setMessage, 1}}, + {2214, {wxDirDialog, setPath, 1}}, + {2218, {wxFileDialog, new, 2}}, + {2219, {wxFileDialog, destruct, 0}}, + {2220, {wxFileDialog, getDirectory, 0}}, + {2221, {wxFileDialog, getFilename, 0}}, + {2222, {wxFileDialog, getFilenames, 1}}, + {2223, {wxFileDialog, getFilterIndex, 0}}, + {2224, {wxFileDialog, getMessage, 0}}, + {2225, {wxFileDialog, getPath, 0}}, + {2226, {wxFileDialog, getPaths, 1}}, + {2227, {wxFileDialog, getWildcard, 0}}, + {2228, {wxFileDialog, setDirectory, 1}}, + {2229, {wxFileDialog, setFilename, 1}}, + {2230, {wxFileDialog, setFilterIndex, 1}}, + {2231, {wxFileDialog, setMessage, 1}}, + {2232, {wxFileDialog, setPath, 1}}, + {2233, {wxFileDialog, setWildcard, 1}}, + {2234, {wxPickerBase, setInternalMargin, 1}}, + {2235, {wxPickerBase, getInternalMargin, 0}}, + {2236, {wxPickerBase, setTextCtrlProportion, 1}}, + {2237, {wxPickerBase, setPickerCtrlProportion, 1}}, + {2238, {wxPickerBase, getTextCtrlProportion, 0}}, + {2239, {wxPickerBase, getPickerCtrlProportion, 0}}, + {2240, {wxPickerBase, hasTextCtrl, 0}}, + {2241, {wxPickerBase, getTextCtrl, 0}}, + {2242, {wxPickerBase, isTextCtrlGrowable, 0}}, + {2243, {wxPickerBase, setPickerCtrlGrowable, 1}}, + {2244, {wxPickerBase, setTextCtrlGrowable, 1}}, + {2245, {wxPickerBase, isPickerCtrlGrowable, 0}}, + {2246, {wxFilePickerCtrl, new_0, 0}}, + {2247, {wxFilePickerCtrl, new_3, 3}}, + {2248, {wxFilePickerCtrl, create, 3}}, + {2249, {wxFilePickerCtrl, getPath, 0}}, + {2250, {wxFilePickerCtrl, setPath, 1}}, + {2251, {wxFilePickerCtrl, 'Destroy', undefined}}, + {2252, {wxDirPickerCtrl, new_0, 0}}, + {2253, {wxDirPickerCtrl, new_3, 3}}, + {2254, {wxDirPickerCtrl, create, 3}}, + {2255, {wxDirPickerCtrl, getPath, 0}}, + {2256, {wxDirPickerCtrl, setPath, 1}}, + {2257, {wxDirPickerCtrl, 'Destroy', undefined}}, + {2258, {wxColourPickerCtrl, new_0, 0}}, + {2259, {wxColourPickerCtrl, new_3, 3}}, + {2260, {wxColourPickerCtrl, create, 3}}, + {2261, {wxColourPickerCtrl, getColour, 0}}, + {2262, {wxColourPickerCtrl, setColour_1_1, 1}}, + {2263, {wxColourPickerCtrl, setColour_1_0, 1}}, + {2264, {wxColourPickerCtrl, 'Destroy', undefined}}, + {2265, {wxDatePickerCtrl, new_0, 0}}, + {2266, {wxDatePickerCtrl, new_3, 3}}, + {2267, {wxDatePickerCtrl, getRange, 2}}, + {2268, {wxDatePickerCtrl, getValue, 0}}, + {2269, {wxDatePickerCtrl, setRange, 2}}, + {2270, {wxDatePickerCtrl, setValue, 1}}, + {2271, {wxDatePickerCtrl, 'Destroy', undefined}}, + {2272, {wxFontPickerCtrl, new_0, 0}}, + {2273, {wxFontPickerCtrl, new_3, 3}}, + {2274, {wxFontPickerCtrl, create, 3}}, + {2275, {wxFontPickerCtrl, getSelectedFont, 0}}, + {2276, {wxFontPickerCtrl, setSelectedFont, 1}}, + {2277, {wxFontPickerCtrl, getMaxPointSize, 0}}, + {2278, {wxFontPickerCtrl, setMaxPointSize, 1}}, + {2279, {wxFontPickerCtrl, 'Destroy', undefined}}, + {2282, {wxFindReplaceDialog, new_0, 0}}, + {2283, {wxFindReplaceDialog, new_4, 4}}, + {2284, {wxFindReplaceDialog, destruct, 0}}, + {2285, {wxFindReplaceDialog, create, 4}}, + {2286, {wxFindReplaceDialog, getData, 0}}, + {2287, {wxFindReplaceData, new_0, 0}}, + {2288, {wxFindReplaceData, new_1, 1}}, + {2289, {wxFindReplaceData, getFindString, 0}}, + {2290, {wxFindReplaceData, getReplaceString, 0}}, + {2291, {wxFindReplaceData, getFlags, 0}}, + {2292, {wxFindReplaceData, setFlags, 1}}, + {2293, {wxFindReplaceData, setFindString, 1}}, + {2294, {wxFindReplaceData, setReplaceString, 1}}, + {2295, {wxFindReplaceData, 'Destroy', undefined}}, + {2296, {wxMultiChoiceDialog, new_0, 0}}, + {2298, {wxMultiChoiceDialog, new_5, 5}}, + {2299, {wxMultiChoiceDialog, getSelections, 0}}, + {2300, {wxMultiChoiceDialog, setSelections, 1}}, + {2301, {wxMultiChoiceDialog, 'Destroy', undefined}}, + {2302, {wxSingleChoiceDialog, new_0, 0}}, + {2304, {wxSingleChoiceDialog, new_5, 5}}, + {2305, {wxSingleChoiceDialog, getSelection, 0}}, + {2306, {wxSingleChoiceDialog, getStringSelection, 0}}, + {2307, {wxSingleChoiceDialog, setSelection, 1}}, + {2308, {wxSingleChoiceDialog, 'Destroy', undefined}}, + {2309, {wxTextEntryDialog, new, 3}}, + {2310, {wxTextEntryDialog, getValue, 0}}, + {2311, {wxTextEntryDialog, setValue, 1}}, + {2312, {wxTextEntryDialog, 'Destroy', undefined}}, + {2313, {wxPasswordEntryDialog, new, 3}}, + {2314, {wxPasswordEntryDialog, 'Destroy', undefined}}, + {2315, {wxFontData, new_0, 0}}, + {2316, {wxFontData, new_1, 1}}, + {2317, {wxFontData, destruct, 0}}, + {2318, {wxFontData, enableEffects, 1}}, + {2319, {wxFontData, getAllowSymbols, 0}}, + {2320, {wxFontData, getColour, 0}}, + {2321, {wxFontData, getChosenFont, 0}}, + {2322, {wxFontData, getEnableEffects, 0}}, + {2323, {wxFontData, getInitialFont, 0}}, + {2324, {wxFontData, getShowHelp, 0}}, + {2325, {wxFontData, setAllowSymbols, 1}}, + {2326, {wxFontData, setChosenFont, 1}}, + {2327, {wxFontData, setColour, 1}}, + {2328, {wxFontData, setInitialFont, 1}}, + {2329, {wxFontData, setRange, 2}}, + {2330, {wxFontData, setShowHelp, 1}}, + {2334, {wxFontDialog, new_0, 0}}, + {2336, {wxFontDialog, new_2, 2}}, + {2338, {wxFontDialog, create, 2}}, + {2339, {wxFontDialog, getFontData, 0}}, + {2341, {wxFontDialog, 'Destroy', undefined}}, + {2342, {wxProgressDialog, new, 3}}, + {2343, {wxProgressDialog, destruct, 0}}, + {2344, {wxProgressDialog, resume, 0}}, + {2345, {wxProgressDialog, update_2, 2}}, + {2346, {wxProgressDialog, update_0, 0}}, + {2347, {wxMessageDialog, new, 3}}, + {2348, {wxMessageDialog, destruct, 0}}, + {2349, {wxPageSetupDialog, new, 2}}, + {2350, {wxPageSetupDialog, destruct, 0}}, + {2351, {wxPageSetupDialog, getPageSetupData, 0}}, + {2352, {wxPageSetupDialog, showModal, 0}}, + {2353, {wxPageSetupDialogData, new_0, 0}}, + {2354, {wxPageSetupDialogData, new_1_0, 1}}, + {2355, {wxPageSetupDialogData, new_1_1, 1}}, + {2356, {wxPageSetupDialogData, destruct, 0}}, + {2357, {wxPageSetupDialogData, enableHelp, 1}}, + {2358, {wxPageSetupDialogData, enableMargins, 1}}, + {2359, {wxPageSetupDialogData, enableOrientation, 1}}, + {2360, {wxPageSetupDialogData, enablePaper, 1}}, + {2361, {wxPageSetupDialogData, enablePrinter, 1}}, + {2362, {wxPageSetupDialogData, getDefaultMinMargins, 0}}, + {2363, {wxPageSetupDialogData, getEnableMargins, 0}}, + {2364, {wxPageSetupDialogData, getEnableOrientation, 0}}, + {2365, {wxPageSetupDialogData, getEnablePaper, 0}}, + {2366, {wxPageSetupDialogData, getEnablePrinter, 0}}, + {2367, {wxPageSetupDialogData, getEnableHelp, 0}}, + {2368, {wxPageSetupDialogData, getDefaultInfo, 0}}, + {2369, {wxPageSetupDialogData, getMarginTopLeft, 0}}, + {2370, {wxPageSetupDialogData, getMarginBottomRight, 0}}, + {2371, {wxPageSetupDialogData, getMinMarginTopLeft, 0}}, + {2372, {wxPageSetupDialogData, getMinMarginBottomRight, 0}}, + {2373, {wxPageSetupDialogData, getPaperId, 0}}, + {2374, {wxPageSetupDialogData, getPaperSize, 0}}, + {2376, {wxPageSetupDialogData, getPrintData, 0}}, + {2377, {wxPageSetupDialogData, isOk, 0}}, + {2378, {wxPageSetupDialogData, setDefaultInfo, 1}}, + {2379, {wxPageSetupDialogData, setDefaultMinMargins, 1}}, + {2380, {wxPageSetupDialogData, setMarginTopLeft, 1}}, + {2381, {wxPageSetupDialogData, setMarginBottomRight, 1}}, + {2382, {wxPageSetupDialogData, setMinMarginTopLeft, 1}}, + {2383, {wxPageSetupDialogData, setMinMarginBottomRight, 1}}, + {2384, {wxPageSetupDialogData, setPaperId, 1}}, + {2385, {wxPageSetupDialogData, setPaperSize_1_1, 1}}, + {2386, {wxPageSetupDialogData, setPaperSize_1_0, 1}}, + {2387, {wxPageSetupDialogData, setPrintData, 1}}, + {2388, {wxPrintDialog, new_2_0, 2}}, + {2389, {wxPrintDialog, new_2_1, 2}}, + {2390, {wxPrintDialog, destruct, 0}}, + {2391, {wxPrintDialog, getPrintDialogData, 0}}, + {2392, {wxPrintDialog, getPrintDC, 0}}, + {2393, {wxPrintDialogData, new_0, 0}}, + {2394, {wxPrintDialogData, new_1_1, 1}}, + {2395, {wxPrintDialogData, new_1_0, 1}}, + {2396, {wxPrintDialogData, destruct, 0}}, + {2397, {wxPrintDialogData, enableHelp, 1}}, + {2398, {wxPrintDialogData, enablePageNumbers, 1}}, + {2399, {wxPrintDialogData, enablePrintToFile, 1}}, + {2400, {wxPrintDialogData, enableSelection, 1}}, + {2401, {wxPrintDialogData, getAllPages, 0}}, + {2402, {wxPrintDialogData, getCollate, 0}}, + {2403, {wxPrintDialogData, getFromPage, 0}}, + {2404, {wxPrintDialogData, getMaxPage, 0}}, + {2405, {wxPrintDialogData, getMinPage, 0}}, + {2406, {wxPrintDialogData, getNoCopies, 0}}, + {2407, {wxPrintDialogData, getPrintData, 0}}, + {2408, {wxPrintDialogData, getPrintToFile, 0}}, + {2409, {wxPrintDialogData, getSelection, 0}}, + {2410, {wxPrintDialogData, getToPage, 0}}, + {2411, {wxPrintDialogData, isOk, 0}}, + {2412, {wxPrintDialogData, setCollate, 1}}, + {2413, {wxPrintDialogData, setFromPage, 1}}, + {2414, {wxPrintDialogData, setMaxPage, 1}}, + {2415, {wxPrintDialogData, setMinPage, 1}}, + {2416, {wxPrintDialogData, setNoCopies, 1}}, + {2417, {wxPrintDialogData, setPrintData, 1}}, + {2418, {wxPrintDialogData, setPrintToFile, 1}}, + {2419, {wxPrintDialogData, setSelection, 1}}, + {2420, {wxPrintDialogData, setToPage, 1}}, + {2421, {wxPrintData, new_0, 0}}, + {2422, {wxPrintData, new_1, 1}}, + {2423, {wxPrintData, destruct, 0}}, + {2424, {wxPrintData, getCollate, 0}}, + {2425, {wxPrintData, getBin, 0}}, + {2426, {wxPrintData, getColour, 0}}, + {2427, {wxPrintData, getDuplex, 0}}, + {2428, {wxPrintData, getNoCopies, 0}}, + {2429, {wxPrintData, getOrientation, 0}}, + {2430, {wxPrintData, getPaperId, 0}}, + {2431, {wxPrintData, getPrinterName, 0}}, + {2432, {wxPrintData, getQuality, 0}}, + {2433, {wxPrintData, isOk, 0}}, + {2434, {wxPrintData, setBin, 1}}, + {2435, {wxPrintData, setCollate, 1}}, + {2436, {wxPrintData, setColour, 1}}, + {2437, {wxPrintData, setDuplex, 1}}, + {2438, {wxPrintData, setNoCopies, 1}}, + {2439, {wxPrintData, setOrientation, 1}}, + {2440, {wxPrintData, setPaperId, 1}}, + {2441, {wxPrintData, setPrinterName, 1}}, + {2442, {wxPrintData, setQuality, 1}}, + {2445, {wxPrintPreview, new_2, 2}}, + {2446, {wxPrintPreview, new_3, 3}}, + {2448, {wxPrintPreview, destruct, 0}}, + {2449, {wxPrintPreview, getCanvas, 0}}, + {2450, {wxPrintPreview, getCurrentPage, 0}}, + {2451, {wxPrintPreview, getFrame, 0}}, + {2452, {wxPrintPreview, getMaxPage, 0}}, + {2453, {wxPrintPreview, getMinPage, 0}}, + {2454, {wxPrintPreview, getPrintout, 0}}, + {2455, {wxPrintPreview, getPrintoutForPrinting, 0}}, + {2456, {wxPrintPreview, isOk, 0}}, + {2457, {wxPrintPreview, paintPage, 2}}, + {2458, {wxPrintPreview, print, 1}}, + {2459, {wxPrintPreview, renderPage, 1}}, + {2460, {wxPrintPreview, setCanvas, 1}}, + {2461, {wxPrintPreview, setCurrentPage, 1}}, + {2462, {wxPrintPreview, setFrame, 1}}, + {2463, {wxPrintPreview, setPrintout, 1}}, + {2464, {wxPrintPreview, setZoom, 1}}, + {2465, {wxPreviewFrame, new, 3}}, + {2466, {wxPreviewFrame, destruct, 0}}, + {2467, {wxPreviewFrame, createControlBar, 0}}, + {2468, {wxPreviewFrame, createCanvas, 0}}, + {2469, {wxPreviewFrame, initialize, 0}}, + {2470, {wxPreviewFrame, onCloseWindow, 1}}, + {2471, {wxPreviewControlBar, new, 4}}, + {2472, {wxPreviewControlBar, destruct, 0}}, + {2473, {wxPreviewControlBar, createButtons, 0}}, + {2474, {wxPreviewControlBar, getPrintPreview, 0}}, + {2475, {wxPreviewControlBar, getZoomControl, 0}}, + {2476, {wxPreviewControlBar, setZoomControl, 1}}, + {2478, {wxPrinter, new, 1}}, + {2479, {wxPrinter, createAbortWindow, 2}}, + {2480, {wxPrinter, getAbort, 0}}, + {2481, {wxPrinter, getLastError, 0}}, + {2482, {wxPrinter, getPrintDialogData, 0}}, + {2483, {wxPrinter, print, 3}}, + {2484, {wxPrinter, printDialog, 1}}, + {2485, {wxPrinter, reportError, 3}}, + {2486, {wxPrinter, setup, 1}}, + {2487, {wxPrinter, 'Destroy', undefined}}, + {2488, {wxXmlResource, new_1, 1}}, + {2489, {wxXmlResource, new_2, 2}}, + {2490, {wxXmlResource, destruct, 0}}, + {2491, {wxXmlResource, attachUnknownControl, 3}}, + {2492, {wxXmlResource, clearHandlers, 0}}, + {2493, {wxXmlResource, compareVersion, 4}}, + {2494, {wxXmlResource, get, 0}}, + {2495, {wxXmlResource, getFlags, 0}}, + {2496, {wxXmlResource, getVersion, 0}}, + {2497, {wxXmlResource, getXRCID, 2}}, + {2498, {wxXmlResource, initAllHandlers, 0}}, + {2499, {wxXmlResource, load, 1}}, + {2500, {wxXmlResource, loadBitmap, 1}}, + {2501, {wxXmlResource, loadDialog_2, 2}}, + {2502, {wxXmlResource, loadDialog_3, 3}}, + {2503, {wxXmlResource, loadFrame_2, 2}}, + {2504, {wxXmlResource, loadFrame_3, 3}}, + {2505, {wxXmlResource, loadIcon, 1}}, + {2506, {wxXmlResource, loadMenu, 1}}, + {2507, {wxXmlResource, loadMenuBar_2, 2}}, + {2508, {wxXmlResource, loadMenuBar_1, 1}}, + {2509, {wxXmlResource, loadPanel_2, 2}}, + {2510, {wxXmlResource, loadPanel_3, 3}}, + {2511, {wxXmlResource, loadToolBar, 2}}, + {2512, {wxXmlResource, set, 1}}, + {2513, {wxXmlResource, setFlags, 1}}, + {2514, {wxXmlResource, unload, 1}}, + {2515, {wxXmlResource, xrcctrl, 3}}, + {2516, {wxHtmlEasyPrinting, new, 1}}, + {2517, {wxHtmlEasyPrinting, destruct, 0}}, + {2518, {wxHtmlEasyPrinting, getPrintData, 0}}, + {2519, {wxHtmlEasyPrinting, getPageSetupData, 0}}, + {2520, {wxHtmlEasyPrinting, previewFile, 1}}, + {2521, {wxHtmlEasyPrinting, previewText, 2}}, + {2522, {wxHtmlEasyPrinting, printFile, 1}}, + {2523, {wxHtmlEasyPrinting, printText, 2}}, + {2524, {wxHtmlEasyPrinting, pageSetup, 0}}, + {2525, {wxHtmlEasyPrinting, setFonts, 3}}, + {2526, {wxHtmlEasyPrinting, setHeader, 2}}, + {2527, {wxHtmlEasyPrinting, setFooter, 2}}, + {2529, {wxGLCanvas, new_2, 2}}, + {2530, {wxGLCanvas, new_3_1, 3}}, + {2531, {wxGLCanvas, new_3_0, 3}}, + {2532, {wxGLCanvas, getContext, 0}}, + {2534, {wxGLCanvas, setCurrent, 0}}, + {2535, {wxGLCanvas, swapBuffers, 0}}, + {2536, {wxGLCanvas, 'Destroy', undefined}}, + {2537, {wxAuiManager, new, 1}}, + {2538, {wxAuiManager, destruct, 0}}, + {2539, {wxAuiManager, addPane_2_1, 2}}, + {2540, {wxAuiManager, addPane_3, 3}}, + {2541, {wxAuiManager, addPane_2_0, 2}}, + {2542, {wxAuiManager, detachPane, 1}}, + {2543, {wxAuiManager, getAllPanes, 0}}, + {2544, {wxAuiManager, getArtProvider, 0}}, + {2545, {wxAuiManager, getDockSizeConstraint, 2}}, + {2546, {wxAuiManager, getFlags, 0}}, + {2547, {wxAuiManager, getManagedWindow, 0}}, + {2548, {wxAuiManager, getManager, 1}}, + {2549, {wxAuiManager, getPane_1_1, 1}}, + {2550, {wxAuiManager, getPane_1_0, 1}}, + {2551, {wxAuiManager, hideHint, 0}}, + {2552, {wxAuiManager, insertPane, 3}}, + {2553, {wxAuiManager, loadPaneInfo, 2}}, + {2554, {wxAuiManager, loadPerspective, 2}}, + {2555, {wxAuiManager, savePaneInfo, 1}}, + {2556, {wxAuiManager, savePerspective, 0}}, + {2557, {wxAuiManager, setArtProvider, 1}}, + {2558, {wxAuiManager, setDockSizeConstraint, 2}}, + {2559, {wxAuiManager, setFlags, 1}}, + {2560, {wxAuiManager, setManagedWindow, 1}}, + {2561, {wxAuiManager, showHint, 1}}, + {2562, {wxAuiManager, unInit, 0}}, + {2563, {wxAuiManager, update, 0}}, + {2564, {wxAuiPaneInfo, new_0, 0}}, + {2565, {wxAuiPaneInfo, new_1, 1}}, + {2566, {wxAuiPaneInfo, destruct, 0}}, + {2567, {wxAuiPaneInfo, bestSize_1, 1}}, + {2568, {wxAuiPaneInfo, bestSize_2, 2}}, + {2569, {wxAuiPaneInfo, bottom, 0}}, + {2570, {wxAuiPaneInfo, bottomDockable, 1}}, + {2571, {wxAuiPaneInfo, caption, 1}}, + {2572, {wxAuiPaneInfo, captionVisible, 1}}, + {2573, {wxAuiPaneInfo, centre, 0}}, + {2574, {wxAuiPaneInfo, centrePane, 0}}, + {2575, {wxAuiPaneInfo, closeButton, 1}}, + {2576, {wxAuiPaneInfo, defaultPane, 0}}, + {2577, {wxAuiPaneInfo, destroyOnClose, 1}}, + {2578, {wxAuiPaneInfo, direction, 1}}, + {2579, {wxAuiPaneInfo, dock, 0}}, + {2580, {wxAuiPaneInfo, dockable, 1}}, + {2581, {wxAuiPaneInfo, fixed, 0}}, + {2582, {wxAuiPaneInfo, float, 0}}, + {2583, {wxAuiPaneInfo, floatable, 1}}, + {2584, {wxAuiPaneInfo, floatingPosition_1, 1}}, + {2585, {wxAuiPaneInfo, floatingPosition_2, 2}}, + {2586, {wxAuiPaneInfo, floatingSize_1, 1}}, + {2587, {wxAuiPaneInfo, floatingSize_2, 2}}, + {2588, {wxAuiPaneInfo, gripper, 1}}, + {2589, {wxAuiPaneInfo, gripperTop, 1}}, + {2590, {wxAuiPaneInfo, hasBorder, 0}}, + {2591, {wxAuiPaneInfo, hasCaption, 0}}, + {2592, {wxAuiPaneInfo, hasCloseButton, 0}}, + {2593, {wxAuiPaneInfo, hasFlag, 1}}, + {2594, {wxAuiPaneInfo, hasGripper, 0}}, + {2595, {wxAuiPaneInfo, hasGripperTop, 0}}, + {2596, {wxAuiPaneInfo, hasMaximizeButton, 0}}, + {2597, {wxAuiPaneInfo, hasMinimizeButton, 0}}, + {2598, {wxAuiPaneInfo, hasPinButton, 0}}, + {2599, {wxAuiPaneInfo, hide, 0}}, + {2600, {wxAuiPaneInfo, isBottomDockable, 0}}, + {2601, {wxAuiPaneInfo, isDocked, 0}}, + {2602, {wxAuiPaneInfo, isFixed, 0}}, + {2603, {wxAuiPaneInfo, isFloatable, 0}}, + {2604, {wxAuiPaneInfo, isFloating, 0}}, + {2605, {wxAuiPaneInfo, isLeftDockable, 0}}, + {2606, {wxAuiPaneInfo, isMovable, 0}}, + {2607, {wxAuiPaneInfo, isOk, 0}}, + {2608, {wxAuiPaneInfo, isResizable, 0}}, + {2609, {wxAuiPaneInfo, isRightDockable, 0}}, + {2610, {wxAuiPaneInfo, isShown, 0}}, + {2611, {wxAuiPaneInfo, isToolbar, 0}}, + {2612, {wxAuiPaneInfo, isTopDockable, 0}}, + {2613, {wxAuiPaneInfo, layer, 1}}, + {2614, {wxAuiPaneInfo, left, 0}}, + {2615, {wxAuiPaneInfo, leftDockable, 1}}, + {2616, {wxAuiPaneInfo, maxSize_1, 1}}, + {2617, {wxAuiPaneInfo, maxSize_2, 2}}, + {2618, {wxAuiPaneInfo, maximizeButton, 1}}, + {2619, {wxAuiPaneInfo, minSize_1, 1}}, + {2620, {wxAuiPaneInfo, minSize_2, 2}}, + {2621, {wxAuiPaneInfo, minimizeButton, 1}}, + {2622, {wxAuiPaneInfo, movable, 1}}, + {2623, {wxAuiPaneInfo, name, 1}}, + {2624, {wxAuiPaneInfo, paneBorder, 1}}, + {2625, {wxAuiPaneInfo, pinButton, 1}}, + {2626, {wxAuiPaneInfo, position, 1}}, + {2627, {wxAuiPaneInfo, resizable, 1}}, + {2628, {wxAuiPaneInfo, right, 0}}, + {2629, {wxAuiPaneInfo, rightDockable, 1}}, + {2630, {wxAuiPaneInfo, row, 1}}, + {2631, {wxAuiPaneInfo, safeSet, 1}}, + {2632, {wxAuiPaneInfo, setFlag, 2}}, + {2633, {wxAuiPaneInfo, show, 1}}, + {2634, {wxAuiPaneInfo, toolbarPane, 0}}, + {2635, {wxAuiPaneInfo, top, 0}}, + {2636, {wxAuiPaneInfo, topDockable, 1}}, + {2637, {wxAuiPaneInfo, window, 1}}, + {2638, {wxAuiNotebook, new_0, 0}}, + {2639, {wxAuiNotebook, new_2, 2}}, + {2640, {wxAuiNotebook, addPage, 3}}, + {2641, {wxAuiNotebook, create, 2}}, + {2642, {wxAuiNotebook, deletePage, 1}}, + {2643, {wxAuiNotebook, getArtProvider, 0}}, + {2644, {wxAuiNotebook, getPage, 1}}, + {2645, {wxAuiNotebook, getPageBitmap, 1}}, + {2646, {wxAuiNotebook, getPageCount, 0}}, + {2647, {wxAuiNotebook, getPageIndex, 1}}, + {2648, {wxAuiNotebook, getPageText, 1}}, + {2649, {wxAuiNotebook, getSelection, 0}}, + {2650, {wxAuiNotebook, insertPage, 4}}, + {2651, {wxAuiNotebook, removePage, 1}}, + {2652, {wxAuiNotebook, setArtProvider, 1}}, + {2653, {wxAuiNotebook, setFont, 1}}, + {2654, {wxAuiNotebook, setPageBitmap, 2}}, + {2655, {wxAuiNotebook, setPageText, 2}}, + {2656, {wxAuiNotebook, setSelection, 1}}, + {2657, {wxAuiNotebook, setTabCtrlHeight, 1}}, + {2658, {wxAuiNotebook, setUniformBitmapSize, 1}}, + {2659, {wxAuiNotebook, 'Destroy', undefined}}, + {2660, {wxMDIParentFrame, new_0, 0}}, + {2661, {wxMDIParentFrame, new_4, 4}}, + {2662, {wxMDIParentFrame, destruct, 0}}, + {2663, {wxMDIParentFrame, activateNext, 0}}, + {2664, {wxMDIParentFrame, activatePrevious, 0}}, + {2665, {wxMDIParentFrame, arrangeIcons, 0}}, + {2666, {wxMDIParentFrame, cascade, 0}}, + {2667, {wxMDIParentFrame, create, 4}}, + {2668, {wxMDIParentFrame, getActiveChild, 0}}, + {2669, {wxMDIParentFrame, getClientWindow, 0}}, + {2670, {wxMDIParentFrame, tile, 1}}, + {2671, {wxMDIChildFrame, new_0, 0}}, + {2672, {wxMDIChildFrame, new_4, 4}}, + {2673, {wxMDIChildFrame, destruct, 0}}, + {2674, {wxMDIChildFrame, activate, 0}}, + {2675, {wxMDIChildFrame, create, 4}}, + {2676, {wxMDIChildFrame, maximize, 1}}, + {2677, {wxMDIChildFrame, restore, 0}}, + {2678, {wxMDIClientWindow, new_0, 0}}, + {2679, {wxMDIClientWindow, new_2, 2}}, + {2680, {wxMDIClientWindow, destruct, 0}}, + {2681, {wxMDIClientWindow, createClient, 2}}, + {2682, {wxLayoutAlgorithm, new, 0}}, + {2683, {wxLayoutAlgorithm, layoutFrame, 2}}, + {2684, {wxLayoutAlgorithm, layoutMDIFrame, 2}}, + {2685, {wxLayoutAlgorithm, layoutWindow, 2}}, + {2686, {wxLayoutAlgorithm, 'Destroy', undefined}}, + {2687, {wxEvent, getId, 0}}, + {2688, {wxEvent, getSkipped, 0}}, + {2689, {wxEvent, getTimestamp, 0}}, + {2690, {wxEvent, isCommandEvent, 0}}, + {2691, {wxEvent, resumePropagation, 1}}, + {2692, {wxEvent, shouldPropagate, 0}}, + {2693, {wxEvent, skip, 1}}, + {2694, {wxEvent, stopPropagation, 0}}, + {2695, {wxCommandEvent, getClientData, 0}}, + {2696, {wxCommandEvent, getExtraLong, 0}}, + {2697, {wxCommandEvent, getInt, 0}}, + {2698, {wxCommandEvent, getSelection, 0}}, + {2699, {wxCommandEvent, getString, 0}}, + {2700, {wxCommandEvent, isChecked, 0}}, + {2701, {wxCommandEvent, isSelection, 0}}, + {2702, {wxCommandEvent, setInt, 1}}, + {2703, {wxCommandEvent, setString, 1}}, + {2704, {wxScrollEvent, getOrientation, 0}}, + {2705, {wxScrollEvent, getPosition, 0}}, + {2706, {wxScrollWinEvent, getOrientation, 0}}, + {2707, {wxScrollWinEvent, getPosition, 0}}, + {2708, {wxMouseEvent, altDown, 0}}, + {2709, {wxMouseEvent, button, 1}}, + {2710, {wxMouseEvent, buttonDClick, 1}}, + {2711, {wxMouseEvent, buttonDown, 1}}, + {2712, {wxMouseEvent, buttonUp, 1}}, + {2713, {wxMouseEvent, cmdDown, 0}}, + {2714, {wxMouseEvent, controlDown, 0}}, + {2715, {wxMouseEvent, dragging, 0}}, + {2716, {wxMouseEvent, entering, 0}}, + {2717, {wxMouseEvent, getButton, 0}}, + {2720, {wxMouseEvent, getPosition, 0}}, + {2721, {wxMouseEvent, getLogicalPosition, 1}}, + {2722, {wxMouseEvent, getLinesPerAction, 0}}, + {2723, {wxMouseEvent, getWheelRotation, 0}}, + {2724, {wxMouseEvent, getWheelDelta, 0}}, + {2725, {wxMouseEvent, getX, 0}}, + {2726, {wxMouseEvent, getY, 0}}, + {2727, {wxMouseEvent, isButton, 0}}, + {2728, {wxMouseEvent, isPageScroll, 0}}, + {2729, {wxMouseEvent, leaving, 0}}, + {2730, {wxMouseEvent, leftDClick, 0}}, + {2731, {wxMouseEvent, leftDown, 0}}, + {2732, {wxMouseEvent, leftIsDown, 0}}, + {2733, {wxMouseEvent, leftUp, 0}}, + {2734, {wxMouseEvent, metaDown, 0}}, + {2735, {wxMouseEvent, middleDClick, 0}}, + {2736, {wxMouseEvent, middleDown, 0}}, + {2737, {wxMouseEvent, middleIsDown, 0}}, + {2738, {wxMouseEvent, middleUp, 0}}, + {2739, {wxMouseEvent, moving, 0}}, + {2740, {wxMouseEvent, rightDClick, 0}}, + {2741, {wxMouseEvent, rightDown, 0}}, + {2742, {wxMouseEvent, rightIsDown, 0}}, + {2743, {wxMouseEvent, rightUp, 0}}, + {2744, {wxMouseEvent, shiftDown, 0}}, + {2745, {wxSetCursorEvent, getCursor, 0}}, + {2746, {wxSetCursorEvent, getX, 0}}, + {2747, {wxSetCursorEvent, getY, 0}}, + {2748, {wxSetCursorEvent, hasCursor, 0}}, + {2749, {wxSetCursorEvent, setCursor, 1}}, + {2750, {wxKeyEvent, altDown, 0}}, + {2751, {wxKeyEvent, cmdDown, 0}}, + {2752, {wxKeyEvent, controlDown, 0}}, + {2753, {wxKeyEvent, getKeyCode, 0}}, + {2754, {wxKeyEvent, getModifiers, 0}}, + {2757, {wxKeyEvent, getPosition, 0}}, + {2758, {wxKeyEvent, getRawKeyCode, 0}}, + {2759, {wxKeyEvent, getRawKeyFlags, 0}}, + {2760, {wxKeyEvent, getUnicodeKey, 0}}, + {2761, {wxKeyEvent, getX, 0}}, + {2762, {wxKeyEvent, getY, 0}}, + {2763, {wxKeyEvent, hasModifiers, 0}}, + {2764, {wxKeyEvent, metaDown, 0}}, + {2765, {wxKeyEvent, shiftDown, 0}}, + {2766, {wxSizeEvent, getSize, 0}}, + {2767, {wxMoveEvent, getPosition, 0}}, + {2768, {wxEraseEvent, getDC, 0}}, + {2769, {wxFocusEvent, getWindow, 0}}, + {2770, {wxChildFocusEvent, getWindow, 0}}, + {2771, {wxMenuEvent, getMenu, 0}}, + {2772, {wxMenuEvent, getMenuId, 0}}, + {2773, {wxMenuEvent, isPopup, 0}}, + {2774, {wxCloseEvent, canVeto, 0}}, + {2775, {wxCloseEvent, getLoggingOff, 0}}, + {2776, {wxCloseEvent, setCanVeto, 1}}, + {2777, {wxCloseEvent, setLoggingOff, 1}}, + {2778, {wxCloseEvent, veto, 1}}, + {2779, {wxShowEvent, setShow, 1}}, + {2780, {wxShowEvent, getShow, 0}}, + {2781, {wxIconizeEvent, iconized, 0}}, + {2782, {wxJoystickEvent, buttonDown, 1}}, + {2783, {wxJoystickEvent, buttonIsDown, 1}}, + {2784, {wxJoystickEvent, buttonUp, 1}}, + {2785, {wxJoystickEvent, getButtonChange, 0}}, + {2786, {wxJoystickEvent, getButtonState, 0}}, + {2787, {wxJoystickEvent, getJoystick, 0}}, + {2788, {wxJoystickEvent, getPosition, 0}}, + {2789, {wxJoystickEvent, getZPosition, 0}}, + {2790, {wxJoystickEvent, isButton, 0}}, + {2791, {wxJoystickEvent, isMove, 0}}, + {2792, {wxJoystickEvent, isZMove, 0}}, + {2793, {wxUpdateUIEvent, canUpdate, 1}}, + {2794, {wxUpdateUIEvent, check, 1}}, + {2795, {wxUpdateUIEvent, enable, 1}}, + {2796, {wxUpdateUIEvent, show, 1}}, + {2797, {wxUpdateUIEvent, getChecked, 0}}, + {2798, {wxUpdateUIEvent, getEnabled, 0}}, + {2799, {wxUpdateUIEvent, getShown, 0}}, + {2800, {wxUpdateUIEvent, getSetChecked, 0}}, + {2801, {wxUpdateUIEvent, getSetEnabled, 0}}, + {2802, {wxUpdateUIEvent, getSetShown, 0}}, + {2803, {wxUpdateUIEvent, getSetText, 0}}, + {2804, {wxUpdateUIEvent, getText, 0}}, + {2805, {wxUpdateUIEvent, getMode, 0}}, + {2806, {wxUpdateUIEvent, getUpdateInterval, 0}}, + {2807, {wxUpdateUIEvent, resetUpdateTime, 0}}, + {2808, {wxUpdateUIEvent, setMode, 1}}, + {2809, {wxUpdateUIEvent, setText, 1}}, + {2810, {wxUpdateUIEvent, setUpdateInterval, 1}}, + {2811, {wxMouseCaptureChangedEvent, getCapturedWindow, 0}}, + {2812, {wxPaletteChangedEvent, setChangedWindow, 1}}, + {2813, {wxPaletteChangedEvent, getChangedWindow, 0}}, + {2814, {wxQueryNewPaletteEvent, setPaletteRealized, 1}}, + {2815, {wxQueryNewPaletteEvent, getPaletteRealized, 0}}, + {2816, {wxNavigationKeyEvent, getDirection, 0}}, + {2817, {wxNavigationKeyEvent, setDirection, 1}}, + {2818, {wxNavigationKeyEvent, isWindowChange, 0}}, + {2819, {wxNavigationKeyEvent, setWindowChange, 1}}, + {2820, {wxNavigationKeyEvent, isFromTab, 0}}, + {2821, {wxNavigationKeyEvent, setFromTab, 1}}, + {2822, {wxNavigationKeyEvent, getCurrentFocus, 0}}, + {2823, {wxNavigationKeyEvent, setCurrentFocus, 1}}, + {2824, {wxHelpEvent, getOrigin, 0}}, + {2825, {wxHelpEvent, getPosition, 0}}, + {2826, {wxHelpEvent, setOrigin, 1}}, + {2827, {wxHelpEvent, setPosition, 1}}, + {2828, {wxContextMenuEvent, getPosition, 0}}, + {2829, {wxContextMenuEvent, setPosition, 1}}, + {2830, {wxIdleEvent, canSend, 1}}, + {2831, {wxIdleEvent, getMode, 0}}, + {2832, {wxIdleEvent, requestMore, 1}}, + {2833, {wxIdleEvent, moreRequested, 0}}, + {2834, {wxIdleEvent, setMode, 1}}, + {2835, {wxGridEvent, altDown, 0}}, + {2836, {wxGridEvent, controlDown, 0}}, + {2837, {wxGridEvent, getCol, 0}}, + {2838, {wxGridEvent, getPosition, 0}}, + {2839, {wxGridEvent, getRow, 0}}, + {2840, {wxGridEvent, metaDown, 0}}, + {2841, {wxGridEvent, selecting, 0}}, + {2842, {wxGridEvent, shiftDown, 0}}, + {2843, {wxNotifyEvent, allow, 0}}, + {2844, {wxNotifyEvent, isAllowed, 0}}, + {2845, {wxNotifyEvent, veto, 0}}, + {2846, {wxSashEvent, getEdge, 0}}, + {2847, {wxSashEvent, getDragRect, 0}}, + {2848, {wxSashEvent, getDragStatus, 0}}, + {2849, {wxListEvent, getCacheFrom, 0}}, + {2850, {wxListEvent, getCacheTo, 0}}, + {2851, {wxListEvent, getKeyCode, 0}}, + {2852, {wxListEvent, getIndex, 0}}, + {2853, {wxListEvent, getColumn, 0}}, + {2854, {wxListEvent, getPoint, 0}}, + {2855, {wxListEvent, getLabel, 0}}, + {2856, {wxListEvent, getText, 0}}, + {2857, {wxListEvent, getImage, 0}}, + {2858, {wxListEvent, getData, 0}}, + {2859, {wxListEvent, getMask, 0}}, + {2860, {wxListEvent, getItem, 0}}, + {2861, {wxListEvent, isEditCancelled, 0}}, + {2862, {wxDateEvent, getDate, 0}}, + {2863, {wxCalendarEvent, getWeekDay, 0}}, + {2864, {wxFileDirPickerEvent, getPath, 0}}, + {2865, {wxColourPickerEvent, getColour, 0}}, + {2866, {wxFontPickerEvent, getFont, 0}}, + {2867, {wxStyledTextEvent, getPosition, 0}}, + {2868, {wxStyledTextEvent, getKey, 0}}, + {2869, {wxStyledTextEvent, getModifiers, 0}}, + {2870, {wxStyledTextEvent, getModificationType, 0}}, + {2871, {wxStyledTextEvent, getText, 0}}, + {2872, {wxStyledTextEvent, getLength, 0}}, + {2873, {wxStyledTextEvent, getLinesAdded, 0}}, + {2874, {wxStyledTextEvent, getLine, 0}}, + {2875, {wxStyledTextEvent, getFoldLevelNow, 0}}, + {2876, {wxStyledTextEvent, getFoldLevelPrev, 0}}, + {2877, {wxStyledTextEvent, getMargin, 0}}, + {2878, {wxStyledTextEvent, getMessage, 0}}, + {2879, {wxStyledTextEvent, getWParam, 0}}, + {2880, {wxStyledTextEvent, getLParam, 0}}, + {2881, {wxStyledTextEvent, getListType, 0}}, + {2882, {wxStyledTextEvent, getX, 0}}, + {2883, {wxStyledTextEvent, getY, 0}}, + {2884, {wxStyledTextEvent, getDragText, 0}}, + {2885, {wxStyledTextEvent, getDragAllowMove, 0}}, + {2886, {wxStyledTextEvent, getDragResult, 0}}, + {2887, {wxStyledTextEvent, getShift, 0}}, + {2888, {wxStyledTextEvent, getControl, 0}}, + {2889, {wxStyledTextEvent, getAlt, 0}}, + {2890, {utils, getKeyState, 1}}, + {2891, {utils, getMousePosition, 2}}, + {2892, {utils, getMouseState, 0}}, + {2893, {utils, setDetectableAutoRepeat, 1}}, + {2894, {utils, bell, 0}}, + {2895, {utils, findMenuItemId, 3}}, + {2896, {utils, genericFindWindowAtPoint, 1}}, + {2897, {utils, findWindowAtPoint, 1}}, + {2898, {utils, beginBusyCursor, 1}}, + {2899, {utils, endBusyCursor, 0}}, + {2900, {utils, isBusy, 0}}, + {2901, {utils, shutdown, 1}}, + {2902, {utils, shell, 1}}, + {2903, {utils, launchDefaultBrowser, 2}}, + {2904, {utils, getEmailAddress, 0}}, + {2905, {utils, getUserId, 0}}, + {2906, {utils, getHomeDir, 0}}, + {2907, {utils, newId, 0}}, + {2908, {utils, registerId, 1}}, + {2909, {utils, getCurrentId, 0}}, + {2910, {utils, getOsDescription, 0}}, + {2911, {utils, isPlatformLittleEndian, 0}}, + {2912, {utils, isPlatform64Bit, 0}}, + {2913, {wxPrintout, new, 1}}, + {2914, {wxPrintout, destruct, 0}}, + {2915, {wxPrintout, getDC, 0}}, + {2916, {wxPrintout, getPageSizeMM, 2}}, + {2917, {wxPrintout, getPageSizePixels, 2}}, + {2918, {wxPrintout, getPaperRectPixels, 0}}, + {2919, {wxPrintout, getPPIPrinter, 2}}, + {2920, {wxPrintout, getPPIScreen, 2}}, + {2921, {wxPrintout, getTitle, 0}}, + {2922, {wxPrintout, isPreview, 0}}, + {2923, {wxPrintout, fitThisSizeToPaper, 1}}, + {2924, {wxPrintout, fitThisSizeToPage, 1}}, + {2925, {wxPrintout, fitThisSizeToPageMargins, 2}}, + {2926, {wxPrintout, mapScreenSizeToPaper, 0}}, + {2927, {wxPrintout, mapScreenSizeToPage, 0}}, + {2928, {wxPrintout, mapScreenSizeToPageMargins, 1}}, + {2929, {wxPrintout, mapScreenSizeToDevice, 0}}, + {2930, {wxPrintout, getLogicalPaperRect, 0}}, + {2931, {wxPrintout, getLogicalPageRect, 0}}, + {2932, {wxPrintout, getLogicalPageMarginsRect, 1}}, + {2933, {wxPrintout, setLogicalOrigin, 2}}, + {2934, {wxPrintout, offsetLogicalOrigin, 2}}, + {2935, {wxStyledTextCtrl, new_2, 2}}, + {2936, {wxStyledTextCtrl, new_0, 0}}, + {2937, {wxStyledTextCtrl, destruct, 0}}, + {2938, {wxStyledTextCtrl, create, 2}}, + {2939, {wxStyledTextCtrl, addText, 1}}, + {2940, {wxStyledTextCtrl, addStyledText, 1}}, + {2941, {wxStyledTextCtrl, insertText, 2}}, + {2942, {wxStyledTextCtrl, clearAll, 0}}, + {2943, {wxStyledTextCtrl, clearDocumentStyle, 0}}, + {2944, {wxStyledTextCtrl, getLength, 0}}, + {2945, {wxStyledTextCtrl, getCharAt, 1}}, + {2946, {wxStyledTextCtrl, getCurrentPos, 0}}, + {2947, {wxStyledTextCtrl, getAnchor, 0}}, + {2948, {wxStyledTextCtrl, getStyleAt, 1}}, + {2949, {wxStyledTextCtrl, redo, 0}}, + {2950, {wxStyledTextCtrl, setUndoCollection, 1}}, + {2951, {wxStyledTextCtrl, selectAll, 0}}, + {2952, {wxStyledTextCtrl, setSavePoint, 0}}, + {2953, {wxStyledTextCtrl, getStyledText, 2}}, + {2954, {wxStyledTextCtrl, canRedo, 0}}, + {2955, {wxStyledTextCtrl, markerLineFromHandle, 1}}, + {2956, {wxStyledTextCtrl, markerDeleteHandle, 1}}, + {2957, {wxStyledTextCtrl, getUndoCollection, 0}}, + {2958, {wxStyledTextCtrl, getViewWhiteSpace, 0}}, + {2959, {wxStyledTextCtrl, setViewWhiteSpace, 1}}, + {2960, {wxStyledTextCtrl, positionFromPoint, 1}}, + {2961, {wxStyledTextCtrl, positionFromPointClose, 2}}, + {2962, {wxStyledTextCtrl, gotoLine, 1}}, + {2963, {wxStyledTextCtrl, gotoPos, 1}}, + {2964, {wxStyledTextCtrl, setAnchor, 1}}, + {2965, {wxStyledTextCtrl, getCurLine, 1}}, + {2966, {wxStyledTextCtrl, getEndStyled, 0}}, + {2967, {wxStyledTextCtrl, convertEOLs, 1}}, + {2968, {wxStyledTextCtrl, getEOLMode, 0}}, + {2969, {wxStyledTextCtrl, setEOLMode, 1}}, + {2970, {wxStyledTextCtrl, startStyling, 2}}, + {2971, {wxStyledTextCtrl, setStyling, 2}}, + {2972, {wxStyledTextCtrl, getBufferedDraw, 0}}, + {2973, {wxStyledTextCtrl, setBufferedDraw, 1}}, + {2974, {wxStyledTextCtrl, setTabWidth, 1}}, + {2975, {wxStyledTextCtrl, getTabWidth, 0}}, + {2976, {wxStyledTextCtrl, setCodePage, 1}}, + {2977, {wxStyledTextCtrl, markerDefine, 3}}, + {2978, {wxStyledTextCtrl, markerSetForeground, 2}}, + {2979, {wxStyledTextCtrl, markerSetBackground, 2}}, + {2980, {wxStyledTextCtrl, markerAdd, 2}}, + {2981, {wxStyledTextCtrl, markerDelete, 2}}, + {2982, {wxStyledTextCtrl, markerDeleteAll, 1}}, + {2983, {wxStyledTextCtrl, markerGet, 1}}, + {2984, {wxStyledTextCtrl, markerNext, 2}}, + {2985, {wxStyledTextCtrl, markerPrevious, 2}}, + {2986, {wxStyledTextCtrl, markerDefineBitmap, 2}}, + {2987, {wxStyledTextCtrl, markerAddSet, 2}}, + {2988, {wxStyledTextCtrl, markerSetAlpha, 2}}, + {2989, {wxStyledTextCtrl, setMarginType, 2}}, + {2990, {wxStyledTextCtrl, getMarginType, 1}}, + {2991, {wxStyledTextCtrl, setMarginWidth, 2}}, + {2992, {wxStyledTextCtrl, getMarginWidth, 1}}, + {2993, {wxStyledTextCtrl, setMarginMask, 2}}, + {2994, {wxStyledTextCtrl, getMarginMask, 1}}, + {2995, {wxStyledTextCtrl, setMarginSensitive, 2}}, + {2996, {wxStyledTextCtrl, getMarginSensitive, 1}}, + {2997, {wxStyledTextCtrl, styleClearAll, 0}}, + {2998, {wxStyledTextCtrl, styleSetForeground, 2}}, + {2999, {wxStyledTextCtrl, styleSetBackground, 2}}, + {3000, {wxStyledTextCtrl, styleSetBold, 2}}, + {3001, {wxStyledTextCtrl, styleSetItalic, 2}}, + {3002, {wxStyledTextCtrl, styleSetSize, 2}}, + {3003, {wxStyledTextCtrl, styleSetFaceName, 2}}, + {3004, {wxStyledTextCtrl, styleSetEOLFilled, 2}}, + {3005, {wxStyledTextCtrl, styleResetDefault, 0}}, + {3006, {wxStyledTextCtrl, styleSetUnderline, 2}}, + {3007, {wxStyledTextCtrl, styleSetCase, 2}}, + {3008, {wxStyledTextCtrl, styleSetHotSpot, 2}}, + {3009, {wxStyledTextCtrl, setSelForeground, 2}}, + {3010, {wxStyledTextCtrl, setSelBackground, 2}}, + {3011, {wxStyledTextCtrl, getSelAlpha, 0}}, + {3012, {wxStyledTextCtrl, setSelAlpha, 1}}, + {3013, {wxStyledTextCtrl, setCaretForeground, 1}}, + {3014, {wxStyledTextCtrl, cmdKeyAssign, 3}}, + {3015, {wxStyledTextCtrl, cmdKeyClear, 2}}, + {3016, {wxStyledTextCtrl, cmdKeyClearAll, 0}}, + {3017, {wxStyledTextCtrl, setStyleBytes, 2}}, + {3018, {wxStyledTextCtrl, styleSetVisible, 2}}, + {3019, {wxStyledTextCtrl, getCaretPeriod, 0}}, + {3020, {wxStyledTextCtrl, setCaretPeriod, 1}}, + {3021, {wxStyledTextCtrl, setWordChars, 1}}, + {3022, {wxStyledTextCtrl, beginUndoAction, 0}}, + {3023, {wxStyledTextCtrl, endUndoAction, 0}}, + {3024, {wxStyledTextCtrl, indicatorSetStyle, 2}}, + {3025, {wxStyledTextCtrl, indicatorGetStyle, 1}}, + {3026, {wxStyledTextCtrl, indicatorSetForeground, 2}}, + {3027, {wxStyledTextCtrl, indicatorGetForeground, 1}}, + {3028, {wxStyledTextCtrl, setWhitespaceForeground, 2}}, + {3029, {wxStyledTextCtrl, setWhitespaceBackground, 2}}, + {3030, {wxStyledTextCtrl, getStyleBits, 0}}, + {3031, {wxStyledTextCtrl, setLineState, 2}}, + {3032, {wxStyledTextCtrl, getLineState, 1}}, + {3033, {wxStyledTextCtrl, getMaxLineState, 0}}, + {3034, {wxStyledTextCtrl, getCaretLineVisible, 0}}, + {3035, {wxStyledTextCtrl, setCaretLineVisible, 1}}, + {3036, {wxStyledTextCtrl, getCaretLineBackground, 0}}, + {3037, {wxStyledTextCtrl, setCaretLineBackground, 1}}, + {3038, {wxStyledTextCtrl, autoCompShow, 2}}, + {3039, {wxStyledTextCtrl, autoCompCancel, 0}}, + {3040, {wxStyledTextCtrl, autoCompActive, 0}}, + {3041, {wxStyledTextCtrl, autoCompPosStart, 0}}, + {3042, {wxStyledTextCtrl, autoCompComplete, 0}}, + {3043, {wxStyledTextCtrl, autoCompStops, 1}}, + {3044, {wxStyledTextCtrl, autoCompSetSeparator, 1}}, + {3045, {wxStyledTextCtrl, autoCompGetSeparator, 0}}, + {3046, {wxStyledTextCtrl, autoCompSelect, 1}}, + {3047, {wxStyledTextCtrl, autoCompSetCancelAtStart, 1}}, + {3048, {wxStyledTextCtrl, autoCompGetCancelAtStart, 0}}, + {3049, {wxStyledTextCtrl, autoCompSetFillUps, 1}}, + {3050, {wxStyledTextCtrl, autoCompSetChooseSingle, 1}}, + {3051, {wxStyledTextCtrl, autoCompGetChooseSingle, 0}}, + {3052, {wxStyledTextCtrl, autoCompSetIgnoreCase, 1}}, + {3053, {wxStyledTextCtrl, autoCompGetIgnoreCase, 0}}, + {3054, {wxStyledTextCtrl, userListShow, 2}}, + {3055, {wxStyledTextCtrl, autoCompSetAutoHide, 1}}, + {3056, {wxStyledTextCtrl, autoCompGetAutoHide, 0}}, + {3057, {wxStyledTextCtrl, autoCompSetDropRestOfWord, 1}}, + {3058, {wxStyledTextCtrl, autoCompGetDropRestOfWord, 0}}, + {3059, {wxStyledTextCtrl, registerImage, 2}}, + {3060, {wxStyledTextCtrl, clearRegisteredImages, 0}}, + {3061, {wxStyledTextCtrl, autoCompGetTypeSeparator, 0}}, + {3062, {wxStyledTextCtrl, autoCompSetTypeSeparator, 1}}, + {3063, {wxStyledTextCtrl, autoCompSetMaxWidth, 1}}, + {3064, {wxStyledTextCtrl, autoCompGetMaxWidth, 0}}, + {3065, {wxStyledTextCtrl, autoCompSetMaxHeight, 1}}, + {3066, {wxStyledTextCtrl, autoCompGetMaxHeight, 0}}, + {3067, {wxStyledTextCtrl, setIndent, 1}}, + {3068, {wxStyledTextCtrl, getIndent, 0}}, + {3069, {wxStyledTextCtrl, setUseTabs, 1}}, + {3070, {wxStyledTextCtrl, getUseTabs, 0}}, + {3071, {wxStyledTextCtrl, setLineIndentation, 2}}, + {3072, {wxStyledTextCtrl, getLineIndentation, 1}}, + {3073, {wxStyledTextCtrl, getLineIndentPosition, 1}}, + {3074, {wxStyledTextCtrl, getColumn, 1}}, + {3075, {wxStyledTextCtrl, setUseHorizontalScrollBar, 1}}, + {3076, {wxStyledTextCtrl, getUseHorizontalScrollBar, 0}}, + {3077, {wxStyledTextCtrl, setIndentationGuides, 1}}, + {3078, {wxStyledTextCtrl, getIndentationGuides, 0}}, + {3079, {wxStyledTextCtrl, setHighlightGuide, 1}}, + {3080, {wxStyledTextCtrl, getHighlightGuide, 0}}, + {3081, {wxStyledTextCtrl, getLineEndPosition, 1}}, + {3082, {wxStyledTextCtrl, getCodePage, 0}}, + {3083, {wxStyledTextCtrl, getCaretForeground, 0}}, + {3084, {wxStyledTextCtrl, getReadOnly, 0}}, + {3085, {wxStyledTextCtrl, setCurrentPos, 1}}, + {3086, {wxStyledTextCtrl, setSelectionStart, 1}}, + {3087, {wxStyledTextCtrl, getSelectionStart, 0}}, + {3088, {wxStyledTextCtrl, setSelectionEnd, 1}}, + {3089, {wxStyledTextCtrl, getSelectionEnd, 0}}, + {3090, {wxStyledTextCtrl, setPrintMagnification, 1}}, + {3091, {wxStyledTextCtrl, getPrintMagnification, 0}}, + {3092, {wxStyledTextCtrl, setPrintColourMode, 1}}, + {3093, {wxStyledTextCtrl, getPrintColourMode, 0}}, + {3094, {wxStyledTextCtrl, findText, 4}}, + {3095, {wxStyledTextCtrl, formatRange, 7}}, + {3096, {wxStyledTextCtrl, getFirstVisibleLine, 0}}, + {3097, {wxStyledTextCtrl, getLine, 1}}, + {3098, {wxStyledTextCtrl, getLineCount, 0}}, + {3099, {wxStyledTextCtrl, setMarginLeft, 1}}, + {3100, {wxStyledTextCtrl, getMarginLeft, 0}}, + {3101, {wxStyledTextCtrl, setMarginRight, 1}}, + {3102, {wxStyledTextCtrl, getMarginRight, 0}}, + {3103, {wxStyledTextCtrl, getModify, 0}}, + {3104, {wxStyledTextCtrl, setSelection, 2}}, + {3105, {wxStyledTextCtrl, getSelectedText, 0}}, + {3106, {wxStyledTextCtrl, getTextRange, 2}}, + {3107, {wxStyledTextCtrl, hideSelection, 1}}, + {3108, {wxStyledTextCtrl, lineFromPosition, 1}}, + {3109, {wxStyledTextCtrl, positionFromLine, 1}}, + {3110, {wxStyledTextCtrl, lineScroll, 2}}, + {3111, {wxStyledTextCtrl, ensureCaretVisible, 0}}, + {3112, {wxStyledTextCtrl, replaceSelection, 1}}, + {3113, {wxStyledTextCtrl, setReadOnly, 1}}, + {3114, {wxStyledTextCtrl, canPaste, 0}}, + {3115, {wxStyledTextCtrl, canUndo, 0}}, + {3116, {wxStyledTextCtrl, emptyUndoBuffer, 0}}, + {3117, {wxStyledTextCtrl, undo, 0}}, + {3118, {wxStyledTextCtrl, cut, 0}}, + {3119, {wxStyledTextCtrl, copy, 0}}, + {3120, {wxStyledTextCtrl, paste, 0}}, + {3121, {wxStyledTextCtrl, clear, 0}}, + {3122, {wxStyledTextCtrl, setText, 1}}, + {3123, {wxStyledTextCtrl, getText, 0}}, + {3124, {wxStyledTextCtrl, getTextLength, 0}}, + {3125, {wxStyledTextCtrl, getOvertype, 0}}, + {3126, {wxStyledTextCtrl, setCaretWidth, 1}}, + {3127, {wxStyledTextCtrl, getCaretWidth, 0}}, + {3128, {wxStyledTextCtrl, setTargetStart, 1}}, + {3129, {wxStyledTextCtrl, getTargetStart, 0}}, + {3130, {wxStyledTextCtrl, setTargetEnd, 1}}, + {3131, {wxStyledTextCtrl, getTargetEnd, 0}}, + {3132, {wxStyledTextCtrl, replaceTarget, 1}}, + {3133, {wxStyledTextCtrl, searchInTarget, 1}}, + {3134, {wxStyledTextCtrl, setSearchFlags, 1}}, + {3135, {wxStyledTextCtrl, getSearchFlags, 0}}, + {3136, {wxStyledTextCtrl, callTipShow, 2}}, + {3137, {wxStyledTextCtrl, callTipCancel, 0}}, + {3138, {wxStyledTextCtrl, callTipActive, 0}}, + {3139, {wxStyledTextCtrl, callTipPosAtStart, 0}}, + {3140, {wxStyledTextCtrl, callTipSetHighlight, 2}}, + {3141, {wxStyledTextCtrl, callTipSetBackground, 1}}, + {3142, {wxStyledTextCtrl, callTipSetForeground, 1}}, + {3143, {wxStyledTextCtrl, callTipSetForegroundHighlight, 1}}, + {3144, {wxStyledTextCtrl, callTipUseStyle, 1}}, + {3145, {wxStyledTextCtrl, visibleFromDocLine, 1}}, + {3146, {wxStyledTextCtrl, docLineFromVisible, 1}}, + {3147, {wxStyledTextCtrl, wrapCount, 1}}, + {3148, {wxStyledTextCtrl, setFoldLevel, 2}}, + {3149, {wxStyledTextCtrl, getFoldLevel, 1}}, + {3150, {wxStyledTextCtrl, getLastChild, 2}}, + {3151, {wxStyledTextCtrl, getFoldParent, 1}}, + {3152, {wxStyledTextCtrl, showLines, 2}}, + {3153, {wxStyledTextCtrl, hideLines, 2}}, + {3154, {wxStyledTextCtrl, getLineVisible, 1}}, + {3155, {wxStyledTextCtrl, setFoldExpanded, 2}}, + {3156, {wxStyledTextCtrl, getFoldExpanded, 1}}, + {3157, {wxStyledTextCtrl, toggleFold, 1}}, + {3158, {wxStyledTextCtrl, ensureVisible, 1}}, + {3159, {wxStyledTextCtrl, setFoldFlags, 1}}, + {3160, {wxStyledTextCtrl, ensureVisibleEnforcePolicy, 1}}, + {3161, {wxStyledTextCtrl, setTabIndents, 1}}, + {3162, {wxStyledTextCtrl, getTabIndents, 0}}, + {3163, {wxStyledTextCtrl, setBackSpaceUnIndents, 1}}, + {3164, {wxStyledTextCtrl, getBackSpaceUnIndents, 0}}, + {3165, {wxStyledTextCtrl, setMouseDwellTime, 1}}, + {3166, {wxStyledTextCtrl, getMouseDwellTime, 0}}, + {3167, {wxStyledTextCtrl, wordStartPosition, 2}}, + {3168, {wxStyledTextCtrl, wordEndPosition, 2}}, + {3169, {wxStyledTextCtrl, setWrapMode, 1}}, + {3170, {wxStyledTextCtrl, getWrapMode, 0}}, + {3171, {wxStyledTextCtrl, setWrapVisualFlags, 1}}, + {3172, {wxStyledTextCtrl, getWrapVisualFlags, 0}}, + {3173, {wxStyledTextCtrl, setWrapVisualFlagsLocation, 1}}, + {3174, {wxStyledTextCtrl, getWrapVisualFlagsLocation, 0}}, + {3175, {wxStyledTextCtrl, setWrapStartIndent, 1}}, + {3176, {wxStyledTextCtrl, getWrapStartIndent, 0}}, + {3177, {wxStyledTextCtrl, setLayoutCache, 1}}, + {3178, {wxStyledTextCtrl, getLayoutCache, 0}}, + {3179, {wxStyledTextCtrl, setScrollWidth, 1}}, + {3180, {wxStyledTextCtrl, getScrollWidth, 0}}, + {3181, {wxStyledTextCtrl, textWidth, 2}}, + {3182, {wxStyledTextCtrl, getEndAtLastLine, 0}}, + {3183, {wxStyledTextCtrl, textHeight, 1}}, + {3184, {wxStyledTextCtrl, setUseVerticalScrollBar, 1}}, + {3185, {wxStyledTextCtrl, getUseVerticalScrollBar, 0}}, + {3186, {wxStyledTextCtrl, appendText, 1}}, + {3187, {wxStyledTextCtrl, getTwoPhaseDraw, 0}}, + {3188, {wxStyledTextCtrl, setTwoPhaseDraw, 1}}, + {3189, {wxStyledTextCtrl, targetFromSelection, 0}}, + {3190, {wxStyledTextCtrl, linesJoin, 0}}, + {3191, {wxStyledTextCtrl, linesSplit, 1}}, + {3192, {wxStyledTextCtrl, setFoldMarginColour, 2}}, + {3193, {wxStyledTextCtrl, setFoldMarginHiColour, 2}}, + {3194, {wxStyledTextCtrl, lineDown, 0}}, + {3195, {wxStyledTextCtrl, lineDownExtend, 0}}, + {3196, {wxStyledTextCtrl, lineUp, 0}}, + {3197, {wxStyledTextCtrl, lineUpExtend, 0}}, + {3198, {wxStyledTextCtrl, charLeft, 0}}, + {3199, {wxStyledTextCtrl, charLeftExtend, 0}}, + {3200, {wxStyledTextCtrl, charRight, 0}}, + {3201, {wxStyledTextCtrl, charRightExtend, 0}}, + {3202, {wxStyledTextCtrl, wordLeft, 0}}, + {3203, {wxStyledTextCtrl, wordLeftExtend, 0}}, + {3204, {wxStyledTextCtrl, wordRight, 0}}, + {3205, {wxStyledTextCtrl, wordRightExtend, 0}}, + {3206, {wxStyledTextCtrl, home, 0}}, + {3207, {wxStyledTextCtrl, homeExtend, 0}}, + {3208, {wxStyledTextCtrl, lineEnd, 0}}, + {3209, {wxStyledTextCtrl, lineEndExtend, 0}}, + {3210, {wxStyledTextCtrl, documentStart, 0}}, + {3211, {wxStyledTextCtrl, documentStartExtend, 0}}, + {3212, {wxStyledTextCtrl, documentEnd, 0}}, + {3213, {wxStyledTextCtrl, documentEndExtend, 0}}, + {3214, {wxStyledTextCtrl, pageUp, 0}}, + {3215, {wxStyledTextCtrl, pageUpExtend, 0}}, + {3216, {wxStyledTextCtrl, pageDown, 0}}, + {3217, {wxStyledTextCtrl, pageDownExtend, 0}}, + {3218, {wxStyledTextCtrl, editToggleOvertype, 0}}, + {3219, {wxStyledTextCtrl, cancel, 0}}, + {3220, {wxStyledTextCtrl, deleteBack, 0}}, + {3221, {wxStyledTextCtrl, tab, 0}}, + {3222, {wxStyledTextCtrl, backTab, 0}}, + {3223, {wxStyledTextCtrl, newLine, 0}}, + {3224, {wxStyledTextCtrl, formFeed, 0}}, + {3225, {wxStyledTextCtrl, vCHome, 0}}, + {3226, {wxStyledTextCtrl, vCHomeExtend, 0}}, + {3227, {wxStyledTextCtrl, zoomIn, 0}}, + {3228, {wxStyledTextCtrl, zoomOut, 0}}, + {3229, {wxStyledTextCtrl, delWordLeft, 0}}, + {3230, {wxStyledTextCtrl, delWordRight, 0}}, + {3231, {wxStyledTextCtrl, lineCut, 0}}, + {3232, {wxStyledTextCtrl, lineDelete, 0}}, + {3233, {wxStyledTextCtrl, lineTranspose, 0}}, + {3234, {wxStyledTextCtrl, lineDuplicate, 0}}, + {3235, {wxStyledTextCtrl, lowerCase, 0}}, + {3236, {wxStyledTextCtrl, upperCase, 0}}, + {3237, {wxStyledTextCtrl, lineScrollDown, 0}}, + {3238, {wxStyledTextCtrl, lineScrollUp, 0}}, + {3239, {wxStyledTextCtrl, deleteBackNotLine, 0}}, + {3240, {wxStyledTextCtrl, homeDisplay, 0}}, + {3241, {wxStyledTextCtrl, homeDisplayExtend, 0}}, + {3242, {wxStyledTextCtrl, lineEndDisplay, 0}}, + {3243, {wxStyledTextCtrl, lineEndDisplayExtend, 0}}, + {3244, {wxStyledTextCtrl, homeWrapExtend, 0}}, + {3245, {wxStyledTextCtrl, lineEndWrap, 0}}, + {3246, {wxStyledTextCtrl, lineEndWrapExtend, 0}}, + {3247, {wxStyledTextCtrl, vCHomeWrap, 0}}, + {3248, {wxStyledTextCtrl, vCHomeWrapExtend, 0}}, + {3249, {wxStyledTextCtrl, lineCopy, 0}}, + {3250, {wxStyledTextCtrl, moveCaretInsideView, 0}}, + {3251, {wxStyledTextCtrl, lineLength, 1}}, + {3252, {wxStyledTextCtrl, braceHighlight, 2}}, + {3253, {wxStyledTextCtrl, braceBadLight, 1}}, + {3254, {wxStyledTextCtrl, braceMatch, 1}}, + {3255, {wxStyledTextCtrl, getViewEOL, 0}}, + {3256, {wxStyledTextCtrl, setViewEOL, 1}}, + {3257, {wxStyledTextCtrl, setModEventMask, 1}}, + {3258, {wxStyledTextCtrl, getEdgeColumn, 0}}, + {3259, {wxStyledTextCtrl, setEdgeColumn, 1}}, + {3260, {wxStyledTextCtrl, getEdgeMode, 0}}, + {3261, {wxStyledTextCtrl, getEdgeColour, 0}}, + {3262, {wxStyledTextCtrl, setEdgeColour, 1}}, + {3263, {wxStyledTextCtrl, searchAnchor, 0}}, + {3264, {wxStyledTextCtrl, searchNext, 2}}, + {3265, {wxStyledTextCtrl, searchPrev, 2}}, + {3266, {wxStyledTextCtrl, linesOnScreen, 0}}, + {3267, {wxStyledTextCtrl, usePopUp, 1}}, + {3268, {wxStyledTextCtrl, selectionIsRectangle, 0}}, + {3269, {wxStyledTextCtrl, setZoom, 1}}, + {3270, {wxStyledTextCtrl, getZoom, 0}}, + {3271, {wxStyledTextCtrl, getModEventMask, 0}}, + {3272, {wxStyledTextCtrl, setSTCFocus, 1}}, + {3273, {wxStyledTextCtrl, getSTCFocus, 0}}, + {3274, {wxStyledTextCtrl, setStatus, 1}}, + {3275, {wxStyledTextCtrl, getStatus, 0}}, + {3276, {wxStyledTextCtrl, setMouseDownCaptures, 1}}, + {3277, {wxStyledTextCtrl, getMouseDownCaptures, 0}}, + {3278, {wxStyledTextCtrl, setSTCCursor, 1}}, + {3279, {wxStyledTextCtrl, getSTCCursor, 0}}, + {3280, {wxStyledTextCtrl, setControlCharSymbol, 1}}, + {3281, {wxStyledTextCtrl, getControlCharSymbol, 0}}, + {3282, {wxStyledTextCtrl, wordPartLeft, 0}}, + {3283, {wxStyledTextCtrl, wordPartLeftExtend, 0}}, + {3284, {wxStyledTextCtrl, wordPartRight, 0}}, + {3285, {wxStyledTextCtrl, wordPartRightExtend, 0}}, + {3286, {wxStyledTextCtrl, setVisiblePolicy, 2}}, + {3287, {wxStyledTextCtrl, delLineLeft, 0}}, + {3288, {wxStyledTextCtrl, delLineRight, 0}}, + {3289, {wxStyledTextCtrl, getXOffset, 0}}, + {3290, {wxStyledTextCtrl, chooseCaretX, 0}}, + {3291, {wxStyledTextCtrl, setXCaretPolicy, 2}}, + {3292, {wxStyledTextCtrl, setYCaretPolicy, 2}}, + {3293, {wxStyledTextCtrl, getPrintWrapMode, 0}}, + {3294, {wxStyledTextCtrl, setHotspotActiveForeground, 2}}, + {3295, {wxStyledTextCtrl, setHotspotActiveBackground, 2}}, + {3296, {wxStyledTextCtrl, setHotspotActiveUnderline, 1}}, + {3297, {wxStyledTextCtrl, setHotspotSingleLine, 1}}, + {3298, {wxStyledTextCtrl, paraDownExtend, 0}}, + {3299, {wxStyledTextCtrl, paraUp, 0}}, + {3300, {wxStyledTextCtrl, paraUpExtend, 0}}, + {3301, {wxStyledTextCtrl, positionBefore, 1}}, + {3302, {wxStyledTextCtrl, positionAfter, 1}}, + {3303, {wxStyledTextCtrl, copyRange, 2}}, + {3304, {wxStyledTextCtrl, copyText, 2}}, + {3305, {wxStyledTextCtrl, setSelectionMode, 1}}, + {3306, {wxStyledTextCtrl, getSelectionMode, 0}}, + {3307, {wxStyledTextCtrl, lineDownRectExtend, 0}}, + {3308, {wxStyledTextCtrl, lineUpRectExtend, 0}}, + {3309, {wxStyledTextCtrl, charLeftRectExtend, 0}}, + {3310, {wxStyledTextCtrl, charRightRectExtend, 0}}, + {3311, {wxStyledTextCtrl, homeRectExtend, 0}}, + {3312, {wxStyledTextCtrl, vCHomeRectExtend, 0}}, + {3313, {wxStyledTextCtrl, lineEndRectExtend, 0}}, + {3314, {wxStyledTextCtrl, pageUpRectExtend, 0}}, + {3315, {wxStyledTextCtrl, pageDownRectExtend, 0}}, + {3316, {wxStyledTextCtrl, stutteredPageUp, 0}}, + {3317, {wxStyledTextCtrl, stutteredPageUpExtend, 0}}, + {3318, {wxStyledTextCtrl, stutteredPageDown, 0}}, + {3319, {wxStyledTextCtrl, stutteredPageDownExtend, 0}}, + {3320, {wxStyledTextCtrl, wordLeftEnd, 0}}, + {3321, {wxStyledTextCtrl, wordLeftEndExtend, 0}}, + {3322, {wxStyledTextCtrl, wordRightEnd, 0}}, + {3323, {wxStyledTextCtrl, wordRightEndExtend, 0}}, + {3324, {wxStyledTextCtrl, setWhitespaceChars, 1}}, + {3325, {wxStyledTextCtrl, setCharsDefault, 0}}, + {3326, {wxStyledTextCtrl, autoCompGetCurrent, 0}}, + {3327, {wxStyledTextCtrl, allocate, 1}}, + {3328, {wxStyledTextCtrl, findColumn, 2}}, + {3329, {wxStyledTextCtrl, getCaretSticky, 0}}, + {3330, {wxStyledTextCtrl, setCaretSticky, 1}}, + {3331, {wxStyledTextCtrl, toggleCaretSticky, 0}}, + {3332, {wxStyledTextCtrl, setPasteConvertEndings, 1}}, + {3333, {wxStyledTextCtrl, getPasteConvertEndings, 0}}, + {3334, {wxStyledTextCtrl, selectionDuplicate, 0}}, + {3335, {wxStyledTextCtrl, setCaretLineBackAlpha, 1}}, + {3336, {wxStyledTextCtrl, getCaretLineBackAlpha, 0}}, + {3337, {wxStyledTextCtrl, startRecord, 0}}, + {3338, {wxStyledTextCtrl, stopRecord, 0}}, + {3339, {wxStyledTextCtrl, setLexer, 1}}, + {3340, {wxStyledTextCtrl, getLexer, 0}}, + {3341, {wxStyledTextCtrl, colourise, 2}}, + {3342, {wxStyledTextCtrl, setProperty, 2}}, + {3343, {wxStyledTextCtrl, setKeyWords, 2}}, + {3344, {wxStyledTextCtrl, setLexerLanguage, 1}}, + {3345, {wxStyledTextCtrl, getProperty, 1}}, + {3346, {wxStyledTextCtrl, getStyleBitsNeeded, 0}}, + {3347, {wxStyledTextCtrl, getCurrentLine, 0}}, + {3348, {wxStyledTextCtrl, styleSetSpec, 2}}, + {3349, {wxStyledTextCtrl, styleSetFont, 2}}, + {3350, {wxStyledTextCtrl, styleSetFontAttr, 7}}, + {3351, {wxStyledTextCtrl, styleSetCharacterSet, 2}}, + {3352, {wxStyledTextCtrl, styleSetFontEncoding, 2}}, + {3353, {wxStyledTextCtrl, cmdKeyExecute, 1}}, + {3354, {wxStyledTextCtrl, setMargins, 2}}, + {3355, {wxStyledTextCtrl, getSelection, 2}}, + {3356, {wxStyledTextCtrl, pointFromPosition, 1}}, + {3357, {wxStyledTextCtrl, scrollToLine, 1}}, + {3358, {wxStyledTextCtrl, scrollToColumn, 1}}, + {3359, {wxStyledTextCtrl, sendMsg, 2}}, + {3360, {wxStyledTextCtrl, setVScrollBar, 1}}, + {3361, {wxStyledTextCtrl, setHScrollBar, 1}}, + {3362, {wxStyledTextCtrl, getLastKeydownProcessed, 0}}, + {3363, {wxStyledTextCtrl, setLastKeydownProcessed, 1}}, + {3364, {wxStyledTextCtrl, saveFile, 1}}, + {3365, {wxStyledTextCtrl, loadFile, 1}}, + {3366, {wxStyledTextCtrl, doDragOver, 3}}, + {3367, {wxStyledTextCtrl, doDropText, 3}}, + {3368, {wxStyledTextCtrl, getUseAntiAliasing, 0}}, + {3369, {wxStyledTextCtrl, addTextRaw, 1}}, + {3370, {wxStyledTextCtrl, insertTextRaw, 2}}, + {3371, {wxStyledTextCtrl, getCurLineRaw, 1}}, + {3372, {wxStyledTextCtrl, getLineRaw, 1}}, + {3373, {wxStyledTextCtrl, getSelectedTextRaw, 0}}, + {3374, {wxStyledTextCtrl, getTextRangeRaw, 2}}, + {3375, {wxStyledTextCtrl, setTextRaw, 1}}, + {3376, {wxStyledTextCtrl, getTextRaw, 0}}, + {3377, {wxStyledTextCtrl, appendTextRaw, 1}}, + {3378, {wxArtProvider, getBitmap, 2}}, + {3379, {wxArtProvider, getIcon, 2}}, + {3380, {wxTreeEvent, getKeyCode, 0}}, + {3381, {wxTreeEvent, getItem, 0}}, + {3382, {wxTreeEvent, getKeyEvent, 0}}, + {3383, {wxTreeEvent, getLabel, 0}}, + {3384, {wxTreeEvent, getOldItem, 0}}, + {3385, {wxTreeEvent, getPoint, 0}}, + {3386, {wxTreeEvent, isEditCancelled, 0}}, + {3387, {wxTreeEvent, setToolTip, 1}}, + {3388, {wxNotebookEvent, getOldSelection, 0}}, + {3389, {wxNotebookEvent, getSelection, 0}}, + {3390, {wxNotebookEvent, setOldSelection, 1}}, + {3391, {wxNotebookEvent, setSelection, 1}}, + {3392, {wxFileDataObject, new, 0}}, + {3393, {wxFileDataObject, addFile, 1}}, + {3394, {wxFileDataObject, getFilenames, 0}}, + {3395, {wxFileDataObject, 'Destroy', undefined}}, + {3396, {wxTextDataObject, new, 1}}, + {3397, {wxTextDataObject, getTextLength, 0}}, + {3398, {wxTextDataObject, getText, 0}}, + {3399, {wxTextDataObject, setText, 1}}, + {3400, {wxTextDataObject, 'Destroy', undefined}}, + {3401, {wxBitmapDataObject, new_1_1, 1}}, + {3402, {wxBitmapDataObject, new_1_0, 1}}, + {3403, {wxBitmapDataObject, getBitmap, 0}}, + {3404, {wxBitmapDataObject, setBitmap, 1}}, + {3405, {wxBitmapDataObject, 'Destroy', undefined}}, + {3407, {wxClipboard, new, 0}}, + {3408, {wxClipboard, destruct, 0}}, + {3409, {wxClipboard, addData, 1}}, + {3410, {wxClipboard, clear, 0}}, + {3411, {wxClipboard, close, 0}}, + {3412, {wxClipboard, flush, 0}}, + {3413, {wxClipboard, getData, 1}}, + {3414, {wxClipboard, isOpened, 0}}, + {3415, {wxClipboard, open, 0}}, + {3416, {wxClipboard, setData, 1}}, + {3418, {wxClipboard, usePrimarySelection, 1}}, + {3419, {wxClipboard, isSupported, 1}}, + {3420, {wxClipboard, get, 0}}, + {3421, {wxSpinEvent, getPosition, 0}}, + {3422, {wxSpinEvent, setPosition, 1}}, + {3423, {wxSplitterWindow, new_0, 0}}, + {3424, {wxSplitterWindow, new_2, 2}}, + {3425, {wxSplitterWindow, destruct, 0}}, + {3426, {wxSplitterWindow, create, 2}}, + {3427, {wxSplitterWindow, getMinimumPaneSize, 0}}, + {3428, {wxSplitterWindow, getSashGravity, 0}}, + {3429, {wxSplitterWindow, getSashPosition, 0}}, + {3430, {wxSplitterWindow, getSplitMode, 0}}, + {3431, {wxSplitterWindow, getWindow1, 0}}, + {3432, {wxSplitterWindow, getWindow2, 0}}, + {3433, {wxSplitterWindow, initialize, 1}}, + {3434, {wxSplitterWindow, isSplit, 0}}, + {3435, {wxSplitterWindow, replaceWindow, 2}}, + {3436, {wxSplitterWindow, setSashGravity, 1}}, + {3437, {wxSplitterWindow, setSashPosition, 2}}, + {3438, {wxSplitterWindow, setSashSize, 1}}, + {3439, {wxSplitterWindow, setMinimumPaneSize, 1}}, + {3440, {wxSplitterWindow, setSplitMode, 1}}, + {3441, {wxSplitterWindow, splitHorizontally, 3}}, + {3442, {wxSplitterWindow, splitVertically, 3}}, + {3443, {wxSplitterWindow, unsplit, 1}}, + {3444, {wxSplitterWindow, updateSize, 0}}, + {3445, {wxSplitterEvent, getSashPosition, 0}}, + {3446, {wxSplitterEvent, getX, 0}}, + {3447, {wxSplitterEvent, getY, 0}}, + {3448, {wxSplitterEvent, getWindowBeingRemoved, 0}}, + {3449, {wxSplitterEvent, setSashPosition, 1}}, + {3450, {wxHtmlWindow, new_0, 0}}, + {3451, {wxHtmlWindow, new_2, 2}}, + {3452, {wxHtmlWindow, appendToPage, 1}}, + {3453, {wxHtmlWindow, getOpenedAnchor, 0}}, + {3454, {wxHtmlWindow, getOpenedPage, 0}}, + {3455, {wxHtmlWindow, getOpenedPageTitle, 0}}, + {3456, {wxHtmlWindow, getRelatedFrame, 0}}, + {3457, {wxHtmlWindow, historyBack, 0}}, + {3458, {wxHtmlWindow, historyCanBack, 0}}, + {3459, {wxHtmlWindow, historyCanForward, 0}}, + {3460, {wxHtmlWindow, historyClear, 0}}, + {3461, {wxHtmlWindow, historyForward, 0}}, + {3462, {wxHtmlWindow, loadFile, 1}}, + {3463, {wxHtmlWindow, loadPage, 1}}, + {3464, {wxHtmlWindow, selectAll, 0}}, + {3465, {wxHtmlWindow, selectionToText, 0}}, + {3466, {wxHtmlWindow, selectLine, 1}}, + {3467, {wxHtmlWindow, selectWord, 1}}, + {3468, {wxHtmlWindow, setBorders, 1}}, + {3469, {wxHtmlWindow, setFonts, 3}}, + {3470, {wxHtmlWindow, setPage, 1}}, + {3471, {wxHtmlWindow, setRelatedFrame, 2}}, + {3472, {wxHtmlWindow, setRelatedStatusBar, 1}}, + {3473, {wxHtmlWindow, toText, 0}}, + {3474, {wxHtmlWindow, 'Destroy', undefined}}, + {3475, {wxHtmlLinkEvent, getLinkInfo, 0}}, + {3476, {wxSystemSettings, getColour, 1}}, + {3477, {wxSystemSettings, getFont, 1}}, + {3478, {wxSystemSettings, getMetric, 2}}, + {3479, {wxSystemSettings, getScreenType, 0}}, + {3480, {wxAuiNotebookEvent, setSelection, 1}}, + {3481, {wxAuiNotebookEvent, getSelection, 0}}, + {3482, {wxAuiNotebookEvent, setOldSelection, 1}}, + {3483, {wxAuiNotebookEvent, getOldSelection, 0}}, + {3484, {wxAuiNotebookEvent, setDragSource, 1}}, + {3485, {wxAuiNotebookEvent, getDragSource, 0}}, + {3486, {wxAuiManagerEvent, setManager, 1}}, + {3487, {wxAuiManagerEvent, getManager, 0}}, + {3488, {wxAuiManagerEvent, setPane, 1}}, + {3489, {wxAuiManagerEvent, getPane, 0}}, + {3490, {wxAuiManagerEvent, setButton, 1}}, + {3491, {wxAuiManagerEvent, getButton, 0}}, + {3492, {wxAuiManagerEvent, setDC, 1}}, + {3493, {wxAuiManagerEvent, getDC, 0}}, + {3494, {wxAuiManagerEvent, veto, 1}}, + {3495, {wxAuiManagerEvent, getVeto, 0}}, + {3496, {wxAuiManagerEvent, setCanVeto, 1}}, + {3497, {wxAuiManagerEvent, canVeto, 0}}, + {3498, {wxLogNull, new, 0}}, + {3499, {wxLogNull, 'Destroy', undefined}}, {-1, {mod, func, -1}} ]. diff --git a/lib/wx/src/gen/wxe_funcs.hrl b/lib/wx/src/gen/wxe_funcs.hrl index 7b5ca229c8..cf672644c6 100644 --- a/lib/wx/src/gen/wxe_funcs.hrl +++ b/lib/wx/src/gen/wxe_funcs.hrl @@ -1834,1442 +1834,1447 @@ -define(wxTreeCtrl_Delete, 2007). -define(wxTreeCtrl_DeleteAllItems, 2008). -define(wxTreeCtrl_DeleteChildren, 2009). --define(wxTreeCtrl_EnsureVisible, 2010). --define(wxTreeCtrl_Expand, 2011). --define(wxTreeCtrl_GetBoundingRect, 2012). --define(wxTreeCtrl_GetChildrenCount, 2014). --define(wxTreeCtrl_GetCount, 2015). --define(wxTreeCtrl_GetEditControl, 2016). --define(wxTreeCtrl_GetFirstChild, 2017). --define(wxTreeCtrl_GetNextChild, 2018). --define(wxTreeCtrl_GetFirstVisibleItem, 2019). --define(wxTreeCtrl_GetImageList, 2020). --define(wxTreeCtrl_GetIndent, 2021). --define(wxTreeCtrl_GetItemBackgroundColour, 2022). --define(wxTreeCtrl_GetItemData, 2023). --define(wxTreeCtrl_GetItemFont, 2024). --define(wxTreeCtrl_GetItemImage_1, 2025). --define(wxTreeCtrl_GetItemImage_2, 2026). --define(wxTreeCtrl_GetItemText, 2027). --define(wxTreeCtrl_GetItemTextColour, 2028). --define(wxTreeCtrl_GetLastChild, 2029). --define(wxTreeCtrl_GetNextSibling, 2030). --define(wxTreeCtrl_GetNextVisible, 2031). --define(wxTreeCtrl_GetItemParent, 2032). --define(wxTreeCtrl_GetPrevSibling, 2033). --define(wxTreeCtrl_GetPrevVisible, 2034). --define(wxTreeCtrl_GetRootItem, 2035). --define(wxTreeCtrl_GetSelection, 2036). --define(wxTreeCtrl_GetSelections, 2037). --define(wxTreeCtrl_GetStateImageList, 2038). --define(wxTreeCtrl_HitTest, 2039). --define(wxTreeCtrl_InsertItem, 2041). --define(wxTreeCtrl_IsBold, 2042). --define(wxTreeCtrl_IsExpanded, 2043). --define(wxTreeCtrl_IsSelected, 2044). --define(wxTreeCtrl_IsVisible, 2045). --define(wxTreeCtrl_ItemHasChildren, 2046). --define(wxTreeCtrl_PrependItem, 2047). --define(wxTreeCtrl_ScrollTo, 2048). --define(wxTreeCtrl_SelectItem_1, 2049). --define(wxTreeCtrl_SelectItem_2, 2050). --define(wxTreeCtrl_SetIndent, 2051). --define(wxTreeCtrl_SetImageList, 2052). --define(wxTreeCtrl_SetItemBackgroundColour, 2053). --define(wxTreeCtrl_SetItemBold, 2054). --define(wxTreeCtrl_SetItemData, 2055). --define(wxTreeCtrl_SetItemDropHighlight, 2056). --define(wxTreeCtrl_SetItemFont, 2057). --define(wxTreeCtrl_SetItemHasChildren, 2058). --define(wxTreeCtrl_SetItemImage_2, 2059). --define(wxTreeCtrl_SetItemImage_3, 2060). --define(wxTreeCtrl_SetItemText, 2061). --define(wxTreeCtrl_SetItemTextColour, 2062). --define(wxTreeCtrl_SetStateImageList, 2063). --define(wxTreeCtrl_SetWindowStyle, 2064). --define(wxTreeCtrl_SortChildren, 2065). --define(wxTreeCtrl_Toggle, 2066). --define(wxTreeCtrl_ToggleItemSelection, 2067). --define(wxTreeCtrl_Unselect, 2068). --define(wxTreeCtrl_UnselectAll, 2069). --define(wxTreeCtrl_UnselectItem, 2070). --define(wxScrollBar_new_0, 2071). --define(wxScrollBar_new_3, 2072). --define(wxScrollBar_destruct, 2073). --define(wxScrollBar_Create, 2074). --define(wxScrollBar_GetRange, 2075). --define(wxScrollBar_GetPageSize, 2076). --define(wxScrollBar_GetThumbPosition, 2077). --define(wxScrollBar_GetThumbSize, 2078). --define(wxScrollBar_SetThumbPosition, 2079). --define(wxScrollBar_SetScrollbar, 2080). --define(wxSpinButton_new_2, 2082). --define(wxSpinButton_new_0, 2083). --define(wxSpinButton_Create, 2084). --define(wxSpinButton_GetMax, 2085). --define(wxSpinButton_GetMin, 2086). --define(wxSpinButton_GetValue, 2087). --define(wxSpinButton_SetRange, 2088). --define(wxSpinButton_SetValue, 2089). --define(wxSpinButton_destroy, 2090). --define(wxSpinCtrl_new_0, 2091). --define(wxSpinCtrl_new_2, 2092). --define(wxSpinCtrl_Create, 2094). --define(wxSpinCtrl_SetValue_1_1, 2097). --define(wxSpinCtrl_SetValue_1_0, 2098). --define(wxSpinCtrl_GetValue, 2100). --define(wxSpinCtrl_SetRange, 2102). --define(wxSpinCtrl_SetSelection, 2103). --define(wxSpinCtrl_GetMin, 2105). --define(wxSpinCtrl_GetMax, 2107). --define(wxSpinCtrl_destroy, 2108). --define(wxStaticText_new_0, 2109). --define(wxStaticText_new_4, 2110). --define(wxStaticText_Create, 2111). --define(wxStaticText_GetLabel, 2112). --define(wxStaticText_SetLabel, 2113). --define(wxStaticText_Wrap, 2114). --define(wxStaticText_destroy, 2115). --define(wxStaticBitmap_new_0, 2116). --define(wxStaticBitmap_new_4, 2117). --define(wxStaticBitmap_Create, 2118). --define(wxStaticBitmap_GetBitmap, 2119). --define(wxStaticBitmap_SetBitmap, 2120). --define(wxStaticBitmap_destroy, 2121). --define(wxRadioBox_new, 2122). --define(wxRadioBox_destruct, 2124). --define(wxRadioBox_Create, 2125). --define(wxRadioBox_Enable_2, 2126). --define(wxRadioBox_Enable_1, 2127). --define(wxRadioBox_GetSelection, 2128). --define(wxRadioBox_GetString, 2129). --define(wxRadioBox_SetSelection, 2130). --define(wxRadioBox_Show_2, 2131). --define(wxRadioBox_Show_1, 2132). --define(wxRadioBox_GetColumnCount, 2133). --define(wxRadioBox_GetItemHelpText, 2134). --define(wxRadioBox_GetItemToolTip, 2135). --define(wxRadioBox_GetItemFromPoint, 2137). --define(wxRadioBox_GetRowCount, 2138). --define(wxRadioBox_IsItemEnabled, 2139). --define(wxRadioBox_IsItemShown, 2140). --define(wxRadioBox_SetItemHelpText, 2141). --define(wxRadioBox_SetItemToolTip, 2142). --define(wxRadioButton_new_0, 2143). --define(wxRadioButton_new_4, 2144). --define(wxRadioButton_Create, 2145). --define(wxRadioButton_GetValue, 2146). --define(wxRadioButton_SetValue, 2147). --define(wxRadioButton_destroy, 2148). --define(wxSlider_new_6, 2150). --define(wxSlider_new_0, 2151). --define(wxSlider_Create, 2152). --define(wxSlider_GetLineSize, 2153). --define(wxSlider_GetMax, 2154). --define(wxSlider_GetMin, 2155). --define(wxSlider_GetPageSize, 2156). --define(wxSlider_GetThumbLength, 2157). --define(wxSlider_GetValue, 2158). --define(wxSlider_SetLineSize, 2159). --define(wxSlider_SetPageSize, 2160). --define(wxSlider_SetRange, 2161). --define(wxSlider_SetThumbLength, 2162). --define(wxSlider_SetValue, 2163). --define(wxSlider_destroy, 2164). --define(wxDialog_new_4, 2166). --define(wxDialog_new_0, 2167). --define(wxDialog_destruct, 2169). --define(wxDialog_Create, 2170). --define(wxDialog_CreateButtonSizer, 2171). --define(wxDialog_CreateStdDialogButtonSizer, 2172). --define(wxDialog_EndModal, 2173). --define(wxDialog_GetAffirmativeId, 2174). --define(wxDialog_GetReturnCode, 2175). --define(wxDialog_IsModal, 2176). --define(wxDialog_SetAffirmativeId, 2177). --define(wxDialog_SetReturnCode, 2178). --define(wxDialog_Show, 2179). --define(wxDialog_ShowModal, 2180). --define(wxColourDialog_new_0, 2181). --define(wxColourDialog_new_2, 2182). --define(wxColourDialog_destruct, 2183). --define(wxColourDialog_Create, 2184). --define(wxColourDialog_GetColourData, 2185). --define(wxColourData_new_0, 2186). --define(wxColourData_new_1, 2187). --define(wxColourData_destruct, 2188). --define(wxColourData_GetChooseFull, 2189). --define(wxColourData_GetColour, 2190). --define(wxColourData_GetCustomColour, 2192). --define(wxColourData_SetChooseFull, 2193). --define(wxColourData_SetColour, 2194). --define(wxColourData_SetCustomColour, 2195). --define(wxPalette_new_0, 2196). --define(wxPalette_new_4, 2197). --define(wxPalette_destruct, 2199). --define(wxPalette_Create, 2200). --define(wxPalette_GetColoursCount, 2201). --define(wxPalette_GetPixel, 2202). --define(wxPalette_GetRGB, 2203). --define(wxPalette_IsOk, 2204). --define(wxDirDialog_new, 2208). --define(wxDirDialog_destruct, 2209). --define(wxDirDialog_GetPath, 2210). --define(wxDirDialog_GetMessage, 2211). --define(wxDirDialog_SetMessage, 2212). --define(wxDirDialog_SetPath, 2213). --define(wxFileDialog_new, 2217). --define(wxFileDialog_destruct, 2218). --define(wxFileDialog_GetDirectory, 2219). --define(wxFileDialog_GetFilename, 2220). --define(wxFileDialog_GetFilenames, 2221). --define(wxFileDialog_GetFilterIndex, 2222). --define(wxFileDialog_GetMessage, 2223). --define(wxFileDialog_GetPath, 2224). --define(wxFileDialog_GetPaths, 2225). --define(wxFileDialog_GetWildcard, 2226). --define(wxFileDialog_SetDirectory, 2227). --define(wxFileDialog_SetFilename, 2228). --define(wxFileDialog_SetFilterIndex, 2229). --define(wxFileDialog_SetMessage, 2230). --define(wxFileDialog_SetPath, 2231). --define(wxFileDialog_SetWildcard, 2232). --define(wxPickerBase_SetInternalMargin, 2233). --define(wxPickerBase_GetInternalMargin, 2234). --define(wxPickerBase_SetTextCtrlProportion, 2235). --define(wxPickerBase_SetPickerCtrlProportion, 2236). --define(wxPickerBase_GetTextCtrlProportion, 2237). --define(wxPickerBase_GetPickerCtrlProportion, 2238). --define(wxPickerBase_HasTextCtrl, 2239). --define(wxPickerBase_GetTextCtrl, 2240). --define(wxPickerBase_IsTextCtrlGrowable, 2241). --define(wxPickerBase_SetPickerCtrlGrowable, 2242). --define(wxPickerBase_SetTextCtrlGrowable, 2243). --define(wxPickerBase_IsPickerCtrlGrowable, 2244). --define(wxFilePickerCtrl_new_0, 2245). --define(wxFilePickerCtrl_new_3, 2246). --define(wxFilePickerCtrl_Create, 2247). --define(wxFilePickerCtrl_GetPath, 2248). --define(wxFilePickerCtrl_SetPath, 2249). --define(wxFilePickerCtrl_destroy, 2250). --define(wxDirPickerCtrl_new_0, 2251). --define(wxDirPickerCtrl_new_3, 2252). --define(wxDirPickerCtrl_Create, 2253). --define(wxDirPickerCtrl_GetPath, 2254). --define(wxDirPickerCtrl_SetPath, 2255). --define(wxDirPickerCtrl_destroy, 2256). --define(wxColourPickerCtrl_new_0, 2257). --define(wxColourPickerCtrl_new_3, 2258). --define(wxColourPickerCtrl_Create, 2259). --define(wxColourPickerCtrl_GetColour, 2260). --define(wxColourPickerCtrl_SetColour_1_1, 2261). --define(wxColourPickerCtrl_SetColour_1_0, 2262). --define(wxColourPickerCtrl_destroy, 2263). --define(wxDatePickerCtrl_new_0, 2264). --define(wxDatePickerCtrl_new_3, 2265). --define(wxDatePickerCtrl_GetRange, 2266). --define(wxDatePickerCtrl_GetValue, 2267). --define(wxDatePickerCtrl_SetRange, 2268). --define(wxDatePickerCtrl_SetValue, 2269). --define(wxDatePickerCtrl_destroy, 2270). --define(wxFontPickerCtrl_new_0, 2271). --define(wxFontPickerCtrl_new_3, 2272). --define(wxFontPickerCtrl_Create, 2273). --define(wxFontPickerCtrl_GetSelectedFont, 2274). --define(wxFontPickerCtrl_SetSelectedFont, 2275). --define(wxFontPickerCtrl_GetMaxPointSize, 2276). --define(wxFontPickerCtrl_SetMaxPointSize, 2277). --define(wxFontPickerCtrl_destroy, 2278). --define(wxFindReplaceDialog_new_0, 2281). --define(wxFindReplaceDialog_new_4, 2282). --define(wxFindReplaceDialog_destruct, 2283). --define(wxFindReplaceDialog_Create, 2284). --define(wxFindReplaceDialog_GetData, 2285). --define(wxFindReplaceData_new_0, 2286). --define(wxFindReplaceData_new_1, 2287). --define(wxFindReplaceData_GetFindString, 2288). --define(wxFindReplaceData_GetReplaceString, 2289). --define(wxFindReplaceData_GetFlags, 2290). --define(wxFindReplaceData_SetFlags, 2291). --define(wxFindReplaceData_SetFindString, 2292). --define(wxFindReplaceData_SetReplaceString, 2293). --define(wxFindReplaceData_destroy, 2294). --define(wxMultiChoiceDialog_new_0, 2295). --define(wxMultiChoiceDialog_new_5, 2297). --define(wxMultiChoiceDialog_GetSelections, 2298). --define(wxMultiChoiceDialog_SetSelections, 2299). --define(wxMultiChoiceDialog_destroy, 2300). --define(wxSingleChoiceDialog_new_0, 2301). --define(wxSingleChoiceDialog_new_5, 2303). --define(wxSingleChoiceDialog_GetSelection, 2304). --define(wxSingleChoiceDialog_GetStringSelection, 2305). --define(wxSingleChoiceDialog_SetSelection, 2306). --define(wxSingleChoiceDialog_destroy, 2307). --define(wxTextEntryDialog_new, 2308). --define(wxTextEntryDialog_GetValue, 2309). --define(wxTextEntryDialog_SetValue, 2310). --define(wxTextEntryDialog_destroy, 2311). --define(wxPasswordEntryDialog_new, 2312). --define(wxPasswordEntryDialog_destroy, 2313). --define(wxFontData_new_0, 2314). --define(wxFontData_new_1, 2315). --define(wxFontData_destruct, 2316). --define(wxFontData_EnableEffects, 2317). --define(wxFontData_GetAllowSymbols, 2318). --define(wxFontData_GetColour, 2319). --define(wxFontData_GetChosenFont, 2320). --define(wxFontData_GetEnableEffects, 2321). --define(wxFontData_GetInitialFont, 2322). --define(wxFontData_GetShowHelp, 2323). --define(wxFontData_SetAllowSymbols, 2324). --define(wxFontData_SetChosenFont, 2325). --define(wxFontData_SetColour, 2326). --define(wxFontData_SetInitialFont, 2327). --define(wxFontData_SetRange, 2328). --define(wxFontData_SetShowHelp, 2329). --define(wxFontDialog_new_0, 2333). --define(wxFontDialog_new_2, 2335). --define(wxFontDialog_Create, 2337). --define(wxFontDialog_GetFontData, 2338). --define(wxFontDialog_destroy, 2340). --define(wxProgressDialog_new, 2341). --define(wxProgressDialog_destruct, 2342). --define(wxProgressDialog_Resume, 2343). --define(wxProgressDialog_Update_2, 2344). --define(wxProgressDialog_Update_0, 2345). --define(wxMessageDialog_new, 2346). --define(wxMessageDialog_destruct, 2347). --define(wxPageSetupDialog_new, 2348). --define(wxPageSetupDialog_destruct, 2349). --define(wxPageSetupDialog_GetPageSetupData, 2350). --define(wxPageSetupDialog_ShowModal, 2351). --define(wxPageSetupDialogData_new_0, 2352). --define(wxPageSetupDialogData_new_1_0, 2353). --define(wxPageSetupDialogData_new_1_1, 2354). --define(wxPageSetupDialogData_destruct, 2355). --define(wxPageSetupDialogData_EnableHelp, 2356). --define(wxPageSetupDialogData_EnableMargins, 2357). --define(wxPageSetupDialogData_EnableOrientation, 2358). --define(wxPageSetupDialogData_EnablePaper, 2359). --define(wxPageSetupDialogData_EnablePrinter, 2360). --define(wxPageSetupDialogData_GetDefaultMinMargins, 2361). --define(wxPageSetupDialogData_GetEnableMargins, 2362). --define(wxPageSetupDialogData_GetEnableOrientation, 2363). --define(wxPageSetupDialogData_GetEnablePaper, 2364). --define(wxPageSetupDialogData_GetEnablePrinter, 2365). --define(wxPageSetupDialogData_GetEnableHelp, 2366). --define(wxPageSetupDialogData_GetDefaultInfo, 2367). --define(wxPageSetupDialogData_GetMarginTopLeft, 2368). --define(wxPageSetupDialogData_GetMarginBottomRight, 2369). --define(wxPageSetupDialogData_GetMinMarginTopLeft, 2370). --define(wxPageSetupDialogData_GetMinMarginBottomRight, 2371). --define(wxPageSetupDialogData_GetPaperId, 2372). --define(wxPageSetupDialogData_GetPaperSize, 2373). --define(wxPageSetupDialogData_GetPrintData, 2375). --define(wxPageSetupDialogData_IsOk, 2376). --define(wxPageSetupDialogData_SetDefaultInfo, 2377). --define(wxPageSetupDialogData_SetDefaultMinMargins, 2378). --define(wxPageSetupDialogData_SetMarginTopLeft, 2379). --define(wxPageSetupDialogData_SetMarginBottomRight, 2380). --define(wxPageSetupDialogData_SetMinMarginTopLeft, 2381). --define(wxPageSetupDialogData_SetMinMarginBottomRight, 2382). --define(wxPageSetupDialogData_SetPaperId, 2383). --define(wxPageSetupDialogData_SetPaperSize_1_1, 2384). --define(wxPageSetupDialogData_SetPaperSize_1_0, 2385). --define(wxPageSetupDialogData_SetPrintData, 2386). --define(wxPrintDialog_new_2_0, 2387). --define(wxPrintDialog_new_2_1, 2388). --define(wxPrintDialog_destruct, 2389). --define(wxPrintDialog_GetPrintDialogData, 2390). --define(wxPrintDialog_GetPrintDC, 2391). --define(wxPrintDialogData_new_0, 2392). --define(wxPrintDialogData_new_1_1, 2393). --define(wxPrintDialogData_new_1_0, 2394). --define(wxPrintDialogData_destruct, 2395). --define(wxPrintDialogData_EnableHelp, 2396). --define(wxPrintDialogData_EnablePageNumbers, 2397). --define(wxPrintDialogData_EnablePrintToFile, 2398). --define(wxPrintDialogData_EnableSelection, 2399). --define(wxPrintDialogData_GetAllPages, 2400). --define(wxPrintDialogData_GetCollate, 2401). --define(wxPrintDialogData_GetFromPage, 2402). --define(wxPrintDialogData_GetMaxPage, 2403). --define(wxPrintDialogData_GetMinPage, 2404). --define(wxPrintDialogData_GetNoCopies, 2405). --define(wxPrintDialogData_GetPrintData, 2406). --define(wxPrintDialogData_GetPrintToFile, 2407). --define(wxPrintDialogData_GetSelection, 2408). --define(wxPrintDialogData_GetToPage, 2409). --define(wxPrintDialogData_IsOk, 2410). --define(wxPrintDialogData_SetCollate, 2411). --define(wxPrintDialogData_SetFromPage, 2412). --define(wxPrintDialogData_SetMaxPage, 2413). --define(wxPrintDialogData_SetMinPage, 2414). --define(wxPrintDialogData_SetNoCopies, 2415). --define(wxPrintDialogData_SetPrintData, 2416). --define(wxPrintDialogData_SetPrintToFile, 2417). --define(wxPrintDialogData_SetSelection, 2418). --define(wxPrintDialogData_SetToPage, 2419). --define(wxPrintData_new_0, 2420). --define(wxPrintData_new_1, 2421). --define(wxPrintData_destruct, 2422). --define(wxPrintData_GetCollate, 2423). --define(wxPrintData_GetBin, 2424). --define(wxPrintData_GetColour, 2425). --define(wxPrintData_GetDuplex, 2426). --define(wxPrintData_GetNoCopies, 2427). --define(wxPrintData_GetOrientation, 2428). --define(wxPrintData_GetPaperId, 2429). --define(wxPrintData_GetPrinterName, 2430). --define(wxPrintData_GetQuality, 2431). --define(wxPrintData_IsOk, 2432). --define(wxPrintData_SetBin, 2433). --define(wxPrintData_SetCollate, 2434). --define(wxPrintData_SetColour, 2435). --define(wxPrintData_SetDuplex, 2436). --define(wxPrintData_SetNoCopies, 2437). --define(wxPrintData_SetOrientation, 2438). --define(wxPrintData_SetPaperId, 2439). --define(wxPrintData_SetPrinterName, 2440). --define(wxPrintData_SetQuality, 2441). --define(wxPrintPreview_new_2, 2444). --define(wxPrintPreview_new_3, 2445). --define(wxPrintPreview_destruct, 2447). --define(wxPrintPreview_GetCanvas, 2448). --define(wxPrintPreview_GetCurrentPage, 2449). --define(wxPrintPreview_GetFrame, 2450). --define(wxPrintPreview_GetMaxPage, 2451). --define(wxPrintPreview_GetMinPage, 2452). --define(wxPrintPreview_GetPrintout, 2453). --define(wxPrintPreview_GetPrintoutForPrinting, 2454). --define(wxPrintPreview_IsOk, 2455). --define(wxPrintPreview_PaintPage, 2456). --define(wxPrintPreview_Print, 2457). --define(wxPrintPreview_RenderPage, 2458). --define(wxPrintPreview_SetCanvas, 2459). --define(wxPrintPreview_SetCurrentPage, 2460). --define(wxPrintPreview_SetFrame, 2461). --define(wxPrintPreview_SetPrintout, 2462). --define(wxPrintPreview_SetZoom, 2463). --define(wxPreviewFrame_new, 2464). --define(wxPreviewFrame_destruct, 2465). --define(wxPreviewFrame_CreateControlBar, 2466). --define(wxPreviewFrame_CreateCanvas, 2467). --define(wxPreviewFrame_Initialize, 2468). --define(wxPreviewFrame_OnCloseWindow, 2469). --define(wxPreviewControlBar_new, 2470). --define(wxPreviewControlBar_destruct, 2471). --define(wxPreviewControlBar_CreateButtons, 2472). --define(wxPreviewControlBar_GetPrintPreview, 2473). --define(wxPreviewControlBar_GetZoomControl, 2474). --define(wxPreviewControlBar_SetZoomControl, 2475). --define(wxPrinter_new, 2477). --define(wxPrinter_CreateAbortWindow, 2478). --define(wxPrinter_GetAbort, 2479). --define(wxPrinter_GetLastError, 2480). --define(wxPrinter_GetPrintDialogData, 2481). --define(wxPrinter_Print, 2482). --define(wxPrinter_PrintDialog, 2483). --define(wxPrinter_ReportError, 2484). --define(wxPrinter_Setup, 2485). --define(wxPrinter_destroy, 2486). --define(wxXmlResource_new_1, 2487). --define(wxXmlResource_new_2, 2488). --define(wxXmlResource_destruct, 2489). --define(wxXmlResource_AttachUnknownControl, 2490). --define(wxXmlResource_ClearHandlers, 2491). --define(wxXmlResource_CompareVersion, 2492). --define(wxXmlResource_Get, 2493). --define(wxXmlResource_GetFlags, 2494). --define(wxXmlResource_GetVersion, 2495). --define(wxXmlResource_GetXRCID, 2496). --define(wxXmlResource_InitAllHandlers, 2497). --define(wxXmlResource_Load, 2498). --define(wxXmlResource_LoadBitmap, 2499). --define(wxXmlResource_LoadDialog_2, 2500). --define(wxXmlResource_LoadDialog_3, 2501). --define(wxXmlResource_LoadFrame_2, 2502). --define(wxXmlResource_LoadFrame_3, 2503). --define(wxXmlResource_LoadIcon, 2504). --define(wxXmlResource_LoadMenu, 2505). --define(wxXmlResource_LoadMenuBar_2, 2506). --define(wxXmlResource_LoadMenuBar_1, 2507). --define(wxXmlResource_LoadPanel_2, 2508). --define(wxXmlResource_LoadPanel_3, 2509). --define(wxXmlResource_LoadToolBar, 2510). --define(wxXmlResource_Set, 2511). --define(wxXmlResource_SetFlags, 2512). --define(wxXmlResource_Unload, 2513). --define(wxXmlResource_xrcctrl, 2514). --define(wxHtmlEasyPrinting_new, 2515). --define(wxHtmlEasyPrinting_destruct, 2516). --define(wxHtmlEasyPrinting_GetPrintData, 2517). --define(wxHtmlEasyPrinting_GetPageSetupData, 2518). --define(wxHtmlEasyPrinting_PreviewFile, 2519). --define(wxHtmlEasyPrinting_PreviewText, 2520). --define(wxHtmlEasyPrinting_PrintFile, 2521). --define(wxHtmlEasyPrinting_PrintText, 2522). --define(wxHtmlEasyPrinting_PageSetup, 2523). --define(wxHtmlEasyPrinting_SetFonts, 2524). --define(wxHtmlEasyPrinting_SetHeader, 2525). --define(wxHtmlEasyPrinting_SetFooter, 2526). --define(wxGLCanvas_new_2, 2528). --define(wxGLCanvas_new_3_1, 2529). --define(wxGLCanvas_new_3_0, 2530). --define(wxGLCanvas_GetContext, 2531). --define(wxGLCanvas_SetCurrent, 2533). --define(wxGLCanvas_SwapBuffers, 2534). --define(wxGLCanvas_destroy, 2535). --define(wxAuiManager_new, 2536). --define(wxAuiManager_destruct, 2537). --define(wxAuiManager_AddPane_2_1, 2538). --define(wxAuiManager_AddPane_3, 2539). --define(wxAuiManager_AddPane_2_0, 2540). --define(wxAuiManager_DetachPane, 2541). --define(wxAuiManager_GetAllPanes, 2542). --define(wxAuiManager_GetArtProvider, 2543). --define(wxAuiManager_GetDockSizeConstraint, 2544). --define(wxAuiManager_GetFlags, 2545). --define(wxAuiManager_GetManagedWindow, 2546). --define(wxAuiManager_GetManager, 2547). --define(wxAuiManager_GetPane_1_1, 2548). --define(wxAuiManager_GetPane_1_0, 2549). --define(wxAuiManager_HideHint, 2550). --define(wxAuiManager_InsertPane, 2551). --define(wxAuiManager_LoadPaneInfo, 2552). --define(wxAuiManager_LoadPerspective, 2553). --define(wxAuiManager_SavePaneInfo, 2554). --define(wxAuiManager_SavePerspective, 2555). --define(wxAuiManager_SetArtProvider, 2556). --define(wxAuiManager_SetDockSizeConstraint, 2557). --define(wxAuiManager_SetFlags, 2558). --define(wxAuiManager_SetManagedWindow, 2559). --define(wxAuiManager_ShowHint, 2560). --define(wxAuiManager_UnInit, 2561). --define(wxAuiManager_Update, 2562). --define(wxAuiPaneInfo_new_0, 2563). --define(wxAuiPaneInfo_new_1, 2564). --define(wxAuiPaneInfo_destruct, 2565). --define(wxAuiPaneInfo_BestSize_1, 2566). --define(wxAuiPaneInfo_BestSize_2, 2567). --define(wxAuiPaneInfo_Bottom, 2568). --define(wxAuiPaneInfo_BottomDockable, 2569). --define(wxAuiPaneInfo_Caption, 2570). --define(wxAuiPaneInfo_CaptionVisible, 2571). --define(wxAuiPaneInfo_Centre, 2572). --define(wxAuiPaneInfo_CentrePane, 2573). --define(wxAuiPaneInfo_CloseButton, 2574). --define(wxAuiPaneInfo_DefaultPane, 2575). --define(wxAuiPaneInfo_DestroyOnClose, 2576). --define(wxAuiPaneInfo_Direction, 2577). --define(wxAuiPaneInfo_Dock, 2578). --define(wxAuiPaneInfo_Dockable, 2579). --define(wxAuiPaneInfo_Fixed, 2580). --define(wxAuiPaneInfo_Float, 2581). --define(wxAuiPaneInfo_Floatable, 2582). --define(wxAuiPaneInfo_FloatingPosition_1, 2583). --define(wxAuiPaneInfo_FloatingPosition_2, 2584). --define(wxAuiPaneInfo_FloatingSize_1, 2585). --define(wxAuiPaneInfo_FloatingSize_2, 2586). --define(wxAuiPaneInfo_Gripper, 2587). --define(wxAuiPaneInfo_GripperTop, 2588). --define(wxAuiPaneInfo_HasBorder, 2589). --define(wxAuiPaneInfo_HasCaption, 2590). --define(wxAuiPaneInfo_HasCloseButton, 2591). --define(wxAuiPaneInfo_HasFlag, 2592). --define(wxAuiPaneInfo_HasGripper, 2593). --define(wxAuiPaneInfo_HasGripperTop, 2594). --define(wxAuiPaneInfo_HasMaximizeButton, 2595). --define(wxAuiPaneInfo_HasMinimizeButton, 2596). --define(wxAuiPaneInfo_HasPinButton, 2597). --define(wxAuiPaneInfo_Hide, 2598). --define(wxAuiPaneInfo_IsBottomDockable, 2599). --define(wxAuiPaneInfo_IsDocked, 2600). --define(wxAuiPaneInfo_IsFixed, 2601). --define(wxAuiPaneInfo_IsFloatable, 2602). --define(wxAuiPaneInfo_IsFloating, 2603). --define(wxAuiPaneInfo_IsLeftDockable, 2604). --define(wxAuiPaneInfo_IsMovable, 2605). --define(wxAuiPaneInfo_IsOk, 2606). --define(wxAuiPaneInfo_IsResizable, 2607). --define(wxAuiPaneInfo_IsRightDockable, 2608). --define(wxAuiPaneInfo_IsShown, 2609). --define(wxAuiPaneInfo_IsToolbar, 2610). --define(wxAuiPaneInfo_IsTopDockable, 2611). --define(wxAuiPaneInfo_Layer, 2612). --define(wxAuiPaneInfo_Left, 2613). --define(wxAuiPaneInfo_LeftDockable, 2614). --define(wxAuiPaneInfo_MaxSize_1, 2615). --define(wxAuiPaneInfo_MaxSize_2, 2616). --define(wxAuiPaneInfo_MaximizeButton, 2617). --define(wxAuiPaneInfo_MinSize_1, 2618). --define(wxAuiPaneInfo_MinSize_2, 2619). --define(wxAuiPaneInfo_MinimizeButton, 2620). --define(wxAuiPaneInfo_Movable, 2621). --define(wxAuiPaneInfo_Name, 2622). --define(wxAuiPaneInfo_PaneBorder, 2623). --define(wxAuiPaneInfo_PinButton, 2624). --define(wxAuiPaneInfo_Position, 2625). --define(wxAuiPaneInfo_Resizable, 2626). --define(wxAuiPaneInfo_Right, 2627). --define(wxAuiPaneInfo_RightDockable, 2628). --define(wxAuiPaneInfo_Row, 2629). --define(wxAuiPaneInfo_SafeSet, 2630). --define(wxAuiPaneInfo_SetFlag, 2631). --define(wxAuiPaneInfo_Show, 2632). --define(wxAuiPaneInfo_ToolbarPane, 2633). --define(wxAuiPaneInfo_Top, 2634). --define(wxAuiPaneInfo_TopDockable, 2635). --define(wxAuiPaneInfo_Window, 2636). --define(wxAuiNotebook_new_0, 2637). --define(wxAuiNotebook_new_2, 2638). --define(wxAuiNotebook_AddPage, 2639). --define(wxAuiNotebook_Create, 2640). --define(wxAuiNotebook_DeletePage, 2641). --define(wxAuiNotebook_GetArtProvider, 2642). --define(wxAuiNotebook_GetPage, 2643). --define(wxAuiNotebook_GetPageBitmap, 2644). --define(wxAuiNotebook_GetPageCount, 2645). --define(wxAuiNotebook_GetPageIndex, 2646). --define(wxAuiNotebook_GetPageText, 2647). --define(wxAuiNotebook_GetSelection, 2648). --define(wxAuiNotebook_InsertPage, 2649). --define(wxAuiNotebook_RemovePage, 2650). --define(wxAuiNotebook_SetArtProvider, 2651). --define(wxAuiNotebook_SetFont, 2652). --define(wxAuiNotebook_SetPageBitmap, 2653). --define(wxAuiNotebook_SetPageText, 2654). --define(wxAuiNotebook_SetSelection, 2655). --define(wxAuiNotebook_SetTabCtrlHeight, 2656). --define(wxAuiNotebook_SetUniformBitmapSize, 2657). --define(wxAuiNotebook_destroy, 2658). --define(wxMDIParentFrame_new_0, 2659). --define(wxMDIParentFrame_new_4, 2660). --define(wxMDIParentFrame_destruct, 2661). --define(wxMDIParentFrame_ActivateNext, 2662). --define(wxMDIParentFrame_ActivatePrevious, 2663). --define(wxMDIParentFrame_ArrangeIcons, 2664). --define(wxMDIParentFrame_Cascade, 2665). --define(wxMDIParentFrame_Create, 2666). --define(wxMDIParentFrame_GetActiveChild, 2667). --define(wxMDIParentFrame_GetClientWindow, 2668). --define(wxMDIParentFrame_Tile, 2669). --define(wxMDIChildFrame_new_0, 2670). --define(wxMDIChildFrame_new_4, 2671). --define(wxMDIChildFrame_destruct, 2672). --define(wxMDIChildFrame_Activate, 2673). --define(wxMDIChildFrame_Create, 2674). --define(wxMDIChildFrame_Maximize, 2675). --define(wxMDIChildFrame_Restore, 2676). --define(wxMDIClientWindow_new_0, 2677). --define(wxMDIClientWindow_new_2, 2678). --define(wxMDIClientWindow_destruct, 2679). --define(wxMDIClientWindow_CreateClient, 2680). --define(wxLayoutAlgorithm_new, 2681). --define(wxLayoutAlgorithm_LayoutFrame, 2682). --define(wxLayoutAlgorithm_LayoutMDIFrame, 2683). --define(wxLayoutAlgorithm_LayoutWindow, 2684). --define(wxLayoutAlgorithm_destroy, 2685). --define(wxEvent_GetId, 2686). --define(wxEvent_GetSkipped, 2687). --define(wxEvent_GetTimestamp, 2688). --define(wxEvent_IsCommandEvent, 2689). --define(wxEvent_ResumePropagation, 2690). --define(wxEvent_ShouldPropagate, 2691). --define(wxEvent_Skip, 2692). --define(wxEvent_StopPropagation, 2693). --define(wxCommandEvent_getClientData, 2694). --define(wxCommandEvent_GetExtraLong, 2695). --define(wxCommandEvent_GetInt, 2696). --define(wxCommandEvent_GetSelection, 2697). --define(wxCommandEvent_GetString, 2698). --define(wxCommandEvent_IsChecked, 2699). --define(wxCommandEvent_IsSelection, 2700). --define(wxCommandEvent_SetInt, 2701). --define(wxCommandEvent_SetString, 2702). --define(wxScrollEvent_GetOrientation, 2703). --define(wxScrollEvent_GetPosition, 2704). --define(wxScrollWinEvent_GetOrientation, 2705). --define(wxScrollWinEvent_GetPosition, 2706). --define(wxMouseEvent_AltDown, 2707). --define(wxMouseEvent_Button, 2708). --define(wxMouseEvent_ButtonDClick, 2709). --define(wxMouseEvent_ButtonDown, 2710). --define(wxMouseEvent_ButtonUp, 2711). --define(wxMouseEvent_CmdDown, 2712). --define(wxMouseEvent_ControlDown, 2713). --define(wxMouseEvent_Dragging, 2714). --define(wxMouseEvent_Entering, 2715). --define(wxMouseEvent_GetButton, 2716). --define(wxMouseEvent_GetPosition, 2719). --define(wxMouseEvent_GetLogicalPosition, 2720). --define(wxMouseEvent_GetLinesPerAction, 2721). --define(wxMouseEvent_GetWheelRotation, 2722). --define(wxMouseEvent_GetWheelDelta, 2723). --define(wxMouseEvent_GetX, 2724). --define(wxMouseEvent_GetY, 2725). --define(wxMouseEvent_IsButton, 2726). --define(wxMouseEvent_IsPageScroll, 2727). --define(wxMouseEvent_Leaving, 2728). --define(wxMouseEvent_LeftDClick, 2729). --define(wxMouseEvent_LeftDown, 2730). --define(wxMouseEvent_LeftIsDown, 2731). --define(wxMouseEvent_LeftUp, 2732). --define(wxMouseEvent_MetaDown, 2733). --define(wxMouseEvent_MiddleDClick, 2734). --define(wxMouseEvent_MiddleDown, 2735). --define(wxMouseEvent_MiddleIsDown, 2736). --define(wxMouseEvent_MiddleUp, 2737). --define(wxMouseEvent_Moving, 2738). --define(wxMouseEvent_RightDClick, 2739). --define(wxMouseEvent_RightDown, 2740). --define(wxMouseEvent_RightIsDown, 2741). --define(wxMouseEvent_RightUp, 2742). --define(wxMouseEvent_ShiftDown, 2743). --define(wxSetCursorEvent_GetCursor, 2744). --define(wxSetCursorEvent_GetX, 2745). --define(wxSetCursorEvent_GetY, 2746). --define(wxSetCursorEvent_HasCursor, 2747). --define(wxSetCursorEvent_SetCursor, 2748). --define(wxKeyEvent_AltDown, 2749). --define(wxKeyEvent_CmdDown, 2750). --define(wxKeyEvent_ControlDown, 2751). --define(wxKeyEvent_GetKeyCode, 2752). --define(wxKeyEvent_GetModifiers, 2753). --define(wxKeyEvent_GetPosition, 2756). --define(wxKeyEvent_GetRawKeyCode, 2757). --define(wxKeyEvent_GetRawKeyFlags, 2758). --define(wxKeyEvent_GetUnicodeKey, 2759). --define(wxKeyEvent_GetX, 2760). --define(wxKeyEvent_GetY, 2761). --define(wxKeyEvent_HasModifiers, 2762). --define(wxKeyEvent_MetaDown, 2763). --define(wxKeyEvent_ShiftDown, 2764). --define(wxSizeEvent_GetSize, 2765). --define(wxMoveEvent_GetPosition, 2766). --define(wxEraseEvent_GetDC, 2767). --define(wxFocusEvent_GetWindow, 2768). --define(wxChildFocusEvent_GetWindow, 2769). --define(wxMenuEvent_GetMenu, 2770). --define(wxMenuEvent_GetMenuId, 2771). --define(wxMenuEvent_IsPopup, 2772). --define(wxCloseEvent_CanVeto, 2773). --define(wxCloseEvent_GetLoggingOff, 2774). --define(wxCloseEvent_SetCanVeto, 2775). --define(wxCloseEvent_SetLoggingOff, 2776). --define(wxCloseEvent_Veto, 2777). --define(wxShowEvent_SetShow, 2778). --define(wxShowEvent_GetShow, 2779). --define(wxIconizeEvent_Iconized, 2780). --define(wxJoystickEvent_ButtonDown, 2781). --define(wxJoystickEvent_ButtonIsDown, 2782). --define(wxJoystickEvent_ButtonUp, 2783). --define(wxJoystickEvent_GetButtonChange, 2784). --define(wxJoystickEvent_GetButtonState, 2785). --define(wxJoystickEvent_GetJoystick, 2786). --define(wxJoystickEvent_GetPosition, 2787). --define(wxJoystickEvent_GetZPosition, 2788). --define(wxJoystickEvent_IsButton, 2789). --define(wxJoystickEvent_IsMove, 2790). --define(wxJoystickEvent_IsZMove, 2791). --define(wxUpdateUIEvent_CanUpdate, 2792). --define(wxUpdateUIEvent_Check, 2793). --define(wxUpdateUIEvent_Enable, 2794). --define(wxUpdateUIEvent_Show, 2795). --define(wxUpdateUIEvent_GetChecked, 2796). --define(wxUpdateUIEvent_GetEnabled, 2797). --define(wxUpdateUIEvent_GetShown, 2798). --define(wxUpdateUIEvent_GetSetChecked, 2799). --define(wxUpdateUIEvent_GetSetEnabled, 2800). --define(wxUpdateUIEvent_GetSetShown, 2801). --define(wxUpdateUIEvent_GetSetText, 2802). --define(wxUpdateUIEvent_GetText, 2803). --define(wxUpdateUIEvent_GetMode, 2804). --define(wxUpdateUIEvent_GetUpdateInterval, 2805). --define(wxUpdateUIEvent_ResetUpdateTime, 2806). --define(wxUpdateUIEvent_SetMode, 2807). --define(wxUpdateUIEvent_SetText, 2808). --define(wxUpdateUIEvent_SetUpdateInterval, 2809). --define(wxMouseCaptureChangedEvent_GetCapturedWindow, 2810). --define(wxPaletteChangedEvent_SetChangedWindow, 2811). --define(wxPaletteChangedEvent_GetChangedWindow, 2812). --define(wxQueryNewPaletteEvent_SetPaletteRealized, 2813). --define(wxQueryNewPaletteEvent_GetPaletteRealized, 2814). --define(wxNavigationKeyEvent_GetDirection, 2815). --define(wxNavigationKeyEvent_SetDirection, 2816). --define(wxNavigationKeyEvent_IsWindowChange, 2817). --define(wxNavigationKeyEvent_SetWindowChange, 2818). --define(wxNavigationKeyEvent_IsFromTab, 2819). --define(wxNavigationKeyEvent_SetFromTab, 2820). --define(wxNavigationKeyEvent_GetCurrentFocus, 2821). --define(wxNavigationKeyEvent_SetCurrentFocus, 2822). --define(wxHelpEvent_GetOrigin, 2823). --define(wxHelpEvent_GetPosition, 2824). --define(wxHelpEvent_SetOrigin, 2825). --define(wxHelpEvent_SetPosition, 2826). --define(wxContextMenuEvent_GetPosition, 2827). --define(wxContextMenuEvent_SetPosition, 2828). --define(wxIdleEvent_CanSend, 2829). --define(wxIdleEvent_GetMode, 2830). --define(wxIdleEvent_RequestMore, 2831). --define(wxIdleEvent_MoreRequested, 2832). --define(wxIdleEvent_SetMode, 2833). --define(wxGridEvent_AltDown, 2834). --define(wxGridEvent_ControlDown, 2835). --define(wxGridEvent_GetCol, 2836). --define(wxGridEvent_GetPosition, 2837). --define(wxGridEvent_GetRow, 2838). --define(wxGridEvent_MetaDown, 2839). --define(wxGridEvent_Selecting, 2840). --define(wxGridEvent_ShiftDown, 2841). --define(wxNotifyEvent_Allow, 2842). --define(wxNotifyEvent_IsAllowed, 2843). --define(wxNotifyEvent_Veto, 2844). --define(wxSashEvent_GetEdge, 2845). --define(wxSashEvent_GetDragRect, 2846). --define(wxSashEvent_GetDragStatus, 2847). --define(wxListEvent_GetCacheFrom, 2848). --define(wxListEvent_GetCacheTo, 2849). --define(wxListEvent_GetKeyCode, 2850). --define(wxListEvent_GetIndex, 2851). --define(wxListEvent_GetColumn, 2852). --define(wxListEvent_GetPoint, 2853). --define(wxListEvent_GetLabel, 2854). --define(wxListEvent_GetText, 2855). --define(wxListEvent_GetImage, 2856). --define(wxListEvent_GetData, 2857). --define(wxListEvent_GetMask, 2858). --define(wxListEvent_GetItem, 2859). --define(wxListEvent_IsEditCancelled, 2860). --define(wxDateEvent_GetDate, 2861). --define(wxCalendarEvent_GetWeekDay, 2862). --define(wxFileDirPickerEvent_GetPath, 2863). --define(wxColourPickerEvent_GetColour, 2864). --define(wxFontPickerEvent_GetFont, 2865). --define(wxStyledTextEvent_GetPosition, 2866). --define(wxStyledTextEvent_GetKey, 2867). --define(wxStyledTextEvent_GetModifiers, 2868). --define(wxStyledTextEvent_GetModificationType, 2869). --define(wxStyledTextEvent_GetText, 2870). --define(wxStyledTextEvent_GetLength, 2871). --define(wxStyledTextEvent_GetLinesAdded, 2872). --define(wxStyledTextEvent_GetLine, 2873). --define(wxStyledTextEvent_GetFoldLevelNow, 2874). --define(wxStyledTextEvent_GetFoldLevelPrev, 2875). --define(wxStyledTextEvent_GetMargin, 2876). --define(wxStyledTextEvent_GetMessage, 2877). --define(wxStyledTextEvent_GetWParam, 2878). --define(wxStyledTextEvent_GetLParam, 2879). --define(wxStyledTextEvent_GetListType, 2880). --define(wxStyledTextEvent_GetX, 2881). --define(wxStyledTextEvent_GetY, 2882). --define(wxStyledTextEvent_GetDragText, 2883). --define(wxStyledTextEvent_GetDragAllowMove, 2884). --define(wxStyledTextEvent_GetDragResult, 2885). --define(wxStyledTextEvent_GetShift, 2886). --define(wxStyledTextEvent_GetControl, 2887). --define(wxStyledTextEvent_GetAlt, 2888). --define(utils_wxGetKeyState, 2889). --define(utils_wxGetMousePosition, 2890). --define(utils_wxGetMouseState, 2891). --define(utils_wxSetDetectableAutoRepeat, 2892). --define(utils_wxBell, 2893). --define(utils_wxFindMenuItemId, 2894). --define(utils_wxGenericFindWindowAtPoint, 2895). --define(utils_wxFindWindowAtPoint, 2896). --define(utils_wxBeginBusyCursor, 2897). --define(utils_wxEndBusyCursor, 2898). --define(utils_wxIsBusy, 2899). --define(utils_wxShutdown, 2900). --define(utils_wxShell, 2901). --define(utils_wxLaunchDefaultBrowser, 2902). --define(utils_wxGetEmailAddress, 2903). --define(utils_wxGetUserId, 2904). --define(utils_wxGetHomeDir, 2905). --define(utils_wxNewId, 2906). --define(utils_wxRegisterId, 2907). --define(utils_wxGetCurrentId, 2908). --define(utils_wxGetOsDescription, 2909). --define(utils_wxIsPlatformLittleEndian, 2910). --define(utils_wxIsPlatform64Bit, 2911). --define(wxPrintout_new, 2912). --define(wxPrintout_destruct, 2913). --define(wxPrintout_GetDC, 2914). --define(wxPrintout_GetPageSizeMM, 2915). --define(wxPrintout_GetPageSizePixels, 2916). --define(wxPrintout_GetPaperRectPixels, 2917). --define(wxPrintout_GetPPIPrinter, 2918). --define(wxPrintout_GetPPIScreen, 2919). --define(wxPrintout_GetTitle, 2920). --define(wxPrintout_IsPreview, 2921). --define(wxPrintout_FitThisSizeToPaper, 2922). --define(wxPrintout_FitThisSizeToPage, 2923). --define(wxPrintout_FitThisSizeToPageMargins, 2924). --define(wxPrintout_MapScreenSizeToPaper, 2925). --define(wxPrintout_MapScreenSizeToPage, 2926). --define(wxPrintout_MapScreenSizeToPageMargins, 2927). --define(wxPrintout_MapScreenSizeToDevice, 2928). --define(wxPrintout_GetLogicalPaperRect, 2929). --define(wxPrintout_GetLogicalPageRect, 2930). --define(wxPrintout_GetLogicalPageMarginsRect, 2931). --define(wxPrintout_SetLogicalOrigin, 2932). --define(wxPrintout_OffsetLogicalOrigin, 2933). --define(wxStyledTextCtrl_new_2, 2934). --define(wxStyledTextCtrl_new_0, 2935). --define(wxStyledTextCtrl_destruct, 2936). --define(wxStyledTextCtrl_Create, 2937). --define(wxStyledTextCtrl_AddText, 2938). --define(wxStyledTextCtrl_AddStyledText, 2939). --define(wxStyledTextCtrl_InsertText, 2940). --define(wxStyledTextCtrl_ClearAll, 2941). --define(wxStyledTextCtrl_ClearDocumentStyle, 2942). --define(wxStyledTextCtrl_GetLength, 2943). --define(wxStyledTextCtrl_GetCharAt, 2944). --define(wxStyledTextCtrl_GetCurrentPos, 2945). --define(wxStyledTextCtrl_GetAnchor, 2946). --define(wxStyledTextCtrl_GetStyleAt, 2947). --define(wxStyledTextCtrl_Redo, 2948). --define(wxStyledTextCtrl_SetUndoCollection, 2949). --define(wxStyledTextCtrl_SelectAll, 2950). --define(wxStyledTextCtrl_SetSavePoint, 2951). --define(wxStyledTextCtrl_GetStyledText, 2952). --define(wxStyledTextCtrl_CanRedo, 2953). --define(wxStyledTextCtrl_MarkerLineFromHandle, 2954). --define(wxStyledTextCtrl_MarkerDeleteHandle, 2955). --define(wxStyledTextCtrl_GetUndoCollection, 2956). --define(wxStyledTextCtrl_GetViewWhiteSpace, 2957). --define(wxStyledTextCtrl_SetViewWhiteSpace, 2958). --define(wxStyledTextCtrl_PositionFromPoint, 2959). --define(wxStyledTextCtrl_PositionFromPointClose, 2960). --define(wxStyledTextCtrl_GotoLine, 2961). --define(wxStyledTextCtrl_GotoPos, 2962). --define(wxStyledTextCtrl_SetAnchor, 2963). --define(wxStyledTextCtrl_GetCurLine, 2964). --define(wxStyledTextCtrl_GetEndStyled, 2965). --define(wxStyledTextCtrl_ConvertEOLs, 2966). --define(wxStyledTextCtrl_GetEOLMode, 2967). --define(wxStyledTextCtrl_SetEOLMode, 2968). --define(wxStyledTextCtrl_StartStyling, 2969). --define(wxStyledTextCtrl_SetStyling, 2970). --define(wxStyledTextCtrl_GetBufferedDraw, 2971). --define(wxStyledTextCtrl_SetBufferedDraw, 2972). --define(wxStyledTextCtrl_SetTabWidth, 2973). --define(wxStyledTextCtrl_GetTabWidth, 2974). --define(wxStyledTextCtrl_SetCodePage, 2975). --define(wxStyledTextCtrl_MarkerDefine, 2976). --define(wxStyledTextCtrl_MarkerSetForeground, 2977). --define(wxStyledTextCtrl_MarkerSetBackground, 2978). --define(wxStyledTextCtrl_MarkerAdd, 2979). --define(wxStyledTextCtrl_MarkerDelete, 2980). --define(wxStyledTextCtrl_MarkerDeleteAll, 2981). --define(wxStyledTextCtrl_MarkerGet, 2982). --define(wxStyledTextCtrl_MarkerNext, 2983). --define(wxStyledTextCtrl_MarkerPrevious, 2984). --define(wxStyledTextCtrl_MarkerDefineBitmap, 2985). --define(wxStyledTextCtrl_MarkerAddSet, 2986). --define(wxStyledTextCtrl_MarkerSetAlpha, 2987). --define(wxStyledTextCtrl_SetMarginType, 2988). --define(wxStyledTextCtrl_GetMarginType, 2989). --define(wxStyledTextCtrl_SetMarginWidth, 2990). --define(wxStyledTextCtrl_GetMarginWidth, 2991). --define(wxStyledTextCtrl_SetMarginMask, 2992). --define(wxStyledTextCtrl_GetMarginMask, 2993). --define(wxStyledTextCtrl_SetMarginSensitive, 2994). --define(wxStyledTextCtrl_GetMarginSensitive, 2995). --define(wxStyledTextCtrl_StyleClearAll, 2996). --define(wxStyledTextCtrl_StyleSetForeground, 2997). --define(wxStyledTextCtrl_StyleSetBackground, 2998). --define(wxStyledTextCtrl_StyleSetBold, 2999). --define(wxStyledTextCtrl_StyleSetItalic, 3000). --define(wxStyledTextCtrl_StyleSetSize, 3001). --define(wxStyledTextCtrl_StyleSetFaceName, 3002). --define(wxStyledTextCtrl_StyleSetEOLFilled, 3003). --define(wxStyledTextCtrl_StyleResetDefault, 3004). --define(wxStyledTextCtrl_StyleSetUnderline, 3005). --define(wxStyledTextCtrl_StyleSetCase, 3006). --define(wxStyledTextCtrl_StyleSetHotSpot, 3007). --define(wxStyledTextCtrl_SetSelForeground, 3008). --define(wxStyledTextCtrl_SetSelBackground, 3009). --define(wxStyledTextCtrl_GetSelAlpha, 3010). --define(wxStyledTextCtrl_SetSelAlpha, 3011). --define(wxStyledTextCtrl_SetCaretForeground, 3012). --define(wxStyledTextCtrl_CmdKeyAssign, 3013). --define(wxStyledTextCtrl_CmdKeyClear, 3014). --define(wxStyledTextCtrl_CmdKeyClearAll, 3015). --define(wxStyledTextCtrl_SetStyleBytes, 3016). --define(wxStyledTextCtrl_StyleSetVisible, 3017). --define(wxStyledTextCtrl_GetCaretPeriod, 3018). --define(wxStyledTextCtrl_SetCaretPeriod, 3019). --define(wxStyledTextCtrl_SetWordChars, 3020). --define(wxStyledTextCtrl_BeginUndoAction, 3021). --define(wxStyledTextCtrl_EndUndoAction, 3022). --define(wxStyledTextCtrl_IndicatorSetStyle, 3023). --define(wxStyledTextCtrl_IndicatorGetStyle, 3024). --define(wxStyledTextCtrl_IndicatorSetForeground, 3025). --define(wxStyledTextCtrl_IndicatorGetForeground, 3026). --define(wxStyledTextCtrl_SetWhitespaceForeground, 3027). --define(wxStyledTextCtrl_SetWhitespaceBackground, 3028). --define(wxStyledTextCtrl_GetStyleBits, 3029). --define(wxStyledTextCtrl_SetLineState, 3030). --define(wxStyledTextCtrl_GetLineState, 3031). --define(wxStyledTextCtrl_GetMaxLineState, 3032). --define(wxStyledTextCtrl_GetCaretLineVisible, 3033). --define(wxStyledTextCtrl_SetCaretLineVisible, 3034). --define(wxStyledTextCtrl_GetCaretLineBackground, 3035). --define(wxStyledTextCtrl_SetCaretLineBackground, 3036). --define(wxStyledTextCtrl_AutoCompShow, 3037). --define(wxStyledTextCtrl_AutoCompCancel, 3038). --define(wxStyledTextCtrl_AutoCompActive, 3039). --define(wxStyledTextCtrl_AutoCompPosStart, 3040). --define(wxStyledTextCtrl_AutoCompComplete, 3041). --define(wxStyledTextCtrl_AutoCompStops, 3042). --define(wxStyledTextCtrl_AutoCompSetSeparator, 3043). --define(wxStyledTextCtrl_AutoCompGetSeparator, 3044). --define(wxStyledTextCtrl_AutoCompSelect, 3045). --define(wxStyledTextCtrl_AutoCompSetCancelAtStart, 3046). --define(wxStyledTextCtrl_AutoCompGetCancelAtStart, 3047). --define(wxStyledTextCtrl_AutoCompSetFillUps, 3048). --define(wxStyledTextCtrl_AutoCompSetChooseSingle, 3049). --define(wxStyledTextCtrl_AutoCompGetChooseSingle, 3050). --define(wxStyledTextCtrl_AutoCompSetIgnoreCase, 3051). --define(wxStyledTextCtrl_AutoCompGetIgnoreCase, 3052). --define(wxStyledTextCtrl_UserListShow, 3053). --define(wxStyledTextCtrl_AutoCompSetAutoHide, 3054). --define(wxStyledTextCtrl_AutoCompGetAutoHide, 3055). --define(wxStyledTextCtrl_AutoCompSetDropRestOfWord, 3056). --define(wxStyledTextCtrl_AutoCompGetDropRestOfWord, 3057). --define(wxStyledTextCtrl_RegisterImage, 3058). --define(wxStyledTextCtrl_ClearRegisteredImages, 3059). --define(wxStyledTextCtrl_AutoCompGetTypeSeparator, 3060). --define(wxStyledTextCtrl_AutoCompSetTypeSeparator, 3061). --define(wxStyledTextCtrl_AutoCompSetMaxWidth, 3062). --define(wxStyledTextCtrl_AutoCompGetMaxWidth, 3063). --define(wxStyledTextCtrl_AutoCompSetMaxHeight, 3064). --define(wxStyledTextCtrl_AutoCompGetMaxHeight, 3065). --define(wxStyledTextCtrl_SetIndent, 3066). --define(wxStyledTextCtrl_GetIndent, 3067). --define(wxStyledTextCtrl_SetUseTabs, 3068). --define(wxStyledTextCtrl_GetUseTabs, 3069). --define(wxStyledTextCtrl_SetLineIndentation, 3070). --define(wxStyledTextCtrl_GetLineIndentation, 3071). --define(wxStyledTextCtrl_GetLineIndentPosition, 3072). --define(wxStyledTextCtrl_GetColumn, 3073). --define(wxStyledTextCtrl_SetUseHorizontalScrollBar, 3074). --define(wxStyledTextCtrl_GetUseHorizontalScrollBar, 3075). --define(wxStyledTextCtrl_SetIndentationGuides, 3076). --define(wxStyledTextCtrl_GetIndentationGuides, 3077). --define(wxStyledTextCtrl_SetHighlightGuide, 3078). --define(wxStyledTextCtrl_GetHighlightGuide, 3079). --define(wxStyledTextCtrl_GetLineEndPosition, 3080). --define(wxStyledTextCtrl_GetCodePage, 3081). --define(wxStyledTextCtrl_GetCaretForeground, 3082). --define(wxStyledTextCtrl_GetReadOnly, 3083). --define(wxStyledTextCtrl_SetCurrentPos, 3084). --define(wxStyledTextCtrl_SetSelectionStart, 3085). --define(wxStyledTextCtrl_GetSelectionStart, 3086). --define(wxStyledTextCtrl_SetSelectionEnd, 3087). --define(wxStyledTextCtrl_GetSelectionEnd, 3088). --define(wxStyledTextCtrl_SetPrintMagnification, 3089). --define(wxStyledTextCtrl_GetPrintMagnification, 3090). --define(wxStyledTextCtrl_SetPrintColourMode, 3091). --define(wxStyledTextCtrl_GetPrintColourMode, 3092). --define(wxStyledTextCtrl_FindText, 3093). --define(wxStyledTextCtrl_FormatRange, 3094). --define(wxStyledTextCtrl_GetFirstVisibleLine, 3095). --define(wxStyledTextCtrl_GetLine, 3096). --define(wxStyledTextCtrl_GetLineCount, 3097). --define(wxStyledTextCtrl_SetMarginLeft, 3098). --define(wxStyledTextCtrl_GetMarginLeft, 3099). --define(wxStyledTextCtrl_SetMarginRight, 3100). --define(wxStyledTextCtrl_GetMarginRight, 3101). --define(wxStyledTextCtrl_GetModify, 3102). --define(wxStyledTextCtrl_SetSelection, 3103). --define(wxStyledTextCtrl_GetSelectedText, 3104). --define(wxStyledTextCtrl_GetTextRange, 3105). --define(wxStyledTextCtrl_HideSelection, 3106). --define(wxStyledTextCtrl_LineFromPosition, 3107). --define(wxStyledTextCtrl_PositionFromLine, 3108). --define(wxStyledTextCtrl_LineScroll, 3109). --define(wxStyledTextCtrl_EnsureCaretVisible, 3110). --define(wxStyledTextCtrl_ReplaceSelection, 3111). --define(wxStyledTextCtrl_SetReadOnly, 3112). --define(wxStyledTextCtrl_CanPaste, 3113). --define(wxStyledTextCtrl_CanUndo, 3114). --define(wxStyledTextCtrl_EmptyUndoBuffer, 3115). --define(wxStyledTextCtrl_Undo, 3116). --define(wxStyledTextCtrl_Cut, 3117). --define(wxStyledTextCtrl_Copy, 3118). --define(wxStyledTextCtrl_Paste, 3119). --define(wxStyledTextCtrl_Clear, 3120). --define(wxStyledTextCtrl_SetText, 3121). --define(wxStyledTextCtrl_GetText, 3122). --define(wxStyledTextCtrl_GetTextLength, 3123). --define(wxStyledTextCtrl_GetOvertype, 3124). --define(wxStyledTextCtrl_SetCaretWidth, 3125). --define(wxStyledTextCtrl_GetCaretWidth, 3126). --define(wxStyledTextCtrl_SetTargetStart, 3127). --define(wxStyledTextCtrl_GetTargetStart, 3128). --define(wxStyledTextCtrl_SetTargetEnd, 3129). --define(wxStyledTextCtrl_GetTargetEnd, 3130). --define(wxStyledTextCtrl_ReplaceTarget, 3131). --define(wxStyledTextCtrl_SearchInTarget, 3132). --define(wxStyledTextCtrl_SetSearchFlags, 3133). --define(wxStyledTextCtrl_GetSearchFlags, 3134). --define(wxStyledTextCtrl_CallTipShow, 3135). --define(wxStyledTextCtrl_CallTipCancel, 3136). --define(wxStyledTextCtrl_CallTipActive, 3137). --define(wxStyledTextCtrl_CallTipPosAtStart, 3138). --define(wxStyledTextCtrl_CallTipSetHighlight, 3139). --define(wxStyledTextCtrl_CallTipSetBackground, 3140). --define(wxStyledTextCtrl_CallTipSetForeground, 3141). --define(wxStyledTextCtrl_CallTipSetForegroundHighlight, 3142). --define(wxStyledTextCtrl_CallTipUseStyle, 3143). --define(wxStyledTextCtrl_VisibleFromDocLine, 3144). --define(wxStyledTextCtrl_DocLineFromVisible, 3145). --define(wxStyledTextCtrl_WrapCount, 3146). --define(wxStyledTextCtrl_SetFoldLevel, 3147). --define(wxStyledTextCtrl_GetFoldLevel, 3148). --define(wxStyledTextCtrl_GetLastChild, 3149). --define(wxStyledTextCtrl_GetFoldParent, 3150). --define(wxStyledTextCtrl_ShowLines, 3151). --define(wxStyledTextCtrl_HideLines, 3152). --define(wxStyledTextCtrl_GetLineVisible, 3153). --define(wxStyledTextCtrl_SetFoldExpanded, 3154). --define(wxStyledTextCtrl_GetFoldExpanded, 3155). --define(wxStyledTextCtrl_ToggleFold, 3156). --define(wxStyledTextCtrl_EnsureVisible, 3157). --define(wxStyledTextCtrl_SetFoldFlags, 3158). --define(wxStyledTextCtrl_EnsureVisibleEnforcePolicy, 3159). --define(wxStyledTextCtrl_SetTabIndents, 3160). --define(wxStyledTextCtrl_GetTabIndents, 3161). --define(wxStyledTextCtrl_SetBackSpaceUnIndents, 3162). --define(wxStyledTextCtrl_GetBackSpaceUnIndents, 3163). --define(wxStyledTextCtrl_SetMouseDwellTime, 3164). --define(wxStyledTextCtrl_GetMouseDwellTime, 3165). --define(wxStyledTextCtrl_WordStartPosition, 3166). --define(wxStyledTextCtrl_WordEndPosition, 3167). --define(wxStyledTextCtrl_SetWrapMode, 3168). --define(wxStyledTextCtrl_GetWrapMode, 3169). --define(wxStyledTextCtrl_SetWrapVisualFlags, 3170). --define(wxStyledTextCtrl_GetWrapVisualFlags, 3171). --define(wxStyledTextCtrl_SetWrapVisualFlagsLocation, 3172). --define(wxStyledTextCtrl_GetWrapVisualFlagsLocation, 3173). --define(wxStyledTextCtrl_SetWrapStartIndent, 3174). --define(wxStyledTextCtrl_GetWrapStartIndent, 3175). --define(wxStyledTextCtrl_SetLayoutCache, 3176). --define(wxStyledTextCtrl_GetLayoutCache, 3177). --define(wxStyledTextCtrl_SetScrollWidth, 3178). --define(wxStyledTextCtrl_GetScrollWidth, 3179). --define(wxStyledTextCtrl_TextWidth, 3180). --define(wxStyledTextCtrl_GetEndAtLastLine, 3181). --define(wxStyledTextCtrl_TextHeight, 3182). --define(wxStyledTextCtrl_SetUseVerticalScrollBar, 3183). --define(wxStyledTextCtrl_GetUseVerticalScrollBar, 3184). --define(wxStyledTextCtrl_AppendText, 3185). --define(wxStyledTextCtrl_GetTwoPhaseDraw, 3186). --define(wxStyledTextCtrl_SetTwoPhaseDraw, 3187). --define(wxStyledTextCtrl_TargetFromSelection, 3188). --define(wxStyledTextCtrl_LinesJoin, 3189). --define(wxStyledTextCtrl_LinesSplit, 3190). --define(wxStyledTextCtrl_SetFoldMarginColour, 3191). --define(wxStyledTextCtrl_SetFoldMarginHiColour, 3192). --define(wxStyledTextCtrl_LineDown, 3193). --define(wxStyledTextCtrl_LineDownExtend, 3194). --define(wxStyledTextCtrl_LineUp, 3195). --define(wxStyledTextCtrl_LineUpExtend, 3196). --define(wxStyledTextCtrl_CharLeft, 3197). --define(wxStyledTextCtrl_CharLeftExtend, 3198). --define(wxStyledTextCtrl_CharRight, 3199). --define(wxStyledTextCtrl_CharRightExtend, 3200). --define(wxStyledTextCtrl_WordLeft, 3201). --define(wxStyledTextCtrl_WordLeftExtend, 3202). --define(wxStyledTextCtrl_WordRight, 3203). --define(wxStyledTextCtrl_WordRightExtend, 3204). --define(wxStyledTextCtrl_Home, 3205). --define(wxStyledTextCtrl_HomeExtend, 3206). --define(wxStyledTextCtrl_LineEnd, 3207). --define(wxStyledTextCtrl_LineEndExtend, 3208). --define(wxStyledTextCtrl_DocumentStart, 3209). --define(wxStyledTextCtrl_DocumentStartExtend, 3210). --define(wxStyledTextCtrl_DocumentEnd, 3211). --define(wxStyledTextCtrl_DocumentEndExtend, 3212). --define(wxStyledTextCtrl_PageUp, 3213). --define(wxStyledTextCtrl_PageUpExtend, 3214). --define(wxStyledTextCtrl_PageDown, 3215). --define(wxStyledTextCtrl_PageDownExtend, 3216). --define(wxStyledTextCtrl_EditToggleOvertype, 3217). --define(wxStyledTextCtrl_Cancel, 3218). --define(wxStyledTextCtrl_DeleteBack, 3219). --define(wxStyledTextCtrl_Tab, 3220). --define(wxStyledTextCtrl_BackTab, 3221). --define(wxStyledTextCtrl_NewLine, 3222). --define(wxStyledTextCtrl_FormFeed, 3223). --define(wxStyledTextCtrl_VCHome, 3224). --define(wxStyledTextCtrl_VCHomeExtend, 3225). --define(wxStyledTextCtrl_ZoomIn, 3226). --define(wxStyledTextCtrl_ZoomOut, 3227). --define(wxStyledTextCtrl_DelWordLeft, 3228). --define(wxStyledTextCtrl_DelWordRight, 3229). --define(wxStyledTextCtrl_LineCut, 3230). --define(wxStyledTextCtrl_LineDelete, 3231). --define(wxStyledTextCtrl_LineTranspose, 3232). --define(wxStyledTextCtrl_LineDuplicate, 3233). --define(wxStyledTextCtrl_LowerCase, 3234). --define(wxStyledTextCtrl_UpperCase, 3235). --define(wxStyledTextCtrl_LineScrollDown, 3236). --define(wxStyledTextCtrl_LineScrollUp, 3237). --define(wxStyledTextCtrl_DeleteBackNotLine, 3238). --define(wxStyledTextCtrl_HomeDisplay, 3239). --define(wxStyledTextCtrl_HomeDisplayExtend, 3240). --define(wxStyledTextCtrl_LineEndDisplay, 3241). --define(wxStyledTextCtrl_LineEndDisplayExtend, 3242). --define(wxStyledTextCtrl_HomeWrapExtend, 3243). --define(wxStyledTextCtrl_LineEndWrap, 3244). --define(wxStyledTextCtrl_LineEndWrapExtend, 3245). --define(wxStyledTextCtrl_VCHomeWrap, 3246). --define(wxStyledTextCtrl_VCHomeWrapExtend, 3247). --define(wxStyledTextCtrl_LineCopy, 3248). --define(wxStyledTextCtrl_MoveCaretInsideView, 3249). --define(wxStyledTextCtrl_LineLength, 3250). --define(wxStyledTextCtrl_BraceHighlight, 3251). --define(wxStyledTextCtrl_BraceBadLight, 3252). --define(wxStyledTextCtrl_BraceMatch, 3253). --define(wxStyledTextCtrl_GetViewEOL, 3254). --define(wxStyledTextCtrl_SetViewEOL, 3255). --define(wxStyledTextCtrl_SetModEventMask, 3256). --define(wxStyledTextCtrl_GetEdgeColumn, 3257). --define(wxStyledTextCtrl_SetEdgeColumn, 3258). --define(wxStyledTextCtrl_GetEdgeMode, 3259). --define(wxStyledTextCtrl_GetEdgeColour, 3260). --define(wxStyledTextCtrl_SetEdgeColour, 3261). --define(wxStyledTextCtrl_SearchAnchor, 3262). --define(wxStyledTextCtrl_SearchNext, 3263). --define(wxStyledTextCtrl_SearchPrev, 3264). --define(wxStyledTextCtrl_LinesOnScreen, 3265). --define(wxStyledTextCtrl_UsePopUp, 3266). --define(wxStyledTextCtrl_SelectionIsRectangle, 3267). --define(wxStyledTextCtrl_SetZoom, 3268). --define(wxStyledTextCtrl_GetZoom, 3269). --define(wxStyledTextCtrl_GetModEventMask, 3270). --define(wxStyledTextCtrl_SetSTCFocus, 3271). --define(wxStyledTextCtrl_GetSTCFocus, 3272). --define(wxStyledTextCtrl_SetStatus, 3273). --define(wxStyledTextCtrl_GetStatus, 3274). --define(wxStyledTextCtrl_SetMouseDownCaptures, 3275). --define(wxStyledTextCtrl_GetMouseDownCaptures, 3276). --define(wxStyledTextCtrl_SetSTCCursor, 3277). --define(wxStyledTextCtrl_GetSTCCursor, 3278). --define(wxStyledTextCtrl_SetControlCharSymbol, 3279). --define(wxStyledTextCtrl_GetControlCharSymbol, 3280). --define(wxStyledTextCtrl_WordPartLeft, 3281). --define(wxStyledTextCtrl_WordPartLeftExtend, 3282). --define(wxStyledTextCtrl_WordPartRight, 3283). --define(wxStyledTextCtrl_WordPartRightExtend, 3284). --define(wxStyledTextCtrl_SetVisiblePolicy, 3285). --define(wxStyledTextCtrl_DelLineLeft, 3286). --define(wxStyledTextCtrl_DelLineRight, 3287). --define(wxStyledTextCtrl_GetXOffset, 3288). --define(wxStyledTextCtrl_ChooseCaretX, 3289). --define(wxStyledTextCtrl_SetXCaretPolicy, 3290). --define(wxStyledTextCtrl_SetYCaretPolicy, 3291). --define(wxStyledTextCtrl_GetPrintWrapMode, 3292). --define(wxStyledTextCtrl_SetHotspotActiveForeground, 3293). --define(wxStyledTextCtrl_SetHotspotActiveBackground, 3294). --define(wxStyledTextCtrl_SetHotspotActiveUnderline, 3295). --define(wxStyledTextCtrl_SetHotspotSingleLine, 3296). --define(wxStyledTextCtrl_ParaDownExtend, 3297). --define(wxStyledTextCtrl_ParaUp, 3298). --define(wxStyledTextCtrl_ParaUpExtend, 3299). --define(wxStyledTextCtrl_PositionBefore, 3300). --define(wxStyledTextCtrl_PositionAfter, 3301). --define(wxStyledTextCtrl_CopyRange, 3302). --define(wxStyledTextCtrl_CopyText, 3303). --define(wxStyledTextCtrl_SetSelectionMode, 3304). --define(wxStyledTextCtrl_GetSelectionMode, 3305). --define(wxStyledTextCtrl_LineDownRectExtend, 3306). --define(wxStyledTextCtrl_LineUpRectExtend, 3307). --define(wxStyledTextCtrl_CharLeftRectExtend, 3308). --define(wxStyledTextCtrl_CharRightRectExtend, 3309). --define(wxStyledTextCtrl_HomeRectExtend, 3310). --define(wxStyledTextCtrl_VCHomeRectExtend, 3311). --define(wxStyledTextCtrl_LineEndRectExtend, 3312). --define(wxStyledTextCtrl_PageUpRectExtend, 3313). --define(wxStyledTextCtrl_PageDownRectExtend, 3314). --define(wxStyledTextCtrl_StutteredPageUp, 3315). --define(wxStyledTextCtrl_StutteredPageUpExtend, 3316). --define(wxStyledTextCtrl_StutteredPageDown, 3317). --define(wxStyledTextCtrl_StutteredPageDownExtend, 3318). --define(wxStyledTextCtrl_WordLeftEnd, 3319). --define(wxStyledTextCtrl_WordLeftEndExtend, 3320). --define(wxStyledTextCtrl_WordRightEnd, 3321). --define(wxStyledTextCtrl_WordRightEndExtend, 3322). --define(wxStyledTextCtrl_SetWhitespaceChars, 3323). --define(wxStyledTextCtrl_SetCharsDefault, 3324). --define(wxStyledTextCtrl_AutoCompGetCurrent, 3325). --define(wxStyledTextCtrl_Allocate, 3326). --define(wxStyledTextCtrl_FindColumn, 3327). --define(wxStyledTextCtrl_GetCaretSticky, 3328). --define(wxStyledTextCtrl_SetCaretSticky, 3329). --define(wxStyledTextCtrl_ToggleCaretSticky, 3330). --define(wxStyledTextCtrl_SetPasteConvertEndings, 3331). --define(wxStyledTextCtrl_GetPasteConvertEndings, 3332). --define(wxStyledTextCtrl_SelectionDuplicate, 3333). --define(wxStyledTextCtrl_SetCaretLineBackAlpha, 3334). --define(wxStyledTextCtrl_GetCaretLineBackAlpha, 3335). --define(wxStyledTextCtrl_StartRecord, 3336). --define(wxStyledTextCtrl_StopRecord, 3337). --define(wxStyledTextCtrl_SetLexer, 3338). --define(wxStyledTextCtrl_GetLexer, 3339). --define(wxStyledTextCtrl_Colourise, 3340). --define(wxStyledTextCtrl_SetProperty, 3341). --define(wxStyledTextCtrl_SetKeyWords, 3342). --define(wxStyledTextCtrl_SetLexerLanguage, 3343). --define(wxStyledTextCtrl_GetProperty, 3344). --define(wxStyledTextCtrl_GetStyleBitsNeeded, 3345). --define(wxStyledTextCtrl_GetCurrentLine, 3346). --define(wxStyledTextCtrl_StyleSetSpec, 3347). --define(wxStyledTextCtrl_StyleSetFont, 3348). --define(wxStyledTextCtrl_StyleSetFontAttr, 3349). --define(wxStyledTextCtrl_StyleSetCharacterSet, 3350). --define(wxStyledTextCtrl_StyleSetFontEncoding, 3351). --define(wxStyledTextCtrl_CmdKeyExecute, 3352). --define(wxStyledTextCtrl_SetMargins, 3353). --define(wxStyledTextCtrl_GetSelection, 3354). --define(wxStyledTextCtrl_PointFromPosition, 3355). --define(wxStyledTextCtrl_ScrollToLine, 3356). --define(wxStyledTextCtrl_ScrollToColumn, 3357). --define(wxStyledTextCtrl_SendMsg, 3358). --define(wxStyledTextCtrl_SetVScrollBar, 3359). --define(wxStyledTextCtrl_SetHScrollBar, 3360). --define(wxStyledTextCtrl_GetLastKeydownProcessed, 3361). --define(wxStyledTextCtrl_SetLastKeydownProcessed, 3362). --define(wxStyledTextCtrl_SaveFile, 3363). --define(wxStyledTextCtrl_LoadFile, 3364). --define(wxStyledTextCtrl_DoDragOver, 3365). --define(wxStyledTextCtrl_DoDropText, 3366). --define(wxStyledTextCtrl_GetUseAntiAliasing, 3367). --define(wxStyledTextCtrl_AddTextRaw, 3368). --define(wxStyledTextCtrl_InsertTextRaw, 3369). --define(wxStyledTextCtrl_GetCurLineRaw, 3370). --define(wxStyledTextCtrl_GetLineRaw, 3371). --define(wxStyledTextCtrl_GetSelectedTextRaw, 3372). --define(wxStyledTextCtrl_GetTextRangeRaw, 3373). --define(wxStyledTextCtrl_SetTextRaw, 3374). --define(wxStyledTextCtrl_GetTextRaw, 3375). --define(wxStyledTextCtrl_AppendTextRaw, 3376). --define(wxArtProvider_GetBitmap, 3377). --define(wxArtProvider_GetIcon, 3378). --define(wxTreeEvent_GetKeyCode, 3379). --define(wxTreeEvent_GetItem, 3380). --define(wxTreeEvent_GetKeyEvent, 3381). --define(wxTreeEvent_GetLabel, 3382). --define(wxTreeEvent_GetOldItem, 3383). --define(wxTreeEvent_GetPoint, 3384). --define(wxTreeEvent_IsEditCancelled, 3385). --define(wxTreeEvent_SetToolTip, 3386). --define(wxNotebookEvent_GetOldSelection, 3387). --define(wxNotebookEvent_GetSelection, 3388). --define(wxNotebookEvent_SetOldSelection, 3389). --define(wxNotebookEvent_SetSelection, 3390). --define(wxFileDataObject_new, 3391). --define(wxFileDataObject_AddFile, 3392). --define(wxFileDataObject_GetFilenames, 3393). --define(wxFileDataObject_destroy, 3394). --define(wxTextDataObject_new, 3395). --define(wxTextDataObject_GetTextLength, 3396). --define(wxTextDataObject_GetText, 3397). --define(wxTextDataObject_SetText, 3398). --define(wxTextDataObject_destroy, 3399). --define(wxBitmapDataObject_new_1_1, 3400). --define(wxBitmapDataObject_new_1_0, 3401). --define(wxBitmapDataObject_GetBitmap, 3402). --define(wxBitmapDataObject_SetBitmap, 3403). --define(wxBitmapDataObject_destroy, 3404). --define(wxClipboard_new, 3406). --define(wxClipboard_destruct, 3407). --define(wxClipboard_AddData, 3408). --define(wxClipboard_Clear, 3409). --define(wxClipboard_Close, 3410). --define(wxClipboard_Flush, 3411). --define(wxClipboard_GetData, 3412). --define(wxClipboard_IsOpened, 3413). --define(wxClipboard_Open, 3414). --define(wxClipboard_SetData, 3415). --define(wxClipboard_UsePrimarySelection, 3417). --define(wxClipboard_IsSupported, 3418). --define(wxClipboard_Get, 3419). --define(wxSpinEvent_GetPosition, 3420). --define(wxSpinEvent_SetPosition, 3421). --define(wxSplitterWindow_new_0, 3422). --define(wxSplitterWindow_new_2, 3423). --define(wxSplitterWindow_destruct, 3424). --define(wxSplitterWindow_Create, 3425). --define(wxSplitterWindow_GetMinimumPaneSize, 3426). --define(wxSplitterWindow_GetSashGravity, 3427). --define(wxSplitterWindow_GetSashPosition, 3428). --define(wxSplitterWindow_GetSplitMode, 3429). --define(wxSplitterWindow_GetWindow1, 3430). --define(wxSplitterWindow_GetWindow2, 3431). --define(wxSplitterWindow_Initialize, 3432). --define(wxSplitterWindow_IsSplit, 3433). --define(wxSplitterWindow_ReplaceWindow, 3434). --define(wxSplitterWindow_SetSashGravity, 3435). --define(wxSplitterWindow_SetSashPosition, 3436). --define(wxSplitterWindow_SetSashSize, 3437). --define(wxSplitterWindow_SetMinimumPaneSize, 3438). --define(wxSplitterWindow_SetSplitMode, 3439). --define(wxSplitterWindow_SplitHorizontally, 3440). --define(wxSplitterWindow_SplitVertically, 3441). --define(wxSplitterWindow_Unsplit, 3442). --define(wxSplitterWindow_UpdateSize, 3443). --define(wxSplitterEvent_GetSashPosition, 3444). --define(wxSplitterEvent_GetX, 3445). --define(wxSplitterEvent_GetY, 3446). --define(wxSplitterEvent_GetWindowBeingRemoved, 3447). --define(wxSplitterEvent_SetSashPosition, 3448). --define(wxHtmlWindow_new_0, 3449). --define(wxHtmlWindow_new_2, 3450). --define(wxHtmlWindow_AppendToPage, 3451). --define(wxHtmlWindow_GetOpenedAnchor, 3452). --define(wxHtmlWindow_GetOpenedPage, 3453). --define(wxHtmlWindow_GetOpenedPageTitle, 3454). --define(wxHtmlWindow_GetRelatedFrame, 3455). --define(wxHtmlWindow_HistoryBack, 3456). --define(wxHtmlWindow_HistoryCanBack, 3457). --define(wxHtmlWindow_HistoryCanForward, 3458). --define(wxHtmlWindow_HistoryClear, 3459). --define(wxHtmlWindow_HistoryForward, 3460). --define(wxHtmlWindow_LoadFile, 3461). --define(wxHtmlWindow_LoadPage, 3462). --define(wxHtmlWindow_SelectAll, 3463). --define(wxHtmlWindow_SelectionToText, 3464). --define(wxHtmlWindow_SelectLine, 3465). --define(wxHtmlWindow_SelectWord, 3466). --define(wxHtmlWindow_SetBorders, 3467). --define(wxHtmlWindow_SetFonts, 3468). --define(wxHtmlWindow_SetPage, 3469). --define(wxHtmlWindow_SetRelatedFrame, 3470). --define(wxHtmlWindow_SetRelatedStatusBar, 3471). --define(wxHtmlWindow_ToText, 3472). --define(wxHtmlWindow_destroy, 3473). --define(wxHtmlLinkEvent_GetLinkInfo, 3474). --define(wxAuiNotebookEvent_SetSelection, 3475). --define(wxAuiNotebookEvent_GetSelection, 3476). --define(wxAuiNotebookEvent_SetOldSelection, 3477). --define(wxAuiNotebookEvent_GetOldSelection, 3478). --define(wxAuiNotebookEvent_SetDragSource, 3479). --define(wxAuiNotebookEvent_GetDragSource, 3480). --define(wxAuiManagerEvent_SetManager, 3481). --define(wxAuiManagerEvent_GetManager, 3482). --define(wxAuiManagerEvent_SetPane, 3483). --define(wxAuiManagerEvent_GetPane, 3484). --define(wxAuiManagerEvent_SetButton, 3485). --define(wxAuiManagerEvent_GetButton, 3486). --define(wxAuiManagerEvent_SetDC, 3487). --define(wxAuiManagerEvent_GetDC, 3488). --define(wxAuiManagerEvent_Veto, 3489). --define(wxAuiManagerEvent_GetVeto, 3490). --define(wxAuiManagerEvent_SetCanVeto, 3491). --define(wxAuiManagerEvent_CanVeto, 3492). --define(wxLogNull_new, 3493). --define(wxLogNull_destroy, 3494). +-define(wxTreeCtrl_EditLabel, 2010). +-define(wxTreeCtrl_EnsureVisible, 2011). +-define(wxTreeCtrl_Expand, 2012). +-define(wxTreeCtrl_GetBoundingRect, 2013). +-define(wxTreeCtrl_GetChildrenCount, 2015). +-define(wxTreeCtrl_GetCount, 2016). +-define(wxTreeCtrl_GetEditControl, 2017). +-define(wxTreeCtrl_GetFirstChild, 2018). +-define(wxTreeCtrl_GetNextChild, 2019). +-define(wxTreeCtrl_GetFirstVisibleItem, 2020). +-define(wxTreeCtrl_GetImageList, 2021). +-define(wxTreeCtrl_GetIndent, 2022). +-define(wxTreeCtrl_GetItemBackgroundColour, 2023). +-define(wxTreeCtrl_GetItemData, 2024). +-define(wxTreeCtrl_GetItemFont, 2025). +-define(wxTreeCtrl_GetItemImage_1, 2026). +-define(wxTreeCtrl_GetItemImage_2, 2027). +-define(wxTreeCtrl_GetItemText, 2028). +-define(wxTreeCtrl_GetItemTextColour, 2029). +-define(wxTreeCtrl_GetLastChild, 2030). +-define(wxTreeCtrl_GetNextSibling, 2031). +-define(wxTreeCtrl_GetNextVisible, 2032). +-define(wxTreeCtrl_GetItemParent, 2033). +-define(wxTreeCtrl_GetPrevSibling, 2034). +-define(wxTreeCtrl_GetPrevVisible, 2035). +-define(wxTreeCtrl_GetRootItem, 2036). +-define(wxTreeCtrl_GetSelection, 2037). +-define(wxTreeCtrl_GetSelections, 2038). +-define(wxTreeCtrl_GetStateImageList, 2039). +-define(wxTreeCtrl_HitTest, 2040). +-define(wxTreeCtrl_InsertItem, 2042). +-define(wxTreeCtrl_IsBold, 2043). +-define(wxTreeCtrl_IsExpanded, 2044). +-define(wxTreeCtrl_IsSelected, 2045). +-define(wxTreeCtrl_IsVisible, 2046). +-define(wxTreeCtrl_ItemHasChildren, 2047). +-define(wxTreeCtrl_PrependItem, 2048). +-define(wxTreeCtrl_ScrollTo, 2049). +-define(wxTreeCtrl_SelectItem_1, 2050). +-define(wxTreeCtrl_SelectItem_2, 2051). +-define(wxTreeCtrl_SetIndent, 2052). +-define(wxTreeCtrl_SetImageList, 2053). +-define(wxTreeCtrl_SetItemBackgroundColour, 2054). +-define(wxTreeCtrl_SetItemBold, 2055). +-define(wxTreeCtrl_SetItemData, 2056). +-define(wxTreeCtrl_SetItemDropHighlight, 2057). +-define(wxTreeCtrl_SetItemFont, 2058). +-define(wxTreeCtrl_SetItemHasChildren, 2059). +-define(wxTreeCtrl_SetItemImage_2, 2060). +-define(wxTreeCtrl_SetItemImage_3, 2061). +-define(wxTreeCtrl_SetItemText, 2062). +-define(wxTreeCtrl_SetItemTextColour, 2063). +-define(wxTreeCtrl_SetStateImageList, 2064). +-define(wxTreeCtrl_SetWindowStyle, 2065). +-define(wxTreeCtrl_SortChildren, 2066). +-define(wxTreeCtrl_Toggle, 2067). +-define(wxTreeCtrl_ToggleItemSelection, 2068). +-define(wxTreeCtrl_Unselect, 2069). +-define(wxTreeCtrl_UnselectAll, 2070). +-define(wxTreeCtrl_UnselectItem, 2071). +-define(wxScrollBar_new_0, 2072). +-define(wxScrollBar_new_3, 2073). +-define(wxScrollBar_destruct, 2074). +-define(wxScrollBar_Create, 2075). +-define(wxScrollBar_GetRange, 2076). +-define(wxScrollBar_GetPageSize, 2077). +-define(wxScrollBar_GetThumbPosition, 2078). +-define(wxScrollBar_GetThumbSize, 2079). +-define(wxScrollBar_SetThumbPosition, 2080). +-define(wxScrollBar_SetScrollbar, 2081). +-define(wxSpinButton_new_2, 2083). +-define(wxSpinButton_new_0, 2084). +-define(wxSpinButton_Create, 2085). +-define(wxSpinButton_GetMax, 2086). +-define(wxSpinButton_GetMin, 2087). +-define(wxSpinButton_GetValue, 2088). +-define(wxSpinButton_SetRange, 2089). +-define(wxSpinButton_SetValue, 2090). +-define(wxSpinButton_destroy, 2091). +-define(wxSpinCtrl_new_0, 2092). +-define(wxSpinCtrl_new_2, 2093). +-define(wxSpinCtrl_Create, 2095). +-define(wxSpinCtrl_SetValue_1_1, 2098). +-define(wxSpinCtrl_SetValue_1_0, 2099). +-define(wxSpinCtrl_GetValue, 2101). +-define(wxSpinCtrl_SetRange, 2103). +-define(wxSpinCtrl_SetSelection, 2104). +-define(wxSpinCtrl_GetMin, 2106). +-define(wxSpinCtrl_GetMax, 2108). +-define(wxSpinCtrl_destroy, 2109). +-define(wxStaticText_new_0, 2110). +-define(wxStaticText_new_4, 2111). +-define(wxStaticText_Create, 2112). +-define(wxStaticText_GetLabel, 2113). +-define(wxStaticText_SetLabel, 2114). +-define(wxStaticText_Wrap, 2115). +-define(wxStaticText_destroy, 2116). +-define(wxStaticBitmap_new_0, 2117). +-define(wxStaticBitmap_new_4, 2118). +-define(wxStaticBitmap_Create, 2119). +-define(wxStaticBitmap_GetBitmap, 2120). +-define(wxStaticBitmap_SetBitmap, 2121). +-define(wxStaticBitmap_destroy, 2122). +-define(wxRadioBox_new, 2123). +-define(wxRadioBox_destruct, 2125). +-define(wxRadioBox_Create, 2126). +-define(wxRadioBox_Enable_2, 2127). +-define(wxRadioBox_Enable_1, 2128). +-define(wxRadioBox_GetSelection, 2129). +-define(wxRadioBox_GetString, 2130). +-define(wxRadioBox_SetSelection, 2131). +-define(wxRadioBox_Show_2, 2132). +-define(wxRadioBox_Show_1, 2133). +-define(wxRadioBox_GetColumnCount, 2134). +-define(wxRadioBox_GetItemHelpText, 2135). +-define(wxRadioBox_GetItemToolTip, 2136). +-define(wxRadioBox_GetItemFromPoint, 2138). +-define(wxRadioBox_GetRowCount, 2139). +-define(wxRadioBox_IsItemEnabled, 2140). +-define(wxRadioBox_IsItemShown, 2141). +-define(wxRadioBox_SetItemHelpText, 2142). +-define(wxRadioBox_SetItemToolTip, 2143). +-define(wxRadioButton_new_0, 2144). +-define(wxRadioButton_new_4, 2145). +-define(wxRadioButton_Create, 2146). +-define(wxRadioButton_GetValue, 2147). +-define(wxRadioButton_SetValue, 2148). +-define(wxRadioButton_destroy, 2149). +-define(wxSlider_new_6, 2151). +-define(wxSlider_new_0, 2152). +-define(wxSlider_Create, 2153). +-define(wxSlider_GetLineSize, 2154). +-define(wxSlider_GetMax, 2155). +-define(wxSlider_GetMin, 2156). +-define(wxSlider_GetPageSize, 2157). +-define(wxSlider_GetThumbLength, 2158). +-define(wxSlider_GetValue, 2159). +-define(wxSlider_SetLineSize, 2160). +-define(wxSlider_SetPageSize, 2161). +-define(wxSlider_SetRange, 2162). +-define(wxSlider_SetThumbLength, 2163). +-define(wxSlider_SetValue, 2164). +-define(wxSlider_destroy, 2165). +-define(wxDialog_new_4, 2167). +-define(wxDialog_new_0, 2168). +-define(wxDialog_destruct, 2170). +-define(wxDialog_Create, 2171). +-define(wxDialog_CreateButtonSizer, 2172). +-define(wxDialog_CreateStdDialogButtonSizer, 2173). +-define(wxDialog_EndModal, 2174). +-define(wxDialog_GetAffirmativeId, 2175). +-define(wxDialog_GetReturnCode, 2176). +-define(wxDialog_IsModal, 2177). +-define(wxDialog_SetAffirmativeId, 2178). +-define(wxDialog_SetReturnCode, 2179). +-define(wxDialog_Show, 2180). +-define(wxDialog_ShowModal, 2181). +-define(wxColourDialog_new_0, 2182). +-define(wxColourDialog_new_2, 2183). +-define(wxColourDialog_destruct, 2184). +-define(wxColourDialog_Create, 2185). +-define(wxColourDialog_GetColourData, 2186). +-define(wxColourData_new_0, 2187). +-define(wxColourData_new_1, 2188). +-define(wxColourData_destruct, 2189). +-define(wxColourData_GetChooseFull, 2190). +-define(wxColourData_GetColour, 2191). +-define(wxColourData_GetCustomColour, 2193). +-define(wxColourData_SetChooseFull, 2194). +-define(wxColourData_SetColour, 2195). +-define(wxColourData_SetCustomColour, 2196). +-define(wxPalette_new_0, 2197). +-define(wxPalette_new_4, 2198). +-define(wxPalette_destruct, 2200). +-define(wxPalette_Create, 2201). +-define(wxPalette_GetColoursCount, 2202). +-define(wxPalette_GetPixel, 2203). +-define(wxPalette_GetRGB, 2204). +-define(wxPalette_IsOk, 2205). +-define(wxDirDialog_new, 2209). +-define(wxDirDialog_destruct, 2210). +-define(wxDirDialog_GetPath, 2211). +-define(wxDirDialog_GetMessage, 2212). +-define(wxDirDialog_SetMessage, 2213). +-define(wxDirDialog_SetPath, 2214). +-define(wxFileDialog_new, 2218). +-define(wxFileDialog_destruct, 2219). +-define(wxFileDialog_GetDirectory, 2220). +-define(wxFileDialog_GetFilename, 2221). +-define(wxFileDialog_GetFilenames, 2222). +-define(wxFileDialog_GetFilterIndex, 2223). +-define(wxFileDialog_GetMessage, 2224). +-define(wxFileDialog_GetPath, 2225). +-define(wxFileDialog_GetPaths, 2226). +-define(wxFileDialog_GetWildcard, 2227). +-define(wxFileDialog_SetDirectory, 2228). +-define(wxFileDialog_SetFilename, 2229). +-define(wxFileDialog_SetFilterIndex, 2230). +-define(wxFileDialog_SetMessage, 2231). +-define(wxFileDialog_SetPath, 2232). +-define(wxFileDialog_SetWildcard, 2233). +-define(wxPickerBase_SetInternalMargin, 2234). +-define(wxPickerBase_GetInternalMargin, 2235). +-define(wxPickerBase_SetTextCtrlProportion, 2236). +-define(wxPickerBase_SetPickerCtrlProportion, 2237). +-define(wxPickerBase_GetTextCtrlProportion, 2238). +-define(wxPickerBase_GetPickerCtrlProportion, 2239). +-define(wxPickerBase_HasTextCtrl, 2240). +-define(wxPickerBase_GetTextCtrl, 2241). +-define(wxPickerBase_IsTextCtrlGrowable, 2242). +-define(wxPickerBase_SetPickerCtrlGrowable, 2243). +-define(wxPickerBase_SetTextCtrlGrowable, 2244). +-define(wxPickerBase_IsPickerCtrlGrowable, 2245). +-define(wxFilePickerCtrl_new_0, 2246). +-define(wxFilePickerCtrl_new_3, 2247). +-define(wxFilePickerCtrl_Create, 2248). +-define(wxFilePickerCtrl_GetPath, 2249). +-define(wxFilePickerCtrl_SetPath, 2250). +-define(wxFilePickerCtrl_destroy, 2251). +-define(wxDirPickerCtrl_new_0, 2252). +-define(wxDirPickerCtrl_new_3, 2253). +-define(wxDirPickerCtrl_Create, 2254). +-define(wxDirPickerCtrl_GetPath, 2255). +-define(wxDirPickerCtrl_SetPath, 2256). +-define(wxDirPickerCtrl_destroy, 2257). +-define(wxColourPickerCtrl_new_0, 2258). +-define(wxColourPickerCtrl_new_3, 2259). +-define(wxColourPickerCtrl_Create, 2260). +-define(wxColourPickerCtrl_GetColour, 2261). +-define(wxColourPickerCtrl_SetColour_1_1, 2262). +-define(wxColourPickerCtrl_SetColour_1_0, 2263). +-define(wxColourPickerCtrl_destroy, 2264). +-define(wxDatePickerCtrl_new_0, 2265). +-define(wxDatePickerCtrl_new_3, 2266). +-define(wxDatePickerCtrl_GetRange, 2267). +-define(wxDatePickerCtrl_GetValue, 2268). +-define(wxDatePickerCtrl_SetRange, 2269). +-define(wxDatePickerCtrl_SetValue, 2270). +-define(wxDatePickerCtrl_destroy, 2271). +-define(wxFontPickerCtrl_new_0, 2272). +-define(wxFontPickerCtrl_new_3, 2273). +-define(wxFontPickerCtrl_Create, 2274). +-define(wxFontPickerCtrl_GetSelectedFont, 2275). +-define(wxFontPickerCtrl_SetSelectedFont, 2276). +-define(wxFontPickerCtrl_GetMaxPointSize, 2277). +-define(wxFontPickerCtrl_SetMaxPointSize, 2278). +-define(wxFontPickerCtrl_destroy, 2279). +-define(wxFindReplaceDialog_new_0, 2282). +-define(wxFindReplaceDialog_new_4, 2283). +-define(wxFindReplaceDialog_destruct, 2284). +-define(wxFindReplaceDialog_Create, 2285). +-define(wxFindReplaceDialog_GetData, 2286). +-define(wxFindReplaceData_new_0, 2287). +-define(wxFindReplaceData_new_1, 2288). +-define(wxFindReplaceData_GetFindString, 2289). +-define(wxFindReplaceData_GetReplaceString, 2290). +-define(wxFindReplaceData_GetFlags, 2291). +-define(wxFindReplaceData_SetFlags, 2292). +-define(wxFindReplaceData_SetFindString, 2293). +-define(wxFindReplaceData_SetReplaceString, 2294). +-define(wxFindReplaceData_destroy, 2295). +-define(wxMultiChoiceDialog_new_0, 2296). +-define(wxMultiChoiceDialog_new_5, 2298). +-define(wxMultiChoiceDialog_GetSelections, 2299). +-define(wxMultiChoiceDialog_SetSelections, 2300). +-define(wxMultiChoiceDialog_destroy, 2301). +-define(wxSingleChoiceDialog_new_0, 2302). +-define(wxSingleChoiceDialog_new_5, 2304). +-define(wxSingleChoiceDialog_GetSelection, 2305). +-define(wxSingleChoiceDialog_GetStringSelection, 2306). +-define(wxSingleChoiceDialog_SetSelection, 2307). +-define(wxSingleChoiceDialog_destroy, 2308). +-define(wxTextEntryDialog_new, 2309). +-define(wxTextEntryDialog_GetValue, 2310). +-define(wxTextEntryDialog_SetValue, 2311). +-define(wxTextEntryDialog_destroy, 2312). +-define(wxPasswordEntryDialog_new, 2313). +-define(wxPasswordEntryDialog_destroy, 2314). +-define(wxFontData_new_0, 2315). +-define(wxFontData_new_1, 2316). +-define(wxFontData_destruct, 2317). +-define(wxFontData_EnableEffects, 2318). +-define(wxFontData_GetAllowSymbols, 2319). +-define(wxFontData_GetColour, 2320). +-define(wxFontData_GetChosenFont, 2321). +-define(wxFontData_GetEnableEffects, 2322). +-define(wxFontData_GetInitialFont, 2323). +-define(wxFontData_GetShowHelp, 2324). +-define(wxFontData_SetAllowSymbols, 2325). +-define(wxFontData_SetChosenFont, 2326). +-define(wxFontData_SetColour, 2327). +-define(wxFontData_SetInitialFont, 2328). +-define(wxFontData_SetRange, 2329). +-define(wxFontData_SetShowHelp, 2330). +-define(wxFontDialog_new_0, 2334). +-define(wxFontDialog_new_2, 2336). +-define(wxFontDialog_Create, 2338). +-define(wxFontDialog_GetFontData, 2339). +-define(wxFontDialog_destroy, 2341). +-define(wxProgressDialog_new, 2342). +-define(wxProgressDialog_destruct, 2343). +-define(wxProgressDialog_Resume, 2344). +-define(wxProgressDialog_Update_2, 2345). +-define(wxProgressDialog_Update_0, 2346). +-define(wxMessageDialog_new, 2347). +-define(wxMessageDialog_destruct, 2348). +-define(wxPageSetupDialog_new, 2349). +-define(wxPageSetupDialog_destruct, 2350). +-define(wxPageSetupDialog_GetPageSetupData, 2351). +-define(wxPageSetupDialog_ShowModal, 2352). +-define(wxPageSetupDialogData_new_0, 2353). +-define(wxPageSetupDialogData_new_1_0, 2354). +-define(wxPageSetupDialogData_new_1_1, 2355). +-define(wxPageSetupDialogData_destruct, 2356). +-define(wxPageSetupDialogData_EnableHelp, 2357). +-define(wxPageSetupDialogData_EnableMargins, 2358). +-define(wxPageSetupDialogData_EnableOrientation, 2359). +-define(wxPageSetupDialogData_EnablePaper, 2360). +-define(wxPageSetupDialogData_EnablePrinter, 2361). +-define(wxPageSetupDialogData_GetDefaultMinMargins, 2362). +-define(wxPageSetupDialogData_GetEnableMargins, 2363). +-define(wxPageSetupDialogData_GetEnableOrientation, 2364). +-define(wxPageSetupDialogData_GetEnablePaper, 2365). +-define(wxPageSetupDialogData_GetEnablePrinter, 2366). +-define(wxPageSetupDialogData_GetEnableHelp, 2367). +-define(wxPageSetupDialogData_GetDefaultInfo, 2368). +-define(wxPageSetupDialogData_GetMarginTopLeft, 2369). +-define(wxPageSetupDialogData_GetMarginBottomRight, 2370). +-define(wxPageSetupDialogData_GetMinMarginTopLeft, 2371). +-define(wxPageSetupDialogData_GetMinMarginBottomRight, 2372). +-define(wxPageSetupDialogData_GetPaperId, 2373). +-define(wxPageSetupDialogData_GetPaperSize, 2374). +-define(wxPageSetupDialogData_GetPrintData, 2376). +-define(wxPageSetupDialogData_IsOk, 2377). +-define(wxPageSetupDialogData_SetDefaultInfo, 2378). +-define(wxPageSetupDialogData_SetDefaultMinMargins, 2379). +-define(wxPageSetupDialogData_SetMarginTopLeft, 2380). +-define(wxPageSetupDialogData_SetMarginBottomRight, 2381). +-define(wxPageSetupDialogData_SetMinMarginTopLeft, 2382). +-define(wxPageSetupDialogData_SetMinMarginBottomRight, 2383). +-define(wxPageSetupDialogData_SetPaperId, 2384). +-define(wxPageSetupDialogData_SetPaperSize_1_1, 2385). +-define(wxPageSetupDialogData_SetPaperSize_1_0, 2386). +-define(wxPageSetupDialogData_SetPrintData, 2387). +-define(wxPrintDialog_new_2_0, 2388). +-define(wxPrintDialog_new_2_1, 2389). +-define(wxPrintDialog_destruct, 2390). +-define(wxPrintDialog_GetPrintDialogData, 2391). +-define(wxPrintDialog_GetPrintDC, 2392). +-define(wxPrintDialogData_new_0, 2393). +-define(wxPrintDialogData_new_1_1, 2394). +-define(wxPrintDialogData_new_1_0, 2395). +-define(wxPrintDialogData_destruct, 2396). +-define(wxPrintDialogData_EnableHelp, 2397). +-define(wxPrintDialogData_EnablePageNumbers, 2398). +-define(wxPrintDialogData_EnablePrintToFile, 2399). +-define(wxPrintDialogData_EnableSelection, 2400). +-define(wxPrintDialogData_GetAllPages, 2401). +-define(wxPrintDialogData_GetCollate, 2402). +-define(wxPrintDialogData_GetFromPage, 2403). +-define(wxPrintDialogData_GetMaxPage, 2404). +-define(wxPrintDialogData_GetMinPage, 2405). +-define(wxPrintDialogData_GetNoCopies, 2406). +-define(wxPrintDialogData_GetPrintData, 2407). +-define(wxPrintDialogData_GetPrintToFile, 2408). +-define(wxPrintDialogData_GetSelection, 2409). +-define(wxPrintDialogData_GetToPage, 2410). +-define(wxPrintDialogData_IsOk, 2411). +-define(wxPrintDialogData_SetCollate, 2412). +-define(wxPrintDialogData_SetFromPage, 2413). +-define(wxPrintDialogData_SetMaxPage, 2414). +-define(wxPrintDialogData_SetMinPage, 2415). +-define(wxPrintDialogData_SetNoCopies, 2416). +-define(wxPrintDialogData_SetPrintData, 2417). +-define(wxPrintDialogData_SetPrintToFile, 2418). +-define(wxPrintDialogData_SetSelection, 2419). +-define(wxPrintDialogData_SetToPage, 2420). +-define(wxPrintData_new_0, 2421). +-define(wxPrintData_new_1, 2422). +-define(wxPrintData_destruct, 2423). +-define(wxPrintData_GetCollate, 2424). +-define(wxPrintData_GetBin, 2425). +-define(wxPrintData_GetColour, 2426). +-define(wxPrintData_GetDuplex, 2427). +-define(wxPrintData_GetNoCopies, 2428). +-define(wxPrintData_GetOrientation, 2429). +-define(wxPrintData_GetPaperId, 2430). +-define(wxPrintData_GetPrinterName, 2431). +-define(wxPrintData_GetQuality, 2432). +-define(wxPrintData_IsOk, 2433). +-define(wxPrintData_SetBin, 2434). +-define(wxPrintData_SetCollate, 2435). +-define(wxPrintData_SetColour, 2436). +-define(wxPrintData_SetDuplex, 2437). +-define(wxPrintData_SetNoCopies, 2438). +-define(wxPrintData_SetOrientation, 2439). +-define(wxPrintData_SetPaperId, 2440). +-define(wxPrintData_SetPrinterName, 2441). +-define(wxPrintData_SetQuality, 2442). +-define(wxPrintPreview_new_2, 2445). +-define(wxPrintPreview_new_3, 2446). +-define(wxPrintPreview_destruct, 2448). +-define(wxPrintPreview_GetCanvas, 2449). +-define(wxPrintPreview_GetCurrentPage, 2450). +-define(wxPrintPreview_GetFrame, 2451). +-define(wxPrintPreview_GetMaxPage, 2452). +-define(wxPrintPreview_GetMinPage, 2453). +-define(wxPrintPreview_GetPrintout, 2454). +-define(wxPrintPreview_GetPrintoutForPrinting, 2455). +-define(wxPrintPreview_IsOk, 2456). +-define(wxPrintPreview_PaintPage, 2457). +-define(wxPrintPreview_Print, 2458). +-define(wxPrintPreview_RenderPage, 2459). +-define(wxPrintPreview_SetCanvas, 2460). +-define(wxPrintPreview_SetCurrentPage, 2461). +-define(wxPrintPreview_SetFrame, 2462). +-define(wxPrintPreview_SetPrintout, 2463). +-define(wxPrintPreview_SetZoom, 2464). +-define(wxPreviewFrame_new, 2465). +-define(wxPreviewFrame_destruct, 2466). +-define(wxPreviewFrame_CreateControlBar, 2467). +-define(wxPreviewFrame_CreateCanvas, 2468). +-define(wxPreviewFrame_Initialize, 2469). +-define(wxPreviewFrame_OnCloseWindow, 2470). +-define(wxPreviewControlBar_new, 2471). +-define(wxPreviewControlBar_destruct, 2472). +-define(wxPreviewControlBar_CreateButtons, 2473). +-define(wxPreviewControlBar_GetPrintPreview, 2474). +-define(wxPreviewControlBar_GetZoomControl, 2475). +-define(wxPreviewControlBar_SetZoomControl, 2476). +-define(wxPrinter_new, 2478). +-define(wxPrinter_CreateAbortWindow, 2479). +-define(wxPrinter_GetAbort, 2480). +-define(wxPrinter_GetLastError, 2481). +-define(wxPrinter_GetPrintDialogData, 2482). +-define(wxPrinter_Print, 2483). +-define(wxPrinter_PrintDialog, 2484). +-define(wxPrinter_ReportError, 2485). +-define(wxPrinter_Setup, 2486). +-define(wxPrinter_destroy, 2487). +-define(wxXmlResource_new_1, 2488). +-define(wxXmlResource_new_2, 2489). +-define(wxXmlResource_destruct, 2490). +-define(wxXmlResource_AttachUnknownControl, 2491). +-define(wxXmlResource_ClearHandlers, 2492). +-define(wxXmlResource_CompareVersion, 2493). +-define(wxXmlResource_Get, 2494). +-define(wxXmlResource_GetFlags, 2495). +-define(wxXmlResource_GetVersion, 2496). +-define(wxXmlResource_GetXRCID, 2497). +-define(wxXmlResource_InitAllHandlers, 2498). +-define(wxXmlResource_Load, 2499). +-define(wxXmlResource_LoadBitmap, 2500). +-define(wxXmlResource_LoadDialog_2, 2501). +-define(wxXmlResource_LoadDialog_3, 2502). +-define(wxXmlResource_LoadFrame_2, 2503). +-define(wxXmlResource_LoadFrame_3, 2504). +-define(wxXmlResource_LoadIcon, 2505). +-define(wxXmlResource_LoadMenu, 2506). +-define(wxXmlResource_LoadMenuBar_2, 2507). +-define(wxXmlResource_LoadMenuBar_1, 2508). +-define(wxXmlResource_LoadPanel_2, 2509). +-define(wxXmlResource_LoadPanel_3, 2510). +-define(wxXmlResource_LoadToolBar, 2511). +-define(wxXmlResource_Set, 2512). +-define(wxXmlResource_SetFlags, 2513). +-define(wxXmlResource_Unload, 2514). +-define(wxXmlResource_xrcctrl, 2515). +-define(wxHtmlEasyPrinting_new, 2516). +-define(wxHtmlEasyPrinting_destruct, 2517). +-define(wxHtmlEasyPrinting_GetPrintData, 2518). +-define(wxHtmlEasyPrinting_GetPageSetupData, 2519). +-define(wxHtmlEasyPrinting_PreviewFile, 2520). +-define(wxHtmlEasyPrinting_PreviewText, 2521). +-define(wxHtmlEasyPrinting_PrintFile, 2522). +-define(wxHtmlEasyPrinting_PrintText, 2523). +-define(wxHtmlEasyPrinting_PageSetup, 2524). +-define(wxHtmlEasyPrinting_SetFonts, 2525). +-define(wxHtmlEasyPrinting_SetHeader, 2526). +-define(wxHtmlEasyPrinting_SetFooter, 2527). +-define(wxGLCanvas_new_2, 2529). +-define(wxGLCanvas_new_3_1, 2530). +-define(wxGLCanvas_new_3_0, 2531). +-define(wxGLCanvas_GetContext, 2532). +-define(wxGLCanvas_SetCurrent, 2534). +-define(wxGLCanvas_SwapBuffers, 2535). +-define(wxGLCanvas_destroy, 2536). +-define(wxAuiManager_new, 2537). +-define(wxAuiManager_destruct, 2538). +-define(wxAuiManager_AddPane_2_1, 2539). +-define(wxAuiManager_AddPane_3, 2540). +-define(wxAuiManager_AddPane_2_0, 2541). +-define(wxAuiManager_DetachPane, 2542). +-define(wxAuiManager_GetAllPanes, 2543). +-define(wxAuiManager_GetArtProvider, 2544). +-define(wxAuiManager_GetDockSizeConstraint, 2545). +-define(wxAuiManager_GetFlags, 2546). +-define(wxAuiManager_GetManagedWindow, 2547). +-define(wxAuiManager_GetManager, 2548). +-define(wxAuiManager_GetPane_1_1, 2549). +-define(wxAuiManager_GetPane_1_0, 2550). +-define(wxAuiManager_HideHint, 2551). +-define(wxAuiManager_InsertPane, 2552). +-define(wxAuiManager_LoadPaneInfo, 2553). +-define(wxAuiManager_LoadPerspective, 2554). +-define(wxAuiManager_SavePaneInfo, 2555). +-define(wxAuiManager_SavePerspective, 2556). +-define(wxAuiManager_SetArtProvider, 2557). +-define(wxAuiManager_SetDockSizeConstraint, 2558). +-define(wxAuiManager_SetFlags, 2559). +-define(wxAuiManager_SetManagedWindow, 2560). +-define(wxAuiManager_ShowHint, 2561). +-define(wxAuiManager_UnInit, 2562). +-define(wxAuiManager_Update, 2563). +-define(wxAuiPaneInfo_new_0, 2564). +-define(wxAuiPaneInfo_new_1, 2565). +-define(wxAuiPaneInfo_destruct, 2566). +-define(wxAuiPaneInfo_BestSize_1, 2567). +-define(wxAuiPaneInfo_BestSize_2, 2568). +-define(wxAuiPaneInfo_Bottom, 2569). +-define(wxAuiPaneInfo_BottomDockable, 2570). +-define(wxAuiPaneInfo_Caption, 2571). +-define(wxAuiPaneInfo_CaptionVisible, 2572). +-define(wxAuiPaneInfo_Centre, 2573). +-define(wxAuiPaneInfo_CentrePane, 2574). +-define(wxAuiPaneInfo_CloseButton, 2575). +-define(wxAuiPaneInfo_DefaultPane, 2576). +-define(wxAuiPaneInfo_DestroyOnClose, 2577). +-define(wxAuiPaneInfo_Direction, 2578). +-define(wxAuiPaneInfo_Dock, 2579). +-define(wxAuiPaneInfo_Dockable, 2580). +-define(wxAuiPaneInfo_Fixed, 2581). +-define(wxAuiPaneInfo_Float, 2582). +-define(wxAuiPaneInfo_Floatable, 2583). +-define(wxAuiPaneInfo_FloatingPosition_1, 2584). +-define(wxAuiPaneInfo_FloatingPosition_2, 2585). +-define(wxAuiPaneInfo_FloatingSize_1, 2586). +-define(wxAuiPaneInfo_FloatingSize_2, 2587). +-define(wxAuiPaneInfo_Gripper, 2588). +-define(wxAuiPaneInfo_GripperTop, 2589). +-define(wxAuiPaneInfo_HasBorder, 2590). +-define(wxAuiPaneInfo_HasCaption, 2591). +-define(wxAuiPaneInfo_HasCloseButton, 2592). +-define(wxAuiPaneInfo_HasFlag, 2593). +-define(wxAuiPaneInfo_HasGripper, 2594). +-define(wxAuiPaneInfo_HasGripperTop, 2595). +-define(wxAuiPaneInfo_HasMaximizeButton, 2596). +-define(wxAuiPaneInfo_HasMinimizeButton, 2597). +-define(wxAuiPaneInfo_HasPinButton, 2598). +-define(wxAuiPaneInfo_Hide, 2599). +-define(wxAuiPaneInfo_IsBottomDockable, 2600). +-define(wxAuiPaneInfo_IsDocked, 2601). +-define(wxAuiPaneInfo_IsFixed, 2602). +-define(wxAuiPaneInfo_IsFloatable, 2603). +-define(wxAuiPaneInfo_IsFloating, 2604). +-define(wxAuiPaneInfo_IsLeftDockable, 2605). +-define(wxAuiPaneInfo_IsMovable, 2606). +-define(wxAuiPaneInfo_IsOk, 2607). +-define(wxAuiPaneInfo_IsResizable, 2608). +-define(wxAuiPaneInfo_IsRightDockable, 2609). +-define(wxAuiPaneInfo_IsShown, 2610). +-define(wxAuiPaneInfo_IsToolbar, 2611). +-define(wxAuiPaneInfo_IsTopDockable, 2612). +-define(wxAuiPaneInfo_Layer, 2613). +-define(wxAuiPaneInfo_Left, 2614). +-define(wxAuiPaneInfo_LeftDockable, 2615). +-define(wxAuiPaneInfo_MaxSize_1, 2616). +-define(wxAuiPaneInfo_MaxSize_2, 2617). +-define(wxAuiPaneInfo_MaximizeButton, 2618). +-define(wxAuiPaneInfo_MinSize_1, 2619). +-define(wxAuiPaneInfo_MinSize_2, 2620). +-define(wxAuiPaneInfo_MinimizeButton, 2621). +-define(wxAuiPaneInfo_Movable, 2622). +-define(wxAuiPaneInfo_Name, 2623). +-define(wxAuiPaneInfo_PaneBorder, 2624). +-define(wxAuiPaneInfo_PinButton, 2625). +-define(wxAuiPaneInfo_Position, 2626). +-define(wxAuiPaneInfo_Resizable, 2627). +-define(wxAuiPaneInfo_Right, 2628). +-define(wxAuiPaneInfo_RightDockable, 2629). +-define(wxAuiPaneInfo_Row, 2630). +-define(wxAuiPaneInfo_SafeSet, 2631). +-define(wxAuiPaneInfo_SetFlag, 2632). +-define(wxAuiPaneInfo_Show, 2633). +-define(wxAuiPaneInfo_ToolbarPane, 2634). +-define(wxAuiPaneInfo_Top, 2635). +-define(wxAuiPaneInfo_TopDockable, 2636). +-define(wxAuiPaneInfo_Window, 2637). +-define(wxAuiNotebook_new_0, 2638). +-define(wxAuiNotebook_new_2, 2639). +-define(wxAuiNotebook_AddPage, 2640). +-define(wxAuiNotebook_Create, 2641). +-define(wxAuiNotebook_DeletePage, 2642). +-define(wxAuiNotebook_GetArtProvider, 2643). +-define(wxAuiNotebook_GetPage, 2644). +-define(wxAuiNotebook_GetPageBitmap, 2645). +-define(wxAuiNotebook_GetPageCount, 2646). +-define(wxAuiNotebook_GetPageIndex, 2647). +-define(wxAuiNotebook_GetPageText, 2648). +-define(wxAuiNotebook_GetSelection, 2649). +-define(wxAuiNotebook_InsertPage, 2650). +-define(wxAuiNotebook_RemovePage, 2651). +-define(wxAuiNotebook_SetArtProvider, 2652). +-define(wxAuiNotebook_SetFont, 2653). +-define(wxAuiNotebook_SetPageBitmap, 2654). +-define(wxAuiNotebook_SetPageText, 2655). +-define(wxAuiNotebook_SetSelection, 2656). +-define(wxAuiNotebook_SetTabCtrlHeight, 2657). +-define(wxAuiNotebook_SetUniformBitmapSize, 2658). +-define(wxAuiNotebook_destroy, 2659). +-define(wxMDIParentFrame_new_0, 2660). +-define(wxMDIParentFrame_new_4, 2661). +-define(wxMDIParentFrame_destruct, 2662). +-define(wxMDIParentFrame_ActivateNext, 2663). +-define(wxMDIParentFrame_ActivatePrevious, 2664). +-define(wxMDIParentFrame_ArrangeIcons, 2665). +-define(wxMDIParentFrame_Cascade, 2666). +-define(wxMDIParentFrame_Create, 2667). +-define(wxMDIParentFrame_GetActiveChild, 2668). +-define(wxMDIParentFrame_GetClientWindow, 2669). +-define(wxMDIParentFrame_Tile, 2670). +-define(wxMDIChildFrame_new_0, 2671). +-define(wxMDIChildFrame_new_4, 2672). +-define(wxMDIChildFrame_destruct, 2673). +-define(wxMDIChildFrame_Activate, 2674). +-define(wxMDIChildFrame_Create, 2675). +-define(wxMDIChildFrame_Maximize, 2676). +-define(wxMDIChildFrame_Restore, 2677). +-define(wxMDIClientWindow_new_0, 2678). +-define(wxMDIClientWindow_new_2, 2679). +-define(wxMDIClientWindow_destruct, 2680). +-define(wxMDIClientWindow_CreateClient, 2681). +-define(wxLayoutAlgorithm_new, 2682). +-define(wxLayoutAlgorithm_LayoutFrame, 2683). +-define(wxLayoutAlgorithm_LayoutMDIFrame, 2684). +-define(wxLayoutAlgorithm_LayoutWindow, 2685). +-define(wxLayoutAlgorithm_destroy, 2686). +-define(wxEvent_GetId, 2687). +-define(wxEvent_GetSkipped, 2688). +-define(wxEvent_GetTimestamp, 2689). +-define(wxEvent_IsCommandEvent, 2690). +-define(wxEvent_ResumePropagation, 2691). +-define(wxEvent_ShouldPropagate, 2692). +-define(wxEvent_Skip, 2693). +-define(wxEvent_StopPropagation, 2694). +-define(wxCommandEvent_getClientData, 2695). +-define(wxCommandEvent_GetExtraLong, 2696). +-define(wxCommandEvent_GetInt, 2697). +-define(wxCommandEvent_GetSelection, 2698). +-define(wxCommandEvent_GetString, 2699). +-define(wxCommandEvent_IsChecked, 2700). +-define(wxCommandEvent_IsSelection, 2701). +-define(wxCommandEvent_SetInt, 2702). +-define(wxCommandEvent_SetString, 2703). +-define(wxScrollEvent_GetOrientation, 2704). +-define(wxScrollEvent_GetPosition, 2705). +-define(wxScrollWinEvent_GetOrientation, 2706). +-define(wxScrollWinEvent_GetPosition, 2707). +-define(wxMouseEvent_AltDown, 2708). +-define(wxMouseEvent_Button, 2709). +-define(wxMouseEvent_ButtonDClick, 2710). +-define(wxMouseEvent_ButtonDown, 2711). +-define(wxMouseEvent_ButtonUp, 2712). +-define(wxMouseEvent_CmdDown, 2713). +-define(wxMouseEvent_ControlDown, 2714). +-define(wxMouseEvent_Dragging, 2715). +-define(wxMouseEvent_Entering, 2716). +-define(wxMouseEvent_GetButton, 2717). +-define(wxMouseEvent_GetPosition, 2720). +-define(wxMouseEvent_GetLogicalPosition, 2721). +-define(wxMouseEvent_GetLinesPerAction, 2722). +-define(wxMouseEvent_GetWheelRotation, 2723). +-define(wxMouseEvent_GetWheelDelta, 2724). +-define(wxMouseEvent_GetX, 2725). +-define(wxMouseEvent_GetY, 2726). +-define(wxMouseEvent_IsButton, 2727). +-define(wxMouseEvent_IsPageScroll, 2728). +-define(wxMouseEvent_Leaving, 2729). +-define(wxMouseEvent_LeftDClick, 2730). +-define(wxMouseEvent_LeftDown, 2731). +-define(wxMouseEvent_LeftIsDown, 2732). +-define(wxMouseEvent_LeftUp, 2733). +-define(wxMouseEvent_MetaDown, 2734). +-define(wxMouseEvent_MiddleDClick, 2735). +-define(wxMouseEvent_MiddleDown, 2736). +-define(wxMouseEvent_MiddleIsDown, 2737). +-define(wxMouseEvent_MiddleUp, 2738). +-define(wxMouseEvent_Moving, 2739). +-define(wxMouseEvent_RightDClick, 2740). +-define(wxMouseEvent_RightDown, 2741). +-define(wxMouseEvent_RightIsDown, 2742). +-define(wxMouseEvent_RightUp, 2743). +-define(wxMouseEvent_ShiftDown, 2744). +-define(wxSetCursorEvent_GetCursor, 2745). +-define(wxSetCursorEvent_GetX, 2746). +-define(wxSetCursorEvent_GetY, 2747). +-define(wxSetCursorEvent_HasCursor, 2748). +-define(wxSetCursorEvent_SetCursor, 2749). +-define(wxKeyEvent_AltDown, 2750). +-define(wxKeyEvent_CmdDown, 2751). +-define(wxKeyEvent_ControlDown, 2752). +-define(wxKeyEvent_GetKeyCode, 2753). +-define(wxKeyEvent_GetModifiers, 2754). +-define(wxKeyEvent_GetPosition, 2757). +-define(wxKeyEvent_GetRawKeyCode, 2758). +-define(wxKeyEvent_GetRawKeyFlags, 2759). +-define(wxKeyEvent_GetUnicodeKey, 2760). +-define(wxKeyEvent_GetX, 2761). +-define(wxKeyEvent_GetY, 2762). +-define(wxKeyEvent_HasModifiers, 2763). +-define(wxKeyEvent_MetaDown, 2764). +-define(wxKeyEvent_ShiftDown, 2765). +-define(wxSizeEvent_GetSize, 2766). +-define(wxMoveEvent_GetPosition, 2767). +-define(wxEraseEvent_GetDC, 2768). +-define(wxFocusEvent_GetWindow, 2769). +-define(wxChildFocusEvent_GetWindow, 2770). +-define(wxMenuEvent_GetMenu, 2771). +-define(wxMenuEvent_GetMenuId, 2772). +-define(wxMenuEvent_IsPopup, 2773). +-define(wxCloseEvent_CanVeto, 2774). +-define(wxCloseEvent_GetLoggingOff, 2775). +-define(wxCloseEvent_SetCanVeto, 2776). +-define(wxCloseEvent_SetLoggingOff, 2777). +-define(wxCloseEvent_Veto, 2778). +-define(wxShowEvent_SetShow, 2779). +-define(wxShowEvent_GetShow, 2780). +-define(wxIconizeEvent_Iconized, 2781). +-define(wxJoystickEvent_ButtonDown, 2782). +-define(wxJoystickEvent_ButtonIsDown, 2783). +-define(wxJoystickEvent_ButtonUp, 2784). +-define(wxJoystickEvent_GetButtonChange, 2785). +-define(wxJoystickEvent_GetButtonState, 2786). +-define(wxJoystickEvent_GetJoystick, 2787). +-define(wxJoystickEvent_GetPosition, 2788). +-define(wxJoystickEvent_GetZPosition, 2789). +-define(wxJoystickEvent_IsButton, 2790). +-define(wxJoystickEvent_IsMove, 2791). +-define(wxJoystickEvent_IsZMove, 2792). +-define(wxUpdateUIEvent_CanUpdate, 2793). +-define(wxUpdateUIEvent_Check, 2794). +-define(wxUpdateUIEvent_Enable, 2795). +-define(wxUpdateUIEvent_Show, 2796). +-define(wxUpdateUIEvent_GetChecked, 2797). +-define(wxUpdateUIEvent_GetEnabled, 2798). +-define(wxUpdateUIEvent_GetShown, 2799). +-define(wxUpdateUIEvent_GetSetChecked, 2800). +-define(wxUpdateUIEvent_GetSetEnabled, 2801). +-define(wxUpdateUIEvent_GetSetShown, 2802). +-define(wxUpdateUIEvent_GetSetText, 2803). +-define(wxUpdateUIEvent_GetText, 2804). +-define(wxUpdateUIEvent_GetMode, 2805). +-define(wxUpdateUIEvent_GetUpdateInterval, 2806). +-define(wxUpdateUIEvent_ResetUpdateTime, 2807). +-define(wxUpdateUIEvent_SetMode, 2808). +-define(wxUpdateUIEvent_SetText, 2809). +-define(wxUpdateUIEvent_SetUpdateInterval, 2810). +-define(wxMouseCaptureChangedEvent_GetCapturedWindow, 2811). +-define(wxPaletteChangedEvent_SetChangedWindow, 2812). +-define(wxPaletteChangedEvent_GetChangedWindow, 2813). +-define(wxQueryNewPaletteEvent_SetPaletteRealized, 2814). +-define(wxQueryNewPaletteEvent_GetPaletteRealized, 2815). +-define(wxNavigationKeyEvent_GetDirection, 2816). +-define(wxNavigationKeyEvent_SetDirection, 2817). +-define(wxNavigationKeyEvent_IsWindowChange, 2818). +-define(wxNavigationKeyEvent_SetWindowChange, 2819). +-define(wxNavigationKeyEvent_IsFromTab, 2820). +-define(wxNavigationKeyEvent_SetFromTab, 2821). +-define(wxNavigationKeyEvent_GetCurrentFocus, 2822). +-define(wxNavigationKeyEvent_SetCurrentFocus, 2823). +-define(wxHelpEvent_GetOrigin, 2824). +-define(wxHelpEvent_GetPosition, 2825). +-define(wxHelpEvent_SetOrigin, 2826). +-define(wxHelpEvent_SetPosition, 2827). +-define(wxContextMenuEvent_GetPosition, 2828). +-define(wxContextMenuEvent_SetPosition, 2829). +-define(wxIdleEvent_CanSend, 2830). +-define(wxIdleEvent_GetMode, 2831). +-define(wxIdleEvent_RequestMore, 2832). +-define(wxIdleEvent_MoreRequested, 2833). +-define(wxIdleEvent_SetMode, 2834). +-define(wxGridEvent_AltDown, 2835). +-define(wxGridEvent_ControlDown, 2836). +-define(wxGridEvent_GetCol, 2837). +-define(wxGridEvent_GetPosition, 2838). +-define(wxGridEvent_GetRow, 2839). +-define(wxGridEvent_MetaDown, 2840). +-define(wxGridEvent_Selecting, 2841). +-define(wxGridEvent_ShiftDown, 2842). +-define(wxNotifyEvent_Allow, 2843). +-define(wxNotifyEvent_IsAllowed, 2844). +-define(wxNotifyEvent_Veto, 2845). +-define(wxSashEvent_GetEdge, 2846). +-define(wxSashEvent_GetDragRect, 2847). +-define(wxSashEvent_GetDragStatus, 2848). +-define(wxListEvent_GetCacheFrom, 2849). +-define(wxListEvent_GetCacheTo, 2850). +-define(wxListEvent_GetKeyCode, 2851). +-define(wxListEvent_GetIndex, 2852). +-define(wxListEvent_GetColumn, 2853). +-define(wxListEvent_GetPoint, 2854). +-define(wxListEvent_GetLabel, 2855). +-define(wxListEvent_GetText, 2856). +-define(wxListEvent_GetImage, 2857). +-define(wxListEvent_GetData, 2858). +-define(wxListEvent_GetMask, 2859). +-define(wxListEvent_GetItem, 2860). +-define(wxListEvent_IsEditCancelled, 2861). +-define(wxDateEvent_GetDate, 2862). +-define(wxCalendarEvent_GetWeekDay, 2863). +-define(wxFileDirPickerEvent_GetPath, 2864). +-define(wxColourPickerEvent_GetColour, 2865). +-define(wxFontPickerEvent_GetFont, 2866). +-define(wxStyledTextEvent_GetPosition, 2867). +-define(wxStyledTextEvent_GetKey, 2868). +-define(wxStyledTextEvent_GetModifiers, 2869). +-define(wxStyledTextEvent_GetModificationType, 2870). +-define(wxStyledTextEvent_GetText, 2871). +-define(wxStyledTextEvent_GetLength, 2872). +-define(wxStyledTextEvent_GetLinesAdded, 2873). +-define(wxStyledTextEvent_GetLine, 2874). +-define(wxStyledTextEvent_GetFoldLevelNow, 2875). +-define(wxStyledTextEvent_GetFoldLevelPrev, 2876). +-define(wxStyledTextEvent_GetMargin, 2877). +-define(wxStyledTextEvent_GetMessage, 2878). +-define(wxStyledTextEvent_GetWParam, 2879). +-define(wxStyledTextEvent_GetLParam, 2880). +-define(wxStyledTextEvent_GetListType, 2881). +-define(wxStyledTextEvent_GetX, 2882). +-define(wxStyledTextEvent_GetY, 2883). +-define(wxStyledTextEvent_GetDragText, 2884). +-define(wxStyledTextEvent_GetDragAllowMove, 2885). +-define(wxStyledTextEvent_GetDragResult, 2886). +-define(wxStyledTextEvent_GetShift, 2887). +-define(wxStyledTextEvent_GetControl, 2888). +-define(wxStyledTextEvent_GetAlt, 2889). +-define(utils_wxGetKeyState, 2890). +-define(utils_wxGetMousePosition, 2891). +-define(utils_wxGetMouseState, 2892). +-define(utils_wxSetDetectableAutoRepeat, 2893). +-define(utils_wxBell, 2894). +-define(utils_wxFindMenuItemId, 2895). +-define(utils_wxGenericFindWindowAtPoint, 2896). +-define(utils_wxFindWindowAtPoint, 2897). +-define(utils_wxBeginBusyCursor, 2898). +-define(utils_wxEndBusyCursor, 2899). +-define(utils_wxIsBusy, 2900). +-define(utils_wxShutdown, 2901). +-define(utils_wxShell, 2902). +-define(utils_wxLaunchDefaultBrowser, 2903). +-define(utils_wxGetEmailAddress, 2904). +-define(utils_wxGetUserId, 2905). +-define(utils_wxGetHomeDir, 2906). +-define(utils_wxNewId, 2907). +-define(utils_wxRegisterId, 2908). +-define(utils_wxGetCurrentId, 2909). +-define(utils_wxGetOsDescription, 2910). +-define(utils_wxIsPlatformLittleEndian, 2911). +-define(utils_wxIsPlatform64Bit, 2912). +-define(wxPrintout_new, 2913). +-define(wxPrintout_destruct, 2914). +-define(wxPrintout_GetDC, 2915). +-define(wxPrintout_GetPageSizeMM, 2916). +-define(wxPrintout_GetPageSizePixels, 2917). +-define(wxPrintout_GetPaperRectPixels, 2918). +-define(wxPrintout_GetPPIPrinter, 2919). +-define(wxPrintout_GetPPIScreen, 2920). +-define(wxPrintout_GetTitle, 2921). +-define(wxPrintout_IsPreview, 2922). +-define(wxPrintout_FitThisSizeToPaper, 2923). +-define(wxPrintout_FitThisSizeToPage, 2924). +-define(wxPrintout_FitThisSizeToPageMargins, 2925). +-define(wxPrintout_MapScreenSizeToPaper, 2926). +-define(wxPrintout_MapScreenSizeToPage, 2927). +-define(wxPrintout_MapScreenSizeToPageMargins, 2928). +-define(wxPrintout_MapScreenSizeToDevice, 2929). +-define(wxPrintout_GetLogicalPaperRect, 2930). +-define(wxPrintout_GetLogicalPageRect, 2931). +-define(wxPrintout_GetLogicalPageMarginsRect, 2932). +-define(wxPrintout_SetLogicalOrigin, 2933). +-define(wxPrintout_OffsetLogicalOrigin, 2934). +-define(wxStyledTextCtrl_new_2, 2935). +-define(wxStyledTextCtrl_new_0, 2936). +-define(wxStyledTextCtrl_destruct, 2937). +-define(wxStyledTextCtrl_Create, 2938). +-define(wxStyledTextCtrl_AddText, 2939). +-define(wxStyledTextCtrl_AddStyledText, 2940). +-define(wxStyledTextCtrl_InsertText, 2941). +-define(wxStyledTextCtrl_ClearAll, 2942). +-define(wxStyledTextCtrl_ClearDocumentStyle, 2943). +-define(wxStyledTextCtrl_GetLength, 2944). +-define(wxStyledTextCtrl_GetCharAt, 2945). +-define(wxStyledTextCtrl_GetCurrentPos, 2946). +-define(wxStyledTextCtrl_GetAnchor, 2947). +-define(wxStyledTextCtrl_GetStyleAt, 2948). +-define(wxStyledTextCtrl_Redo, 2949). +-define(wxStyledTextCtrl_SetUndoCollection, 2950). +-define(wxStyledTextCtrl_SelectAll, 2951). +-define(wxStyledTextCtrl_SetSavePoint, 2952). +-define(wxStyledTextCtrl_GetStyledText, 2953). +-define(wxStyledTextCtrl_CanRedo, 2954). +-define(wxStyledTextCtrl_MarkerLineFromHandle, 2955). +-define(wxStyledTextCtrl_MarkerDeleteHandle, 2956). +-define(wxStyledTextCtrl_GetUndoCollection, 2957). +-define(wxStyledTextCtrl_GetViewWhiteSpace, 2958). +-define(wxStyledTextCtrl_SetViewWhiteSpace, 2959). +-define(wxStyledTextCtrl_PositionFromPoint, 2960). +-define(wxStyledTextCtrl_PositionFromPointClose, 2961). +-define(wxStyledTextCtrl_GotoLine, 2962). +-define(wxStyledTextCtrl_GotoPos, 2963). +-define(wxStyledTextCtrl_SetAnchor, 2964). +-define(wxStyledTextCtrl_GetCurLine, 2965). +-define(wxStyledTextCtrl_GetEndStyled, 2966). +-define(wxStyledTextCtrl_ConvertEOLs, 2967). +-define(wxStyledTextCtrl_GetEOLMode, 2968). +-define(wxStyledTextCtrl_SetEOLMode, 2969). +-define(wxStyledTextCtrl_StartStyling, 2970). +-define(wxStyledTextCtrl_SetStyling, 2971). +-define(wxStyledTextCtrl_GetBufferedDraw, 2972). +-define(wxStyledTextCtrl_SetBufferedDraw, 2973). +-define(wxStyledTextCtrl_SetTabWidth, 2974). +-define(wxStyledTextCtrl_GetTabWidth, 2975). +-define(wxStyledTextCtrl_SetCodePage, 2976). +-define(wxStyledTextCtrl_MarkerDefine, 2977). +-define(wxStyledTextCtrl_MarkerSetForeground, 2978). +-define(wxStyledTextCtrl_MarkerSetBackground, 2979). +-define(wxStyledTextCtrl_MarkerAdd, 2980). +-define(wxStyledTextCtrl_MarkerDelete, 2981). +-define(wxStyledTextCtrl_MarkerDeleteAll, 2982). +-define(wxStyledTextCtrl_MarkerGet, 2983). +-define(wxStyledTextCtrl_MarkerNext, 2984). +-define(wxStyledTextCtrl_MarkerPrevious, 2985). +-define(wxStyledTextCtrl_MarkerDefineBitmap, 2986). +-define(wxStyledTextCtrl_MarkerAddSet, 2987). +-define(wxStyledTextCtrl_MarkerSetAlpha, 2988). +-define(wxStyledTextCtrl_SetMarginType, 2989). +-define(wxStyledTextCtrl_GetMarginType, 2990). +-define(wxStyledTextCtrl_SetMarginWidth, 2991). +-define(wxStyledTextCtrl_GetMarginWidth, 2992). +-define(wxStyledTextCtrl_SetMarginMask, 2993). +-define(wxStyledTextCtrl_GetMarginMask, 2994). +-define(wxStyledTextCtrl_SetMarginSensitive, 2995). +-define(wxStyledTextCtrl_GetMarginSensitive, 2996). +-define(wxStyledTextCtrl_StyleClearAll, 2997). +-define(wxStyledTextCtrl_StyleSetForeground, 2998). +-define(wxStyledTextCtrl_StyleSetBackground, 2999). +-define(wxStyledTextCtrl_StyleSetBold, 3000). +-define(wxStyledTextCtrl_StyleSetItalic, 3001). +-define(wxStyledTextCtrl_StyleSetSize, 3002). +-define(wxStyledTextCtrl_StyleSetFaceName, 3003). +-define(wxStyledTextCtrl_StyleSetEOLFilled, 3004). +-define(wxStyledTextCtrl_StyleResetDefault, 3005). +-define(wxStyledTextCtrl_StyleSetUnderline, 3006). +-define(wxStyledTextCtrl_StyleSetCase, 3007). +-define(wxStyledTextCtrl_StyleSetHotSpot, 3008). +-define(wxStyledTextCtrl_SetSelForeground, 3009). +-define(wxStyledTextCtrl_SetSelBackground, 3010). +-define(wxStyledTextCtrl_GetSelAlpha, 3011). +-define(wxStyledTextCtrl_SetSelAlpha, 3012). +-define(wxStyledTextCtrl_SetCaretForeground, 3013). +-define(wxStyledTextCtrl_CmdKeyAssign, 3014). +-define(wxStyledTextCtrl_CmdKeyClear, 3015). +-define(wxStyledTextCtrl_CmdKeyClearAll, 3016). +-define(wxStyledTextCtrl_SetStyleBytes, 3017). +-define(wxStyledTextCtrl_StyleSetVisible, 3018). +-define(wxStyledTextCtrl_GetCaretPeriod, 3019). +-define(wxStyledTextCtrl_SetCaretPeriod, 3020). +-define(wxStyledTextCtrl_SetWordChars, 3021). +-define(wxStyledTextCtrl_BeginUndoAction, 3022). +-define(wxStyledTextCtrl_EndUndoAction, 3023). +-define(wxStyledTextCtrl_IndicatorSetStyle, 3024). +-define(wxStyledTextCtrl_IndicatorGetStyle, 3025). +-define(wxStyledTextCtrl_IndicatorSetForeground, 3026). +-define(wxStyledTextCtrl_IndicatorGetForeground, 3027). +-define(wxStyledTextCtrl_SetWhitespaceForeground, 3028). +-define(wxStyledTextCtrl_SetWhitespaceBackground, 3029). +-define(wxStyledTextCtrl_GetStyleBits, 3030). +-define(wxStyledTextCtrl_SetLineState, 3031). +-define(wxStyledTextCtrl_GetLineState, 3032). +-define(wxStyledTextCtrl_GetMaxLineState, 3033). +-define(wxStyledTextCtrl_GetCaretLineVisible, 3034). +-define(wxStyledTextCtrl_SetCaretLineVisible, 3035). +-define(wxStyledTextCtrl_GetCaretLineBackground, 3036). +-define(wxStyledTextCtrl_SetCaretLineBackground, 3037). +-define(wxStyledTextCtrl_AutoCompShow, 3038). +-define(wxStyledTextCtrl_AutoCompCancel, 3039). +-define(wxStyledTextCtrl_AutoCompActive, 3040). +-define(wxStyledTextCtrl_AutoCompPosStart, 3041). +-define(wxStyledTextCtrl_AutoCompComplete, 3042). +-define(wxStyledTextCtrl_AutoCompStops, 3043). +-define(wxStyledTextCtrl_AutoCompSetSeparator, 3044). +-define(wxStyledTextCtrl_AutoCompGetSeparator, 3045). +-define(wxStyledTextCtrl_AutoCompSelect, 3046). +-define(wxStyledTextCtrl_AutoCompSetCancelAtStart, 3047). +-define(wxStyledTextCtrl_AutoCompGetCancelAtStart, 3048). +-define(wxStyledTextCtrl_AutoCompSetFillUps, 3049). +-define(wxStyledTextCtrl_AutoCompSetChooseSingle, 3050). +-define(wxStyledTextCtrl_AutoCompGetChooseSingle, 3051). +-define(wxStyledTextCtrl_AutoCompSetIgnoreCase, 3052). +-define(wxStyledTextCtrl_AutoCompGetIgnoreCase, 3053). +-define(wxStyledTextCtrl_UserListShow, 3054). +-define(wxStyledTextCtrl_AutoCompSetAutoHide, 3055). +-define(wxStyledTextCtrl_AutoCompGetAutoHide, 3056). +-define(wxStyledTextCtrl_AutoCompSetDropRestOfWord, 3057). +-define(wxStyledTextCtrl_AutoCompGetDropRestOfWord, 3058). +-define(wxStyledTextCtrl_RegisterImage, 3059). +-define(wxStyledTextCtrl_ClearRegisteredImages, 3060). +-define(wxStyledTextCtrl_AutoCompGetTypeSeparator, 3061). +-define(wxStyledTextCtrl_AutoCompSetTypeSeparator, 3062). +-define(wxStyledTextCtrl_AutoCompSetMaxWidth, 3063). +-define(wxStyledTextCtrl_AutoCompGetMaxWidth, 3064). +-define(wxStyledTextCtrl_AutoCompSetMaxHeight, 3065). +-define(wxStyledTextCtrl_AutoCompGetMaxHeight, 3066). +-define(wxStyledTextCtrl_SetIndent, 3067). +-define(wxStyledTextCtrl_GetIndent, 3068). +-define(wxStyledTextCtrl_SetUseTabs, 3069). +-define(wxStyledTextCtrl_GetUseTabs, 3070). +-define(wxStyledTextCtrl_SetLineIndentation, 3071). +-define(wxStyledTextCtrl_GetLineIndentation, 3072). +-define(wxStyledTextCtrl_GetLineIndentPosition, 3073). +-define(wxStyledTextCtrl_GetColumn, 3074). +-define(wxStyledTextCtrl_SetUseHorizontalScrollBar, 3075). +-define(wxStyledTextCtrl_GetUseHorizontalScrollBar, 3076). +-define(wxStyledTextCtrl_SetIndentationGuides, 3077). +-define(wxStyledTextCtrl_GetIndentationGuides, 3078). +-define(wxStyledTextCtrl_SetHighlightGuide, 3079). +-define(wxStyledTextCtrl_GetHighlightGuide, 3080). +-define(wxStyledTextCtrl_GetLineEndPosition, 3081). +-define(wxStyledTextCtrl_GetCodePage, 3082). +-define(wxStyledTextCtrl_GetCaretForeground, 3083). +-define(wxStyledTextCtrl_GetReadOnly, 3084). +-define(wxStyledTextCtrl_SetCurrentPos, 3085). +-define(wxStyledTextCtrl_SetSelectionStart, 3086). +-define(wxStyledTextCtrl_GetSelectionStart, 3087). +-define(wxStyledTextCtrl_SetSelectionEnd, 3088). +-define(wxStyledTextCtrl_GetSelectionEnd, 3089). +-define(wxStyledTextCtrl_SetPrintMagnification, 3090). +-define(wxStyledTextCtrl_GetPrintMagnification, 3091). +-define(wxStyledTextCtrl_SetPrintColourMode, 3092). +-define(wxStyledTextCtrl_GetPrintColourMode, 3093). +-define(wxStyledTextCtrl_FindText, 3094). +-define(wxStyledTextCtrl_FormatRange, 3095). +-define(wxStyledTextCtrl_GetFirstVisibleLine, 3096). +-define(wxStyledTextCtrl_GetLine, 3097). +-define(wxStyledTextCtrl_GetLineCount, 3098). +-define(wxStyledTextCtrl_SetMarginLeft, 3099). +-define(wxStyledTextCtrl_GetMarginLeft, 3100). +-define(wxStyledTextCtrl_SetMarginRight, 3101). +-define(wxStyledTextCtrl_GetMarginRight, 3102). +-define(wxStyledTextCtrl_GetModify, 3103). +-define(wxStyledTextCtrl_SetSelection, 3104). +-define(wxStyledTextCtrl_GetSelectedText, 3105). +-define(wxStyledTextCtrl_GetTextRange, 3106). +-define(wxStyledTextCtrl_HideSelection, 3107). +-define(wxStyledTextCtrl_LineFromPosition, 3108). +-define(wxStyledTextCtrl_PositionFromLine, 3109). +-define(wxStyledTextCtrl_LineScroll, 3110). +-define(wxStyledTextCtrl_EnsureCaretVisible, 3111). +-define(wxStyledTextCtrl_ReplaceSelection, 3112). +-define(wxStyledTextCtrl_SetReadOnly, 3113). +-define(wxStyledTextCtrl_CanPaste, 3114). +-define(wxStyledTextCtrl_CanUndo, 3115). +-define(wxStyledTextCtrl_EmptyUndoBuffer, 3116). +-define(wxStyledTextCtrl_Undo, 3117). +-define(wxStyledTextCtrl_Cut, 3118). +-define(wxStyledTextCtrl_Copy, 3119). +-define(wxStyledTextCtrl_Paste, 3120). +-define(wxStyledTextCtrl_Clear, 3121). +-define(wxStyledTextCtrl_SetText, 3122). +-define(wxStyledTextCtrl_GetText, 3123). +-define(wxStyledTextCtrl_GetTextLength, 3124). +-define(wxStyledTextCtrl_GetOvertype, 3125). +-define(wxStyledTextCtrl_SetCaretWidth, 3126). +-define(wxStyledTextCtrl_GetCaretWidth, 3127). +-define(wxStyledTextCtrl_SetTargetStart, 3128). +-define(wxStyledTextCtrl_GetTargetStart, 3129). +-define(wxStyledTextCtrl_SetTargetEnd, 3130). +-define(wxStyledTextCtrl_GetTargetEnd, 3131). +-define(wxStyledTextCtrl_ReplaceTarget, 3132). +-define(wxStyledTextCtrl_SearchInTarget, 3133). +-define(wxStyledTextCtrl_SetSearchFlags, 3134). +-define(wxStyledTextCtrl_GetSearchFlags, 3135). +-define(wxStyledTextCtrl_CallTipShow, 3136). +-define(wxStyledTextCtrl_CallTipCancel, 3137). +-define(wxStyledTextCtrl_CallTipActive, 3138). +-define(wxStyledTextCtrl_CallTipPosAtStart, 3139). +-define(wxStyledTextCtrl_CallTipSetHighlight, 3140). +-define(wxStyledTextCtrl_CallTipSetBackground, 3141). +-define(wxStyledTextCtrl_CallTipSetForeground, 3142). +-define(wxStyledTextCtrl_CallTipSetForegroundHighlight, 3143). +-define(wxStyledTextCtrl_CallTipUseStyle, 3144). +-define(wxStyledTextCtrl_VisibleFromDocLine, 3145). +-define(wxStyledTextCtrl_DocLineFromVisible, 3146). +-define(wxStyledTextCtrl_WrapCount, 3147). +-define(wxStyledTextCtrl_SetFoldLevel, 3148). +-define(wxStyledTextCtrl_GetFoldLevel, 3149). +-define(wxStyledTextCtrl_GetLastChild, 3150). +-define(wxStyledTextCtrl_GetFoldParent, 3151). +-define(wxStyledTextCtrl_ShowLines, 3152). +-define(wxStyledTextCtrl_HideLines, 3153). +-define(wxStyledTextCtrl_GetLineVisible, 3154). +-define(wxStyledTextCtrl_SetFoldExpanded, 3155). +-define(wxStyledTextCtrl_GetFoldExpanded, 3156). +-define(wxStyledTextCtrl_ToggleFold, 3157). +-define(wxStyledTextCtrl_EnsureVisible, 3158). +-define(wxStyledTextCtrl_SetFoldFlags, 3159). +-define(wxStyledTextCtrl_EnsureVisibleEnforcePolicy, 3160). +-define(wxStyledTextCtrl_SetTabIndents, 3161). +-define(wxStyledTextCtrl_GetTabIndents, 3162). +-define(wxStyledTextCtrl_SetBackSpaceUnIndents, 3163). +-define(wxStyledTextCtrl_GetBackSpaceUnIndents, 3164). +-define(wxStyledTextCtrl_SetMouseDwellTime, 3165). +-define(wxStyledTextCtrl_GetMouseDwellTime, 3166). +-define(wxStyledTextCtrl_WordStartPosition, 3167). +-define(wxStyledTextCtrl_WordEndPosition, 3168). +-define(wxStyledTextCtrl_SetWrapMode, 3169). +-define(wxStyledTextCtrl_GetWrapMode, 3170). +-define(wxStyledTextCtrl_SetWrapVisualFlags, 3171). +-define(wxStyledTextCtrl_GetWrapVisualFlags, 3172). +-define(wxStyledTextCtrl_SetWrapVisualFlagsLocation, 3173). +-define(wxStyledTextCtrl_GetWrapVisualFlagsLocation, 3174). +-define(wxStyledTextCtrl_SetWrapStartIndent, 3175). +-define(wxStyledTextCtrl_GetWrapStartIndent, 3176). +-define(wxStyledTextCtrl_SetLayoutCache, 3177). +-define(wxStyledTextCtrl_GetLayoutCache, 3178). +-define(wxStyledTextCtrl_SetScrollWidth, 3179). +-define(wxStyledTextCtrl_GetScrollWidth, 3180). +-define(wxStyledTextCtrl_TextWidth, 3181). +-define(wxStyledTextCtrl_GetEndAtLastLine, 3182). +-define(wxStyledTextCtrl_TextHeight, 3183). +-define(wxStyledTextCtrl_SetUseVerticalScrollBar, 3184). +-define(wxStyledTextCtrl_GetUseVerticalScrollBar, 3185). +-define(wxStyledTextCtrl_AppendText, 3186). +-define(wxStyledTextCtrl_GetTwoPhaseDraw, 3187). +-define(wxStyledTextCtrl_SetTwoPhaseDraw, 3188). +-define(wxStyledTextCtrl_TargetFromSelection, 3189). +-define(wxStyledTextCtrl_LinesJoin, 3190). +-define(wxStyledTextCtrl_LinesSplit, 3191). +-define(wxStyledTextCtrl_SetFoldMarginColour, 3192). +-define(wxStyledTextCtrl_SetFoldMarginHiColour, 3193). +-define(wxStyledTextCtrl_LineDown, 3194). +-define(wxStyledTextCtrl_LineDownExtend, 3195). +-define(wxStyledTextCtrl_LineUp, 3196). +-define(wxStyledTextCtrl_LineUpExtend, 3197). +-define(wxStyledTextCtrl_CharLeft, 3198). +-define(wxStyledTextCtrl_CharLeftExtend, 3199). +-define(wxStyledTextCtrl_CharRight, 3200). +-define(wxStyledTextCtrl_CharRightExtend, 3201). +-define(wxStyledTextCtrl_WordLeft, 3202). +-define(wxStyledTextCtrl_WordLeftExtend, 3203). +-define(wxStyledTextCtrl_WordRight, 3204). +-define(wxStyledTextCtrl_WordRightExtend, 3205). +-define(wxStyledTextCtrl_Home, 3206). +-define(wxStyledTextCtrl_HomeExtend, 3207). +-define(wxStyledTextCtrl_LineEnd, 3208). +-define(wxStyledTextCtrl_LineEndExtend, 3209). +-define(wxStyledTextCtrl_DocumentStart, 3210). +-define(wxStyledTextCtrl_DocumentStartExtend, 3211). +-define(wxStyledTextCtrl_DocumentEnd, 3212). +-define(wxStyledTextCtrl_DocumentEndExtend, 3213). +-define(wxStyledTextCtrl_PageUp, 3214). +-define(wxStyledTextCtrl_PageUpExtend, 3215). +-define(wxStyledTextCtrl_PageDown, 3216). +-define(wxStyledTextCtrl_PageDownExtend, 3217). +-define(wxStyledTextCtrl_EditToggleOvertype, 3218). +-define(wxStyledTextCtrl_Cancel, 3219). +-define(wxStyledTextCtrl_DeleteBack, 3220). +-define(wxStyledTextCtrl_Tab, 3221). +-define(wxStyledTextCtrl_BackTab, 3222). +-define(wxStyledTextCtrl_NewLine, 3223). +-define(wxStyledTextCtrl_FormFeed, 3224). +-define(wxStyledTextCtrl_VCHome, 3225). +-define(wxStyledTextCtrl_VCHomeExtend, 3226). +-define(wxStyledTextCtrl_ZoomIn, 3227). +-define(wxStyledTextCtrl_ZoomOut, 3228). +-define(wxStyledTextCtrl_DelWordLeft, 3229). +-define(wxStyledTextCtrl_DelWordRight, 3230). +-define(wxStyledTextCtrl_LineCut, 3231). +-define(wxStyledTextCtrl_LineDelete, 3232). +-define(wxStyledTextCtrl_LineTranspose, 3233). +-define(wxStyledTextCtrl_LineDuplicate, 3234). +-define(wxStyledTextCtrl_LowerCase, 3235). +-define(wxStyledTextCtrl_UpperCase, 3236). +-define(wxStyledTextCtrl_LineScrollDown, 3237). +-define(wxStyledTextCtrl_LineScrollUp, 3238). +-define(wxStyledTextCtrl_DeleteBackNotLine, 3239). +-define(wxStyledTextCtrl_HomeDisplay, 3240). +-define(wxStyledTextCtrl_HomeDisplayExtend, 3241). +-define(wxStyledTextCtrl_LineEndDisplay, 3242). +-define(wxStyledTextCtrl_LineEndDisplayExtend, 3243). +-define(wxStyledTextCtrl_HomeWrapExtend, 3244). +-define(wxStyledTextCtrl_LineEndWrap, 3245). +-define(wxStyledTextCtrl_LineEndWrapExtend, 3246). +-define(wxStyledTextCtrl_VCHomeWrap, 3247). +-define(wxStyledTextCtrl_VCHomeWrapExtend, 3248). +-define(wxStyledTextCtrl_LineCopy, 3249). +-define(wxStyledTextCtrl_MoveCaretInsideView, 3250). +-define(wxStyledTextCtrl_LineLength, 3251). +-define(wxStyledTextCtrl_BraceHighlight, 3252). +-define(wxStyledTextCtrl_BraceBadLight, 3253). +-define(wxStyledTextCtrl_BraceMatch, 3254). +-define(wxStyledTextCtrl_GetViewEOL, 3255). +-define(wxStyledTextCtrl_SetViewEOL, 3256). +-define(wxStyledTextCtrl_SetModEventMask, 3257). +-define(wxStyledTextCtrl_GetEdgeColumn, 3258). +-define(wxStyledTextCtrl_SetEdgeColumn, 3259). +-define(wxStyledTextCtrl_GetEdgeMode, 3260). +-define(wxStyledTextCtrl_GetEdgeColour, 3261). +-define(wxStyledTextCtrl_SetEdgeColour, 3262). +-define(wxStyledTextCtrl_SearchAnchor, 3263). +-define(wxStyledTextCtrl_SearchNext, 3264). +-define(wxStyledTextCtrl_SearchPrev, 3265). +-define(wxStyledTextCtrl_LinesOnScreen, 3266). +-define(wxStyledTextCtrl_UsePopUp, 3267). +-define(wxStyledTextCtrl_SelectionIsRectangle, 3268). +-define(wxStyledTextCtrl_SetZoom, 3269). +-define(wxStyledTextCtrl_GetZoom, 3270). +-define(wxStyledTextCtrl_GetModEventMask, 3271). +-define(wxStyledTextCtrl_SetSTCFocus, 3272). +-define(wxStyledTextCtrl_GetSTCFocus, 3273). +-define(wxStyledTextCtrl_SetStatus, 3274). +-define(wxStyledTextCtrl_GetStatus, 3275). +-define(wxStyledTextCtrl_SetMouseDownCaptures, 3276). +-define(wxStyledTextCtrl_GetMouseDownCaptures, 3277). +-define(wxStyledTextCtrl_SetSTCCursor, 3278). +-define(wxStyledTextCtrl_GetSTCCursor, 3279). +-define(wxStyledTextCtrl_SetControlCharSymbol, 3280). +-define(wxStyledTextCtrl_GetControlCharSymbol, 3281). +-define(wxStyledTextCtrl_WordPartLeft, 3282). +-define(wxStyledTextCtrl_WordPartLeftExtend, 3283). +-define(wxStyledTextCtrl_WordPartRight, 3284). +-define(wxStyledTextCtrl_WordPartRightExtend, 3285). +-define(wxStyledTextCtrl_SetVisiblePolicy, 3286). +-define(wxStyledTextCtrl_DelLineLeft, 3287). +-define(wxStyledTextCtrl_DelLineRight, 3288). +-define(wxStyledTextCtrl_GetXOffset, 3289). +-define(wxStyledTextCtrl_ChooseCaretX, 3290). +-define(wxStyledTextCtrl_SetXCaretPolicy, 3291). +-define(wxStyledTextCtrl_SetYCaretPolicy, 3292). +-define(wxStyledTextCtrl_GetPrintWrapMode, 3293). +-define(wxStyledTextCtrl_SetHotspotActiveForeground, 3294). +-define(wxStyledTextCtrl_SetHotspotActiveBackground, 3295). +-define(wxStyledTextCtrl_SetHotspotActiveUnderline, 3296). +-define(wxStyledTextCtrl_SetHotspotSingleLine, 3297). +-define(wxStyledTextCtrl_ParaDownExtend, 3298). +-define(wxStyledTextCtrl_ParaUp, 3299). +-define(wxStyledTextCtrl_ParaUpExtend, 3300). +-define(wxStyledTextCtrl_PositionBefore, 3301). +-define(wxStyledTextCtrl_PositionAfter, 3302). +-define(wxStyledTextCtrl_CopyRange, 3303). +-define(wxStyledTextCtrl_CopyText, 3304). +-define(wxStyledTextCtrl_SetSelectionMode, 3305). +-define(wxStyledTextCtrl_GetSelectionMode, 3306). +-define(wxStyledTextCtrl_LineDownRectExtend, 3307). +-define(wxStyledTextCtrl_LineUpRectExtend, 3308). +-define(wxStyledTextCtrl_CharLeftRectExtend, 3309). +-define(wxStyledTextCtrl_CharRightRectExtend, 3310). +-define(wxStyledTextCtrl_HomeRectExtend, 3311). +-define(wxStyledTextCtrl_VCHomeRectExtend, 3312). +-define(wxStyledTextCtrl_LineEndRectExtend, 3313). +-define(wxStyledTextCtrl_PageUpRectExtend, 3314). +-define(wxStyledTextCtrl_PageDownRectExtend, 3315). +-define(wxStyledTextCtrl_StutteredPageUp, 3316). +-define(wxStyledTextCtrl_StutteredPageUpExtend, 3317). +-define(wxStyledTextCtrl_StutteredPageDown, 3318). +-define(wxStyledTextCtrl_StutteredPageDownExtend, 3319). +-define(wxStyledTextCtrl_WordLeftEnd, 3320). +-define(wxStyledTextCtrl_WordLeftEndExtend, 3321). +-define(wxStyledTextCtrl_WordRightEnd, 3322). +-define(wxStyledTextCtrl_WordRightEndExtend, 3323). +-define(wxStyledTextCtrl_SetWhitespaceChars, 3324). +-define(wxStyledTextCtrl_SetCharsDefault, 3325). +-define(wxStyledTextCtrl_AutoCompGetCurrent, 3326). +-define(wxStyledTextCtrl_Allocate, 3327). +-define(wxStyledTextCtrl_FindColumn, 3328). +-define(wxStyledTextCtrl_GetCaretSticky, 3329). +-define(wxStyledTextCtrl_SetCaretSticky, 3330). +-define(wxStyledTextCtrl_ToggleCaretSticky, 3331). +-define(wxStyledTextCtrl_SetPasteConvertEndings, 3332). +-define(wxStyledTextCtrl_GetPasteConvertEndings, 3333). +-define(wxStyledTextCtrl_SelectionDuplicate, 3334). +-define(wxStyledTextCtrl_SetCaretLineBackAlpha, 3335). +-define(wxStyledTextCtrl_GetCaretLineBackAlpha, 3336). +-define(wxStyledTextCtrl_StartRecord, 3337). +-define(wxStyledTextCtrl_StopRecord, 3338). +-define(wxStyledTextCtrl_SetLexer, 3339). +-define(wxStyledTextCtrl_GetLexer, 3340). +-define(wxStyledTextCtrl_Colourise, 3341). +-define(wxStyledTextCtrl_SetProperty, 3342). +-define(wxStyledTextCtrl_SetKeyWords, 3343). +-define(wxStyledTextCtrl_SetLexerLanguage, 3344). +-define(wxStyledTextCtrl_GetProperty, 3345). +-define(wxStyledTextCtrl_GetStyleBitsNeeded, 3346). +-define(wxStyledTextCtrl_GetCurrentLine, 3347). +-define(wxStyledTextCtrl_StyleSetSpec, 3348). +-define(wxStyledTextCtrl_StyleSetFont, 3349). +-define(wxStyledTextCtrl_StyleSetFontAttr, 3350). +-define(wxStyledTextCtrl_StyleSetCharacterSet, 3351). +-define(wxStyledTextCtrl_StyleSetFontEncoding, 3352). +-define(wxStyledTextCtrl_CmdKeyExecute, 3353). +-define(wxStyledTextCtrl_SetMargins, 3354). +-define(wxStyledTextCtrl_GetSelection, 3355). +-define(wxStyledTextCtrl_PointFromPosition, 3356). +-define(wxStyledTextCtrl_ScrollToLine, 3357). +-define(wxStyledTextCtrl_ScrollToColumn, 3358). +-define(wxStyledTextCtrl_SendMsg, 3359). +-define(wxStyledTextCtrl_SetVScrollBar, 3360). +-define(wxStyledTextCtrl_SetHScrollBar, 3361). +-define(wxStyledTextCtrl_GetLastKeydownProcessed, 3362). +-define(wxStyledTextCtrl_SetLastKeydownProcessed, 3363). +-define(wxStyledTextCtrl_SaveFile, 3364). +-define(wxStyledTextCtrl_LoadFile, 3365). +-define(wxStyledTextCtrl_DoDragOver, 3366). +-define(wxStyledTextCtrl_DoDropText, 3367). +-define(wxStyledTextCtrl_GetUseAntiAliasing, 3368). +-define(wxStyledTextCtrl_AddTextRaw, 3369). +-define(wxStyledTextCtrl_InsertTextRaw, 3370). +-define(wxStyledTextCtrl_GetCurLineRaw, 3371). +-define(wxStyledTextCtrl_GetLineRaw, 3372). +-define(wxStyledTextCtrl_GetSelectedTextRaw, 3373). +-define(wxStyledTextCtrl_GetTextRangeRaw, 3374). +-define(wxStyledTextCtrl_SetTextRaw, 3375). +-define(wxStyledTextCtrl_GetTextRaw, 3376). +-define(wxStyledTextCtrl_AppendTextRaw, 3377). +-define(wxArtProvider_GetBitmap, 3378). +-define(wxArtProvider_GetIcon, 3379). +-define(wxTreeEvent_GetKeyCode, 3380). +-define(wxTreeEvent_GetItem, 3381). +-define(wxTreeEvent_GetKeyEvent, 3382). +-define(wxTreeEvent_GetLabel, 3383). +-define(wxTreeEvent_GetOldItem, 3384). +-define(wxTreeEvent_GetPoint, 3385). +-define(wxTreeEvent_IsEditCancelled, 3386). +-define(wxTreeEvent_SetToolTip, 3387). +-define(wxNotebookEvent_GetOldSelection, 3388). +-define(wxNotebookEvent_GetSelection, 3389). +-define(wxNotebookEvent_SetOldSelection, 3390). +-define(wxNotebookEvent_SetSelection, 3391). +-define(wxFileDataObject_new, 3392). +-define(wxFileDataObject_AddFile, 3393). +-define(wxFileDataObject_GetFilenames, 3394). +-define(wxFileDataObject_destroy, 3395). +-define(wxTextDataObject_new, 3396). +-define(wxTextDataObject_GetTextLength, 3397). +-define(wxTextDataObject_GetText, 3398). +-define(wxTextDataObject_SetText, 3399). +-define(wxTextDataObject_destroy, 3400). +-define(wxBitmapDataObject_new_1_1, 3401). +-define(wxBitmapDataObject_new_1_0, 3402). +-define(wxBitmapDataObject_GetBitmap, 3403). +-define(wxBitmapDataObject_SetBitmap, 3404). +-define(wxBitmapDataObject_destroy, 3405). +-define(wxClipboard_new, 3407). +-define(wxClipboard_destruct, 3408). +-define(wxClipboard_AddData, 3409). +-define(wxClipboard_Clear, 3410). +-define(wxClipboard_Close, 3411). +-define(wxClipboard_Flush, 3412). +-define(wxClipboard_GetData, 3413). +-define(wxClipboard_IsOpened, 3414). +-define(wxClipboard_Open, 3415). +-define(wxClipboard_SetData, 3416). +-define(wxClipboard_UsePrimarySelection, 3418). +-define(wxClipboard_IsSupported, 3419). +-define(wxClipboard_Get, 3420). +-define(wxSpinEvent_GetPosition, 3421). +-define(wxSpinEvent_SetPosition, 3422). +-define(wxSplitterWindow_new_0, 3423). +-define(wxSplitterWindow_new_2, 3424). +-define(wxSplitterWindow_destruct, 3425). +-define(wxSplitterWindow_Create, 3426). +-define(wxSplitterWindow_GetMinimumPaneSize, 3427). +-define(wxSplitterWindow_GetSashGravity, 3428). +-define(wxSplitterWindow_GetSashPosition, 3429). +-define(wxSplitterWindow_GetSplitMode, 3430). +-define(wxSplitterWindow_GetWindow1, 3431). +-define(wxSplitterWindow_GetWindow2, 3432). +-define(wxSplitterWindow_Initialize, 3433). +-define(wxSplitterWindow_IsSplit, 3434). +-define(wxSplitterWindow_ReplaceWindow, 3435). +-define(wxSplitterWindow_SetSashGravity, 3436). +-define(wxSplitterWindow_SetSashPosition, 3437). +-define(wxSplitterWindow_SetSashSize, 3438). +-define(wxSplitterWindow_SetMinimumPaneSize, 3439). +-define(wxSplitterWindow_SetSplitMode, 3440). +-define(wxSplitterWindow_SplitHorizontally, 3441). +-define(wxSplitterWindow_SplitVertically, 3442). +-define(wxSplitterWindow_Unsplit, 3443). +-define(wxSplitterWindow_UpdateSize, 3444). +-define(wxSplitterEvent_GetSashPosition, 3445). +-define(wxSplitterEvent_GetX, 3446). +-define(wxSplitterEvent_GetY, 3447). +-define(wxSplitterEvent_GetWindowBeingRemoved, 3448). +-define(wxSplitterEvent_SetSashPosition, 3449). +-define(wxHtmlWindow_new_0, 3450). +-define(wxHtmlWindow_new_2, 3451). +-define(wxHtmlWindow_AppendToPage, 3452). +-define(wxHtmlWindow_GetOpenedAnchor, 3453). +-define(wxHtmlWindow_GetOpenedPage, 3454). +-define(wxHtmlWindow_GetOpenedPageTitle, 3455). +-define(wxHtmlWindow_GetRelatedFrame, 3456). +-define(wxHtmlWindow_HistoryBack, 3457). +-define(wxHtmlWindow_HistoryCanBack, 3458). +-define(wxHtmlWindow_HistoryCanForward, 3459). +-define(wxHtmlWindow_HistoryClear, 3460). +-define(wxHtmlWindow_HistoryForward, 3461). +-define(wxHtmlWindow_LoadFile, 3462). +-define(wxHtmlWindow_LoadPage, 3463). +-define(wxHtmlWindow_SelectAll, 3464). +-define(wxHtmlWindow_SelectionToText, 3465). +-define(wxHtmlWindow_SelectLine, 3466). +-define(wxHtmlWindow_SelectWord, 3467). +-define(wxHtmlWindow_SetBorders, 3468). +-define(wxHtmlWindow_SetFonts, 3469). +-define(wxHtmlWindow_SetPage, 3470). +-define(wxHtmlWindow_SetRelatedFrame, 3471). +-define(wxHtmlWindow_SetRelatedStatusBar, 3472). +-define(wxHtmlWindow_ToText, 3473). +-define(wxHtmlWindow_destroy, 3474). +-define(wxHtmlLinkEvent_GetLinkInfo, 3475). +-define(wxSystemSettings_GetColour, 3476). +-define(wxSystemSettings_GetFont, 3477). +-define(wxSystemSettings_GetMetric, 3478). +-define(wxSystemSettings_GetScreenType, 3479). +-define(wxAuiNotebookEvent_SetSelection, 3480). +-define(wxAuiNotebookEvent_GetSelection, 3481). +-define(wxAuiNotebookEvent_SetOldSelection, 3482). +-define(wxAuiNotebookEvent_GetOldSelection, 3483). +-define(wxAuiNotebookEvent_SetDragSource, 3484). +-define(wxAuiNotebookEvent_GetDragSource, 3485). +-define(wxAuiManagerEvent_SetManager, 3486). +-define(wxAuiManagerEvent_GetManager, 3487). +-define(wxAuiManagerEvent_SetPane, 3488). +-define(wxAuiManagerEvent_GetPane, 3489). +-define(wxAuiManagerEvent_SetButton, 3490). +-define(wxAuiManagerEvent_GetButton, 3491). +-define(wxAuiManagerEvent_SetDC, 3492). +-define(wxAuiManagerEvent_GetDC, 3493). +-define(wxAuiManagerEvent_Veto, 3494). +-define(wxAuiManagerEvent_GetVeto, 3495). +-define(wxAuiManagerEvent_SetCanVeto, 3496). +-define(wxAuiManagerEvent_CanVeto, 3497). +-define(wxLogNull_new, 3498). +-define(wxLogNull_destroy, 3499). diff --git a/lib/wx/test/wx_class_SUITE.erl b/lib/wx/test/wx_class_SUITE.erl index 76df6e4a23..6f43247d74 100644 --- a/lib/wx/test/wx_class_SUITE.erl +++ b/lib/wx/test/wx_class_SUITE.erl @@ -137,6 +137,9 @@ treeCtrl(Config) -> wxFrame:connect(Tree, command_tree_item_expanded), wxFrame:connect(Tree, command_tree_item_collapsed), wxFrame:connect(Frame, close_window), + + wxTreeCtrl:editLabel(Tree, Root), + wx_test_lib:wx_destroy(Frame,Config). diff --git a/lib/wx/vsn.mk b/lib/wx/vsn.mk index 4ed22d2256..c3ad3920a4 100644 --- a/lib/wx/vsn.mk +++ b/lib/wx/vsn.mk @@ -1,9 +1 @@ WX_VSN = 0.98.6 - -TICKETS = OTP-8656 - -TICKETS_0.98.5 = OTP-8330 OTP-8461 OTP-8408 OTP-8455 OTP-8462 -TICKETS_0.98.4 = OTP-8243 OTP-8250 OTP-8292 -TICKETS_0.98.3 = OTP-8138 OTP-8126 OTP-8083 -TICKETS_0.98.2 = OTP-7943 -TICKETS_0.98.1 = OTP-7875
\ No newline at end of file diff --git a/lib/xmerl/src/xmerl_dtd.erl b/lib/xmerl/src/xmerl_dtd.erl deleted file mode 100644 index e69de29bb2..0000000000 --- a/lib/xmerl/src/xmerl_dtd.erl +++ /dev/null diff --git a/lib/xmerl/vsn.mk b/lib/xmerl/vsn.mk index aee7546c3c..03d16ad6fe 100644 --- a/lib/xmerl/vsn.mk +++ b/lib/xmerl/vsn.mk @@ -1,130 +1 @@ -# -# %CopyrightBegin% -# -# Copyright Ericsson AB 2003-2010. All Rights Reserved. -# -# The contents of this file are subject to the Erlang Public License, -# Version 1.1, (the "License"); you may not use this file except in -# compliance with the License. You should have received a copy of the -# Erlang Public License along with this software. If not, it can be -# retrieved online at http://www.erlang.org/. -# -# Software distributed under the License is distributed on an "AS IS" -# basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See -# the License for the specific language governing rights and limitations -# under the License. -# -# %CopyrightEnd% -# - XMERL_VSN = 1.2.5 - - -TICKETS = \ - OTP-8537 \ - OTP-8599 - -TICKETS_1.2.5 = \ - OTP-8537 - -TICKETS_1.2.4 = \ - OTP-8343 - -TICKETS_1.2.3 = \ - OTP-8251 \ - OTP-8252 \ - OTP-8253 - -TICKETS_1.2.2 = \ - OTP-8213 \ - OTP-8214 - -TICKETS_1.2.1 = \ - OTP-8084 \ - OTP-8153 \ - OTP-8156 - -TICKETS_1.2 = \ - OTP-6635 - -TICKETS_1.1.12 = \ - OTP-7847 - -TICKETS_1.1.11 = \ - OTP-7736 - -TICKETS_1.1.10 = \ - OTP-6053 \ - OTP-6873 \ - OTP-7430 \ - OTP-7473 \ - OTP-7496 - -TICKETS_1.1.9 = \ - OTP-5998 \ - OTP-6947 \ - OTP-7288 - -TICKETS_1.1.8 = \ - OTP-7211 \ - OTP-7214 - -TICKETS_1.1.7 = \ - OTP-7190 - -TICKETS_1.1.6 = \ - OTP-6773 \ - OTP-6777 \ - OTP-6877 \ - OTP-6910 - -TICKETS_1.1.5 = \ - OTP-6720 \ - OTP-6739 \ - OTP-6752 - -TICKETS_1.1.4 = \ - OTP-6679 - -TICKETS_1.1.3 = \ - OTP-6599 - -TICKETS_1.1.2 = \ - OTP-6507 \ - OTP-6460 - -TICKETS_1.1.1 = \ - OTP-6402 - -TICKETS_1.1 = \ - OTP-6043 \ - OTP-6099 \ - OTP-6401 - -TICKETS_1.0.5 = \ - - -TICKETS_1.0.4 = \ - OTP-5599 \ - OTP-5718 \ - OTP-5734 \ - OTP-5895 \ - OTP-5902 \ - OTP-5905 - -TICKETS_1.0.3 = \ - OTP-5587 - -TICKETS_1.0.2 = \ - OTP-5498 \ - OTP-5500 \ - OTP-5531 - -TICKETS_1.0.1 = \ - OTP-5268 \ - OTP-5301 \ - OTP-5407 - -TICKETS_1.0 = \ - OTP-5174 \ - |